Gecode::Support::SentinelStack< T > Class Template Reference
[Support algorithms and datastructures]
Detailed Description
template<class T>
class Gecode::Support::SentinelStack< T >
A simple stack that uses a sentinel element.
The sentinel element is used to mark the bottom of the stack and must be given at compile time.
Note that the stack does not provide memory management. As it is so simple it is ment to be used with automatically allocated memory.
Definition at line 53 of file sentinel-stack.icc.
Public Member Functions | |
SentinelStack (T *p, T s, int n) | |
Create stack that uses the memory area p of size n and sentinel s. | |
bool | empty (void) const |
Check whether stack is empty. | |
T | top (void) const |
Return topmost element. | |
T | last (void) const |
Return element that has just been popped. | |
T | pop (void) |
Return topmost element and pop it. | |
void | push (T x) |
Push element. |
Constructor & Destructor Documentation
template<class T>
Gecode::Support::SentinelStack< T >::SentinelStack | ( | T * | p, | |
T | s, | |||
int | n | |||
) | [inline] |
Create stack that uses the memory area p of size n and sentinel s.
Definition at line 78 of file sentinel-stack.icc.
Member Function Documentation
template<class T>
bool Gecode::Support::SentinelStack< T >::empty | ( | void | ) | const [inline] |
template<class T>
T Gecode::Support::SentinelStack< T >::top | ( | void | ) | const [inline] |
template<class T>
T Gecode::Support::SentinelStack< T >::last | ( | void | ) | const [inline] |
template<class T>
T Gecode::Support::SentinelStack< T >::pop | ( | void | ) | [inline] |
template<class T>
void Gecode::Support::SentinelStack< T >::push | ( | T | x | ) | [inline] |
The documentation for this class was generated from the following file:
- gecode/support/sentinel-stack.icc (Revision: 7358)