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

SgConnCompIterator Class Reference

Iterate through all connected components of a given set. More...

#include <SgConnCompIterator.h>

List of all members.

Public Member Functions

 SgConnCompIterator (const SgPointSet &set, int boardSize)
 Create an iterator to iterate through set on 'board'.
void operator++ ()
const SgPointSetoperator* () const
 operator bool () const

Private Attributes

SgPointSet m_set
SgPointSet m_nextSet
int m_nextPoint
int m_lastBoardPoint

Detailed Description

Iterate through all connected components of a given set.

Example: compute all blocks of a given color:

    for (ConnCompIterator it(board.All(color), board); it; ++it) DO
    {
    ...define block with points '*it' and color 'color'...
    }
    

Definition at line 21 of file SgConnCompIterator.h.


Constructor & Destructor Documentation

SgConnCompIterator::SgConnCompIterator ( const SgPointSet set,
int  boardSize 
)

Create an iterator to iterate through set on 'board'.

Definition at line 12 of file SgConnCompIterator.cpp.

References operator++(), SG_ASSERTRANGE, and SG_MAX_SIZE.


Member Function Documentation

SgConnCompIterator::operator bool (  )  const

Definition at line 31 of file SgConnCompIterator.h.

References m_lastBoardPoint, and m_nextPoint.

const SgPointSet & SgConnCompIterator::operator* (  )  const

Definition at line 33 of file SgConnCompIterator.cpp.

References m_lastBoardPoint, m_nextPoint, m_nextSet, and SG_ASSERT.

void SgConnCompIterator::operator++ (  ) 

Definition at line 21 of file SgConnCompIterator.cpp.

References SgPointSet::ConnComp(), m_lastBoardPoint, m_nextPoint, m_nextSet, and m_set.

Referenced by SgConnCompIterator().


Member Data Documentation

Definition at line 43 of file SgConnCompIterator.h.

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

Definition at line 41 of file SgConnCompIterator.h.

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

Definition at line 39 of file SgConnCompIterator.h.

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

Definition at line 37 of file SgConnCompIterator.h.

Referenced by operator++().


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


Sun Mar 13 2011 Doxygen 1.7.1