
Stack with arbitrary number of elements. More...
#include <dynamic-stack.hpp>
Public Member Functions | |
| DynamicStack (A &a, int n=64) | |
| Initialize stack with n elements. More... | |
| ~DynamicStack (void) | |
| Release memory. 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... | |
| T & | operator[] (int i) |
| Return entry at position i. More... | |
| const T & | operator[] (int i) const |
| Return entry at position i. More... | |
Stack with arbitrary number of elements.
Definition at line 46 of file dynamic-stack.hpp.
|
inline |
Initialize stack with n elements.
Definition at line 115 of file dynamic-stack.hpp.
|
inline |
Release memory.
Definition at line 120 of file dynamic-stack.hpp.
|
inline |
Test whether stack is empty.
Definition at line 152 of file dynamic-stack.hpp.
|
inline |
Return number of entries currently on stack.
Definition at line 158 of file dynamic-stack.hpp.
|
inline |
Pop topmost element from stack and return it.
Definition at line 126 of file dynamic-stack.hpp.
|
inline |
Return element on top of stack.
Definition at line 132 of file dynamic-stack.hpp.
|
inline |
Return element that has just been popped.
Definition at line 138 of file dynamic-stack.hpp.
|
inline |
Push element x on top of stack.
Definition at line 144 of file dynamic-stack.hpp.
|
inline |
Return entry at position i.
Position 0 corresponds to the element first pushed, whereas position entries()-1 corresponds to the element pushed last.
Definition at line 164 of file dynamic-stack.hpp.
|
inline |
Return entry at position i.
Position 0 corresponds to the element first pushed, whereas position entries()-1 corresponds to the element pushed last.
Definition at line 170 of file dynamic-stack.hpp.