Generated on Mon Aug 25 11:35:54 2008 for Gecode by doxygen 1.5.6

Gecode::Support::SentinelStack< T > Class Template Reference
[Support algorithms and datastructures]

List of all members.


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.
top (void) const
 Return topmost element.
last (void) const
 Return element that has just been popped.
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,
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]

Check whether stack is empty.

Definition at line 89 of file sentinel-stack.icc.

template<class T>
T Gecode::Support::SentinelStack< T >::top ( void   )  const [inline]

Return topmost element.

Definition at line 94 of file sentinel-stack.icc.

template<class T>
T Gecode::Support::SentinelStack< T >::last ( void   )  const [inline]

Return element that has just been popped.

Definition at line 100 of file sentinel-stack.icc.

template<class T>
T Gecode::Support::SentinelStack< T >::pop ( void   )  [inline]

Return topmost element and pop it.

Definition at line 105 of file sentinel-stack.icc.

template<class T>
void Gecode::Support::SentinelStack< T >::push ( x  )  [inline]

Push element.

Definition at line 113 of file sentinel-stack.icc.


The documentation for this class was generated from the following file: