#include <sparingStack.h>
Public Methods | |
Block () | |
The default constructor. | |
void | push (const value_type &element) |
Adds a element to the block. | |
const value_type & | top () const |
Returns a reference to the last element. | |
void | pop () |
Removes the last element. | |
void | clear () |
Removes all elements so that the block is empty. | |
bool | empty () const |
Returns true iff the block contains no elements. | |
bool | full () const |
Returns true iff the block can't adopt more elements. | |
int | size () const |
Returns the number of elements which are stored in the block. | |
const value_type & | operator[] (int index) const |
Returns a reference to the element which is stored at the given position. | |
void | setPrevBlock (Block *const prev) |
Sets the pointer to the previous block. | |
Block * | prevBlock () const |
Returns a pointer to the previous block. | |
Private Attributes | |
int | _size |
The number of elements which are stored in the block. | |
Block * | _prev |
A pointer to the previous block. | |
value_type | _elements [elementsPerBlock] |
The elements. |
Definition at line 27 of file sparingStack.h.
|
Removes the last element. Precondition(!): empty() must return false. Definition at line 53 of file sparingStack.h. References CommonPoolOfBlocks< value_type, elementsPerBlock, noOfBlocks >::Block::_size. |
|
Adds a element to the block. Precondition(!): full() must return false. Definition at line 39 of file sparingStack.h. References CommonPoolOfBlocks< value_type, elementsPerBlock, noOfBlocks >::Block::_elements, and CommonPoolOfBlocks< value_type, elementsPerBlock, noOfBlocks >::Block::_size. |
|
Returns a reference to the last element. Precondition(!): empty() must return false. Definition at line 47 of file sparingStack.h. References CommonPoolOfBlocks< value_type, elementsPerBlock, noOfBlocks >::Block::_elements, and CommonPoolOfBlocks< value_type, elementsPerBlock, noOfBlocks >::Block::_size. |