connectivitymodules/SeCon/wbxml/conmlhandler/inc/sconxmlstack.h
author Pat Downey <patd@symbian.org>
Wed, 01 Sep 2010 12:20:56 +0100
branchRCL_3
changeset 20 4a793f564d72
parent 0 d0791faffa3f
permissions -rw-r--r--
Revert incorrect RCL_3 drop: Revision: 201032 Kit: 201035

/*
* Copyright (c) 2005 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_H__
#define __SCONXMLSTACK_H__

// -----------------------------------------------------------------------------
// CNSmlStack - Stack for WBXML / XML elements
// ----------------------------------------------------------------------------

template <class T>
class CXMLStack  : public CBase
	{
public:
	static inline CXMLStack* NewL();
	inline ~CXMLStack();
        
        /**
        *  Removes latest item from the stack
        * @param none
        * @return none
        */
	inline T* Pop();
	
	/**
        *  Return the latest item from the stack
        * @param none
        * @return the item
        */
	inline T* Top();
	
	/**
        *  Adds an item to the stack
        * @param none
        * @return none
        */
	inline void Push( T* aItem );
	
	/**
        * Returns the number of items in the stack
        * @param none
        * @return number of items as TInt
        */
	inline TInt Count();
	
	/**
        *  Resets the stack
        * @param none
        * @return none
        */
	inline void Reset();
	
	/**
        *  Resets and destroys the stack
        * @param none
        * @return none
        */
	inline void ResetAndDestroy();


protected:
	inline CXMLStack<T>();

private:
	RPointerArray<T>* iStack;
	};

#include "sconxmlstack.inl"

#endif // __SCONXMLSTACK_H__