Matrix::iterator Class Reference

Iterator is used to access the two-dimensional array in the Matrix class. More...

#include <Matrix.h>

List of all members.

Public Types

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

Public Member Functions

 iterator (const Matrix *matrix, SizeType xIndex=0, SizeType yIndex=0)
 Constructor.
 iterator (const iterator &iter)
 Copy constructor.
 ~iterator ()
 Destructor.
Objectoperator * ()
 Dereferences the iterator.
Objectoperator-> ()
 Dereferences the iterator.
iteratoroperator++ ()
 Moves iterator to the next place (prefix).
iterator operator++ (int)
 Moves iterator to the next place (postfix).
iteratoroperator= (const iterator &iter)
 Assignment of two iterators.

Private Attributes

const Matrixm
 Matrix into which the iterator is pointed.
SizeType x
 [x][] index
SizeType y
 [][y] index

Friends

bool operator== (const iterator &iter1, const iterator &iter2)
 Returns true if the two selected iterators points to the same place.
bool operator!= (const iterator &iter1, const iterator &iter2)
 Returns true if the two selected iterators doesn't point to the same place.


Detailed Description

Iterator is used to access the two-dimensional array in the Matrix class.


Member Typedef Documentation

Matrix::SizeType Matrix::iterator::SizeType

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


Constructor & Destructor Documentation

Matrix::iterator::iterator ( const Matrix matrix,
SizeType  xIndex = 0,
SizeType  yIndex = 0 
) [inline]

Constructor.

Parameters:
matrix Matrix into which the iterator is pointed
xIndex Index x
yIndex Index y

Matrix::iterator::iterator ( const iterator iter  )  [inline]

Copy constructor.

Parameters:
iter Iterator to be copied

Matrix::iterator::~iterator (  )  [inline]

Destructor.


Member Function Documentation

Object & Matrix::iterator::operator * (  ) 

Dereferences the iterator.

Returns:
Reference to the current object

Matrix::iterator Matrix::iterator::operator++ ( int   ) 

Moves iterator to the next place (postfix).

Note: Prefix variant is more effective.

Matrix::iterator & Matrix::iterator::operator++ (  ) 

Moves iterator to the next place (prefix).

Object * Matrix::iterator::operator-> (  ) 

Dereferences the iterator.

Returns:
Pointer to the current object

Matrix::iterator & Matrix::iterator::operator= ( const iterator iter  ) 

Assignment of two iterators.

Parameters:
iter Iterator to be assigned


Friends And Related Function Documentation

bool operator!= ( const iterator iter1,
const iterator iter2 
) [friend]

Returns true if the two selected iterators doesn't point to the same place.

Parameters:
iter1 First iterator
iter2 Second iterator
Both iterators must be pointing to the same matrix.

bool operator== ( const iterator iter1,
const iterator iter2 
) [friend]

Returns true if the two selected iterators points to the same place.

Parameters:
iter1 First iterator
iter2 Second iterator
Both iterators must be pointing to the same matrix.


Member Data Documentation

const Matrix* Matrix::iterator::m [private]

Matrix into which the iterator is pointed.

SizeType Matrix::iterator::x [private]

[x][] index

SizeType Matrix::iterator::y [private]

[][y] index


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