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 309 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 312 of file netinfo.h.

312  :
313  m_iterator( aIter ), m_mapping( aMapping )
314  {
315  }
const NETINFO_MAPPING * m_mapping
Definition: netinfo.h:350
std::map< int, int >::const_iterator m_iterator
Definition: netinfo.h:349

Member Function Documentation

◆ operator *()

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

Definition at line 242 of file netinfo_list.cpp.

243 {
244  return m_mapping->m_board->FindNet( m_iterator->first );
245 }
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:386
const NETINFO_MAPPING * m_mapping
Definition: netinfo.h:350
std::map< int, int >::const_iterator m_iterator
Definition: netinfo.h:349

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 338 of file netinfo.h.

339  {
340  return m_iterator != aOther.m_iterator;
341  }
std::map< int, int >::const_iterator m_iterator
Definition: netinfo.h:349

References m_iterator.

◆ operator++() [1/2]

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

pre-increment operator

Definition at line 318 of file netinfo.h.

319  {
320  ++m_iterator;
321 
322  return *this;
323  }
std::map< int, int >::const_iterator m_iterator
Definition: netinfo.h:349

References m_iterator.

◆ operator++() [2/2]

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

post-increment operator

Definition at line 326 of file netinfo.h.

327  {
328  iterator ret = *this;
329  ++m_iterator;
330 
331  return ret;
332  }
iterator(std::map< int, int >::const_iterator aIter, const NETINFO_MAPPING *aMapping)
Definition: netinfo.h:312
std::map< int, int >::const_iterator m_iterator
Definition: netinfo.h:349

References m_iterator.

◆ operator->()

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

Definition at line 248 of file netinfo_list.cpp.

249 {
250  return m_mapping->m_board->FindNet( m_iterator->first );
251 }
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:386
const NETINFO_MAPPING * m_mapping
Definition: netinfo.h:350
std::map< int, int >::const_iterator m_iterator
Definition: netinfo.h:349

◆ operator==()

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

Definition at line 343 of file netinfo.h.

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

References m_iterator.

Member Data Documentation

◆ m_iterator

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

Definition at line 349 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 350 of file netinfo.h.

Referenced by operator *().


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