|
1 /* |
|
2 * Copyright (c) 2002-2004 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 // INCLUDE FILES |
|
27 #include "CSchedulerUtility.h" |
|
28 #include <e32svr.h> |
|
29 |
|
30 // ============================ LOCAL DEFINITIONS ================= ============= |
|
31 //static CSchedulerUtility* iInstance; |
|
32 //CSchedulerUtility* CSchedulerUtility::iInstance; |
|
33 // ============================ MEMBER FUNCTIONS =============================== |
|
34 |
|
35 // ----------------------------------------------------------------------------- |
|
36 // CSchedulerUtility::CSchedulerUtility |
|
37 // C++ default constructor can NOT contain any code, that |
|
38 // might leave. |
|
39 // ----------------------------------------------------------------------------- |
|
40 // |
|
41 CSchedulerUtility::CSchedulerUtility() |
|
42 { |
|
43 RDebug::Print( _L( "Digia:CSchedulerUtility::CSchedulerUtility()" ) ); |
|
44 } |
|
45 |
|
46 // ----------------------------------------------------------------------------- |
|
47 // CSchedulerUtility::ConstructL |
|
48 // Symbian 2nd phase constructor can leave. |
|
49 // ----------------------------------------------------------------------------- |
|
50 // |
|
51 void CSchedulerUtility::ConstructL() |
|
52 { |
|
53 iWait = new ( ELeave ) CActiveSchedulerWait; |
|
54 } |
|
55 |
|
56 // ----------------------------------------------------------------------------- |
|
57 // CSchedulerUtility::NewL |
|
58 // Two-phased constructor. |
|
59 // ----------------------------------------------------------------------------- |
|
60 // |
|
61 CSchedulerUtility* CSchedulerUtility::NewL() |
|
62 { |
|
63 CSchedulerUtility* self = new( ELeave ) CSchedulerUtility; |
|
64 |
|
65 CleanupStack::PushL( self ); |
|
66 self->ConstructL(); |
|
67 CleanupStack::Pop(); |
|
68 |
|
69 return self; |
|
70 } |
|
71 |
|
72 |
|
73 // Destructor |
|
74 CSchedulerUtility::~CSchedulerUtility() |
|
75 { |
|
76 Stop(); |
|
77 delete iWait; |
|
78 RDebug::Print( _L( "Digia:CSchedulerUtility::~CSchedulerUtility()" ) ); |
|
79 } |
|
80 |
|
81 |
|
82 // ----------------------------------------------------------------------------- |
|
83 // CSchedulerUtility::InstanceL |
|
84 // (other items were commented in a header). |
|
85 // ----------------------------------------------------------------------------- |
|
86 // |
|
87 /*CSchedulerUtility* CSchedulerUtility::InstanceL() |
|
88 { |
|
89 if( iInstance == NULL ) |
|
90 { |
|
91 iInstance = CSchedulerUtility::NewL(); |
|
92 } |
|
93 return iInstance; |
|
94 } |
|
95 */ |
|
96 /*void CSchedulerUtility::Release() |
|
97 { |
|
98 delete iInstance; |
|
99 iInstance = NULL; |
|
100 } |
|
101 */ |
|
102 // ----------------------------------------------------------------------------- |
|
103 // CSchedulerUtility::Start |
|
104 // (other items were commented in a header). |
|
105 // ----------------------------------------------------------------------------- |
|
106 // |
|
107 void CSchedulerUtility::Start() |
|
108 { |
|
109 if( !iWait->IsStarted() ) |
|
110 { |
|
111 iWait->Start(); |
|
112 } |
|
113 } |
|
114 |
|
115 // ----------------------------------------------------------------------------- |
|
116 // CSchedulerUtility::Stop |
|
117 // (other items were commented in a header). |
|
118 // ----------------------------------------------------------------------------- |
|
119 // |
|
120 void CSchedulerUtility::Stop() |
|
121 { |
|
122 if( iWait->IsStarted() ) |
|
123 { |
|
124 iWait->AsyncStop(); |
|
125 } |
|
126 } |
|
127 |
|
128 // End of File |
|
129 |