|
1 /* |
|
2 * Copyright (c) 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 "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 // -------------------------------------------------------------------------- |
|
24 // CUPnPObjectStackLite::CUPnPObjectStackLite |
|
25 // See upnpobjectstack.h |
|
26 // -------------------------------------------------------------------------- |
|
27 inline CUPnPObjectStackLite::CUPnPObjectStackLite() |
|
28 { |
|
29 } |
|
30 |
|
31 // -------------------------------------------------------------------------- |
|
32 // CUPnPObjectStackLite::~CUPnPObjectStackLite |
|
33 // See upnpobjectstack.h |
|
34 // -------------------------------------------------------------------------- |
|
35 inline CUPnPObjectStackLite::~CUPnPObjectStackLite() |
|
36 { |
|
37 iStack->ResetAndDestroy(); |
|
38 delete iStack; |
|
39 } |
|
40 |
|
41 // -------------------------------------------------------------------------- |
|
42 // CUPnPObjectStackLite::NewL |
|
43 // See upnpobjectstack.h |
|
44 // -------------------------------------------------------------------------- |
|
45 inline CUPnPObjectStackLite* CUPnPObjectStackLite::NewL() |
|
46 { |
|
47 CUPnPObjectStackLite* self = new (ELeave) CUPnPObjectStackLite(); |
|
48 CleanupStack::PushL(self); |
|
49 self->iStack = new (ELeave) RPointerArray<CUpnpObjectLite>(); |
|
50 CleanupStack::Pop( self ); |
|
51 return self; |
|
52 } |
|
53 |
|
54 // -------------------------------------------------------------------------- |
|
55 // CUPnPObjectStackLite::Pop |
|
56 // See upnpobjectstack.h |
|
57 // -------------------------------------------------------------------------- |
|
58 inline CUpnpObjectLite* CUPnPObjectStackLite::Pop() |
|
59 { |
|
60 CUpnpObjectLite* temp = NULL; |
|
61 |
|
62 if( Count() > 0 ) |
|
63 { |
|
64 CUpnpObjectLite* temp = iStack->operator[](iStack->Count() - 1); |
|
65 iStack->Remove(iStack->Count() - 1); |
|
66 } |
|
67 return temp; |
|
68 } |
|
69 |
|
70 // -------------------------------------------------------------------------- |
|
71 // CUPnPObjectStackLite::Top |
|
72 // See upnpobjectstack.h |
|
73 // -------------------------------------------------------------------------- |
|
74 inline CUpnpObjectLite* CUPnPObjectStackLite::Top() |
|
75 { |
|
76 if( Count() > 0 ) |
|
77 { |
|
78 return iStack->operator[](iStack->Count() - 1); |
|
79 } |
|
80 return NULL; |
|
81 } |
|
82 |
|
83 // -------------------------------------------------------------------------- |
|
84 // CUPnPObjectStackLite::PushL |
|
85 // See upnpobjectstack.h |
|
86 // -------------------------------------------------------------------------- |
|
87 inline void CUPnPObjectStackLite::PushL( CUpnpObjectLite* aObject ) |
|
88 { |
|
89 iStack->AppendL( aObject ); |
|
90 } |
|
91 |
|
92 // -------------------------------------------------------------------------- |
|
93 // CUPnPObjectStackLite::Count |
|
94 // See upnpobjectstack.h |
|
95 // -------------------------------------------------------------------------- |
|
96 inline TInt CUPnPObjectStackLite::Count() |
|
97 { |
|
98 return iStack->Count(); |
|
99 } |
|
100 |
|
101 // -------------------------------------------------------------------------- |
|
102 // CUPnPObjectStackLite::Reset |
|
103 // See upnpobjectstack.h |
|
104 // -------------------------------------------------------------------------- |
|
105 inline void CUPnPObjectStackLite::Reset() |
|
106 { |
|
107 iStack->Reset(); |
|
108 } |
|
109 |
|
110 // -------------------------------------------------------------------------- |
|
111 // CUPnPObjectStackLite::ResetAndDestroy |
|
112 // See upnpobjectstack.h |
|
113 // -------------------------------------------------------------------------- |
|
114 inline void CUPnPObjectStackLite::ResetAndDestroy() |
|
115 { |
|
116 iStack->ResetAndDestroy(); |
|
117 } |
|
118 |