Index   Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  

SgNb4DiagIterator Class Reference

#include <SgNbIterator.h>

List of all members.


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 72 of file SgNbIterator.h.

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]


Constructor & Destructor Documentation

SgNb4DiagIterator::SgNb4DiagIterator ( SgPoint  p  ) 

Definition at line 75 of file SgNbIterator.h.

References SgPointUtil::InBoardRange(), and SG_ASSERT.

SgNb4DiagIterator::SgNb4DiagIterator ( const SgNb4DiagIterator  )  [private]

Not implemented.


Member Function Documentation

SgPoint SgNb4DiagIterator::operator * (  )  const

Return the value of the current element.

Definition at line 90 of file SgNbIterator.h.

References m_next, m_p, and s_diag.

SgNb4DiagIterator::operator bool (  )  const

Return true if iteration is valid, otherwise false.

Definition at line 96 of file SgNbIterator.h.

References m_next.

void SgNb4DiagIterator::operator++ (  ) 

Advance the state of the iteration to the next element.

Definition at line 83 of file SgNbIterator.h.

References m_next, and SG_ASSERT.

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

Not implemented.


Member Data Documentation

int SgNb4DiagIterator::m_next [private]

Definition at line 102 of file SgNbIterator.h.

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

SgPoint SgNb4DiagIterator::m_p [private]

Definition at line 104 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 106 of file SgNbIterator.h.

Referenced by operator *().


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


17 Jun 2010 Doxygen 1.4.7