GPL_Stack(const unsigned long size, const GPL_Boolean a = TRUE)
Initialize the stack by pre-allocating size elements of storage
and set whether the stack automatically allocates space.
GPL_Reference::~GPL_Reference().
TRUE if every element of the stack is equivalent to the
corresponding element in stack and FALSE otherwise.
GPL_Boolean operator!=(const GPL_Stack<T> & stack) const
Return FALSE if every element of the stack is equivalent to the
corresponding element in stack and TRUE otherwise.
T & operator[](const unsigned long i)
Return a reference to the i-th element in the stack, counting from
zero. This method blindly steps into the stack and is invalid if the
object is null or the index out-of-bounds.
const T & operator[](const unsigned long i) const
Return a constant reference to the i-th element in the stack,
counting from zero. This method blindly steps into the stack and is
invalid if the object is null or the index out-of-bounds.
unsigned long GetCount(void) const
Return the number of elements in the stack or zero if stack is null.
long Compare(const GPL_Stack<T> & stack) const
Perform an element-by-element comparison of this stack with stack.
Return 0 if the cardinality and elements of both stacks are
identical and -1 otherwise.
void Clear(void)
Remove all elements from the stack.
void Resize(const unsigned long size)
Increase or decrease the number of elements allocated for the stack.
This method does not affect the value returned by GetCount().
GPL_Boolean Peek(T & element, const unsigned long depth = 0) const
Place the stack element depth levels down into element. Return
TRUE if the stack has at least depth + 1 levels and
FALSE otherwise. This method does not affect the contents of the
stack.
GPL_Boolean Push(const T & element)
Put element on the top of the stack. Return TRUE if the stack
has enough space for element or the stack is auto-sizing and
FALSE otherwise. This method affects the contents of the stack.
GPL_Boolean Pop(T & element)
Put the element on the top of the stack in element. Return
TRUE if the stack has at least one element and FALSE
otherwise. This method affects the contents of the stack.
T & Top(void)
Return the element on the top of the stack. This method blindly steps
into the stack and is invalid if the stack is empty. Ths method does
not affect the contents of the stack.