Main Page   Class Hierarchy   Compound List   File List   Compound Members  

CommonPoolOfBlocks< value_type, elementsPerBlock, noOfBlocks >::Block Class Reference

A block which can contain several elements. More...

#include <sparingStack.h>

List of all members.

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.


Detailed Description

template<typename value_type, int elementsPerBlock, int noOfBlocks>
class CommonPoolOfBlocks< value_type, elementsPerBlock, noOfBlocks >::Block

A block which can contain several elements.

Definition at line 27 of file sparingStack.h.


Member Function Documentation

template<typename value_type, int elementsPerBlock, int noOfBlocks>
void CommonPoolOfBlocks< value_type, elementsPerBlock, noOfBlocks >::Block::pop   [inline]
 

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.

template<typename value_type, int elementsPerBlock, int noOfBlocks>
void CommonPoolOfBlocks< value_type, elementsPerBlock, noOfBlocks >::Block::push const value_type &    element [inline]
 

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.

template<typename value_type, int elementsPerBlock, int noOfBlocks>
const value_type& CommonPoolOfBlocks< value_type, elementsPerBlock, noOfBlocks >::Block::top   const [inline]
 

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.


The documentation for this class was generated from the following file:
Generated on Thu Aug 14 15:13:27 2003 for External Memory Minimum Spanning Trees by doxygen1.2.17