Gecode::Support::DynamicStack< T > Class Template Reference
[Support algorithms and datastructures]
#include <dynamic-stack.hh>
Inherited by Gecode::Search::ReCoStack.
Detailed Description
template<class T>
class Gecode::Support::DynamicStack< T >
Stack with arbitrary number of elements.
Requires
#include "gecode/support/dynamic-stack.hh"
Definition at line 36 of file dynamic-stack.hh.
Public Member Functions | |
DynamicStack (unsigned int n=64) | |
Initialize stack with n elements. | |
~DynamicStack (void) | |
Release memory. | |
bool | empty (void) const |
Test whether stack is empty. | |
T | pop (void) |
Pop topmost element from stack and return it. | |
T & | top (void) |
Return top of stack. | |
void | push (T) |
Push element on stack. | |
unsigned int | entries (void) const |
Return number of entries currently on 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. |
Constructor & Destructor Documentation
template<class T>
Gecode::Support::DynamicStack< T >::DynamicStack | ( | unsigned int | n = 64 |
) | [inline] |
template<class T>
Gecode::Support::DynamicStack< T >::~DynamicStack | ( | void | ) | [inline] |
Member Function Documentation
template<class T>
bool Gecode::Support::DynamicStack< T >::empty | ( | void | ) | const [inline] |
template<class T>
T Gecode::Support::DynamicStack< T >::pop | ( | void | ) | [inline] |
template<class T>
T & Gecode::Support::DynamicStack< T >::top | ( | void | ) | [inline] |
template<class T>
void Gecode::Support::DynamicStack< T >::push | ( | T | ) | [inline] |
template<class T>
unsigned int Gecode::Support::DynamicStack< T >::entries | ( | void | ) | const [inline] |
template<class T>
T & Gecode::Support::DynamicStack< T >::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 137 of file dynamic-stack.hh.
template<class T>
const T & Gecode::Support::DynamicStack< T >::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 143 of file dynamic-stack.hh.
template<class T>
size_t Gecode::Support::DynamicStack< T >::size | ( | void | ) | const [inline] |
The documentation for this class was generated from the following file:
- gecode/support/dynamic-stack.hh (Revision: 3188)