1.1 --- a/epoc32/include/cmarkedstack.inl Wed Mar 31 12:27:01 2010 +0100
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,86 +0,0 @@
1.4 -// Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 -// All rights reserved.
1.6 -// This component and the accompanying materials are made available
1.7 -// 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.8 -// which accompanies this distribution, and is available
1.9 -// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.10 -//
1.11 -// Initial Contributors:
1.12 -// Nokia Corporation - initial contribution.
1.13 -//
1.14 -// Contributors:
1.15 -//
1.16 -// Description:
1.17 -// CMStack.inl
1.18 -//
1.19 -//
1.20 -
1.21 -#include <cmarkedstack.h>
1.22 -
1.23 -/** Destructor.
1.24 -
1.25 -It clears all marks.
1.26 -*/
1.27 -template <class T, TBool Owner>
1.28 -inline CMarkedStack<T, Owner>::~CMarkedStack()
1.29 -{
1.30 - iMarks.Clear();
1.31 -}
1.32 -
1.33 -/** Marks the stack's head item.
1.34 -
1.35 -@param aMarkType Mark type
1.36 -*/
1.37 -template <class T, TBool Owner>
1.38 -void
1.39 -inline CMarkedStack<T, Owner>::MarkL(TInt aMarkType)
1.40 - {
1.41 - TMarkPoint* point = new (ELeave) TMarkPoint(aMarkType, this->Count());
1.42 - iMarks.PushL(point);
1.43 - }
1.44 -
1.45 -/** Removes all marks until a mark of the specified type is found.
1.46 -
1.47 -@return Index of the stack item marked by the found mark
1.48 -@param aMarkType Mark type
1.49 -*/
1.50 -template <class T, TBool Owner>
1.51 -TInt
1.52 -inline CMarkedStack<T, Owner>::RemoveMark(TInt aMarkType)
1.53 - {
1.54 - TMarkPoint* point = NULL;
1.55 - do
1.56 - {
1.57 - delete point;
1.58 - point = iMarks.Pop();
1.59 - } while (point->iMarkType != aMarkType);
1.60 - TInt stackIndex = point->iStackIndex;
1.61 - delete point;
1.62 - return stackIndex;
1.63 - }
1.64 -
1.65 -/** Pops and deletes items from the stack until the item marked with the specified mark type is at the head.
1.66 -
1.67 -@param aMarkType Mark type
1.68 -*/
1.69 -template <class T, TBool Owner>
1.70 -void
1.71 -inline CMarkedStack<T, Owner>::DeleteToMark(TInt aMarkType)
1.72 - {
1.73 - TInt lastMark = RemoveMark(aMarkType);
1.74 - while (this->Count() > lastMark)
1.75 - delete this->Pop();
1.76 - }
1.77 -
1.78 -/** Pops items from the stack until the item marked with the specified mark type is at the head.
1.79 -
1.80 -@param aMarkType Mark type
1.81 -*/
1.82 -template <class T, TBool Owner>
1.83 -void
1.84 -inline CMarkedStack<T, Owner>::ResetToMark(TInt aMarkType)
1.85 - {
1.86 - TInt lastMark = RemoveMark(aMarkType);
1.87 - while (this->Count() > lastMark)
1.88 - this->Pop();
1.89 - }