equal
deleted
inserted
replaced
|
1 /* |
|
2 * Copyright (c) 2005 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: Waits for request to complete |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef WAITER_H |
|
20 #define WAITER_H |
|
21 |
|
22 #include <e32std.h> |
|
23 #include <e32base.h> |
|
24 |
|
25 NONSHARABLE_CLASS(CWaiter) : public CActive |
|
26 { |
|
27 public://Instantition and Destructor |
|
28 |
|
29 /** |
|
30 * Instantiation |
|
31 */ |
|
32 static CWaiter* NewL(); |
|
33 |
|
34 /** |
|
35 * Destructor. |
|
36 */ |
|
37 virtual ~CWaiter(); |
|
38 |
|
39 protected://Construction and destruction |
|
40 |
|
41 /** |
|
42 * Default constructor. |
|
43 */ |
|
44 CWaiter(); |
|
45 |
|
46 /** |
|
47 * 2nd phase constructor |
|
48 */ |
|
49 void ConstructL(); |
|
50 |
|
51 public: |
|
52 |
|
53 /** |
|
54 * A sync function which will start waiting. |
|
55 * This function inturn calls CActiveSchedulerWait::Wait |
|
56 * |
|
57 * @param void |
|
58 * @return void |
|
59 */ |
|
60 TInt Wait(); |
|
61 |
|
62 public://From CActive |
|
63 |
|
64 /** |
|
65 * RunL function from CActive |
|
66 * |
|
67 * @param void |
|
68 * @return void |
|
69 */ |
|
70 void RunL(); |
|
71 |
|
72 /** |
|
73 * Cancel API from CActive |
|
74 * |
|
75 * @param void |
|
76 * @return void |
|
77 */ |
|
78 void DoCancel(); |
|
79 |
|
80 /** |
|
81 * Completes Request |
|
82 * |
|
83 * @param aStatus This value will be used to complete active object request |
|
84 * @return ETrue is Request is completed otherwise EFalse |
|
85 */ |
|
86 TBool RequestComplete(TInt aStatus); |
|
87 |
|
88 private://Data |
|
89 |
|
90 CActiveSchedulerWait iSyncWait; |
|
91 TBool iIsWaiting; |
|
92 |
|
93 }; |
|
94 #endif /*WAITER_H*/ |