|
1 /* |
|
2 * Copyright (c) 2006-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: Stack for XML SAX Parser. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 #ifndef _C_UPNPOBJECTSTACK_H_ |
|
24 #define _C_UPNPOBJECTSTACK_H_ |
|
25 |
|
26 // INCLUDES |
|
27 #include <e32base.h> |
|
28 #include "upnpobject.h" |
|
29 |
|
30 /** |
|
31 * A Stack class, which is used to hold UPnP objects in order while parsing |
|
32 * xml. |
|
33 * |
|
34 * @since Series 60 3.1 |
|
35 * @lib upnpxmlparser.lib |
|
36 */ |
|
37 NONSHARABLE_CLASS( CUPnPObjectStack ) : public CBase |
|
38 { |
|
39 public: |
|
40 /** |
|
41 * 2-phased constructor. |
|
42 */ |
|
43 static inline CUPnPObjectStack* NewL(); |
|
44 |
|
45 /** |
|
46 * Destructor. |
|
47 */ |
|
48 inline virtual ~CUPnPObjectStack(); |
|
49 |
|
50 public: |
|
51 |
|
52 /** |
|
53 * Pops top object from the stack. |
|
54 * @return pointer to the popped object. |
|
55 */ |
|
56 inline CUpnpObject* Pop(); |
|
57 |
|
58 /** |
|
59 * Retuns the pointer of the top object. |
|
60 * @return pointer to the top object. |
|
61 */ |
|
62 inline CUpnpObject* Top(); |
|
63 |
|
64 /** |
|
65 * Pushes object to the stack. |
|
66 * @param aObject, an object, which is added to the stack as top object. |
|
67 */ |
|
68 inline void PushL( CUpnpObject* aObject ); |
|
69 |
|
70 /** |
|
71 * Returns the current count of the stack. |
|
72 * @return stack count. |
|
73 */ |
|
74 inline TInt Count(); |
|
75 |
|
76 /** |
|
77 * Clears the stack. |
|
78 */ |
|
79 inline void Reset(); |
|
80 |
|
81 /** |
|
82 * Clears the stack and deletes all the objects in it. |
|
83 */ |
|
84 inline void ResetAndDestroy(); |
|
85 |
|
86 private: |
|
87 |
|
88 /** |
|
89 * Constructor. |
|
90 */ |
|
91 inline CUPnPObjectStack(); |
|
92 |
|
93 private: |
|
94 |
|
95 /** |
|
96 * An array, which contains the objects in the stack. |
|
97 * Own. |
|
98 */ |
|
99 RPointerArray<CUpnpObject>* iStack; |
|
100 }; |
|
101 |
|
102 #include "upnpobjectstack.inl" |
|
103 |
|
104 #endif // _C_UPNPOBJECTSTACK_H_ |