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

SgNb4DiagIterator Class Reference

Iterator over all 4 diagonal neighbor points. More...

#include <SgNbIterator.h>

List of all members.

Public Member Functions

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

Private Member Functions

 SgNb4DiagIterator (const SgNb4DiagIterator &)
 Not implemented.
SgNb4DiagIteratoroperator= (const SgNb4DiagIterator &)
 Not implemented.

Private Attributes

int m_next
SgPoint m_p

Static Private Attributes

static const int s_diag [4]

Detailed Description

Iterator over all 4 diagonal neighbor points.

Iterates in sorted order. Does not filter points off board, that would need access to current board

Diagonal neighbors (a subset of SgNb8Iterator).

    0     1
     \   /
       p       e.g. next[0] = -NS-WE
     /   \
    2     3
    

Definition at line 69 of file SgNbIterator.h.


Constructor & Destructor Documentation

SgNb4DiagIterator::SgNb4DiagIterator ( SgPoint  p  ) 

Definition at line 72 of file SgNbIterator.h.

References SgPointUtil::InBoardRange(), and SG_ASSERT.

SgNb4DiagIterator::SgNb4DiagIterator ( const SgNb4DiagIterator  )  [private]

Not implemented.


Member Function Documentation

SgNb4DiagIterator::operator bool (  )  const

Return true if iteration is valid, otherwise false.

Definition at line 93 of file SgNbIterator.h.

References m_next.

SgPoint SgNb4DiagIterator::operator* (  )  const

Return the value of the current element.

Definition at line 87 of file SgNbIterator.h.

References m_next, m_p, and s_diag.

void SgNb4DiagIterator::operator++ (  ) 

Advance the state of the iteration to the next element.

Definition at line 80 of file SgNbIterator.h.

References m_next, and SG_ASSERT.

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

Not implemented.


Member Data Documentation

Definition at line 99 of file SgNbIterator.h.

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

Definition at line 101 of file SgNbIterator.h.

Referenced by operator*().

const int SgNb4DiagIterator::s_diag [static, private]
Initial value:
 {
    -SG_NS - SG_WE,
    -SG_NS + SG_WE,
    +SG_NS - SG_WE,
    +SG_NS + SG_WE
}

Definition at line 103 of file SgNbIterator.h.

Referenced by operator*().


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


Sun Mar 13 2011 Doxygen 1.7.1