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@2: // 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 williamr@2: // which accompanies this distribution, and is available williamr@2: // at the URL "http://www.symbianfoundation.org/legal/licencesv10.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: // williamr@2: williamr@2: williamr@2: // note: MergeToMark is not atomic - a leave means that data has been removed williamr@2: template williamr@2: inline void CRuleMarkedStack::MergeToMarkL(TInt aMarkType) williamr@2: { williamr@2: const TInt lastMark=this->RemoveMark(aMarkType); williamr@2: if (this->Count()>lastMark) williamr@2: { williamr@2: CBNFNode* currentRule=this->Pop(); williamr@2: if (StackOwnsEntry) williamr@2: CleanupStack::PushL(currentRule); williamr@2: williamr@2: while (this->Count()>lastMark) williamr@2: { williamr@2: CBNFNode* nextRule=this->Pop(); williamr@2: if (StackOwnsEntry) williamr@2: CleanupStack::PushL(nextRule); williamr@2: currentRule->ReparentL(nextRule); williamr@2: if (StackOwnsEntry) williamr@2: { williamr@2: CleanupStack::Pop(2); // nextRule, currentRule williamr@2: CleanupStack::PushL(nextRule); // nextRule williamr@2: } williamr@2: williamr@2: currentRule=nextRule; williamr@2: } williamr@2: williamr@2: if (StackOwnsEntry) williamr@2: CleanupStack::Pop(); // currentRule williamr@2: this->PushL(currentRule); williamr@2: } williamr@2: }