ConfigMatrix Class Reference

Config object for matrix. More...

#include <ConfigMatrix.h>

Inheritance diagram for ConfigMatrix:

BaseConfig List of all members.

Public Types

typedef size_t SizeType
 Size type of the array (width / height / indexes).

Public Member Functions

 ConfigMatrix (SizeType matrixWidth, SizeType matrixHeight)
 Constructor.
 ConfigMatrix (TiXmlElement *node)
 Constructs object using data from XML node.
virtual ~ConfigMatrix ()
 Destructor.
virtual TiXmlElement * CreateXmlNode () const
 Creates node representing the config.
void SetWidth (SizeType matrixWidth)
 Sets matrix width.
SizeType GetWidth () const
 Gets matrix width.
void SetHeight (SizeType matrixHeight)
 Sets matrix height.
SizeType GetHeight () const
 Gets matrix height.
void AddConfigCell (const ConfigCell *cell)
 Adds selected cell to the config.
const ConfigCellGetConfigCell () const
 Returns next ConfigCell. Using this function with combination with AreThereConfigCells() you can go through stored cells in the matrix.
bool AreThereConfigCells () const
 Returns true if there are config cells that can be returned by GetConfigCell().

Private Types

typedef std::deque< const
ConfigCell * > 
CellsContainer
 Container type for cell configs.

Private Attributes

SizeType width
 Width of the matrix.
SizeType height
 Height of the matrix.
CellsContainer container
 Container for cells configs.
CellsContainer::iterator currentCell
 Iterator to the current cell (state attribute).

Classes

class  ConfigCell
 Configuration of a single cell on the matrix. More...

Detailed Description

Config object for matrix.


Member Typedef Documentation

typedef std::deque<const ConfigCell *> ConfigMatrix::CellsContainer [private]

Container type for cell configs.

typedef size_t ConfigMatrix::SizeType

Size type of the array (width / height / indexes).


Constructor & Destructor Documentation

ConfigMatrix::ConfigMatrix ( SizeType  matrixWidth,
SizeType  matrixHeight 
) [inline]

Constructor.

Parameters:
matrixWidth Width of the matrix
matrixHeight Height of the matrix

ConfigMatrix::ConfigMatrix ( TiXmlElement *  node  )  [explicit]

Constructs object using data from XML node.

ConfigMatrix::~ConfigMatrix (  )  [virtual]

Destructor.


Member Function Documentation

void ConfigMatrix::AddConfigCell ( const ConfigCell cell  ) 

Adds selected cell to the config.

Parameters:
cell Dynamicaly allocated cell's config
Cell must be allocated dynamicaly on the heap and ConfigMatrix will take care of it's deleting.

bool ConfigMatrix::AreThereConfigCells (  )  const [inline]

Returns true if there are config cells that can be returned by GetConfigCell().

TiXmlElement * ConfigMatrix::CreateXmlNode (  )  const [virtual]

Creates node representing the config.

Implements BaseConfig.

const ConfigMatrix::ConfigCell & ConfigMatrix::GetConfigCell (  )  const

Returns next ConfigCell. Using this function with combination with AreThereConfigCells() you can go through stored cells in the matrix.

Warning: Before you call this function you have to call AreThereConfigCells(). If there are no cells left it will throw ExceptionConfigMatrixNoCells

SizeType ConfigMatrix::GetHeight (  )  const [inline]

Gets matrix height.

SizeType ConfigMatrix::GetWidth (  )  const [inline]

Gets matrix width.

void ConfigMatrix::SetHeight ( SizeType  matrixHeight  )  [inline]

Sets matrix height.

Parameters:
matrixHeight New matrix height

void ConfigMatrix::SetWidth ( SizeType  matrixWidth  )  [inline]

Sets matrix width.

Parameters:
matrixWidth New matrix width


Member Data Documentation

CellsContainer ConfigMatrix::container [private]

Container for cells configs.

CellsContainer::iterator ConfigMatrix::currentCell [mutable, private]

Iterator to the current cell (state attribute).

SizeType ConfigMatrix::height [private]

Height of the matrix.

SizeType ConfigMatrix::width [private]

Width of the matrix.


The documentation for this class was generated from the following files:
Generated on Sun Apr 29 11:46:11 2007 for IPP/ICP2007 by  doxygen 1.4.7