|
1 /* |
|
2 * Copyright (c) 2004 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: Access handler of the network session |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef __CPENGTRANSADAPFACTORY_H__ |
|
19 #define __CPENGTRANSADAPFACTORY_H__ |
|
20 |
|
21 // INCLUDES |
|
22 #include <E32Base.h> |
|
23 #include "MPEngTransAdapFactory.h" |
|
24 |
|
25 |
|
26 // FORWARD DECLARATIONS |
|
27 class MPEngAccessHandler; |
|
28 class MPEngPureDataHandler; |
|
29 class CPEngSessionSlotId; |
|
30 class CPEngSessionManager; |
|
31 |
|
32 /** |
|
33 * NWSessionSlotID implementation. |
|
34 * |
|
35 * @since 3.0 |
|
36 */ |
|
37 NONSHARABLE_CLASS( CPEngTransAdapFactory ) : |
|
38 public CObject, |
|
39 public MPEngTransAdapFactory |
|
40 { |
|
41 public: /* Construction */ |
|
42 |
|
43 /** |
|
44 * Tryes to get instance from the Thread local storage |
|
45 * if it does not exists there, it is constructed and stored |
|
46 * there |
|
47 * |
|
48 * @since 3.0 |
|
49 * @return CPEngTransAdapFactory instance |
|
50 */ |
|
51 static CPEngTransAdapFactory* InstanceLC(); |
|
52 |
|
53 /** |
|
54 * Destructor. |
|
55 */ |
|
56 ~CPEngTransAdapFactory(); |
|
57 |
|
58 //----------------------------------------------------------------------- |
|
59 public: //new functions of the MPEngTransAdapFactory |
|
60 |
|
61 /** |
|
62 * Add session reference |
|
63 * |
|
64 * @since 3.0 |
|
65 */ |
|
66 void OpenSessionCount(); |
|
67 |
|
68 /** |
|
69 * Close session manager |
|
70 * |
|
71 * @since 3.0 |
|
72 * @param aSessManager session manager |
|
73 */ |
|
74 void CloseSession( CPEngSessionManager* aSessManager ); |
|
75 |
|
76 //----------------------------------------------------------------------- |
|
77 public: // |
|
78 |
|
79 /** |
|
80 * Get Access handler for defined session |
|
81 * |
|
82 * @since 3.0 |
|
83 * @param aSessionId |
|
84 * @return access handler |
|
85 */ |
|
86 MPEngAccessHandler* AccessHandlerL( |
|
87 const CPEngSessionSlotId& aSessionId ); |
|
88 |
|
89 /** |
|
90 * Get Pure data handler for defined session Id |
|
91 * |
|
92 * @since 3.0 |
|
93 * @param |
|
94 * @return |
|
95 */ |
|
96 MPEngPureDataHandler* PureDataHandlerL( |
|
97 const CPEngSessionSlotId& aSessionId ); |
|
98 |
|
99 private: // |
|
100 |
|
101 /** |
|
102 * Get Session manager |
|
103 * |
|
104 * @since 3.0 |
|
105 * @param aSessionId session id to find |
|
106 * @return session manager |
|
107 */ |
|
108 CPEngSessionManager& SessionManagerLC( |
|
109 const CPEngSessionSlotId& aSessionId ); |
|
110 |
|
111 protected: // construction |
|
112 |
|
113 /** |
|
114 * C++ constructor. protected |
|
115 */ |
|
116 CPEngTransAdapFactory(); |
|
117 |
|
118 private: //Data |
|
119 |
|
120 /// OWN: Access count |
|
121 TInt iAccessCount; |
|
122 |
|
123 /// OWN: Active managers, |
|
124 /// elements OWNED |
|
125 RPointerArray<CPEngSessionManager> iSessManagers; |
|
126 |
|
127 }; |
|
128 |
|
129 #endif //__CPENGTRANSADAPFACTORY_H__ |
|
130 |
|
131 // End of File |