epoc32/include/mw/cmarkedstack.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 3 e1b950c65cb4
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
     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".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 // Template class to implement a marked stack. Conatins a stack itself of marks 
    15 // providing basic marking functionality.
    16 // 
    17 //
    18 
    19 #ifndef __CMARKEDSTACK_H__
    20 #define __CMARKEDSTACK_H__
    21 
    22 // includes
    23 #include <e32base.h>
    24 #include <cstack.h>
    25 
    26 //##ModelId=3B666BCD0001
    27 
    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.
    31 
    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.
    34 
    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.
    37     @publishedAll
    38     @deprecated
    39  
    40 */
    41 {
    42 protected:
    43 class TMarkPoint
    44 /** Represents a mark.
    45  */
    46 {
    47 public:
    48 	/** Represents a mark. */	
    49 	TMarkPoint(TInt aMarkType
    50 		   , TInt aIndex)
    51 	  : iMarkType(aMarkType)
    52 	  , iStackIndex(aIndex)
    53 	{}
    54 	/** Mark type. */
    55 	TInt iMarkType;
    56 	/** Index of the marked stack item. */
    57 	TInt iStackIndex;
    58 };
    59 /** Defines a stack of marks. */
    60 typedef CStack<TMarkPoint, ETrue> CMarks;
    61 public:
    62 	//##ModelId=3B666BCD0048
    63 	inline virtual ~CMarkedStack();
    64 
    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);
    73 protected:
    74 	/** A stack of marks.
    75 
    76 	Items are added and removed from this stack by MarkL(), RemoveMark() etc.
    77 	*/
    78 	//##ModelId=3B666BCD002D
    79 	CMarks iMarks;
    80 };
    81 
    82 #include <cmarkedstack.inl>
    83 
    84 #endif // __CMARKEDSTACK_H__