KiCad PCB EDA Suite
NETINFO_MAPPING::iterator Class Reference

Wrapper class, so you can iterate through NETINFO_ITEM*s, not std::pair<int/wxString, NETINFO_ITEM*>

More...

#include <netinfo.h>

Public Member Functions

 iterator (std::map< int, int >::const_iterator aIter, const NETINFO_MAPPING *aMapping)
 
const iteratoroperator++ ()
 pre-increment operator More...
 
iterator operator++ (int)
 post-increment operator More...
 
NETINFO_ITEMoperator * () const
 
NETINFO_ITEMoperator-> () const
 
bool operator!= (const iterator &aOther) const
 
bool operator== (const iterator &aOther) const
 

Private Attributes

std::map< int, int >::const_iterator m_iterator
 
const NETINFO_MAPPINGm_mapping
 

Detailed Description

Wrapper class, so you can iterate through NETINFO_ITEM*s, not std::pair<int/wxString, NETINFO_ITEM*>

Definition at line 313 of file netinfo.h.

Constructor & Destructor Documentation

◆ iterator()

NETINFO_MAPPING::iterator::iterator ( std::map< int, int >::const_iterator  aIter,
const NETINFO_MAPPING aMapping 
)
inline

Definition at line 316 of file netinfo.h.

316  :
317  m_iterator( aIter ), m_mapping( aMapping )
318  {
319  }
const NETINFO_MAPPING * m_mapping
Definition: netinfo.h:354
std::map< int, int >::const_iterator m_iterator
Definition: netinfo.h:353

Member Function Documentation

◆ operator *()

NETINFO_ITEM * NETINFO_MAPPING::iterator::operator * ( ) const

Definition at line 245 of file netinfo_list.cpp.

246 {
247  return m_mapping->m_board->FindNet( m_iterator->first );
248 }
NETINFO_ITEM * FindNet(int aNetcode) const
Function FindNet searches for a net with the given netcode.
const BOARD * m_board
Board for which mapping is prepared
Definition: netinfo.h:390
const NETINFO_MAPPING * m_mapping
Definition: netinfo.h:354
std::map< int, int >::const_iterator m_iterator
Definition: netinfo.h:353

References BOARD::FindNet(), NETINFO_MAPPING::m_board, m_iterator, and m_mapping.

◆ operator!=()

bool NETINFO_MAPPING::iterator::operator!= ( const iterator aOther) const
inline

Definition at line 342 of file netinfo.h.

343  {
344  return m_iterator != aOther.m_iterator;
345  }
std::map< int, int >::const_iterator m_iterator
Definition: netinfo.h:353

References m_iterator.

◆ operator++() [1/2]

const iterator& NETINFO_MAPPING::iterator::operator++ ( )
inline

pre-increment operator

Definition at line 322 of file netinfo.h.

323  {
324  ++m_iterator;
325 
326  return *this;
327  }
std::map< int, int >::const_iterator m_iterator
Definition: netinfo.h:353

References m_iterator.

◆ operator++() [2/2]

iterator NETINFO_MAPPING::iterator::operator++ ( int  )
inline

post-increment operator

Definition at line 330 of file netinfo.h.

331  {
332  iterator ret = *this;
333  ++m_iterator;
334 
335  return ret;
336  }
iterator(std::map< int, int >::const_iterator aIter, const NETINFO_MAPPING *aMapping)
Definition: netinfo.h:316
std::map< int, int >::const_iterator m_iterator
Definition: netinfo.h:353

References m_iterator.

◆ operator->()

NETINFO_ITEM * NETINFO_MAPPING::iterator::operator-> ( ) const

Definition at line 251 of file netinfo_list.cpp.

252 {
253  return m_mapping->m_board->FindNet( m_iterator->first );
254 }
NETINFO_ITEM * FindNet(int aNetcode) const
Function FindNet searches for a net with the given netcode.
const BOARD * m_board
Board for which mapping is prepared
Definition: netinfo.h:390
const NETINFO_MAPPING * m_mapping
Definition: netinfo.h:354
std::map< int, int >::const_iterator m_iterator
Definition: netinfo.h:353

◆ operator==()

bool NETINFO_MAPPING::iterator::operator== ( const iterator aOther) const
inline

Definition at line 347 of file netinfo.h.

348  {
349  return m_iterator == aOther.m_iterator;
350  }
std::map< int, int >::const_iterator m_iterator
Definition: netinfo.h:353

References m_iterator.

Member Data Documentation

◆ m_iterator

std::map<int, int>::const_iterator NETINFO_MAPPING::iterator::m_iterator
private

Definition at line 353 of file netinfo.h.

Referenced by operator *(), operator!=(), operator++(), and operator==().

◆ m_mapping

const NETINFO_MAPPING* NETINFO_MAPPING::iterator::m_mapping
private

Definition at line 354 of file netinfo.h.

Referenced by operator *().


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