Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages   Examples  

CTBstack Class Template Reference

Indexable stack container. **. More...

#include <CTBstack.hxx>

Inheritance diagram for CTBstack:

Inheritance graph
[legend]
Collaboration diagram for CTBstack:

Collaboration graph
[legend]
List of all members.

Public Methods

 CTBstack ()
 CTBstack (CTBint i_capacity)
 CTBstack (const CTBstack< T > &rhs)
 CTBstack (CTBstack< T > &rhs, bool b_grab)
TAt (CTBint i_ind)
const TAt (CTBint i_ind) const
void Resize (CTBint i_size)
void Resize (CTBint i_size, const T &def)
void Insert (CTBint i_ind, const T &rhs)
void Remove (CTBint i_ind, T &rhs)
void Delete (CTBint i_ind)
void InsertHead (const T &rhs)
bool RemoveHead (T &rhs)
void InsertTail (const T &rhs)
bool RemoveTail (T &rhs)
void Push (const T &rhs)
bool Pop (T &rhs)
void Grab (CTBstack< T > &rhs)
Toperator[] (CTBint i_ind)
const Toperator[] (CTBint i_ind) const
CTBstack< T > & operator= (const T &rhs)
CTBstack< T > & operator= (const CTBstack< T > &rhs)
CTBstack< T > & operator<< (const T &rhs)
CTBstack< T > & operator>> (T &rhs)

Detailed Description

template<class T>
class CTBstack< T >

Indexable stack container. **.

Requirements:

Definition at line 20 of file CTBstack.hxx.


Constructor & Destructor Documentation

template<class T>
CTBstack< T >::CTBstack [inline]
 

Construct empty (size=0) stack.

Definition at line 28 of file CTBstack.icc.

template<class T>
CTBstack< T >::CTBstack CTBint i_capacity [inline, explicit]
 

Construct empty stack with an initial capacity of i_capacity.

Definition at line 36 of file CTBstack.icc.

template<class T>
CTBstack< T >::CTBstack const CTBstack< T > & rhs [inline]
 

Copy constructor.

Definition at line 46 of file CTBstack.icc.

template<class T>
CTBstack< T >::CTBstack CTBstack< T > & rhs,
bool b_grab
[inline]
 

Grab constructor.

Definition at line 54 of file CTBstack.icc.


Member Function Documentation

template<class T>
T & CTBstack< T >::At CTBint i_ind [inline]
 

Access vector element with index range check.

Exceptions:
CTBexceptionIndexRange   index out of range

Reimplemented from CTBvector.

Definition at line 65 of file CTBstack.icc.

template<class T>
const T & CTBstack< T >::At CTBint i_ind const [inline]
 

Constant access vector element with index range check.

Exceptions:
CTBexceptionIndexRange   index out of range

Reimplemented from CTBvector.

Definition at line 77 of file CTBstack.icc.

template<class T>
void CTBstack< T >::Resize CTBint i_size [inline]
 

Resize stack, adding or removing elements from the top of stack.

This method pops elements from the stack if i_size is smaller than the current size and adds default constructed elements if i_size is larger than the current value.

Reimplemented from CTBvector.

Definition at line 91 of file CTBstack.icc.

template<class T>
void CTBstack< T >::Resize CTBint i_size,
const T & def
[inline]
 

Resize stack, add elements with a value of def if needed.

This method pops elements from the stack if i_size is smaller than the current size and adds elements initialized with a value of def if i_size is larger than the current value.

Reimplemented from CTBvector.

Definition at line 106 of file CTBstack.icc.

template<class T>
void CTBstack< T >::Insert CTBint i_ind,
const T & rhs
[inline]
 

Insert element.

Reimplemented from CTBvector.

Definition at line 116 of file CTBstack.icc.

template<class T>
void CTBstack< T >::Remove CTBint i_ind,
T & rhs
[inline]
 

Remove element.

Reimplemented from CTBvector.

Definition at line 126 of file CTBstack.icc.

template<class T>
void CTBstack< T >::Delete CTBint i_ind [inline]
 

Delete element.

Reimplemented from CTBvector.

Definition at line 136 of file CTBstack.icc.

template<class T>
void CTBstack< T >::InsertHead const T & rhs [inline]
 

Insert at begin (top) of stack.

Reimplemented from CTBvector.

Definition at line 146 of file CTBstack.icc.

Referenced by Push().

template<class T>
bool CTBstack< T >::RemoveHead T & rhs [inline]
 

Remove from begin (top) of stack, returns true on success.

If the stack is not empty, the element at the begin (top) of the stack is copied to rhs and true is returned. If the stack is empty, rhs is unchanged and false is returned.

Reimplemented from CTBvector.

Definition at line 161 of file CTBstack.icc.

Referenced by Pop().

template<class T>
void CTBstack< T >::InsertTail const T & rhs [inline]
 

Insert at end (bottom) of stack.

Reimplemented from CTBvector.

Definition at line 170 of file CTBstack.icc.

template<class T>
bool CTBstack< T >::RemoveTail T & rhs [inline]
 

Remove from end (bottom) of stack, returns true on success.

If the stack is not empty, the element at the end (bottom) of the stack is copied to rhs and true is returned. If the stack is empty, rhs is unchanged and false is returned.

Reimplemented from CTBvector.

Definition at line 185 of file CTBstack.icc.

template<class T>
void CTBstack< T >::Push const T & rhs [inline]
 

Push rhs onto the stack, equivalent to InsertHead() .

Definition at line 194 of file CTBstack.icc.

Referenced by operator<<().

template<class T>
bool CTBstack< T >::Pop T & rhs [inline]
 

Pop element from top of stack, equivalent to RemoveHead() .

Definition at line 204 of file CTBstack.icc.

Referenced by operator>>().

template<class T>
void CTBstack< T >::Grab CTBstack< T > & rhs [inline]
 

Grab resources.

The resources allocated for rhs will be transfered to the calling object.

Definition at line 216 of file CTBstack.icc.

template<class T>
T & CTBstack< T >::operator[] CTBint i_ind [inline]
 

Access element.

Reimplemented from CTBvector.

Definition at line 226 of file CTBstack.icc.

template<class T>
const T & CTBstack< T >::operator[] CTBint i_ind const [inline]
 

Constant access element.

Reimplemented from CTBvector.

Definition at line 235 of file CTBstack.icc.

template<class T>
CTBstack<T>& CTBstack< T >::operator= const T & rhs
 

Set all elements to the scalar value rhs.

Reimplemented from CTBvector.

template<class T>
CTBstack<T>& CTBstack< T >::operator= const CTBstack< T > & rhs
 

template<class T>
CTBstack< T > & CTBstack< T >::operator<< const T & rhs [inline]
 

Insert a new element with value rhs at top of stack.

Reimplemented from CTBvector.

Definition at line 244 of file CTBstack.icc.

template<class T>
CTBstack< T > & CTBstack< T >::operator>> T & rhs [inline]
 

Return top of stack as rhs, remove last element.

Reimplemented from CTBvector.

Definition at line 254 of file CTBstack.icc.


The documentation for this class was generated from the following files:
Generated at Fri Oct 24 18:14:11 2003 for CTBbase by doxygen1.2.9-20010812 written by Dimitri van Heesch, © 1997-2001