KiCad PCB EDA Suite
Loading...
Searching...
No Matches
NETINFO_LIST Class Reference

Container for NETINFO_ITEM elements, which are the nets. More...

#include <netinfo.h>

Classes

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

Public Member Functions

 NETINFO_LIST (BOARD *aParent)
 
 ~NETINFO_LIST ()
 
NETINFO_ITEMGetNetItem (int aNetCode) const
 
NETINFO_ITEMGetNetItem (const wxString &aNetName) const
 
unsigned GetNetCount () const
 
void AppendNet (NETINFO_ITEM *aNewElement)
 Add aNewElement to the end of the net list. More...
 
void RemoveNet (NETINFO_ITEM *aNet)
 Remove a net from the net list. More...
 
void RemoveUnusedNets ()
 
const NETNAMES_MAP & NetsByName () const
 Return the name map, at least for python. More...
 
const NETCODES_MAP & NetsByNetcode () const
 Return the netcode map, at least for python. More...
 
iterator begin () const
 
iterator end () const
 
BOARDGetParent () const
 

Static Public Member Functions

static NETINFO_ITEMOrphanedItem ()
 NETINFO_ITEM meaning that there was no net assigned for an item, as there was no board storing net list available. More...
 

Static Public Attributes

static const int UNCONNECTED = 0
 Constant that holds the "unconnected net" number (typically 0) all items "connected" to this net are actually not connected items. More...
 
static const int ORPHANED = -1
 Constant that forces initialization of a netinfo item to the NETINFO_ITEM ORPHANED (typically -1) when calling SetNetCode on board connected items. More...
 

Private Member Functions

void clear ()
 Delete the list of nets (and free memory). More...
 
void buildListOfNets ()
 Rebuild the list of NETINFO_ITEMs. More...
 
int getFreeNetCode ()
 Return the first available net code that is not used by any other net. More...
 

Private Attributes

BOARDm_parent
 
NETNAMES_MAP m_netNames
 map of <wxString, NETINFO_ITEM*>, is NETINFO_ITEM owner More...
 
NETCODES_MAP m_netCodes
 map of <int, NETINFO_ITEM*> is NOT owner More...
 
int m_newNetCode
 possible value for new net code assignment More...
 

Friends

class BOARD
 

Detailed Description

Container for NETINFO_ITEM elements, which are the nets.

Definition at line 337 of file netinfo.h.

Constructor & Destructor Documentation

◆ NETINFO_LIST()

NETINFO_LIST::NETINFO_LIST ( BOARD aParent)

Definition at line 36 of file netinfo_list.cpp.

References AppendNet().

◆ ~NETINFO_LIST()

NETINFO_LIST::~NETINFO_LIST ( )

Definition at line 45 of file netinfo_list.cpp.

References clear().

Member Function Documentation

◆ AppendNet()

void NETINFO_LIST::AppendNet ( NETINFO_ITEM aNewElement)

Add aNewElement to the end of the net list.

Negative net code means it is going to be auto-assigned.

Definition at line 134 of file netinfo_list.cpp.

References getFreeNetCode(), NETINFO_ITEM::GetNetCode(), GetNetItem(), NETINFO_ITEM::GetNetname(), NETINFO_ITEM::m_netCode, m_netCodes, and m_netNames.

Referenced by NET_SELECTOR_COMBOPOPUP::Accept(), BOARD::Add(), NETINFO_LIST(), and DIALOG_NET_INSPECTOR::onRenameNet().

◆ begin()

iterator NETINFO_LIST::begin ( ) const
inline

Definition at line 458 of file netinfo.h.

References m_netNames.

Referenced by BOARD::BeginNets(), and DSN::SPECCTRA_DB::FromBOARD().

◆ buildListOfNets()

void NETINFO_LIST::buildListOfNets ( )
private

Rebuild the list of NETINFO_ITEMs.

The list is sorted by names.

Definition at line 162 of file netinfo_list.cpp.

References NETINFO_ITEM::Clear(), m_parent, BOARD::SetAreasNetCodesFromNetNames(), and BOARD::SynchronizeNetsAndNetClasses().

Referenced by BOARD::BuildListOfNets().

◆ clear()

void NETINFO_LIST::clear ( )
private

Delete the list of nets (and free memory).

Definition at line 51 of file netinfo_list.cpp.

References m_netCodes, m_netNames, and m_newNetCode.

Referenced by ~NETINFO_LIST().

◆ end()

iterator NETINFO_LIST::end ( ) const
inline

Definition at line 463 of file netinfo.h.

References m_netNames.

Referenced by BOARD::EndNets(), and DSN::SPECCTRA_DB::FromBOARD().

◆ getFreeNetCode()

int NETINFO_LIST::getFreeNetCode ( )
private

Return the first available net code that is not used by any other net.

Definition at line 190 of file netinfo_list.cpp.

References m_netCodes, and m_newNetCode.

Referenced by AppendNet().

◆ GetNetCount()

unsigned NETINFO_LIST::GetNetCount ( ) const
inline
Returns
the number of nets ( always >= 1 ) because the first net is the "not connected" net and always exists

Definition at line 361 of file netinfo.h.

References m_netNames.

Referenced by BOARD::FindNet(), BOARD::GetNetCount(), FABMASTER::loadZones(), and DIALOG_COPPER_ZONE::readNetInformation().

◆ GetNetItem() [1/2]

NETINFO_ITEM * NETINFO_LIST::GetNetItem ( const wxString &  aNetName) const
Parameters
aNetNamenet name to identify a given NETINFO_ITEM.
Returns
net item by aNetName, or NULL if not found.

Definition at line 75 of file netinfo_list.cpp.

References m_netNames.

◆ GetNetItem() [2/2]

◆ GetParent()

BOARD * NETINFO_LIST::GetParent ( ) const
inline

Definition at line 469 of file netinfo.h.

References m_parent.

Referenced by NET_SELECTOR_COMBOPOPUP::Accept().

◆ NetsByName()

const NETNAMES_MAP & NETINFO_LIST::NetsByName ( ) const
inline

Return the name map, at least for python.

Returns
the number of pads in board.

Definition at line 380 of file netinfo.h.

References m_netNames.

Referenced by FABMASTER::loadEtch(), FABMASTER::loadFootprints(), FABMASTER::loadVias(), FABMASTER::loadZone(), and NET_GRID_TABLE::Rebuild().

◆ NetsByNetcode()

const NETCODES_MAP & NETINFO_LIST::NetsByNetcode ( ) const
inline

Return the netcode map, at least for python.

Definition at line 383 of file netinfo.h.

References m_netCodes.

Referenced by DIALOG_NET_INSPECTOR::buildNetsList(), and PCB_PROPERTIES_PANEL::updateLists().

◆ OrphanedItem()

static NETINFO_ITEM * NETINFO_LIST::OrphanedItem ( )
inlinestatic

NETINFO_ITEM meaning that there was no net assigned for an item, as there was no board storing net list available.

Definition at line 395 of file netinfo.h.

References UNCONNECTED.

Referenced by BOARD::FindNet(), PNS_KICAD_IFACE_BASE::GetOrphanedNetHandle(), PCB_CONTROL::Paste(), and BOARD_CONNECTED_ITEM::SetNetCode().

◆ RemoveNet()

void NETINFO_LIST::RemoveNet ( NETINFO_ITEM aNet)

Remove a net from the net list.

Definition at line 86 of file netinfo_list.cpp.

References NETINFO_ITEM::m_netCode, m_netCodes, m_netNames, and m_newNetCode.

Referenced by NET_SELECTOR_COMBOPOPUP::Accept(), DIALOG_NET_INSPECTOR::onRenameNet(), and BOARD::Remove().

◆ RemoveUnusedNets()

Friends And Related Function Documentation

◆ BOARD

friend class BOARD
friend

Definition at line 339 of file netinfo.h.

Member Data Documentation

◆ m_netCodes

NETCODES_MAP NETINFO_LIST::m_netCodes
private

map of <int, NETINFO_ITEM*> is NOT owner

Definition at line 495 of file netinfo.h.

Referenced by AppendNet(), clear(), getFreeNetCode(), GetNetItem(), NetsByNetcode(), RemoveNet(), and RemoveUnusedNets().

◆ m_netNames

NETNAMES_MAP NETINFO_LIST::m_netNames
private

map of <wxString, NETINFO_ITEM*>, is NETINFO_ITEM owner

Definition at line 494 of file netinfo.h.

Referenced by AppendNet(), begin(), clear(), end(), GetNetCount(), GetNetItem(), NetsByName(), RemoveNet(), and RemoveUnusedNets().

◆ m_newNetCode

int NETINFO_LIST::m_newNetCode
private

possible value for new net code assignment

Definition at line 497 of file netinfo.h.

Referenced by clear(), getFreeNetCode(), and RemoveNet().

◆ m_parent

BOARD* NETINFO_LIST::m_parent
private

Definition at line 492 of file netinfo.h.

Referenced by buildListOfNets(), and GetParent().

◆ ORPHANED

const int NETINFO_LIST::ORPHANED = -1
static

Constant that forces initialization of a netinfo item to the NETINFO_ITEM ORPHANED (typically -1) when calling SetNetCode on board connected items.

Definition at line 391 of file netinfo.h.

Referenced by FOOTPRINT::ClearAllNets(), PCB_PARSER::parsePAD(), and BOARD::SanitizeNetcodes().

◆ UNCONNECTED


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