williamr@2: // Copyright (c) 2000-2009 Nokia Corporation and/or its subsidiary(-ies). williamr@2: // All rights reserved. williamr@2: // This component and the accompanying materials are made available williamr@2: // 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 williamr@2: // which accompanies this distribution, and is available williamr@2: // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". williamr@2: // williamr@2: // Initial Contributors: williamr@2: // Nokia Corporation - initial contribution. williamr@2: // williamr@2: // Contributors: williamr@2: // williamr@2: // Description: williamr@2: // A template class to provide a classic stack like interface & functionality williamr@2: // The entries on the stack are owned (i.e. deleted) by the stack if the williamr@2: // StackOwnsEntry argument is ETrue williamr@2: // williamr@2: // williamr@2: williamr@2: #ifndef __CSTACK_H__ williamr@2: #define __CSTACK_H__ williamr@2: williamr@2: #include williamr@2: williamr@2: #pragma warning (disable : 4127) // conditional expression is constant williamr@2: williamr@2: williamr@2: /** williamr@2: @file williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: williamr@2: williamr@2: template williamr@2: class CStack : /*protected CArrayPtrSeg*/ public CArrayPtrSeg williamr@2: { williamr@2: public: williamr@2: inline CStack(); williamr@2: inline ~CStack(); williamr@2: williamr@2: inline void Clear(); williamr@2: inline TBool IsEmpty() const; williamr@2: inline void PushL(T* aItem); williamr@2: inline T* Pop(); williamr@2: inline T* Head() const; williamr@2: inline T* Last() const; williamr@2: }; williamr@2: williamr@2: #include williamr@2: williamr@2: #pragma warning ( default : 4127 ) // conditional expression is constant williamr@2: williamr@2: #endif // __CSTACK_H__