|
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 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 // INCLUDE FILES |
|
21 #include "CIptvTestActiveWait.h" |
|
22 #include "VCXTestLog.h" |
|
23 |
|
24 // EXTERNAL DATA STRUCTURES |
|
25 |
|
26 // EXTERNAL FUNCTION PROTOTYPES |
|
27 |
|
28 // CONSTANTS |
|
29 |
|
30 // MACROS |
|
31 |
|
32 // LOCAL CONSTANTS AND MACROS |
|
33 |
|
34 // MODULE DATA STRUCTURES |
|
35 |
|
36 // LOCAL FUNCTION PROTOTYPES |
|
37 |
|
38 // FORWARD DECLARATIONS |
|
39 |
|
40 // ============================= LOCAL FUNCTIONS =============================== |
|
41 |
|
42 // ============================ MEMBER FUNCTIONS =============================== |
|
43 |
|
44 // ----------------------------------------------------------------------------- |
|
45 // CIptvTestActiveWait:: |
|
46 // C++ default constructor can NOT contain any code, that |
|
47 // might leave. |
|
48 // ----------------------------------------------------------------------------- |
|
49 // |
|
50 EXPORT_C CIptvTestActiveWait* CIptvTestActiveWait::NewL() |
|
51 { |
|
52 VCXLOGLO1(">>>CIptvTestActiveWait::NewL"); |
|
53 CIptvTestActiveWait* self = new (ELeave) CIptvTestActiveWait(); |
|
54 CleanupStack::PushL(self); |
|
55 self->ConstructL(); |
|
56 CleanupStack::Pop(); |
|
57 VCXLOGLO1("<<<CIptvTestActiveWait::NewL"); |
|
58 return self; |
|
59 } |
|
60 // ----------------------------------------------------------------------------- |
|
61 // CIptvTestActiveWait::~CIptvTestActiveWait |
|
62 // destructor |
|
63 // ----------------------------------------------------------------------------- |
|
64 // |
|
65 EXPORT_C CIptvTestActiveWait::~CIptvTestActiveWait() |
|
66 { |
|
67 VCXLOGLO1(">>>CIptvTestActiveWait::~CIptvTestActiveWait"); |
|
68 |
|
69 ActiveWait(EActiveWaitStop); |
|
70 delete iActiveSchedulerWait; |
|
71 iActiveSchedulerWait = NULL; |
|
72 |
|
73 VCXLOGLO1("<<<CIptvTestActiveWait::~CIptvTestActiveWait"); |
|
74 } |
|
75 |
|
76 // ----------------------------------------------------------------------------- |
|
77 // CIptvTestActiveWait::~CIptvTestActiveWait |
|
78 // destructor |
|
79 // ----------------------------------------------------------------------------- |
|
80 // |
|
81 EXPORT_C CIptvTestActiveWait::CIptvTestActiveWait() |
|
82 { |
|
83 VCXLOGLO1(">>>CIptvTestActiveWait::CIptvTestActiveWait"); |
|
84 |
|
85 |
|
86 VCXLOGLO1("<<<CIptvTestActiveWait::CIptvTestActiveWait"); |
|
87 } |
|
88 |
|
89 |
|
90 // ----------------------------------------------------------------------------- |
|
91 // CIptvTestActiveWait::ConstructL |
|
92 // |
|
93 // ----------------------------------------------------------------------------- |
|
94 // |
|
95 EXPORT_C void CIptvTestActiveWait::ConstructL() |
|
96 { |
|
97 VCXLOGLO1(">>>CIptvTestActiveWait::ConstructL"); |
|
98 |
|
99 iActiveSchedulerWait = new (ELeave) CActiveSchedulerWait; |
|
100 |
|
101 VCXLOGLO1("<<<CIptvTestActiveWait::ConstructL"); |
|
102 } |
|
103 |
|
104 // ----------------------------------------------------------------------------- |
|
105 // CIptvTestActiveWait::ActiveWait |
|
106 // ----------------------------------------------------------------------------- |
|
107 // |
|
108 EXPORT_C void CIptvTestActiveWait::ActiveWait( TIptvTestActiveWaitCmd aActiveWaitCmd ) |
|
109 { |
|
110 VCXLOGLO1(">>>CIptvTestActiveWait::ActiveWait"); |
|
111 |
|
112 VCXLOGLO2("aActiveWaitCmd=%d", aActiveWaitCmd ); |
|
113 |
|
114 switch( aActiveWaitCmd ) |
|
115 { |
|
116 case EActiveWaitStart: |
|
117 { |
|
118 if( !iActiveSchedulerWait->IsStarted() ) |
|
119 { |
|
120 iActiveSchedulerWait->Start(); |
|
121 } |
|
122 else |
|
123 { |
|
124 VCXLOGLO1("ActiveSchedulerWait already started"); |
|
125 } |
|
126 } |
|
127 break; |
|
128 case EActiveWaitStop: |
|
129 { |
|
130 if( iActiveSchedulerWait->IsStarted() ) |
|
131 { |
|
132 iActiveSchedulerWait->AsyncStop(); |
|
133 } |
|
134 else |
|
135 { |
|
136 VCXLOGLO1("ActiveSchedulerWait already stopped"); |
|
137 } |
|
138 } |
|
139 break; |
|
140 default: |
|
141 break; |
|
142 } |
|
143 |
|
144 VCXLOGLO1("<<<CIptvTestActiveWait::ActiveWait"); |
|
145 } |
|
146 |
|
147 // ----------------------------------------------------------------------------- |
|
148 // CIptvTestActiveWait::IsWaiting |
|
149 // ----------------------------------------------------------------------------- |
|
150 // |
|
151 EXPORT_C TBool CIptvTestActiveWait::IsWaiting() |
|
152 { |
|
153 return iActiveSchedulerWait->IsStarted(); |
|
154 } |
|
155 |
|
156 // ----------------------------------------------------------------------------- |
|
157 // CIptvTestActiveWait::Start |
|
158 // ----------------------------------------------------------------------------- |
|
159 // |
|
160 EXPORT_C TInt CIptvTestActiveWait::Start( ) |
|
161 { |
|
162 TInt err = KErrNotReady; |
|
163 if( !iActiveSchedulerWait->IsStarted() ) |
|
164 { |
|
165 iActiveSchedulerWait->Start(); |
|
166 err = KErrNone; |
|
167 } |
|
168 else |
|
169 { |
|
170 VCXLOGLO1("ActiveSchedulerWait already started"); |
|
171 } |
|
172 return err; |
|
173 } |
|
174 |
|
175 // ----------------------------------------------------------------------------- |
|
176 // CIptvTestActiveWait::Stop |
|
177 // ----------------------------------------------------------------------------- |
|
178 // |
|
179 EXPORT_C TInt CIptvTestActiveWait::Stop( ) |
|
180 { |
|
181 TInt err = KErrNotReady; |
|
182 if( iActiveSchedulerWait->IsStarted() ) |
|
183 { |
|
184 iActiveSchedulerWait->AsyncStop(); |
|
185 err = KErrNone; |
|
186 } |
|
187 else |
|
188 { |
|
189 VCXLOGLO1("ActiveSchedulerWait already stopped"); |
|
190 } |
|
191 return err; |
|
192 } |
|
193 |
|
194 // End of File |