epoc32/include/cstack.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
     1.1 --- a/epoc32/include/cstack.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/cstack.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,54 @@
     1.4 -cstack.h
     1.5 +// Copyright (c) 2000-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +// All rights reserved.
     1.7 +// This component and the accompanying materials are made available
     1.8 +// 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
     1.9 +// which accompanies this distribution, and is available
    1.10 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.11 +//
    1.12 +// Initial Contributors:
    1.13 +// Nokia Corporation - initial contribution.
    1.14 +//
    1.15 +// Contributors:
    1.16 +//
    1.17 +// Description:
    1.18 +// A template class to provide a classic stack like interface & functionality
    1.19 +// The entries on the stack are owned (i.e. deleted) by the stack if the 
    1.20 +// StackOwnsEntry argument is ETrue
    1.21 +// 
    1.22 +//
    1.23 +
    1.24 +#ifndef __CSTACK_H__
    1.25 +#define __CSTACK_H__
    1.26 +
    1.27 +#include <e32base.h>
    1.28 +
    1.29 +#pragma warning (disable : 4127) // conditional expression is constant
    1.30 +
    1.31 +
    1.32 +/**	
    1.33 +	@file
    1.34 +	@publishedAll
    1.35 +	@released
    1.36 +*/
    1.37 +
    1.38 +
    1.39 +template <class T, TBool StackOwnsEntry>
    1.40 +class CStack : /*protected CArrayPtrSeg<T>*/ public CArrayPtrSeg<T>
    1.41 +	{
    1.42 +public:
    1.43 +	inline CStack();
    1.44 +	inline ~CStack();
    1.45 +
    1.46 +	inline void Clear();		
    1.47 +	inline TBool IsEmpty() const;
    1.48 +	inline void PushL(T* aItem);
    1.49 +	inline T* Pop();
    1.50 +	inline T* Head() const;
    1.51 +	inline T* Last() const;		
    1.52 +	};
    1.53 +
    1.54 +#include <cstack.inl>
    1.55 +
    1.56 +#pragma warning ( default : 4127 ) // conditional expression is constant
    1.57 +
    1.58 +#endif // __CSTACK_H__