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@4: // under the terms of "Eclipse Public License v1.0" williamr@2: // which accompanies this distribution, and is available williamr@4: // at the URL "http://www.eclipse.org/legal/epl-v10.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: // Template class to implement a marked stack. Conatins a stack itself of marks williamr@2: // providing basic marking functionality. williamr@2: // williamr@2: // williamr@2: williamr@2: #ifndef __CMARKEDSTACK_H__ williamr@2: #define __CMARKEDSTACK_H__ williamr@2: williamr@2: // includes williamr@2: #include williamr@2: #include williamr@2: williamr@2: //##ModelId=3B666BCD0001 williamr@2: williamr@2: template williamr@2: class CMarkedStack : public CStack williamr@2: /** Provides a templated stack that allows items in the stack to be marked. williamr@2: williamr@2: The class allows each mark to have an associated TInt value, which allows different williamr@2: types of mark to be used on the same stack. williamr@2: williamr@2: Template parameter T specifies the type of object on the stack. Owner should be set to williamr@2: ETrue if the object's destructor should delete the objects on the stack. williamr@2: @publishedAll williamr@4: @deprecated williamr@2: williamr@2: */ williamr@2: { williamr@2: protected: williamr@2: class TMarkPoint williamr@2: /** Represents a mark. williamr@2: */ williamr@2: { williamr@2: public: williamr@2: /** Represents a mark. */ williamr@2: TMarkPoint(TInt aMarkType williamr@2: , TInt aIndex) williamr@2: : iMarkType(aMarkType) williamr@2: , iStackIndex(aIndex) williamr@2: {} williamr@2: /** Mark type. */ williamr@2: TInt iMarkType; williamr@2: /** Index of the marked stack item. */ williamr@2: TInt iStackIndex; williamr@2: }; williamr@2: /** Defines a stack of marks. */ williamr@2: typedef CStack CMarks; williamr@2: public: williamr@2: //##ModelId=3B666BCD0048 williamr@2: inline virtual ~CMarkedStack(); williamr@2: williamr@2: //##ModelId=3B666BCD0041 williamr@2: inline void MarkL(TInt aMarkType); williamr@2: //##ModelId=3B666BCD003F williamr@2: inline TInt RemoveMark(TInt aMarkType); williamr@2: //##ModelId=3B666BCD003D williamr@2: inline void DeleteToMark(TInt aMarkType); williamr@2: //##ModelId=3B666BCD0033 williamr@2: inline void ResetToMark(TInt aMarkType); williamr@2: protected: williamr@2: /** A stack of marks. williamr@2: williamr@2: Items are added and removed from this stack by MarkL(), RemoveMark() etc. williamr@2: */ williamr@2: //##ModelId=3B666BCD002D williamr@2: CMarks iMarks; williamr@2: }; williamr@2: williamr@2: #include williamr@2: williamr@2: #endif // __CMARKEDSTACK_H__