diff -r 000000000000 -r d0791faffa3f connectivitymodules/SeCon/wbxml/conmlhandler/inc/sconxmlstack.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/connectivitymodules/SeCon/wbxml/conmlhandler/inc/sconxmlstack.inl Tue Feb 02 01:11:40 2010 +0200 @@ -0,0 +1,99 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ConML parser/generator +* +*/ + + +#ifndef __SCONXMLSTACK_INL__ +#define __SCONXMLSTACK_INL__ + + +// ------------------------------------------------------------------------------------------------ +// CXMLStack +// ------------------------------------------------------------------------------------------------ +template +inline CXMLStack::CXMLStack() + { + } + +// ------------------------------------------------------------------------------------------------ +template +inline CXMLStack::~CXMLStack() + { + iStack->ResetAndDestroy(); + delete iStack; + } + +// ------------------------------------------------------------------------------------------------ +template +inline CXMLStack* CXMLStack::NewL() + { + CXMLStack* self = new (ELeave) CXMLStack(); + CleanupStack::PushL(self); + self->iStack = new (ELeave) RPointerArray(); + CleanupStack::Pop(); // self + return self; + } + +// ------------------------------------------------------------------------------------------------ +template +inline T* CXMLStack::Pop() + { + T* temp = iStack->operator[](iStack->Count() - 1); + iStack->Remove(iStack->Count() - 1); + return temp; + } + +// ------------------------------------------------------------------------------------------------ +template +inline T* CXMLStack::Top() + { + if( Count() > 0 ) + { + return iStack->operator[](iStack->Count() - 1); + } + return 0; + } + +// ------------------------------------------------------------------------------------------------ +template +inline void CXMLStack::Push( T* aItem ) + { + iStack->Append(aItem); + } + +// ------------------------------------------------------------------------------------------------ +template +inline TInt CXMLStack::Count() + { + return iStack->Count(); + } + +// ------------------------------------------------------------------------------------------------ +template +inline void CXMLStack::Reset() + { + iStack->Reset(); + } + +// ------------------------------------------------------------------------------------------------ +template +inline void CXMLStack::ResetAndDestroy() + { + iStack->ResetAndDestroy(); + } + +#endif // __SCONXMLSTACK_INL__ +