|
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: Each application that connects WS-stack through client-server |
|
15 * interface has an application context of it's own, which can |
|
16 * hold a list for active connections and service sessions, |
|
17 * acting as a common place holder and bridge between the |
|
18 * smaller (contexts) that those contain. Class allows |
|
19 * application-wide information to be shared efficiently |
|
20 * at proper layer. |
|
21 * |
|
22 */ |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 #ifndef SEN_CLIENT_CONTEXT_H |
|
32 #define SEN_CLIENT_CONTEXT_H |
|
33 |
|
34 |
|
35 // INCLUDES |
|
36 #include <e32base.h> |
|
37 #include <e32std.h> |
|
38 //#include "SenContext.h" |
|
39 #include "senpointermap.h" |
|
40 |
|
41 // FORWARD DECLARATIONS |
|
42 class CSenSessionContext; |
|
43 class CSenApplicationContext; |
|
44 class CSenClientSession; |
|
45 |
|
46 // TYPE DEFS |
|
47 typedef RSenPointerMap<TInt, CSenSessionContext> RSessionCtxMap; |
|
48 |
|
49 |
|
50 // CLASS DECLARATION |
|
51 class CSenClientContext : public CBase // CSenContext |
|
52 { |
|
53 friend class CSenApplicationContext; |
|
54 friend class CSenClientSession; |
|
55 public: |
|
56 // Destructor: |
|
57 IMPORT_C virtual ~CSenClientContext(); |
|
58 |
|
59 // New methods: |
|
60 virtual TInt ClientId() const; |
|
61 |
|
62 protected: |
|
63 IMPORT_C CSenClientContext(TInt aClientId, CSenApplicationContext& aCtx); |
|
64 |
|
65 IMPORT_C void BaseConstructL(); |
|
66 |
|
67 private: |
|
68 /** |
|
69 * Standard 2-phased constructor |
|
70 * @return pointer to new context. |
|
71 */ |
|
72 IMPORT_C static CSenClientContext* NewL(TInt aClientId, CSenApplicationContext& aCtx); |
|
73 /** |
|
74 * Standard 2-phased constructor |
|
75 * @return pointer to new context, |
|
76 * which is left on cleanupstack. |
|
77 */ |
|
78 IMPORT_C static CSenClientContext* NewLC(TInt aClientId, CSenApplicationContext& aCtx); |
|
79 |
|
80 private: // Data |
|
81 TInt iClientId; |
|
82 CSenApplicationContext& iApplicationContext; |
|
83 RSessionCtxMap iSessions; |
|
84 }; |
|
85 |
|
86 #endif // SEN_CLIENT_CONTEXT_H |
|
87 |
|
88 // End of File |