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

ACE_Bounded_Stack Class Template Reference

Implement a generic LIFO abstract data type. More...

#include <Containers_T.h>

List of all members.

Public Methods

 ACE_Bounded_Stack (size_t size)
 Initialize a new stack so that it is empty. The copy constructor (performs initialization).

 ACE_Bounded_Stack (const ACE_Bounded_Stack<T> &s)
void operator= (const ACE_Bounded_Stack<T> &s)
 Assignment operator(performs assignment).

 ~ACE_Bounded_Stack (void)
 Perform actions needed when stack goes out of scope.

int push (const T &new_item)
int pop (T &item)
int top (T &item) const
int is_empty (void) const
 Returns 1 if the container is empty, otherwise returns 0.

int is_full (void) const
 Returns 1 if the container is full, otherwise returns 0.

size_t size (void) const
 The number of items in the stack.

void dump (void) const
 Dump the state of an object.


Public Attributes

 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks.


Private Attributes

size_t size_
 Size of the dynamically allocated data.

size_t top_
 Keeps track of the current top of stack.

T* stack_
 Holds the stack's contents.


Detailed Description

template<class T> template class ACE_Bounded_Stack

Implement a generic LIFO abstract data type.

This implementation of a Stack uses a bounded array that is allocated dynamically.


Constructor & Destructor Documentation

template<classT>
ACE_Bounded_Stack<T>::ACE_Bounded_Stack<T> ( size_t size )
 

Initialize a new stack so that it is empty. The copy constructor (performs initialization).

template<classT>
ACE_Bounded_Stack< T >::ACE_Bounded_Stack<T> ( const ACE_Bounded_Stack< T >& s )
 

template<classT>
ACE_Bounded_Stack<T>::~ACE_Bounded_Stack<T> ( void )
 

Perform actions needed when stack goes out of scope.


Member Function Documentation

template<classT>
void ACE_Bounded_Stack<T>::dump ( void ) const
 

Dump the state of an object.

template<classT>
ACE_INLINE int ACE_Bounded_Stack< T >::is_empty ( void ) const
 

Returns 1 if the container is empty, otherwise returns 0.

template<classT>
ACE_INLINE int ACE_Bounded_Stack< T >::is_full ( void ) const
 

Returns 1 if the container is full, otherwise returns 0.

template<classT>
void ACE_Bounded_Stack<T>::operator= ( const ACE_Bounded_Stack< T >& s )
 

Assignment operator(performs assignment).

template<classT>
ACE_INLINE int ACE_Bounded_Stack< T >::pop ( T & item )
 

Remove and return the top stack item. Returns -1 if the stack is already empty, 0 if the stack is not already empty, and -1 if failure occurs.

template<classT>
ACE_INLINE int ACE_Bounded_Stack< T >::push ( const T & new_item )
 

Place a new item on top of the stack. Returns -1 if the stack is already full, 0 if the stack is not already full, and -1 if failure occurs.

template<classT>
ACE_INLINE size_t ACE_Bounded_Stack< T >::size ( void ) const
 

The number of items in the stack.

template<classT>
ACE_INLINE int ACE_Bounded_Stack< T >::top ( T & item ) const
 

Return top stack item without removing it. Returns -1 if the stack is already empty, 0 if the stack is not already empty, and -1 if failure occurs.


Member Data Documentation

template<classT>
ACE_Bounded_Stack<T>::ACE_ALLOC_HOOK_DECLARE
 

Declare the dynamic allocation hooks.

template<classT>
size_t ACE_Bounded_Stack<T>::size_ [private]
 

Size of the dynamically allocated data.

template<classT>
T * ACE_Bounded_Stack<T>::stack_ [private]
 

Holds the stack's contents.

template<classT>
size_t ACE_Bounded_Stack<T>::top_ [private]
 

Keeps track of the current top of stack.


The documentation for this class was generated from the following files:
Generated at Sat Dec 1 11:01:08 2001 for ACE by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000