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 "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // Template class to implement a marked stack. Conatins a stack itself of marks
15 // providing basic marking functionality.
19 #ifndef __CMARKEDSTACK_H__
20 #define __CMARKEDSTACK_H__
26 //##ModelId=3B666BCD0001
28 template <class T, TBool Owner>
29 class CMarkedStack : public CStack<T, Owner>
30 /** Provides a templated stack that allows items in the stack to be marked.
32 The class allows each mark to have an associated TInt value, which allows different
33 types of mark to be used on the same stack.
35 Template parameter T specifies the type of object on the stack. Owner should be set to
36 ETrue if the object's destructor should delete the objects on the stack.
44 /** Represents a mark.
48 /** Represents a mark. */
49 TMarkPoint(TInt aMarkType
51 : iMarkType(aMarkType)
56 /** Index of the marked stack item. */
59 /** Defines a stack of marks. */
60 typedef CStack<TMarkPoint, ETrue> CMarks;
62 //##ModelId=3B666BCD0048
63 inline virtual ~CMarkedStack();
65 //##ModelId=3B666BCD0041
66 inline void MarkL(TInt aMarkType);
67 //##ModelId=3B666BCD003F
68 inline TInt RemoveMark(TInt aMarkType);
69 //##ModelId=3B666BCD003D
70 inline void DeleteToMark(TInt aMarkType);
71 //##ModelId=3B666BCD0033
72 inline void ResetToMark(TInt aMarkType);
76 Items are added and removed from this stack by MarkL(), RemoveMark() etc.
78 //##ModelId=3B666BCD002D
82 #include <cmarkedstack.inl>
84 #endif // __CMARKEDSTACK_H__