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

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

Definition at line 316 of file netinfo.h.

Referenced by NETINFO_MAPPING::begin(), NETINFO_LIST::begin(), NETINFO_MAPPING::end(), and NETINFO_LIST::end().

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

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

Definition at line 342 of file netinfo.h.

References m_iterator.

343  {
344  return m_iterator != aOther.m_iterator;
345  }
std::map< int, int >::const_iterator m_iterator
Definition: netinfo.h:353
NETINFO_ITEM * NETINFO_MAPPING::iterator::operator* ( ) const

Definition at line 245 of file netinfo_list.cpp.

Referenced by operator++().

246 {
247  return m_mapping->m_board->FindNet( m_iterator->first );
248 }
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
NETINFO_ITEM * FindNet(int aNetcode) const
Function FindNet searches for a net with the given netcode.
const iterator& NETINFO_MAPPING::iterator::operator++ ( )
inline

pre-increment operator

Definition at line 322 of file netinfo.h.

References m_iterator.

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

post-increment operator

Definition at line 330 of file netinfo.h.

References m_iterator, operator*(), and operator->().

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
NETINFO_ITEM * NETINFO_MAPPING::iterator::operator-> ( ) const

Definition at line 251 of file netinfo_list.cpp.

References NETINFO_LIST::ORPHANED, NETINFO_LIST::ORPHANED_ITEM, and NETINFO_LIST::UNCONNECTED.

Referenced by operator++().

252 {
253  return m_mapping->m_board->FindNet( m_iterator->first );
254 }
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
NETINFO_ITEM * FindNet(int aNetcode) const
Function FindNet searches for a net with the given netcode.
bool NETINFO_MAPPING::iterator::operator== ( const iterator aOther) const
inline

Definition at line 347 of file netinfo.h.

References m_iterator.

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

Member Data Documentation

const NETINFO_MAPPING* NETINFO_MAPPING::iterator::m_mapping
private

Definition at line 354 of file netinfo.h.


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