12 * Contributors: |
12 * Contributors: |
13 * |
13 * |
14 * Description: Active object helper class inline function definitions. |
14 * Description: Active object helper class inline function definitions. |
15 * |
15 * |
16 */ |
16 */ |
|
17 |
|
18 |
|
19 // ======== MEMBER FUNCTIONS ======== |
|
20 |
|
21 // --------------------------------------------------------------------------- |
|
22 // C++ default constructor |
|
23 // --------------------------------------------------------------------------- |
|
24 // |
|
25 inline CBTEngActive::CBTEngActive( MBTEngActiveObserver& aObserver, TInt aId, |
|
26 TInt aPriority ) |
|
27 : CActive( aPriority ), |
|
28 iRequestId( aId ), |
|
29 iObserver( aObserver ) |
|
30 { |
|
31 CActiveScheduler::Add( this ); |
|
32 } |
|
33 |
|
34 |
|
35 // --------------------------------------------------------------------------- |
|
36 // Symbian 2nd-phase constructor |
|
37 // --------------------------------------------------------------------------- |
|
38 // |
|
39 inline void CBTEngActive::ConstructL() |
|
40 { |
|
41 } |
|
42 |
|
43 |
|
44 // --------------------------------------------------------------------------- |
|
45 // NewLC |
|
46 // --------------------------------------------------------------------------- |
|
47 // |
|
48 inline CBTEngActive* CBTEngActive::NewL( MBTEngActiveObserver& aObserver, |
|
49 TInt aId, TInt aPriority ) |
|
50 { |
|
51 CBTEngActive* self = new( ELeave ) CBTEngActive( aObserver, aId, aPriority ); |
|
52 CleanupStack::PushL( self ); |
|
53 self->ConstructL(); |
|
54 CleanupStack::Pop( self ); |
|
55 return self; |
|
56 } |
|
57 |
|
58 |
|
59 // --------------------------------------------------------------------------- |
|
60 // Destructor |
|
61 // --------------------------------------------------------------------------- |
|
62 // |
|
63 inline CBTEngActive::~CBTEngActive() |
|
64 { |
|
65 Cancel(); |
|
66 } |
|
67 |
|
68 |
|
69 // --------------------------------------------------------------------------- |
|
70 // From class CActive. |
|
71 // Called by the active scheduler when the request has been cancelled. |
|
72 // --------------------------------------------------------------------------- |
|
73 // |
|
74 inline void CBTEngActive::DoCancel() |
|
75 { |
|
76 } |
17 |
77 |
18 |
78 |
19 |
79 |
20 // ----------------------------------------------------------------------------- |
80 // ----------------------------------------------------------------------------- |
21 // Get the identifier of this instance. |
81 // Get the identifier of this instance. |
63 // |
123 // |
64 inline TRequestStatus& CBTEngActive::RequestStatus() |
124 inline TRequestStatus& CBTEngActive::RequestStatus() |
65 { |
125 { |
66 return iStatus; |
126 return iStatus; |
67 } |
127 } |
|
128 |
|
129 |
|
130 // --------------------------------------------------------------------------- |
|
131 // From class CActive. |
|
132 // Called by the active scheduler when the request has been completed. |
|
133 // --------------------------------------------------------------------------- |
|
134 // |
|
135 inline void CBTEngActive::RunL() |
|
136 { |
|
137 iObserver.RequestCompletedL( this, iRequestId, iStatus.Int() ); |
|
138 } |
|
139 |
|
140 |
|
141 // --------------------------------------------------------------------------- |
|
142 // From class CActive. |
|
143 // Called by the active scheduler when an error in RunL has occurred. |
|
144 // --------------------------------------------------------------------------- |
|
145 // |
|
146 inline TInt CBTEngActive::RunError( TInt aError ) |
|
147 { |
|
148 iObserver.HandleError( this, iRequestId, aError ); |
|
149 return KErrNone; |
|
150 } |