KiCad PCB EDA Suite
SHAPE_INDEX< T >::Iterator Class Reference

#include <shape_index.h>

Public Member Functions

 Iterator (SHAPE_INDEX *aIndex)
 Iterator constructor. More...
 
operator* ()
 Operator * (prefix) More...
 
bool operator++ ()
 Operator ++ (prefix) More...
 
bool operator++ (int)
 Operator ++ (postfix) More...
 
bool IsNull ()
 Function IsNull() More...
 
bool IsNotNull ()
 Function IsNotNull() More...
 
Next ()
 Function Next() More...
 

Private Types

typedef RTree< T, int, 2, float >::Iterator RTreeIterator
 

Private Member Functions

void Init (RTree< T, int, 2, float > *aTree)
 Function Init() More...
 

Private Attributes

RTreeIterator iterator
 

Detailed Description

template<class T = SHAPE*>
class SHAPE_INDEX< T >::Iterator

Definition at line 110 of file shape_index.h.

Member Typedef Documentation

template<class T = SHAPE*>
typedef RTree<T, int, 2, float>::Iterator SHAPE_INDEX< T >::Iterator::RTreeIterator
private

Definition at line 113 of file shape_index.h.

Constructor & Destructor Documentation

template<class T = SHAPE*>
SHAPE_INDEX< T >::Iterator::Iterator ( SHAPE_INDEX aIndex)
inline

Iterator constructor.

Creates an iterator for the index object

Parameters
aIndexSHAPE_INDEX object to iterate

Definition at line 134 of file shape_index.h.

References SHAPE_INDEX< T >::Iterator::Init(), and SHAPE_INDEX< T >::m_tree.

135  {
136  Init( aIndex->m_tree );
137  }
void Init(RTree< T, int, 2, float > *aTree)
Function Init()
Definition: shape_index.h:122
RTree< T, int, 2, float > * m_tree
Definition: shape_index.h:290

Member Function Documentation

template<class T = SHAPE*>
void SHAPE_INDEX< T >::Iterator::Init ( RTree< T, int, 2, float > *  aTree)
inlineprivate

Function Init()

Setup the internal tree iterator.

Parameters
aTreepointer to a RTREE object

Definition at line 122 of file shape_index.h.

References RTree< DATATYPE, ELEMTYPE, NUMDIMS, ELEMTYPEREAL, TMAXNODES, TMINNODES >::GetFirst().

Referenced by SHAPE_INDEX< T >::Iterator::Iterator().

123  {
124  aTree->GetFirst( iterator );
125  }
void GetFirst(Iterator &a_it)
Get 'first' for iteration.
Definition: rtree.h:337
RTreeIterator iterator
Definition: shape_index.h:114
template<class T = SHAPE*>
bool SHAPE_INDEX< T >::Iterator::IsNotNull ( )
inline

Function IsNotNull()

Checks if the iterator has not reached the end.

Returns
true if it is in an valid position (data not finished)

Definition at line 186 of file shape_index.h.

187  {
188  return iterator.IsNotNull();
189  }
RTreeIterator iterator
Definition: shape_index.h:114
template<class T = SHAPE*>
bool SHAPE_INDEX< T >::Iterator::IsNull ( )
inline

Function IsNull()

Checks if the iterator has reached the end.

Returns
true if it is in an invalid position (data finished)

Definition at line 175 of file shape_index.h.

Referenced by SHAPE_INDEX< T >::Accept().

176  {
177  return iterator.IsNull();
178  }
RTreeIterator iterator
Definition: shape_index.h:114
template<class T = SHAPE*>
T SHAPE_INDEX< T >::Iterator::Next ( )
inline

Function Next()

Returns the current element of the iterator and moves to the next position.

Returns
SHAPE object pointed by the iterator before moving to the next position.

Definition at line 198 of file shape_index.h.

References SHAPE_INDEX< T >::Iterator::iterator.

199  {
200  T object = *iterator;
201  ++iterator;
202 
203  return object;
204  }
T
enum T contains all this lexer's tokens.
RTreeIterator iterator
Definition: shape_index.h:114
template<class T = SHAPE*>
T SHAPE_INDEX< T >::Iterator::operator* ( )
inline

Operator * (prefix)

Returns the next data element.

Definition at line 144 of file shape_index.h.

References SHAPE_INDEX< T >::Iterator::iterator.

145  {
146  return *iterator;
147  }
RTreeIterator iterator
Definition: shape_index.h:114
template<class T = SHAPE*>
bool SHAPE_INDEX< T >::Iterator::operator++ ( )
inline

Operator ++ (prefix)

Shifts the iterator to the next element.

Definition at line 154 of file shape_index.h.

References SHAPE_INDEX< T >::Iterator::iterator.

155  {
156  return ++iterator;
157  }
RTreeIterator iterator
Definition: shape_index.h:114
template<class T = SHAPE*>
bool SHAPE_INDEX< T >::Iterator::operator++ ( int  )
inline

Operator ++ (postfix)

Shifts the iterator to the next element.

Definition at line 164 of file shape_index.h.

References SHAPE_INDEX< T >::Iterator::iterator.

165  {
166  return ++iterator;
167  }
RTreeIterator iterator
Definition: shape_index.h:114

Member Data Documentation

template<class T = SHAPE*>
RTreeIterator SHAPE_INDEX< T >::Iterator::iterator
private

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