|
1 /* |
|
2 * Copyright (c) 2006 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: Interface for Scheduler Server's Session class* |
|
15 */ |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 #ifndef __CCSESCHEDULERSERVERSESSION_H |
|
21 #define __CCSESCHEDULERSERVERSESSION_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include "CseSchedulerServer.pan" // Panic codes |
|
26 |
|
27 // CONSTANTS |
|
28 // None. |
|
29 |
|
30 // MACROS |
|
31 // None. |
|
32 |
|
33 // DATA TYPES |
|
34 // None |
|
35 |
|
36 // FUNCTION PROTOTYPES |
|
37 // None. |
|
38 |
|
39 // FORWARD DECLARATIONS |
|
40 class CCseSchedulerEngine; |
|
41 class CCseSchedulerServer; |
|
42 |
|
43 // CLASS DECLARATION |
|
44 |
|
45 /** |
|
46 * CCseSchedulerSession |
|
47 * |
|
48 * @lib |
|
49 */ |
|
50 class CCseSchedulerServerSession : public CSession2 |
|
51 { |
|
52 public: // Constructors and destructor |
|
53 |
|
54 /** |
|
55 * Two-phased constructor. |
|
56 * @Param aClient reference client thread |
|
57 * @Param aServer pointer to Server |
|
58 * @return CCseSchedulerSession pointer to CCseSchedulerSession class |
|
59 */ |
|
60 static CCseSchedulerServerSession* NewL( CCseSchedulerServer* aServer ); |
|
61 |
|
62 |
|
63 /** |
|
64 * Destructor. |
|
65 */ |
|
66 virtual ~CCseSchedulerServerSession(); |
|
67 |
|
68 public: // New functions |
|
69 |
|
70 /** |
|
71 * Server |
|
72 * @return a pointer to server |
|
73 */ |
|
74 CCseSchedulerServer* Server(); |
|
75 |
|
76 /** |
|
77 * Service |
|
78 * @param aMessage contains data from the client. |
|
79 * @return None |
|
80 */ |
|
81 void ServiceL( const RMessage2& aMessage ); |
|
82 |
|
83 private: // New functions |
|
84 |
|
85 /** |
|
86 * Dispatch message |
|
87 * @param aMessage contains data from the client. |
|
88 * @return None |
|
89 */ |
|
90 void DispatchMessageL( const RMessage2& aMessage ); |
|
91 |
|
92 /** |
|
93 * New Object |
|
94 * @param aMessage contains data from the client. |
|
95 * @return None |
|
96 */ |
|
97 void NewObjectL( const RMessage2& aMessage ); |
|
98 |
|
99 /** |
|
100 * Deletes object, can't fail - can panic client |
|
101 * @param aHandle handle |
|
102 * @return None |
|
103 */ |
|
104 void DeleteObject( TUint aHandle ); |
|
105 |
|
106 /** |
|
107 * Counts resources |
|
108 * @return Number of resources |
|
109 */ |
|
110 TInt CountResources(); |
|
111 |
|
112 /** |
|
113 * Panics client |
|
114 * @param aPanic panic code |
|
115 * @return None |
|
116 */ |
|
117 void PanicClient( TCseSchedulerServPanic aPanic ) const; |
|
118 |
|
119 private: // Constructors and destructor |
|
120 |
|
121 /** |
|
122 * C++ default constructor. |
|
123 * @Param aClient reference client thread |
|
124 */ |
|
125 CCseSchedulerServerSession(); |
|
126 |
|
127 /** |
|
128 * Symbian 2nd phase constructor. |
|
129 * @Param aServer pointer to Server |
|
130 */ |
|
131 void ConstructL( CCseSchedulerServer* aServer ); |
|
132 |
|
133 private: // Data |
|
134 |
|
135 /** |
|
136 * Object index for this session. Own. |
|
137 */ |
|
138 CObjectIx* iObjects; |
|
139 |
|
140 /** |
|
141 * Total number of resources allocated |
|
142 */ |
|
143 TInt iResourceCount; |
|
144 |
|
145 }; |
|
146 |
|
147 #endif // __CCSESCHEDULERSERVERSESSION_H |
|
148 |