class for Last In First Out stack More...
Public Member Functions | |
LIFOStack (int) | |
LIFOStack (std::vector< T > &) | |
LIFOStack (void) | |
~LIFOStack (void) | |
void | clear (void) |
void | decreaseSTACK (void) |
void | display (std::ostream &) |
void | increaseSTACK (void) |
T | pop (void) |
void | push (const std::vector< T > &) |
void | push (const T &) |
Public Attributes | |
int | MAXSTK |
std::vector< T > | STACK |
int | TOPSTK |
class for Last In First Out stack
Manage insertion and extraction from/to a list of object using the L.I.F.O. pragma.
Class template parameter, T, can be of any copy-constructible type.
Definition at line 322 of file SortAlgorithms.hpp.
bitpit::LIFOStack< T >::LIFOStack | ( | void | ) |
Default constructor for class LIFOStack. Initalize an empty stack
Definition at line 62 of file LIFOStack.tpp.
bitpit::LIFOStack< T >::LIFOStack | ( | int | maxstack | ) |
Constructor #1 for class LIFOStack. Initialize an empty stack, and set the memory reserve to maxstack. Once the max capacity is reached, insertion of another elements will cause the memory to be further increased by maxstack.
[in] | maxstack | memory reserved for stack. |
Definition at line 101 of file LIFOStack.tpp.
bitpit::LIFOStack< T >::LIFOStack | ( | std::vector< T > & | items | ) |
Constructor #2 for LIFOStack. Initialize a LIFO stack from a vector of elements. The memory reserve is set to the size of the input vector and elements are inserted in order from items.begin() to items.end()
[in] | items | list of objects to be inserted into the stack |
Definition at line 140 of file LIFOStack.tpp.
bitpit::LIFOStack< T >::~LIFOStack | ( | void | ) |
Default destructor for class LIFOStack.
Clear stack content and release memory.
Definition at line 181 of file LIFOStack.tpp.
void bitpit::LIFOStack< T >::clear | ( | void | ) |
Clear stack content without freeing memory.
Definition at line 217 of file LIFOStack.tpp.
void bitpit::LIFOStack< T >::decreaseSTACK | ( | void | ) |
Decrease memory reserved for stack by maxstack. The parameter maxstack is assigned at class declaration.
Definition at line 272 of file LIFOStack.tpp.
void bitpit::LIFOStack< T >::display | ( | std::ostream & | out | ) |
Display stack info to output stream (e.g. number of elements currently stored into stack, memory currently reserved for stack, etc.)
[in,out] | out | output stream |
Definition at line 409 of file LIFOStack.tpp.
void bitpit::LIFOStack< T >::increaseSTACK | ( | void | ) |
Increase memory reserved for stack by maxstack. The parameter maxstack is assigned at class declaration.
Definition at line 245 of file LIFOStack.tpp.
T bitpit::LIFOStack< T >::pop | ( | void | ) |
Pop the first item (i.e. the last added item) from stack, reducing its size by one element.
Definition at line 301 of file LIFOStack.tpp.
void bitpit::LIFOStack< T >::push | ( | const std::vector< T > & | items | ) |
Push a list of items into stack. Items are inserted in the same order they appear in the input vector, i.e. from items.begin() to items.end().
[in] | items | vector storing the list of items to be pushed into the stack |
Definition at line 377 of file LIFOStack.tpp.
void bitpit::LIFOStack< T >::push | ( | const T & | item | ) |
Push item into stack. This item will be the first to be returned if pop() is called.
[in] | item | item to be pushed into the list. |
Definition at line 338 of file LIFOStack.tpp.
int bitpit::LIFOStack< T >::MAXSTK |
Maximal stack size between resize
Definition at line 326 of file SortAlgorithms.hpp.
std::vector<T> bitpit::LIFOStack< T >::STACK |
LIFO stack
Definition at line 328 of file SortAlgorithms.hpp.
int bitpit::LIFOStack< T >::TOPSTK |
Current stack size
Definition at line 327 of file SortAlgorithms.hpp.