Index   Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  
Public Member Functions | Private Member Functions | Private Attributes

SgBWIterator Class Reference

Iterator over both colors, Black and White. More...

#include <SgBlackWhite.h>

List of all members.

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

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 58 of file SgBlackWhite.h.


Constructor & Destructor Documentation

SgBWIterator::SgBWIterator (  ) 

Definition at line 61 of file SgBlackWhite.h.

SgBWIterator::SgBWIterator ( const SgBWIterator  )  [private]

Not implemented.


Member Function Documentation

SgBWIterator::operator bool (  )  const

Return true if iteration is valid, otherwise false.

Definition at line 85 of file SgBlackWhite.h.

References m_color, and SG_WHITE.

SgBlackWhite SgBWIterator::operator* (  )  const

Return the value of the current element.

Definition at line 73 of file SgBlackWhite.h.

References m_color.

void SgBWIterator::operator++ (  ) 

Advance the state of the iteration to the next element.

Definition at line 66 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 79 of file SgBlackWhite.h.

References m_color, and SgOppBW().


Member Data Documentation

int SgBWIterator::m_color [private]

Definition at line 91 of file SgBlackWhite.h.

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


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


Sun Mar 13 2011 Doxygen 1.7.1