|
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 "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: Harvester Server |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CMPXHARVESTERSERVER_H |
|
20 #define CMPXHARVESTERSERVER_H |
|
21 |
|
22 #include <e32base.h> |
|
23 |
|
24 class CMPXHarvesterEngine; |
|
25 |
|
26 /** |
|
27 * Harvester Server |
|
28 */ |
|
29 NONSHARABLE_CLASS(CMPXHarvesterServer) : public CPolicyServer |
|
30 { |
|
31 public: |
|
32 |
|
33 enum { EMPXHarvesterServerPriority = CActive::EPriorityStandard }; |
|
34 |
|
35 public: |
|
36 |
|
37 /** |
|
38 * Two-phased constructor. Leaves on failure. |
|
39 * |
|
40 * @return The constructed object |
|
41 */ |
|
42 static CMPXHarvesterServer* NewL(); |
|
43 |
|
44 /** |
|
45 * Destructor |
|
46 */ |
|
47 ~CMPXHarvesterServer(); |
|
48 |
|
49 /** |
|
50 * Increments number of sessions this server holds |
|
51 */ |
|
52 void AddClient(); |
|
53 |
|
54 /** |
|
55 * Decrements number of sessions this server holds, and if now zero, shuts |
|
56 * down the server. |
|
57 */ |
|
58 void RemoveClient(); |
|
59 |
|
60 private: |
|
61 |
|
62 /** |
|
63 * C++ constructor |
|
64 * |
|
65 * @param aPriority priority of server |
|
66 * @param aPolicy security policy |
|
67 */ |
|
68 CMPXHarvesterServer(TInt aPriority, const TPolicy &aPolicy); |
|
69 |
|
70 /** |
|
71 * 2nd phase constructor |
|
72 */ |
|
73 void ConstructL(); |
|
74 |
|
75 /** |
|
76 * Create a new session |
|
77 * |
|
78 * @param aVersion version of the server |
|
79 * @param aMessage message object |
|
80 */ |
|
81 CSession2* NewSessionL(const TVersion& aVersion, |
|
82 const RMessage2& aMessage) const; |
|
83 private: |
|
84 |
|
85 CMPXHarvesterEngine* iEngine; // Engine for the server |
|
86 TInt iClients; |
|
87 }; |
|
88 |
|
89 #endif // CMPXHARVESTERSERVER_H |
|
90 |