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

#include <shape_index.h>

Public Member Functions

 Iterator (const TREE_TYPE &aTree)
 
T operator* ()
 
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.
 
T Next ()
 Return the current element of the iterator and moves to the next position.
 

Private Types

using TreeIterator = typename TREE_TYPE::Iterator
 

Private Attributes

TreeIterator m_current
 
TreeIterator m_end
 

Detailed Description

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

Definition at line 118 of file shape_index.h.

Member Typedef Documentation

◆ TreeIterator

template<class T = SHAPE*>
using SHAPE_INDEX< T >::Iterator::TreeIterator = typename TREE_TYPE::Iterator
private

Definition at line 121 of file shape_index.h.

Constructor & Destructor Documentation

◆ Iterator()

template<class T = SHAPE*>
SHAPE_INDEX< T >::Iterator::Iterator ( const TREE_TYPE & aTree)
inline

Definition at line 126 of file shape_index.h.

References SHAPE_INDEX< T >::begin(), SHAPE_INDEX< T >::end(), m_current, and m_end.

Member Function Documentation

◆ 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 170 of file shape_index.h.

References m_current, and m_end.

◆ 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 160 of file shape_index.h.

References m_current, and m_end.

◆ 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 180 of file shape_index.h.

References m_current, and T.

◆ operator*()

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

Definition at line 132 of file shape_index.h.

References m_current, and T.

◆ operator++() [1/2]

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

Shift the iterator to the next element.

Definition at line 140 of file shape_index.h.

References m_current, and m_end.

◆ 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 149 of file shape_index.h.

References m_current, and m_end.

Member Data Documentation

◆ m_current

template<class T = SHAPE*>
TreeIterator SHAPE_INDEX< T >::Iterator::m_current
private

Definition at line 122 of file shape_index.h.

Referenced by IsNotNull(), IsNull(), Iterator(), Next(), operator*(), operator++(), and operator++().

◆ m_end

template<class T = SHAPE*>
TreeIterator SHAPE_INDEX< T >::Iterator::m_end
private

Definition at line 123 of file shape_index.h.

Referenced by IsNotNull(), IsNull(), Iterator(), operator++(), and operator++().


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