|
1 /* |
|
2 * Copyright (c) 2005-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: Map of callback and transaction id. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __SYSINFOKCALLBACKMAP_H__ |
|
20 #define __SYSINFOKCALLBACKMAP_H__ |
|
21 |
|
22 |
|
23 //FORWARD DECLARATION |
|
24 class MLiwNotifyCallback; |
|
25 |
|
26 /** |
|
27 * CSysInfoCallbackMap |
|
28 * This class keeps a map of the transaction id allocated to an asynchronous |
|
29 * request with the callback of the request. |
|
30 */ |
|
31 |
|
32 // CLASS DECLARATION |
|
33 NONSHARABLE_CLASS(CSysInfoCallbackMap): public CBase |
|
34 { |
|
35 public:// Constructors |
|
36 |
|
37 /** |
|
38 * CSysInfoCallbackMap |
|
39 * Constructor. |
|
40 * |
|
41 * @param aTransactionId The transaction id alloted to asynchronous request. |
|
42 * @param aCallback The callback associated with the asynchronous request. |
|
43 */ |
|
44 inline CSysInfoCallbackMap( TInt32 aTransactionId, |
|
45 MLiwNotifyCallback* aCallback ); |
|
46 |
|
47 /** |
|
48 * ~CSysInfoCallbackMap |
|
49 * Destructor. |
|
50 */ |
|
51 inline ~CSysInfoCallbackMap() {} |
|
52 |
|
53 public: |
|
54 |
|
55 /** |
|
56 * Set |
|
57 * Sets the transaction id and callback. |
|
58 * |
|
59 * @param aTransactionId The transaction id alloted to asynchronous request. |
|
60 * @param aCallback The callback associated with the asynchronous request. |
|
61 */ |
|
62 inline void Set( TInt32 aTransactionId, MLiwNotifyCallback* aCallback ); |
|
63 |
|
64 /** |
|
65 * Get |
|
66 * Gets the transaction id and callback. |
|
67 * |
|
68 * @param aTransactionId The transaction id alloted to asynchronous request. |
|
69 * @param aCallback The reference to the callback associated with the asynchronous request. |
|
70 * @return True if aCallback is set else False. |
|
71 */ |
|
72 inline TBool Get( TInt32 aTransactionId, MLiwNotifyCallback*& aCallback) const; |
|
73 |
|
74 private:// Data |
|
75 |
|
76 /** |
|
77 * iTransactionId |
|
78 * The transaction id of the async call. |
|
79 */ |
|
80 TInt32 iTransactionId; |
|
81 |
|
82 /** |
|
83 * iCallback |
|
84 * The handle to MLiwNotifyCallback. |
|
85 */ |
|
86 MLiwNotifyCallback* iCallback; |
|
87 |
|
88 }; |
|
89 |
|
90 #include "sysinfocallbackmap.inl" |
|
91 |
|
92 #endif // __SYSINFOKCALLBACKMAP_H__ |