Stack with fixed number of elements. More...
#include <static-stack.hpp>
Public Member Functions | |
StaticStack (A &a, int n) | |
Initialize for n elements. | |
~StaticStack (void) | |
Release memory. | |
void | reset (void) |
Reset stack (pop all elements) | |
bool | empty (void) const |
Test whether stack is empty. | |
int | entries (void) const |
Return number of entries currently on stack. | |
T | pop (void) |
Pop topmost element from stack and return it. | |
T & | top (void) const |
Return element on top of stack. | |
T & | last (void) const |
Return element that has just been popped. | |
void | push (const T &x) |
Push element x on top of stack. | |
Stack with fixed number of elements.
Definition at line 42 of file static-stack.hpp.
|
inline |
Initialize for n elements.
Definition at line 87 of file static-stack.hpp.
|
inline |
Release memory.
Definition at line 92 of file static-stack.hpp.
|
inline |
Reset stack (pop all elements)
Definition at line 110 of file static-stack.hpp.
|
inline |
Test whether stack is empty.
Definition at line 98 of file static-stack.hpp.
|
inline |
Return number of entries currently on stack.
Definition at line 104 of file static-stack.hpp.
|
inline |
Pop topmost element from stack and return it.
Definition at line 116 of file static-stack.hpp.
|
inline |
Return element on top of stack.
Definition at line 123 of file static-stack.hpp.
|
inline |
Return element that has just been popped.
Definition at line 130 of file static-stack.hpp.
|
inline |
Push element x on top of stack.
Definition at line 137 of file static-stack.hpp.