Nebula
|
#include <stack.h>
Nebula's stack class (a FILO container).
Public Member Functions | |
Stack () | |
constructor | |
Stack (const Stack< TYPE > &rhs) | |
copy constructor | |
void | operator= (const Stack< TYPE > &rhs) |
assignment operator | |
TYPE & | operator[] (IndexT index) const |
access element by index, 0 is the topmost element | |
bool | operator== (const Stack< TYPE > &rhs) const |
equality operator | |
bool | operator!= (const Stack< TYPE > &rhs) const |
inequality operator | |
SizeT | Size () const |
returns number of elements on stack | |
bool | IsEmpty () const |
returns true if stack is empty | |
void | Clear () |
remove all elements from the stack | |
bool | Contains (const TYPE &e) const |
return true if stack contains element | |
void | EraseIndex (const IndexT i) |
erase element at index | |
void | Push (const TYPE &e) |
push an element on the stack | |
TYPE & | Peek () const |
get reference of topmost element of stack, without removing it | |
TYPE | Pop () |
get topmost element of stack, remove element | |
Private Attributes | |
Array< TYPE > | stackArray |
Util::Stack< TYPE >::Stack | ( | ) |
constructor
Util::Stack< TYPE >::Stack | ( | const Stack< TYPE > & | rhs | ) |
copy constructor
void Util::Stack< TYPE >::Clear | ( | ) |
remove all elements from the stack
bool Util::Stack< TYPE >::Contains | ( | const TYPE & | e | ) | const |
return true if stack contains element
void Util::Stack< TYPE >::EraseIndex | ( | const IndexT | i | ) |
erase element at index
bool Util::Stack< TYPE >::IsEmpty | ( | ) | const |
returns true if stack is empty
bool Util::Stack< TYPE >::operator!= | ( | const Stack< TYPE > & | rhs | ) | const |
inequality operator
void Util::Stack< TYPE >::operator= | ( | const Stack< TYPE > & | rhs | ) |
assignment operator
bool Util::Stack< TYPE >::operator== | ( | const Stack< TYPE > & | rhs | ) | const |
equality operator
TYPE & Util::Stack< TYPE >::operator[] | ( | IndexT | index | ) | const |
access element by index, 0 is the topmost element
TYPE & Util::Stack< TYPE >::Peek | ( | ) | const |
get reference of topmost element of stack, without removing it
TYPE Util::Stack< TYPE >::Pop | ( | ) |
get topmost element of stack, remove element
void Util::Stack< TYPE >::Push | ( | const TYPE & | e | ) |
push an element on the stack
SizeT Util::Stack< TYPE >::Size | ( | ) | const |
returns number of elements on stack
|
private |