Stack with fixed number of elements. More...
#include <static-stack.hpp>
Public Member Functions | |
StaticStack (A &a, int n) | |
Initialize for n elements. More... | |
~StaticStack (void) | |
Release memory. More... | |
void | reset (void) |
Reset stack (pop all elements) More... | |
bool | empty (void) const |
Test whether stack is empty. More... | |
int | entries (void) const |
Return number of entries currently on stack. More... | |
T | pop (void) |
Pop topmost element from stack and return it. More... | |
T & | top (void) const |
Return element on top of stack. More... | |
T & | last (void) const |
Return element that has just been popped. More... | |
void | push (const T &x) |
Push element x on top of stack. More... | |
Stack with fixed number of elements.
Definition at line 46 of file static-stack.hpp.
|
inline |
Initialize for n elements.
Definition at line 91 of file static-stack.hpp.
|
inline |
Release memory.
Definition at line 96 of file static-stack.hpp.
|
inline |
Reset stack (pop all elements)
Definition at line 114 of file static-stack.hpp.
|
inline |
Test whether stack is empty.
Definition at line 102 of file static-stack.hpp.
|
inline |
Return number of entries currently on stack.
Definition at line 108 of file static-stack.hpp.
|
inline |
Pop topmost element from stack and return it.
Definition at line 120 of file static-stack.hpp.
|
inline |
Return element on top of stack.
Definition at line 127 of file static-stack.hpp.
|
inline |
Return element that has just been popped.
Definition at line 134 of file static-stack.hpp.
|
inline |
Push element x on top of stack.
Definition at line 141 of file static-stack.hpp.