#include <Containers_T.h>
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. | |
This implementation of a Stack uses a bounded array that is allocated dynamically.
|
||||
|
Initialize a new stack so that it is empty. The copy constructor (performs initialization).
|
|
||||
|
|
|
||||
|
Perform actions needed when stack goes out of scope.
|
|
||||
|
Dump the state of an object.
|
|
||||
|
Returns 1 if the container is empty, otherwise returns 0.
|
|
||||
|
Returns 1 if the container is full, otherwise returns 0.
|
|
||||
|
Assignment operator(performs assignment).
|
|
||||
|
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. |
|
||||
|
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. |
|
||||
|
The number of items in the stack.
|
|
||||
|
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. |
|
|||
|
Declare the dynamic allocation hooks.
|
|
|||
|
Size of the dynamically allocated data.
|
|
|||
|
Holds the stack's contents.
|
|
|||
|
Keeps track of the current top of stack.
|
1.2.3 written by Dimitri van Heesch,
© 1997-2000