Generated on for Gecode by doxygen 1.17.0

Stack with fixed number of elements. More...

#include <gecode/support/static-stack.hpp>

Public Member Functions

 StaticStack (A &a, int n)
 Initialize for n elements.
 ~StaticStack (void)
 Release memory.
void reset (void)
 Reset stack (pop all elements).
bool empty (void) const
 Test whether stack is empty.
int entries (void) const
 Return number of entries currently on stack.
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.
 StaticStack (const StaticStack &s)=delete
 Copy constructor (disabled).
const StaticStackoperator= (const StaticStack &)=delete
 Assignment operator (disabled).

Static Public Member Functions

static void * operator new (size_t s)=delete
 Allocate memory from heap (disabled).
static void operator delete (void *p)=delete
 Free memory allocated from heap (disabled).

Detailed Description

template<class T, class A>
class Gecode::Support::StaticStack< T, A >

Stack with fixed number of elements.

Definition at line 42 of file static-stack.hpp.

Constructor & Destructor Documentation

◆ StaticStack() [1/2]

template<class T, class A>
Gecode::Support::StaticStack< T, A >::StaticStack ( A & a,
int n )
inline

Initialize for n elements.

Definition at line 86 of file static-stack.hpp.

◆ ~StaticStack()

template<class T, class A>
Gecode::Support::StaticStack< T, A >::~StaticStack ( void )
inline

Release memory.

Definition at line 91 of file static-stack.hpp.

◆ StaticStack() [2/2]

template<class T, class A>
Gecode::Support::StaticStack< T, A >::StaticStack ( const StaticStack< T, A > & s)
delete

Copy constructor (disabled).

Member Function Documentation

◆ reset()

template<class T, class A>
void Gecode::Support::StaticStack< T, A >::reset ( void )
inline

Reset stack (pop all elements).

Definition at line 109 of file static-stack.hpp.

◆ empty()

template<class T, class A>
bool Gecode::Support::StaticStack< T, A >::empty ( void ) const
inline

Test whether stack is empty.

Definition at line 97 of file static-stack.hpp.

◆ entries()

template<class T, class A>
int Gecode::Support::StaticStack< T, A >::entries ( void ) const
inline

Return number of entries currently on stack.

Definition at line 103 of file static-stack.hpp.

◆ pop()

template<class T, class A>
T Gecode::Support::StaticStack< T, A >::pop ( void )
inline

Pop topmost element from stack and return it.

Definition at line 115 of file static-stack.hpp.

◆ top()

template<class T, class A>
T & Gecode::Support::StaticStack< T, A >::top ( void ) const
inline

Return element on top of stack.

Definition at line 122 of file static-stack.hpp.

◆ last()

template<class T, class A>
T & Gecode::Support::StaticStack< T, A >::last ( void ) const
inline

Return element that has just been popped.

Definition at line 129 of file static-stack.hpp.

◆ push()

template<class T, class A>
void Gecode::Support::StaticStack< T, A >::push ( const T & x)
inline

Push element x on top of stack.

Definition at line 136 of file static-stack.hpp.

◆ operator new()

template<class T, class A>
void * Gecode::Support::StaticStack< T, A >::operator new ( size_t s)
staticdelete

Allocate memory from heap (disabled).

◆ operator delete()

template<class T, class A>
void Gecode::Support::StaticStack< T, A >::operator delete ( void * p)
staticdelete

Free memory allocated from heap (disabled).

◆ operator=()

template<class T, class A>
const StaticStack & Gecode::Support::StaticStack< T, A >::operator= ( const StaticStack< T, A > & )
delete

Assignment operator (disabled).


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