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

GoBoard::LibertyCopyIterator Class Reference

Iterate through all the liberties of a block. More...

#include <GoBoard.h>

List of all members.

Public Member Functions

 LibertyCopyIterator (const GoBoard &bd, SgPoint p)
void operator++ ()
 Advance the state of the iteration to the next liberty.
int operator* () const
 Return the current liberty.
 operator bool () const
 Return true if iteration is valid, otherwise false.

Private Member Functions

 LibertyCopyIterator (const LibertyCopyIterator &)
 Not implemented.
LibertyCopyIteratoroperator= (const LibertyCopyIterator &)
 Not implemented.

Private Attributes

Block::LibertyList m_liberties
 Copy of liberty list.
Block::LibertyList::Iterator m_it
const GoBoardm_board
SgHashCode m_oldHash

Detailed Description

Iterate through all the liberties of a block.

Point 'p' must be occupied. Like GoBoard::LibertyIterator, but allows moves to be executed during the iteration (uses a copy of the liberty list, if required by the implementation).

Definition at line 960 of file GoBoard.h.


Constructor & Destructor Documentation

GoBoard::LibertyCopyIterator::LibertyCopyIterator ( const GoBoard bd,
SgPoint  p 
)

Definition at line 1056 of file GoBoard.h.

References GoBoard::GetHashCode(), m_board, m_oldHash, GoBoard::Occupied(), and SG_ASSERT.

GoBoard::LibertyCopyIterator::LibertyCopyIterator ( const LibertyCopyIterator  )  [private]

Not implemented.


Member Function Documentation

GoBoard::LibertyCopyIterator::operator bool (  )  const

Return true if iteration is valid, otherwise false.

Definition at line 1079 of file GoBoard.h.

References m_it.

int GoBoard::LibertyCopyIterator::operator* (  )  const

Return the current liberty.

Definition at line 1073 of file GoBoard.h.

References GoBoard::GetHashCode(), m_board, m_it, m_oldHash, and SG_ASSERT.

void GoBoard::LibertyCopyIterator::operator++ (  ) 

Advance the state of the iteration to the next liberty.

Definition at line 1068 of file GoBoard.h.

References m_it.

LibertyCopyIterator& GoBoard::LibertyCopyIterator::operator= ( const LibertyCopyIterator  )  [private]

Not implemented.


Member Data Documentation

Definition at line 984 of file GoBoard.h.

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

Block::LibertyList::Iterator GoBoard::LibertyCopyIterator::m_it [private]

Definition at line 982 of file GoBoard.h.

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

Copy of liberty list.

Necessary, because if moves are played and undone while iterating over liberty list, the implementation of GoBoard does not guarantee, that the order of the block's liberty list is preserved.

Definition at line 980 of file GoBoard.h.

Definition at line 987 of file GoBoard.h.

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


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


Sun Mar 13 2011 Doxygen 1.7.1