|
1 /* |
|
2 * Copyright (c) 2008 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: This class implements the shutdown timer that is used by the |
|
15 * SensorServer to shutdown the server after the last client has |
|
16 * disconnected. |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 |
|
22 #ifndef SENSRVSHUTDOWN_H |
|
23 #define SENSRVSHUTDOWN_H |
|
24 |
|
25 // INCLUDES |
|
26 #include <e32base.h> |
|
27 |
|
28 // CONSTANTS |
|
29 const TInt KSensrvDefaultTerminationPeriod = 30000000; |
|
30 |
|
31 |
|
32 // Forward declarations |
|
33 class CSensrvProxyManager; |
|
34 |
|
35 // CLASS DECLARATION |
|
36 |
|
37 /** |
|
38 * Shutdown timer after the last client has disconnected. |
|
39 */ |
|
40 class CSensrvShutdown : public CTimer |
|
41 { |
|
42 public: // Constructors and destructor |
|
43 |
|
44 /** |
|
45 * Two-phased constructor. |
|
46 */ |
|
47 static CSensrvShutdown* NewL( CSensrvProxyManager& aProxyManager ); |
|
48 |
|
49 /** |
|
50 * Destructor. |
|
51 */ |
|
52 virtual ~CSensrvShutdown(); |
|
53 |
|
54 public: // New functions |
|
55 |
|
56 /** |
|
57 * Starts the shutdown count down. |
|
58 */ |
|
59 void Start(); |
|
60 |
|
61 private: // Functions from base classes |
|
62 |
|
63 /** |
|
64 * From CTimer |
|
65 * Cancel the shutdown timer. |
|
66 */ |
|
67 void DoCancel(); |
|
68 |
|
69 /** |
|
70 * From CTimer |
|
71 * Timer has expired, stop the RadioServer. |
|
72 **/ |
|
73 void RunL(); |
|
74 |
|
75 private: |
|
76 |
|
77 /** |
|
78 * C++ default constructor. |
|
79 */ |
|
80 CSensrvShutdown( CSensrvProxyManager& aProxyManager ); |
|
81 |
|
82 /** |
|
83 * By default Symbian 2nd phase constructor is private. |
|
84 */ |
|
85 void ConstructL(); |
|
86 |
|
87 CSensrvProxyManager& iProxyManager; |
|
88 |
|
89 }; |
|
90 |
|
91 #endif // SENSRVSHUTDOWN_H |
|
92 |
|
93 // End of File |