|
1 /* |
|
2 * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the License "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: WlanTimer declaration |
|
15 * |
|
16 */ |
|
17 |
|
18 /* |
|
19 * %version: 5 % |
|
20 */ |
|
21 |
|
22 #ifndef WLANTIMER_H |
|
23 #define WLANTIMER_H |
|
24 |
|
25 #include <wlantimer.h> |
|
26 #include "wlanobject.h" |
|
27 |
|
28 class WlanOsa; |
|
29 |
|
30 /** |
|
31 * concrete timer context object |
|
32 * |
|
33 * |
|
34 * @lib wlanosa.lib |
|
35 * @since S60 v3.2 |
|
36 */ |
|
37 class WlanTimer : public MWlanTimer, public WlanObject |
|
38 { |
|
39 friend class WlanOsa; |
|
40 |
|
41 public: |
|
42 |
|
43 /** |
|
44 * Destructor. |
|
45 * |
|
46 * @since S60 v3.2 |
|
47 */ |
|
48 virtual ~WlanTimer(); |
|
49 |
|
50 /** |
|
51 * Constructor. |
|
52 * |
|
53 * @since S60 v3.2 |
|
54 * @param aOsa wlanosa object |
|
55 * @param aDfcQueue Pointer to the DFC queue to use |
|
56 */ |
|
57 explicit WlanTimer( WlanOsa& aOsa, void* aDfcQueue ); |
|
58 |
|
59 protected: // from base class MWlanTimer |
|
60 |
|
61 /** |
|
62 * From MWlanTimer. |
|
63 * Enqueue a timeout for execution. |
|
64 * Either succeeds or has no effect. |
|
65 * Calling this method for allready queued timeout has no effect |
|
66 * |
|
67 * @since S60 v3.2 |
|
68 * @param aTimerClient timer client |
|
69 * @param aCtx context for timer client callback |
|
70 * @param aTimeoutInMicroSeconds timeout in microseconds |
|
71 * @param aPeriodic periodic timer or not |
|
72 */ |
|
73 virtual void Enqueue( |
|
74 MWlanTimerClient& aTimerClient, |
|
75 TInt aCtx, |
|
76 TInt aTimeoutInMicroSeconds, |
|
77 TBool aPeriodic ); |
|
78 |
|
79 /** |
|
80 * From MWlanTimer. |
|
81 * Dequeue a queued timeout. |
|
82 * Either succeeds or has no effect. |
|
83 * Calling this method for non queued timeout has no effect |
|
84 * |
|
85 * @since S60 v3.2 |
|
86 */ |
|
87 virtual void Dequeue(); |
|
88 |
|
89 private: |
|
90 |
|
91 /** Prohibit copy constructor. */ |
|
92 WlanTimer( const WlanTimer& ); |
|
93 |
|
94 /** Prohibit assigment operator. */ |
|
95 WlanTimer& operator= ( const WlanTimer& ); |
|
96 |
|
97 /** |
|
98 * timer execution entry |
|
99 * |
|
100 * @since S60 v3.2 |
|
101 */ |
|
102 static void TimerTrigger( TAny* aPtr ); |
|
103 |
|
104 /** |
|
105 * timer execution entry |
|
106 */ |
|
107 void TimerTrigger(); |
|
108 |
|
109 /** |
|
110 * Decrements the reference counter of this object and when all references |
|
111 * are cleared the object is deleted. |
|
112 */ |
|
113 void RefDel(); |
|
114 |
|
115 /** |
|
116 * Incrementes the reference counter. |
|
117 */ |
|
118 void RefAdd(); |
|
119 |
|
120 private: // data |
|
121 |
|
122 /** |
|
123 * DFC for timer callbacks. |
|
124 */ |
|
125 TDfc iTimerDfc; |
|
126 |
|
127 /** |
|
128 * osa object reference |
|
129 */ |
|
130 WlanOsa& iOsa; |
|
131 |
|
132 /** |
|
133 * the one and only timer |
|
134 */ |
|
135 NTimer iNTimer; |
|
136 |
|
137 /** |
|
138 * timer client callback interface |
|
139 * Not Own. |
|
140 */ |
|
141 MWlanTimerClient* iTimerClient; |
|
142 |
|
143 /** |
|
144 * timeout value |
|
145 */ |
|
146 TInt iTimeoutInMicroSeconds; |
|
147 |
|
148 /** |
|
149 * callback context |
|
150 */ |
|
151 TInt iCtx; |
|
152 |
|
153 /** |
|
154 * internal state flags |
|
155 */ |
|
156 TUint iFlags; |
|
157 |
|
158 /** |
|
159 * reference counter for cleanup |
|
160 */ |
|
161 TUint iRefCnt; |
|
162 |
|
163 }; |
|
164 |
|
165 #endif // WLANTIMER_H |