MoveIterator Class Reference

#include <MoveIterator.h>

Collaboration diagram for MoveIterator:

Collaboration graph
[legend]

Public Member Functions

 MoveIterator ()
 Default constructor.
virtual ~MoveIterator ()
 Empty destructor.
MoveIteratoroperator= (const MoveIterator &m)
 Affectation operator.
bool operator== (const MoveIterator &m) const
 Equality test.
bool operator< (const MoveIterator &m) const
 Inferiority test (for STL maps).
bool operator!= (const MoveIterator &m) const
 Difference test.
MoveIteratoroperator++ ()
 Iteration.
move_command operator * (void) const
 Dereference operator.
Moveoperator-> (void) const
 Operator to access properties of the movement referenced.

Protected Member Functions

 MoveIterator (Move *move)
 Private constructor.

Protected Attributes

Move_move
 The movement.

Friends

class Move

Detailed Description

< An iterator on Move

Definition at line 35 of file MoveIterator.h.


Constructor & Destructor Documentation

MoveIterator::MoveIterator ( Move move  )  [protected]

Private constructor.

Parameters:
move 

Definition at line 35 of file MoveIterator.cpp.

00035                                       : _move(move) {
00036 
00037 }


Member Function Documentation

MoveIterator & MoveIterator::operator= ( const MoveIterator m  ) 

Affectation operator.

Parameters:
m other iterator
Returns:
this iterator (modified)

Definition at line 43 of file MoveIterator.cpp.

References _move.

00043                                                            {
00044   _move = m._move;
00045   return (*this);
00046 }

bool MoveIterator::operator== ( const MoveIterator m  )  const

Equality test.

Parameters:
m iterator to test
Returns:
true if m is the same iterator as the current one

Definition at line 48 of file MoveIterator.cpp.

References _move.

00048                                                           {
00049   return (_move == m._move);
00050 }

bool MoveIterator::operator< ( const MoveIterator m  )  const

Inferiority test (for STL maps).

Parameters:
m iterator to test
Returns:
true if m is the same iterator as the current one

Definition at line 52 of file MoveIterator.cpp.

00052                                                          {
00053   return (this->operator*() < m.operator*()); //Compares the handled movements
00054 }

bool MoveIterator::operator!= ( const MoveIterator m  )  const

Difference test.

Parameters:
m iterator to test
Returns:
true if m is different from the current one

Definition at line 56 of file MoveIterator.cpp.

References _move.

00056                                                           {
00057   return (_move != m._move);
00058 }

MoveIterator & MoveIterator::operator++ (  ) 

Iteration.

Returns:
this iterator (modified)

Definition at line 60 of file MoveIterator.cpp.

References _move, and Move::_next.

00060                                        {
00061   if(_move){
00062     _move = _move->_next;
00063   }
00064   return (*this);
00065 }

move_command MoveIterator::operator * ( void   )  const

Dereference operator.

Returns:
the move_command handled by the referenced movement

Definition at line 67 of file MoveIterator.cpp.

References _move, and Move::getHandledMovement().

00067                                                {
00068   return _move->getHandledMovement();
00069 }

Here is the call graph for this function:

Move * MoveIterator::operator-> ( void   )  const

Operator to access properties of the movement referenced.

Returns:
the Move * referenced

Definition at line 71 of file MoveIterator.cpp.

References _move.

00071                                           {
00072   return _move;
00073 }


The documentation for this class was generated from the following files:
Generated on Sat Feb 2 22:23:17 2008 for Teapot Colony Wars by  doxygen 1.5.4