|
1 /* |
|
2 * Copyright (c) 2005 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: Class for storing imps tid queue |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CImpsTidQueue_H |
|
20 #define CImpsTidQueue_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 |
|
25 // FORWARD DECLARATIONS |
|
26 |
|
27 // CLASS DECLARATION |
|
28 /** |
|
29 * FIFO queue for transaction ids. When the queue at max |
|
30 * capacity the oldest item gets deleted. |
|
31 */ |
|
32 |
|
33 class CImpsTidQueue : public CBase |
|
34 { |
|
35 public: |
|
36 |
|
37 /** |
|
38 * 2-phase Constructor |
|
39 */ |
|
40 static CImpsTidQueue* NewL(); |
|
41 |
|
42 // Destructor |
|
43 ~CImpsTidQueue(); |
|
44 |
|
45 /** |
|
46 * Adds a new orphan message to the end of the queue |
|
47 * @param aTid CSP transaction id |
|
48 */ |
|
49 void Add( const TDesC& aTid ); |
|
50 |
|
51 /** |
|
52 * Check if TID queued already |
|
53 * @param aTid CSP transaction id |
|
54 * @return ETrue if TID found |
|
55 */ |
|
56 TBool TidFound( const TDesC& aTid ); |
|
57 |
|
58 /** |
|
59 * Deletes all entities |
|
60 */ |
|
61 void DeleteAll(); |
|
62 |
|
63 private: |
|
64 |
|
65 /** |
|
66 * Constructor |
|
67 */ |
|
68 void ConstructL(); |
|
69 |
|
70 /** |
|
71 * Constructs a new COrpanQueue with given capacity |
|
72 * @param aCapacity the capacity of the queue |
|
73 */ |
|
74 CImpsTidQueue( TInt aCapacity ); |
|
75 |
|
76 private: |
|
77 |
|
78 TInt iCapacity; |
|
79 TInt iNext; // position to write data |
|
80 CDesCArrayFlat* iArray; |
|
81 }; |
|
82 |
|
83 |
|
84 #endif |