|
1 /* |
|
2 * Copyright (c) 2010 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: Active object which ensures that current call stack is run to |
|
15 * completion before a new request is handled |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 // INCLUDE FILES |
|
21 #include "lpdrequestao.h" |
|
22 #include "lpdverifierplugin.h" |
|
23 #include <lbs/epos_cposrequestor.h> |
|
24 #include <lbs/epos_rposrequestorstack.h> |
|
25 |
|
26 // ================= MEMBER FUNCTIONS ======================= |
|
27 |
|
28 // ----------------------------------------------------------------------------- |
|
29 // CLpdRequestAO::CLpdRequestAO |
|
30 // C++ default constructor can NOT contain any code, that |
|
31 // might leave. |
|
32 // ----------------------------------------------------------------------------- |
|
33 // |
|
34 CLpdRequestAO::CLpdRequestAO( CLpdVerifierPlugin& aPlugin ) |
|
35 : CActive( CActive::EPriorityHigh ), iPlugin( aPlugin ) |
|
36 { |
|
37 } |
|
38 |
|
39 // ----------------------------------------------------------------------------- |
|
40 // CLpdRequestAO::NewL |
|
41 // Two-phased constructor. |
|
42 // ----------------------------------------------------------------------------- |
|
43 // |
|
44 CLpdRequestAO* CLpdRequestAO::NewL( CLpdVerifierPlugin& aPlugin ) |
|
45 { |
|
46 CLpdRequestAO* self = new( ELeave ) CLpdRequestAO( aPlugin ); |
|
47 CActiveScheduler::Add(self); |
|
48 // Nothing to do in the Second Phase Constructor |
|
49 return self; |
|
50 } |
|
51 |
|
52 // Destructor |
|
53 CLpdRequestAO::~CLpdRequestAO() |
|
54 { |
|
55 Cancel(); |
|
56 |
|
57 } |
|
58 |
|
59 // ----------------------------------------------------------------------------- |
|
60 // CLpdRequestAO::ScheduleRequest |
|
61 // (other items were commented in a header). |
|
62 // ----------------------------------------------------------------------------- |
|
63 // |
|
64 void CLpdRequestAO::ScheduleRequest() |
|
65 { |
|
66 Cancel(); |
|
67 SetActive(); |
|
68 TRequestStatus* status = &iStatus; |
|
69 User::RequestComplete( status, KErrNone ); |
|
70 } |
|
71 |
|
72 // ----------------------------------------------------------------------------- |
|
73 // CLpdRequestAO::RunL |
|
74 // (other items were commented in a header). |
|
75 // ----------------------------------------------------------------------------- |
|
76 // |
|
77 void CLpdRequestAO::RunL() |
|
78 { |
|
79 iPlugin.HandleNextRequest(); |
|
80 } |
|
81 |
|
82 // ----------------------------------------------------------------------------- |
|
83 // CLpdRequestAO::DoCancel |
|
84 // (other items were commented in a header). |
|
85 // ----------------------------------------------------------------------------- |
|
86 // |
|
87 void CLpdRequestAO::DoCancel() |
|
88 { |
|
89 // Not important with this AO |
|
90 } |
|
91 |
|
92 |
|
93 |
|
94 |
|
95 // End of File |