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

310  :
311  m_iterator( aIter ), m_mapping( aMapping )
312  {
313  }
const NETINFO_MAPPING * m_mapping
Definition: netinfo.h:348
std::map< int, int >::const_iterator m_iterator
Definition: netinfo.h:347

Member Function Documentation

◆ operator *()

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

Definition at line 234 of file netinfo_list.cpp.

235 {
236  return m_mapping->m_board->FindNet( m_iterator->first );
237 }
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:384
const NETINFO_MAPPING * m_mapping
Definition: netinfo.h:348
std::map< int, int >::const_iterator m_iterator
Definition: netinfo.h:347

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

337  {
338  return m_iterator != aOther.m_iterator;
339  }
std::map< int, int >::const_iterator m_iterator
Definition: netinfo.h:347

References m_iterator.

◆ operator++() [1/2]

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

pre-increment operator

Definition at line 316 of file netinfo.h.

317  {
318  ++m_iterator;
319 
320  return *this;
321  }
std::map< int, int >::const_iterator m_iterator
Definition: netinfo.h:347

References m_iterator.

◆ operator++() [2/2]

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

post-increment operator

Definition at line 324 of file netinfo.h.

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

References m_iterator.

◆ operator->()

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

Definition at line 240 of file netinfo_list.cpp.

241 {
242  return m_mapping->m_board->FindNet( m_iterator->first );
243 }
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:384
const NETINFO_MAPPING * m_mapping
Definition: netinfo.h:348
std::map< int, int >::const_iterator m_iterator
Definition: netinfo.h:347

◆ operator==()

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

Definition at line 341 of file netinfo.h.

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

References m_iterator.

Member Data Documentation

◆ m_iterator

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

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

Referenced by operator *().


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