epoc32/include/mw/cstack.h
branchSymbian2
changeset 3 e1b950c65cb4
parent 2 2fe1408b6811
child 4 837f303aceeb
equal deleted inserted replaced
2:2fe1408b6811 3:e1b950c65cb4
       
     1 // Copyright (c) 2000-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // A template class to provide a classic stack like interface & functionality
       
    15 // The entries on the stack are owned (i.e. deleted) by the stack if the 
       
    16 // StackOwnsEntry argument is ETrue
       
    17 // 
       
    18 //
       
    19 
       
    20 #ifndef __CSTACK_H__
       
    21 #define __CSTACK_H__
       
    22 
       
    23 #include <e32base.h>
       
    24 
       
    25 #pragma warning (disable : 4127) // conditional expression is constant
       
    26 
       
    27 
       
    28 /**	
       
    29 	@file
       
    30 	@publishedAll
       
    31 	@released
       
    32 */
       
    33 
       
    34 
       
    35 template <class T, TBool StackOwnsEntry>
       
    36 class CStack : /*protected CArrayPtrSeg<T>*/ public CArrayPtrSeg<T>
       
    37 	{
       
    38 public:
       
    39 	inline CStack();
       
    40 	inline ~CStack();
       
    41 
       
    42 	inline void Clear();		
       
    43 	inline TBool IsEmpty() const;
       
    44 	inline void PushL(T* aItem);
       
    45 	inline T* Pop();
       
    46 	inline T* Head() const;
       
    47 	inline T* Last() const;		
       
    48 	};
       
    49 
       
    50 #include <cstack.inl>
       
    51 
       
    52 #pragma warning ( default : 4127 ) // conditional expression is constant
       
    53 
       
    54 #endif // __CSTACK_H__