|
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 |
|
17 |
|
18 |
|
19 // INCLUDE FILES |
|
20 #include "HWRMServerActiveScheduler.h" |
|
21 #include "HWRMtrace.h" |
|
22 |
|
23 |
|
24 // EXTERNAL DATA STRUCTURES |
|
25 |
|
26 // EXTERNAL FUNCTION PROTOTYPES |
|
27 |
|
28 // CONSTANTS |
|
29 |
|
30 // MACROS |
|
31 |
|
32 // LOCAL CONSTANTS AND MACROS |
|
33 _LIT( KPanicCategory, "HWRMActiveSched" ); |
|
34 |
|
35 // MODULE DATA STRUCTURES |
|
36 |
|
37 // LOCAL FUNCTION PROTOTYPES |
|
38 |
|
39 // FORWARD DECLARATIONS |
|
40 |
|
41 |
|
42 // ============================ MEMBER FUNCTIONS =============================== |
|
43 |
|
44 // ----------------------------------------------------------------------------- |
|
45 // CHWRMServerActiveScheduler::CHWRMServerActiveScheduler |
|
46 // C++ default constructor |
|
47 // ----------------------------------------------------------------------------- |
|
48 // |
|
49 CHWRMServerActiveScheduler::CHWRMServerActiveScheduler() |
|
50 : CActiveScheduler() |
|
51 { |
|
52 COMPONENT_TRACE1(_L( "HWRM Server - CHWRMServerActiveScheduler::CHWRMServerActiveScheduler()" )); |
|
53 COMPONENT_TRACE1(_L( "HWRM Server - CHWRMServerActiveScheduler::CHWRMServerActiveScheduler - return" ) ); |
|
54 } |
|
55 |
|
56 // ----------------------------------------------------------------------------- |
|
57 // CHWRMServerActiveScheduler::NewL |
|
58 // Public constructor. Leaves if out of memory. |
|
59 // ----------------------------------------------------------------------------- |
|
60 // |
|
61 CHWRMServerActiveScheduler* CHWRMServerActiveScheduler::NewL() |
|
62 { |
|
63 COMPONENT_TRACE1(_L( "HWRM Server - CHWRMServerActiveScheduler::NewL()" )); |
|
64 |
|
65 CHWRMServerActiveScheduler* scheduler = NewLC(); |
|
66 |
|
67 CleanupStack::Pop(scheduler); |
|
68 |
|
69 COMPONENT_TRACE2(_L( "HWRM Server - CHWRMServerActiveScheduler::NewL - return 0x%x" ), scheduler ); |
|
70 |
|
71 return scheduler; |
|
72 } |
|
73 |
|
74 // ----------------------------------------------------------------------------- |
|
75 // CHWRMServerActiveScheduler::NewLC |
|
76 // Public constructor. Leaves if out of memory. Pushes object to cleanup stack. |
|
77 // ----------------------------------------------------------------------------- |
|
78 // |
|
79 CHWRMServerActiveScheduler* CHWRMServerActiveScheduler::NewLC() |
|
80 { |
|
81 COMPONENT_TRACE1(_L( "HWRM Server - CHWRMServerActiveScheduler::NewLC()" )); |
|
82 |
|
83 CHWRMServerActiveScheduler* scheduler = |
|
84 new(ELeave) CHWRMServerActiveScheduler; |
|
85 |
|
86 CleanupStack::PushL( scheduler ); |
|
87 |
|
88 COMPONENT_TRACE2(_L( "HWRM Server - CHWRMServerActiveScheduler::NewLC - return 0x%x" ), scheduler ); |
|
89 |
|
90 return scheduler; |
|
91 } |
|
92 |
|
93 |
|
94 // Destructor |
|
95 CHWRMServerActiveScheduler::~CHWRMServerActiveScheduler() |
|
96 { |
|
97 COMPONENT_TRACE1(_L( "HWRM Server - CHWRMServerActiveScheduler::~CHWRMServerActiveScheduler()" )); |
|
98 COMPONENT_TRACE1(_L( "HWRM Server - CHWRMServerActiveScheduler::~CHWRMServerActiveScheduler - return" ) ); |
|
99 } |
|
100 |
|
101 // ----------------------------------------------------------------------------- |
|
102 // CHWRMServerActiveScheduler::Error |
|
103 // Calls Panic function if occurred error is severe enough |
|
104 // However, the execution should never come here unless the plugin |
|
105 // implementation doesn't TRAP all leaves it should. |
|
106 // ----------------------------------------------------------------------------- |
|
107 // |
|
108 void CHWRMServerActiveScheduler::Error( TInt aError ) const |
|
109 { |
|
110 COMPONENT_TRACE2(_L( "HWRM Server - CHWRMServerActiveScheduler::Error(%d)" ), aError ); |
|
111 |
|
112 switch ( aError ) |
|
113 { |
|
114 case KErrNoMemory: |
|
115 { |
|
116 // Recoverable, so ignore because we don't have anything to cleanup |
|
117 COMPONENT_TRACE1(_L( "HWRM Server - CHWRMServerActiveScheduler::Error : KErrNoMemory" ) ); |
|
118 break; |
|
119 } |
|
120 default: |
|
121 { |
|
122 // Unrecoverable error for this thread. Panicing needed! |
|
123 COMPONENT_TRACE2(_L( "HWRM Server - CHWRMServerActiveScheduler::Error - Unrecoverable error: %d" ), aError ); |
|
124 User::Panic( KPanicCategory, aError ); |
|
125 break; |
|
126 } |
|
127 } |
|
128 |
|
129 COMPONENT_TRACE1(_L( "HWRM Server - CHWRMServerActiveScheduler::Error - return" )); |
|
130 } |
|
131 |
|
132 // ========================== OTHER EXPORTED FUNCTIONS ========================= |
|
133 |
|
134 // End of File |