Gecode::Support::DynamicStack< T, A > Class Template Reference
[Support algorithms and datastructures]
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. | |
~DynamicStack (void) | |
Release memory. | |
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. | |
T & | operator[] (int i) |
Return entry at position i. | |
const T & | operator[] (int i) const |
Return entry at position i. | |
size_t | size (void) const |
Return size of stack. |
Detailed Description
template<class T, class A>
class Gecode::Support::DynamicStack< T, A >
Stack with arbitrary number of elements.
Definition at line 46 of file dynamic-stack.hpp.
Constructor & Destructor Documentation
Gecode::Support::DynamicStack< T, A >::DynamicStack | ( | A & | a, | |
int | n = 64 | |||
) | [inline] |
Initialize stack with n elements.
Definition at line 118 of file dynamic-stack.hpp.
Gecode::Support::DynamicStack< T, A >::~DynamicStack | ( | void | ) | [inline] |
Release memory.
Definition at line 123 of file dynamic-stack.hpp.
Member Function Documentation
bool Gecode::Support::DynamicStack< T, A >::empty | ( | void | ) | const [inline] |
Test whether stack is empty.
Definition at line 155 of file dynamic-stack.hpp.
int Gecode::Support::DynamicStack< T, A >::entries | ( | void | ) | const [inline] |
Return number of entries currently on stack.
Definition at line 161 of file dynamic-stack.hpp.
T Gecode::Support::DynamicStack< T, A >::pop | ( | void | ) | [inline] |
Pop topmost element from stack and return it.
Definition at line 129 of file dynamic-stack.hpp.
T & Gecode::Support::DynamicStack< T, A >::top | ( | void | ) | const [inline] |
Return element on top of stack.
Definition at line 135 of file dynamic-stack.hpp.
T & Gecode::Support::DynamicStack< T, A >::last | ( | void | ) | const [inline] |
Return element that has just been popped.
Definition at line 141 of file dynamic-stack.hpp.
void Gecode::Support::DynamicStack< T, A >::push | ( | const T & | x | ) | [inline] |
Push element x on top of stack.
Definition at line 147 of file dynamic-stack.hpp.
T & Gecode::Support::DynamicStack< T, A >::operator[] | ( | int | i | ) | [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 167 of file dynamic-stack.hpp.
const T & Gecode::Support::DynamicStack< T, A >::operator[] | ( | int | i | ) | const [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 173 of file dynamic-stack.hpp.
size_t Gecode::Support::DynamicStack< T, A >::size | ( | void | ) | const [inline] |
Return size of stack.
Definition at line 179 of file dynamic-stack.hpp.
The documentation for this class was generated from the following file:
- gecode/support/dynamic-stack.hpp (Revision: 9692)