NAME

ACE_Bounded_Stack - Implement a generic LIFO abstract data type.

SYNOPSIS

#include <ace/Containers.h>

template<class T> class ACE_Bounded_Stack { public: ACE_Bounded_Stack (size_t size); ACE_Bounded_Stack (const ACE_Bounded_Stack<T> &s); void operator= (const ACE_Bounded_Stack<T> &s); ~ACE_Bounded_Stack (void); int push (const T &new_item); int pop (T &item); int top (T &item) const; int is_empty (void) const; int is_full (void) const; size_t size (void) const; void dump (void) const; ACE_ALLOC_HOOK_DECLARE; private: size_t size_; size_t top_; T *stack_; };

DESCRIPTION

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

Initialization, assignemnt, and termination methods.

ACE_Bounded_Stack (size_t size);

ACE_Bounded_Stack (const ACE_Bounded_Stack<T> &s);

void operator= (const ACE_Bounded_Stack<T> &s);

~ACE_Bounded_Stack (void);

Classic Stack operations.

int push (const T &new_item);

int pop (T &item);

int top (T &item) const;

Check boundary conditions.

int is_empty (void) const;

int is_full (void) const;

size_t size (void) const;

void dump (void) const;

ACE_ALLOC_HOOK_DECLARE;

AUTHOR

Doug Schmidt

LIBRARY

ace