Index   Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  

SgBWIterator Class Reference

#include <SgBlackWhite.h>

List of all members.


Detailed Description

Iterator over both colors, Black and White.

The function Opp() returns the opponent since this is often needed too.

Usage example:

    for (SgBWIterator it; it; ++it)
    { 
        "this section will be executed twice:"
        "first with *it == SG_BLACK, then with *it == SG_WHITE"
        (unless it encounters a break or return inside)
    }
    

Definition at line 60 of file SgBlackWhite.h.

Public Member Functions

 SgBWIterator ()
void operator++ ()
 Advance the state of the iteration to the next element.
SgBlackWhite operator * () const
 Return the value of the current element.
SgBlackWhite Opp () const
 Return the value of the current element.
 operator bool () const
 Return true if iteration is valid, otherwise false.

Private Member Functions

 SgBWIterator (const SgBWIterator &)
 Not implemented.
SgBWIteratoroperator= (const SgBWIterator &)
 Not implemented.

Private Attributes

int m_color


Constructor & Destructor Documentation

SgBWIterator::SgBWIterator (  ) 

Definition at line 63 of file SgBlackWhite.h.

SgBWIterator::SgBWIterator ( const SgBWIterator  )  [private]

Not implemented.


Member Function Documentation

SgBlackWhite SgBWIterator::operator * (  )  const

Return the value of the current element.

Definition at line 75 of file SgBlackWhite.h.

References m_color.

SgBWIterator::operator bool (  )  const

Return true if iteration is valid, otherwise false.

Definition at line 87 of file SgBlackWhite.h.

References m_color, and SG_WHITE.

void SgBWIterator::operator++ (  ) 

Advance the state of the iteration to the next element.

Definition at line 68 of file SgBlackWhite.h.

References m_color, and SG_ASSERT_BW.

SgBWIterator& SgBWIterator::operator= ( const SgBWIterator  )  [private]

Not implemented.

SgBlackWhite SgBWIterator::Opp (  )  const

Return the value of the current element.

Definition at line 81 of file SgBlackWhite.h.

References m_color, and SgOppBW().


Member Data Documentation

int SgBWIterator::m_color [private]

Definition at line 93 of file SgBlackWhite.h.

Referenced by operator *(), operator bool(), operator++(), and Opp().


The documentation for this class was generated from the following file:


17 Jun 2010 Doxygen 1.4.7