equal
deleted
inserted
replaced
|
1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #include "cactivewaiter.h" |
|
17 |
|
18 CActiveWaiter::CActiveWaiter() |
|
19 : CActive(CActive::EPriorityStandard) |
|
20 { |
|
21 CActiveScheduler::Add(this); |
|
22 } |
|
23 |
|
24 CActiveWaiter::~CActiveWaiter() |
|
25 { Cancel(); } |
|
26 |
|
27 void CActiveWaiter::SetActiveDontWait() |
|
28 { |
|
29 SetActive(); |
|
30 } |
|
31 |
|
32 void CActiveWaiter::WaitActive() |
|
33 { |
|
34 ASSERT(!iScheduler.IsStarted()); |
|
35 SetActive(); |
|
36 |
|
37 iScheduler.Start(); |
|
38 } |
|
39 |
|
40 void CActiveWaiter::RunL() |
|
41 { |
|
42 if (iScheduler.IsStarted()) |
|
43 { |
|
44 ASSERT(iScheduler.CanStopNow()); |
|
45 iScheduler.AsyncStop(); |
|
46 } |
|
47 } |
|
48 |
|
49 void CActiveWaiter::DoCancel() |
|
50 { |
|
51 if (iScheduler.IsStarted()) |
|
52 { |
|
53 ASSERT(iScheduler.CanStopNow()); |
|
54 iScheduler.AsyncStop(); |
|
55 } |
|
56 } |