KiCad PCB EDA Suite
Loading...
Searching...
No Matches
SHAPE_INDEX< T >::Iterator Class Reference

#include <shape_index.h>

Public Member Functions

 Iterator (SHAPE_INDEX *aIndex)
 Create an iterator for the index object.
 
operator* ()
 Return the next data element.
 
bool operator++ ()
 Shift the iterator to the next element.
 
bool operator++ (int)
 Shift the iterator to the next element.
 
bool IsNull () const
 Check if the iterator has reached the end.
 
bool IsNotNull () const
 Check if the iterator has not reached the end.
 
Next ()
 Return the current element of the iterator and moves to the next position.
 

Private Types

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

Private Member Functions

void Init (RTree< T, int, 2, double > *aTree)
 Setup the internal tree iterator.
 

Private Attributes

RTreeIterator iterator
 

Detailed Description

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

Definition at line 115 of file shape_index.h.

Member Typedef Documentation

◆ RTreeIterator

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

Definition at line 118 of file shape_index.h.

Constructor & Destructor Documentation

◆ Iterator()

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

Create an iterator for the index object.

Parameters
aIndexis a SHAPE_INDEX object to iterate.

Definition at line 137 of file shape_index.h.

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

Member Function Documentation

◆ Init()

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

Setup the internal tree iterator.

Parameters
aTreeis a #RTREE object/

Definition at line 126 of file shape_index.h.

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

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

◆ IsNotNull()

template<class T = SHAPE*>
bool SHAPE_INDEX< T >::Iterator::IsNotNull ( ) const
inline

Check if the iterator has not reached the end.

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

Definition at line 181 of file shape_index.h.

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

◆ IsNull()

template<class T = SHAPE*>
bool SHAPE_INDEX< T >::Iterator::IsNull ( ) const
inline

Check if the iterator has reached the end.

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

Definition at line 171 of file shape_index.h.

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

Referenced by SHAPE_INDEX< T >::Accept(), and SHAPE_INDEX< T >::Reindex().

◆ Next()

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

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

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

Definition at line 191 of file shape_index.h.

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

◆ operator*()

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

Return the next data element.

Definition at line 145 of file shape_index.h.

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

◆ operator++() [1/2]

template<class T = SHAPE*>
bool SHAPE_INDEX< T >::Iterator::operator++ ( )
inline

Shift the iterator to the next element.

Definition at line 153 of file shape_index.h.

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

◆ operator++() [2/2]

template<class T = SHAPE*>
bool SHAPE_INDEX< T >::Iterator::operator++ ( int  )
inline

Shift the iterator to the next element.

Definition at line 161 of file shape_index.h.

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

Member Data Documentation

◆ iterator


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