Index   Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  

GoBoard::LibertyCopyIterator Class Reference

#include <GoBoard.h>

List of all members.


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 1026 of file GoBoard.h.

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


Constructor & Destructor Documentation

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

Definition at line 1123 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

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

Return the current liberty.

Definition at line 1140 of file GoBoard.h.

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

GoBoard::LibertyCopyIterator::operator bool (  )  const

Return true if iteration is valid, otherwise false.

Definition at line 1146 of file GoBoard.h.

References m_it.

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

Advance the state of the iteration to the next liberty.

Definition at line 1135 of file GoBoard.h.

References m_it.

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

Not implemented.


Member Data Documentation

const GoBoard& GoBoard::LibertyCopyIterator::m_board [private]

Definition at line 1051 of file GoBoard.h.

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

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

Definition at line 1049 of file GoBoard.h.

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

Block::LibertyList GoBoard::LibertyCopyIterator::m_liberties [private]

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 1047 of file GoBoard.h.

SgHashCode GoBoard::LibertyCopyIterator::m_oldHash [private]

Definition at line 1054 of file GoBoard.h.

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


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


17 Jun 2010 Doxygen 1.4.7