Guiliani  Version 2.6 revision 7293 (documentation build 12)
eC_TArrayStack< T > Class Template Reference

Am array based stack container. More...

#include <eC_TArrayStack.h>

Public Member Functions

 eC_TArrayStack ()
 
 eC_TArrayStack (const eC_TArrayStack< T > &rkSource)
 
 ~eC_TArrayStack ()
 
eC_UInt GetQuantity () const
 
eC_Bool IsEmpty () const
 
eC_TArrayStack< T > & operator= (const eC_TArrayStack< T > &rkSource)
 
T & Pop ()
 
void Push (const T &e)
 
T & Top () const
 

Detailed Description

template<typename T>
class eC_TArrayStack< T >

Am array based stack container.

This simple stack implementation provides an array based stack container.

Performance: Push: O(n) - Pop: O(1) - Top: O(1)

Memory consumption: O(n)

NOTE: Do not assign objects to this stack that counts their references or depends on copy-constructors/assign operators for creating copies of itself.

Constructor & Destructor Documentation

◆ eC_TArrayStack() [1/2]

template<typename T >
eC_TArrayStack< T >::eC_TArrayStack ( )
inline

Default constructor creates an empty stack.

◆ eC_TArrayStack() [2/2]

template<typename T >
eC_TArrayStack< T >::eC_TArrayStack ( const eC_TArrayStack< T > &  rkSource)
inline

Copy constructor. Copies every element from given stack to this one.

Parameters
rkSourceStack to copy from.

◆ ~eC_TArrayStack()

template<typename T >
eC_TArrayStack< T >::~eC_TArrayStack ( )
inline

Destructor forces all elements of the stack to be removed.

Member Function Documentation

◆ GetQuantity()

template<typename T >
eC_UInt eC_TArrayStack< T >::GetQuantity ( ) const
inline

Get number of elements this stack currently contains.

Returns
NOF elements in the stack.

◆ IsEmpty()

template<typename T >
eC_Bool eC_TArrayStack< T >::IsEmpty ( ) const
inline

Test whether the container is empty.

Returns
True, if the stack is empty, otherwise False.

◆ operator=()

template<typename T >
eC_TArrayStack< T > & eC_TArrayStack< T >::operator= ( const eC_TArrayStack< T > &  rkSource)
inline

Assign operator. Copies every element from given stack to this one.

Parameters
rkSourceStack to copy from.
Returns
Reference to this class.

◆ Pop()

template<typename T >
T & eC_TArrayStack< T >::Pop ( )
inline

Removes element from top of the stack and return this element.

Returns
Element that has been removed.
Exceptions
CGUIStackUnderflowExceptionIn case of stack does not contain elements.

◆ Push()

template<typename T >
void eC_TArrayStack< T >::Push ( const T &  e)
inline

Add element on top of the stack.

Parameters
eElement to add.

◆ Top()

template<typename T >
T & eC_TArrayStack< T >::Top ( ) const
inline

Get stack top element.

Returns
Element on top of the stack.
Exceptions
CGUIStackUnderflowExceptionIn case of stack does not contain elements.

The documentation for this class was generated from the following file: