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

A named pin map. More...

#include <pin_map.h>

Public Member Functions

 PIN_MAP ()=default
 
 PIN_MAP (const wxString &aName)
 
const wxString & GetName () const
 
void SetName (const wxString &aName)
 
void SetEntry (const wxString &aPinNumber, const wxString &aPadNumber)
 Set the pad number for a symbol pin.
 
void ClearEntry (const wxString &aPinNumber)
 Remove the entry for aPinNumber.
 
bool HasEntry (const wxString &aPinNumber) const
 
const wxString & GetPadNumber (const wxString &aPinNumber) const
 
const std::vector< PIN_MAP_ENTRY > & GetEntries () const
 
bool IsEmpty () const
 
bool IsIdentity (const std::vector< wxString > &aPinNumbers) const
 
bool operator== (const PIN_MAP &aOther) const
 

Private Member Functions

std::vector< PIN_MAP_ENTRY >::iterator findEntry (const wxString &aPinNumber)
 
std::vector< PIN_MAP_ENTRY >::const_iterator findEntry (const wxString &aPinNumber) const
 

Private Attributes

wxString m_name
 
std::vector< PIN_MAP_ENTRYm_entries
 

Detailed Description

A named pin map.

A pin map is footprint-agnostic: it carries only a name unique within the owning symbol and the pin-to-pad entries. The link between a footprint and the map it uses lives in ASSOCIATED_FOOTPRINT, so more than one footprint can reference the same named map without copying the entries.

Schematic instances do not own PIN_MAP objects; they reference one by name and overlay sparse edits via PIN_MAP_INSTANCE_OVERRIDE.

Definition at line 63 of file pin_map.h.

Constructor & Destructor Documentation

◆ PIN_MAP() [1/2]

PIN_MAP::PIN_MAP ( )
default

References PIN_MAP().

Referenced by operator==(), and PIN_MAP().

◆ PIN_MAP() [2/2]

PIN_MAP::PIN_MAP ( const wxString & aName)
explicit

Definition at line 33 of file pin_map.cpp.

References m_name.

Member Function Documentation

◆ ClearEntry()

void PIN_MAP::ClearEntry ( const wxString & aPinNumber)

Remove the entry for aPinNumber.

No-op if no such entry exists.

Definition at line 70 of file pin_map.cpp.

References findEntry(), and m_entries.

Referenced by BOOST_AUTO_TEST_CASE().

◆ findEntry() [1/2]

std::vector< PIN_MAP_ENTRY >::iterator PIN_MAP::findEntry ( const wxString & aPinNumber)
private

Definition at line 39 of file pin_map.cpp.

References m_entries.

Referenced by ClearEntry(), GetPadNumber(), HasEntry(), and SetEntry().

◆ findEntry() [2/2]

std::vector< PIN_MAP_ENTRY >::const_iterator PIN_MAP::findEntry ( const wxString & aPinNumber) const
private

Definition at line 49 of file pin_map.cpp.

References m_entries.

◆ GetEntries()

const std::vector< PIN_MAP_ENTRY > & PIN_MAP::GetEntries ( ) const
inline

Definition at line 91 of file pin_map.h.

References m_entries.

Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and ERC_TESTER::TestPinMap().

◆ GetName()

const wxString & PIN_MAP::GetName ( ) const
inline

Definition at line 69 of file pin_map.h.

References m_name.

Referenced by PIN_MAP_SET::AddOrReplace(), BOOST_AUTO_TEST_CASE(), and ERC_TESTER::TestPinMap().

◆ GetPadNumber()

const wxString & PIN_MAP::GetPadNumber ( const wxString & aPinNumber) const
Returns
the pad number mapped to aPinNumber, or an empty string if no entry exists.

Definition at line 85 of file pin_map.cpp.

References empty(), findEntry(), and m_entries.

Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and SCH_PIN::GetEffectivePadNumber().

◆ HasEntry()

bool PIN_MAP::HasEntry ( const wxString & aPinNumber) const

◆ IsEmpty()

bool PIN_MAP::IsEmpty ( ) const
inline

Definition at line 93 of file pin_map.h.

References m_entries.

Referenced by BOOST_AUTO_TEST_CASE().

◆ IsIdentity()

bool PIN_MAP::IsIdentity ( const std::vector< wxString > & aPinNumbers) const
Returns
true when this map remaps none of aPinNumbers, i.e. every listed pin either has no entry (resolves 1:1 by identity) or an entry whose pad equals the pin number. Bracketed multi-pad entries (e.g. "[4,9]") are never identity even when one expanded pad matches the pin number.

Definition at line 95 of file pin_map.cpp.

References pin.

Referenced by BOOST_AUTO_TEST_CASE().

◆ operator==()

bool PIN_MAP::operator== ( const PIN_MAP & aOther) const

Definition at line 107 of file pin_map.cpp.

References m_entries, m_name, and PIN_MAP().

◆ SetEntry()

◆ SetName()

void PIN_MAP::SetName ( const wxString & aName)
inline

Definition at line 70 of file pin_map.h.

References m_name.

Referenced by BOOST_AUTO_TEST_CASE().

Member Data Documentation

◆ m_entries

std::vector<PIN_MAP_ENTRY> PIN_MAP::m_entries
private

◆ m_name

wxString PIN_MAP::m_name
private

Definition at line 110 of file pin_map.h.

Referenced by GetName(), operator==(), PIN_MAP(), and SetName().


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