|
1 /* |
|
2 * Copyright (c) 2007 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: Defines the notification map data structure used by Location |
|
15 * Triggering Server Logic to store notification request messages |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef LBTNOTIFICATIONMAP_H |
|
21 #define LBTNOTIFICATIONMAP_H |
|
22 |
|
23 // INCLUDE FILES |
|
24 #include <e32cmn.h> |
|
25 #include "lbtserverlogicbase.h" |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 class RMessage2; |
|
29 |
|
30 |
|
31 // CLASS DECLARATION |
|
32 |
|
33 /** |
|
34 * Defination of notification map data structure used |
|
35 * by Location Triggering Server Logic to store IPC |
|
36 * requests by client for asynchronous notifications |
|
37 * |
|
38 */ |
|
39 class CLbtNotificationMap : public CBase |
|
40 { |
|
41 public: |
|
42 /** |
|
43 * Instantiates a new object of |
|
44 * CLbtNotificationMap |
|
45 * |
|
46 */ |
|
47 static CLbtNotificationMap* NewL(); |
|
48 |
|
49 /** |
|
50 * Destructor |
|
51 * |
|
52 */ |
|
53 ~CLbtNotificationMap(); |
|
54 |
|
55 /** |
|
56 * Inserts the IPC message into the notification map. |
|
57 * The IPC messages is inserted such that the notification |
|
58 * map is always is sorted in ascending order based on the |
|
59 * secure id of the client. |
|
60 * |
|
61 * @param aMessage[in] the IPC message to be inserted into |
|
62 * notification map |
|
63 */ |
|
64 void InsertL( |
|
65 const RMessage2& aMessage, |
|
66 CLbtServerLogicBase::TSubSessionType aType); |
|
67 |
|
68 /** |
|
69 * Retreives the IPC message which matches all the supplied data. |
|
70 * The retreived IPC message is removed from the notification |
|
71 * map |
|
72 * |
|
73 * @param[out] aMessage the retreived IPC message is returned |
|
74 * through this parameter |
|
75 * @param[in] aSubSessionHandle the handle number of the sub-session |
|
76 * @param[in] aSecureId the secure id of the client whose IPC message |
|
77 * has to be retreived |
|
78 * @param[in] aServiceId the service id of the IPC message which matches |
|
79 * @param[in] aSession pointer to the session of the IPC message which |
|
80 * should be retreived id. |
|
81 */ |
|
82 TInt Retreive(RMessage2& aMessage, |
|
83 TUint32 aSubSessionHandle, |
|
84 TSecureId aSecureId, |
|
85 TInt aServiceId, |
|
86 CSession2* aSession); |
|
87 |
|
88 /** |
|
89 * Retreives the IPC message which matches all the supplied data. |
|
90 * The retreived IPC message is removed from the notification |
|
91 * map |
|
92 * |
|
93 * @param[out] aMessage the retreived IPC message is returned |
|
94 * through this parameter |
|
95 * @param[in] aSecureId the secure id of the client whose IPC message |
|
96 * has to be retreived |
|
97 * @param[in] aServiceId the service id of the IPC message which matches |
|
98 */ |
|
99 TInt Retreive(RMessage2& aMessage, |
|
100 TSecureId aSecureId, |
|
101 TInt aServiceId); |
|
102 |
|
103 /** |
|
104 * Retreives the IPC message which matches all the supplied data. |
|
105 * The retreived IPC message is removed from the notification |
|
106 * map |
|
107 * |
|
108 * @param[out] aMessage the retreived IPC message is returned |
|
109 * through this parameter |
|
110 * @param[in] aSecureId the secure id of the client whose IPC message |
|
111 * has to be retreived |
|
112 * @param[in] aServiceId the service id of the IPC message which matches |
|
113 */ |
|
114 TInt Retreive(RMessage2& aMessage, |
|
115 TInt aSubSessionHandle, |
|
116 TSecureId aSecureId); |
|
117 /** |
|
118 * Retreives the IPC message which matches all the supplied data. |
|
119 * The retreived IPC message is removed from the notification |
|
120 * map |
|
121 * |
|
122 * @param[out] aMessage the retreived IPC message is returned |
|
123 * through this parameter |
|
124 * @param[in] aServiceId the service id of the IPC message which matches |
|
125 * @param[in] aType the subsession type of the client whose IPC message |
|
126 * has to be retreived |
|
127 */ |
|
128 TInt Retreive(RMessage2& aMessage, |
|
129 TInt aServiceId, |
|
130 CLbtServerLogicBase::TSubSessionType aType); |
|
131 /** |
|
132 * Completes and removes all the IPC messages in the notification map which |
|
133 * matches the supplied data of the parameters |
|
134 * |
|
135 * @param[in] aSession pointer to the session of the IPC message which |
|
136 * should be completed |
|
137 * @param[in] aSubSessionHandle the handle number of the sub-session |
|
138 * @param[in] aErrorCode the error code with which the messages have |
|
139 * to be completed |
|
140 */ |
|
141 void CompleteMessagesOfSubsession(const CSession2* aSession, const TInt aSubSessionHandle, TInt aErrorCode); |
|
142 |
|
143 /** |
|
144 * Removes all the IPC messages registered by the particular client. |
|
145 * |
|
146 * @param[in] aSecureId the secure id of the client whose IPC message |
|
147 * has to be retreived |
|
148 */ |
|
149 void RemoveAllClientMessages(TSecureId aSecureId); |
|
150 |
|
151 /** |
|
152 * Resets the notification map and removes all the IPC messages. All |
|
153 * the IPC messages are completed with the supplied error code |
|
154 * |
|
155 * @param[in] aErrorCode the error code with which the IPC messages |
|
156 * needs to be completed |
|
157 */ |
|
158 void Reset(TInt aErrorCode); |
|
159 |
|
160 public: |
|
161 struct TLbtNotificationReq |
|
162 { |
|
163 RMessage2 iMsg; |
|
164 CLbtServerLogicBase::TSubSessionType iType; |
|
165 }; |
|
166 |
|
167 private: |
|
168 |
|
169 /** |
|
170 * 2nd phase constuctor for instantiating member variables |
|
171 * |
|
172 */ |
|
173 void ConstructL(); |
|
174 |
|
175 private: // Data Members |
|
176 |
|
177 // Array to store all the IPC messages |
|
178 RArray<TLbtNotificationReq> iMessageArray; |
|
179 }; |
|
180 |
|
181 |
|
182 #endif // LBTNOTIFICATIONMAP_H |
|
183 |
|
184 // end of file |