Public Member Functions | Private Member Functions | Private Attributes

STACK< T > Class Template Reference

#include <cxx_template.h>

Inheritance diagram for STACK< T >:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 STACK (MEM_POOL *pool)
 ~STACK (void)
void Push (const T &val)
void Settop (const T &val)
INT32 Topidx (void)
T Pop (void)
TTop_nth (const INT32 n) const
TBottom_nth (const INT32 n) const
TTop (void) const
BOOL Is_Empty (void) const
void Clear (void)
void Free ()
void Alloc (const INT32 n)
mINT32 Elements () const

Private Member Functions

 STACK (const STACK &)
STACKoperator= (const STACK &)

Private Attributes

DYN_ARRAY< T_stack

Detailed Description

template<class T>
class STACK< T >

Description:

class STACK is a simple extension of DYN_ARRAY with stack specific methods.

Reserved Prefix:

None.

Exported Types:

None.

Exported Funcitons:

STACK(MEM_POOL *pool)

Construct a stack using space from *pool.

~STACK(void)

Destruct the stack.

void Push(const T& val)

Push a 'val' to the top of the stack.

void Settop(const T& val)

Set 'val' as the top of the stack (no push and pop involved) if the stack has allocated space (size >= 1).

T Pop(void)

Pop the stack.

T& Top_nth(const INT32 n) const

Get the top 'n'-th element of the stack. Stack top is Nth(0).

T& Bottom_nth(const INT32 n) const

Get the bottom 'n'-th element of the stack. Stack bottom is Nth(0).

T& Top(void) const

Same as Nth(0).

void Clear(void)

Wipe out the entire stack.

void Alloc(const INT32 n)

Allocate space for 'n' element in the stack.

mINT32 Elements() const

How many elements are on the stack.

Definition at line 285 of file cxx_template.h.


Constructor & Destructor Documentation

template<class T>
STACK< T >::STACK ( const STACK< T > &   )  [private]
template<class T>
STACK< T >::STACK ( MEM_POOL pool  )  [inline]

Definition at line 293 of file cxx_template.h.

template<class T>
STACK< T >::~STACK ( void   )  [inline]

Definition at line 294 of file cxx_template.h.


Member Function Documentation

template<class T>
void STACK< T >::Alloc ( const INT32  n  )  [inline]

Definition at line 313 of file cxx_template.h.

template<class T >
T & STACK< T >::Bottom_nth ( const INT32  n  )  const
template<class T>
void STACK< T >::Clear ( void   )  [inline]

Definition at line 311 of file cxx_template.h.

Referenced by OPTIONS_STACK::OPTIONS_STACK(), and PROMPF_INFO::PROMPF_INFO().

template<class T>
mINT32 STACK< T >::Elements (  )  const [inline]
template<class T>
void STACK< T >::Free (  )  [inline]

Definition at line 312 of file cxx_template.h.

template<class T >
BOOL STACK< T >::Is_Empty ( void   )  const

Definition at line 513 of file cxx_template.h.

References STACK< T >::_stack.

template<class T>
STACK& STACK< T >::operator= ( const STACK< T > &   )  [private]
template<class T>
T STACK< T >::Pop ( void   )  [inline]
template<class T>
void STACK< T >::Push ( const T val  )  [inline]
template<class T>
void STACK< T >::Settop ( const T val  ) 

Definition at line 474 of file cxx_template.h.

References STACK< T >::_stack, idx, and Is_True.

template<class T >
T & STACK< T >::Top ( void   )  const

Definition at line 504 of file cxx_template.h.

References STACK< T >::_stack, idx, and Is_True.

Referenced by OPTIONS_STACK::Pop_Current_Options().

template<class T >
T & STACK< T >::Top_nth ( const INT32  n  )  const

Definition at line 484 of file cxx_template.h.

References STACK< T >::_stack, idx, and Is_True.

template<class T>
INT32 STACK< T >::Topidx ( void   )  [inline]

Definition at line 297 of file cxx_template.h.


Member Data Documentation

template<class T>
DYN_ARRAY<T> STACK< T >::_stack [private]

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