diff -r 2fe1408b6811 -r e1b950c65cb4 epoc32/include/mw/cmarkedstack.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/epoc32/include/mw/cmarkedstack.h Wed Mar 31 12:27:01 2010 +0100 @@ -0,0 +1,84 @@ +// Copyright (c) 2000-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// 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 +// which accompanies this distribution, and is available +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// Template class to implement a marked stack. Conatins a stack itself of marks +// providing basic marking functionality. +// +// + +#ifndef __CMARKEDSTACK_H__ +#define __CMARKEDSTACK_H__ + +// includes +#include +#include + +//##ModelId=3B666BCD0001 + +template +class CMarkedStack : public CStack +/** Provides a templated stack that allows items in the stack to be marked. + +The class allows each mark to have an associated TInt value, which allows different +types of mark to be used on the same stack. + +Template parameter T specifies the type of object on the stack. Owner should be set to +ETrue if the object's destructor should delete the objects on the stack. + @publishedAll + @released + +*/ +{ +protected: +class TMarkPoint +/** Represents a mark. + */ +{ +public: + /** Represents a mark. */ + TMarkPoint(TInt aMarkType + , TInt aIndex) + : iMarkType(aMarkType) + , iStackIndex(aIndex) + {} + /** Mark type. */ + TInt iMarkType; + /** Index of the marked stack item. */ + TInt iStackIndex; +}; +/** Defines a stack of marks. */ +typedef CStack CMarks; +public: + //##ModelId=3B666BCD0048 + inline virtual ~CMarkedStack(); + + //##ModelId=3B666BCD0041 + inline void MarkL(TInt aMarkType); + //##ModelId=3B666BCD003F + inline TInt RemoveMark(TInt aMarkType); + //##ModelId=3B666BCD003D + inline void DeleteToMark(TInt aMarkType); + //##ModelId=3B666BCD0033 + inline void ResetToMark(TInt aMarkType); +protected: + /** A stack of marks. + + Items are added and removed from this stack by MarkL(), RemoveMark() etc. + */ + //##ModelId=3B666BCD002D + CMarks iMarks; +}; + +#include + +#endif // __CMARKEDSTACK_H__