#include <ArrayStack.hpp>
Public Methods | |
ArrayStack () | |
ArrayStack (unsigned long sz) | |
virtual | ~ArrayStack () |
void | clear () |
void | push (const Elem item) |
Elem | pop () |
Elem | topValue () const |
BOOL | isEmpty () const |
BOOL | isFilled () const |
Private Attributes | |
unsigned long | size |
unsigned long | top |
Elem * | listarray |
|
Definition at line 11 of file ArrayStack.hpp. |
|
Definition at line 17 of file ArrayStack.hpp. |
|
Definition at line 23 of file ArrayStack.hpp. 00023 : delete the array 00024 { 00025 delete [] listarray; 00026 } |
|
Definition at line 28 of file ArrayStack.hpp. 00029 { 00030 top = 0; 00031 memset( listarray, 0, ( sizeof( Elem ) * LIST_SIZE ) ); 00032 } |
|
Definition at line 54 of file ArrayStack.hpp. 00055 { 00056 return (top == 0); 00057 } |
|
Definition at line 59 of file ArrayStack.hpp. 00060 { 00061 return (top != 0); 00062 } |
|
Definition at line 41 of file ArrayStack.hpp. 00042 { 00043 assert( !isEmpty() ); 00044 --top; 00045 return listarray[ top ]; 00046 } |
|
Definition at line 34 of file ArrayStack.hpp. 00035 { 00036 assert(top < size); 00037 listarray[top] = item; 00038 top++; 00039 } |
|
Definition at line 48 of file ArrayStack.hpp. 00049 { 00050 assert( !isEmpty() ); 00051 return listarray[ top-1 ]; 00052 } |
|
Definition at line 67 of file ArrayStack.hpp. |
|
Definition at line 65 of file ArrayStack.hpp. |
|
Definition at line 66 of file ArrayStack.hpp. |