|
1 /* |
|
2 * Copyright (c) 2006 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 "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: CSendTimer is used for sending data at specified intervals |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef __SENDTIMER_H__ |
|
19 #define __SENDTIMER_H__ |
|
20 |
|
21 #include <e32base.h> |
|
22 |
|
23 class CSocketsEngine; |
|
24 |
|
25 /** |
|
26 * This class will send data over socket after given |
|
27 * time has elapsed. |
|
28 */ |
|
29 class CSendTimer : public CTimer |
|
30 { |
|
31 public: |
|
32 |
|
33 /** |
|
34 * Create a CSendTimer object |
|
35 * @param aPriority priority to use for this timer |
|
36 * @param aEngine object that knows how to send data |
|
37 * @result a pointer to the created instance of CTimeOutTimer |
|
38 */ |
|
39 static CSendTimer* NewL(const TInt aPriority, CSocketsEngine* aEngine); |
|
40 |
|
41 /** |
|
42 * Create a CSendTimer object |
|
43 * @param aPriority priority to use for this timer |
|
44 * @param aEngine object that knows how to send data |
|
45 * @result a pointer to the created instance of CTimeOutTimer |
|
46 */ |
|
47 static CSendTimer* NewLC(const TInt aPriority, CSocketsEngine* aEngine); |
|
48 |
|
49 /** |
|
50 * Destroy the object and release all memory objects |
|
51 */ |
|
52 ~CSendTimer(); |
|
53 |
|
54 protected: // From CTimer |
|
55 |
|
56 /** |
|
57 * Invoked when a timer event occurs |
|
58 */ |
|
59 virtual void RunL(); |
|
60 |
|
61 private: |
|
62 |
|
63 /** |
|
64 * Perform the first phase of two phase construction |
|
65 * @param aPriority priority to use for this timer |
|
66 * @param aEngine object that knows how to send data |
|
67 */ |
|
68 CSendTimer(const TInt aPriority, CSocketsEngine* aEngine); |
|
69 |
|
70 /** |
|
71 * Perform the second phase construction of a CSendTimer |
|
72 */ |
|
73 void ConstructL(); |
|
74 |
|
75 private: |
|
76 // Member variables |
|
77 CSocketsEngine* iEngine; |
|
78 }; |
|
79 |
|
80 #endif // __SENDTIMER_H__ |
|
81 |