#include <StackArray.h>
Public Methods | |
| StackArray () | |
| Empty constructor that sets up an empty stack. | |
| StackArray (BasicArray< T > &data) | |
| Constructor that sets up an empty stack using a shared array. | |
| virtual | ~StackArray () |
| Destructor. | |
| virtual T & | top () |
| Returns the value at the top of the stack, which is the next element that will be removed. | |
| virtual void | add (const T &) |
| Adds a item with data value data. | |
| virtual void | remove (T &) |
| Removes the next item, and returns the data value in data. | |
| int | empty () const |
Returns TRUE if the stack is empty and FALSE otherwise. | |
| operator int () const | |
Returns TRUE if the stack is empty and FALSE otherwise. | |
| size_type | len () const |
| Returns the number of items in the stack. | |
| BasicArray< T > & | get_data () |
Protected Attributes | |
| size_type | Len |
| The number of items in the stack. | |
| BasicArray< T > | Data |
| The array used for storing the stack. | |