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

#include <component_class_manager.h>

Public Member Functions

 COMPONENT_CLASS_MANAGER ()
 
COMPONENT_CLASSGetEffectiveComponentClass (std::unordered_set< wxString > &classNames)
 Gets an effective component class for the given constituent class names.
 
const COMPONENT_CLASSGetNoneComponentClass () const
 Returns the unassigned component class.
 
void InitNetlistUpdate ()
 Prepare the manager for a board update Must be called prior to updating the PCB from the netlist.
 
void FinishNetlistUpdate ()
 Cleans up the manager after a board update Must be called after updating the PCB from the netlist.
 
void Reset ()
 Resets the contents of the manager.
 
const std::unordered_map< wxString, std::unique_ptr< COMPONENT_CLASS > > & GetClasses () const
 Fetches a read-only map of the fundamental component classes.
 

Static Public Member Functions

static wxString GetFullClassNameForConstituents (std::unordered_set< wxString > &classNames)
 Gets the full effective class name for the given set of constituent classes.
 
static wxString GetFullClassNameForConstituents (std::vector< wxString > &classNames)
 Gets the full effective class name for the given set of constituent classes.
 

Protected Attributes

std::unordered_map< wxString, std::unique_ptr< COMPONENT_CLASS > > m_classes
 All individual component classes.
 
std::unordered_map< wxString, std::unique_ptr< COMPONENT_CLASS > > m_effectiveClasses
 Generated effective component classes.
 
std::unordered_map< wxString, std::unique_ptr< COMPONENT_CLASS > > m_classesCache
 Cache of all individual component classes (for netlist updating)
 
std::unordered_map< wxString, std::unique_ptr< COMPONENT_CLASS > > m_effectiveClassesCache
 Cache of all generated effective component classes (for netlist updating)
 
std::unique_ptr< COMPONENT_CLASSm_noneClass
 The class to represent an unassigned component class.
 

Detailed Description

Definition at line 84 of file component_class_manager.h.

Constructor & Destructor Documentation

◆ COMPONENT_CLASS_MANAGER()

COMPONENT_CLASS_MANAGER::COMPONENT_CLASS_MANAGER ( )

Definition at line 86 of file component_class_manager.cpp.

References m_noneClass.

Member Function Documentation

◆ FinishNetlistUpdate()

void COMPONENT_CLASS_MANAGER::FinishNetlistUpdate ( )

Cleans up the manager after a board update Must be called after updating the PCB from the netlist.

Definition at line 173 of file component_class_manager.cpp.

References m_classesCache, and m_effectiveClassesCache.

Referenced by BOARD_NETLIST_UPDATER::UpdateNetlist().

◆ GetClasses()

const std::unordered_map< wxString, std::unique_ptr< COMPONENT_CLASS > > & COMPONENT_CLASS_MANAGER::GetClasses ( ) const
inline

Fetches a read-only map of the fundamental component classes.

Definition at line 117 of file component_class_manager.h.

References m_classes.

Referenced by DIALOG_RULE_AREA_PROPERTIES::TransferDataToWindow().

◆ GetEffectiveComponentClass()

COMPONENT_CLASS * COMPONENT_CLASS_MANAGER::GetEffectiveComponentClass ( std::unordered_set< wxString > &  classNames)

Gets an effective component class for the given constituent class names.

Parameters
classesThe names of the constituent component classes
Returns
Effective COMPONENT_CLASS object

Definition at line 93 of file component_class_manager.cpp.

References COMPONENT_CLASS::GetConstituentClasses(), GetFullClassNameForConstituents(), m_classes, m_classesCache, m_effectiveClasses, m_effectiveClassesCache, and m_noneClass.

Referenced by PCB_IO_KICAD_SEXPR_PARSER::parseFOOTPRINT_unchecked(), and BOARD_NETLIST_UPDATER::updateComponentClass().

◆ GetFullClassNameForConstituents() [1/2]

wxString COMPONENT_CLASS_MANAGER::GetFullClassNameForConstituents ( std::unordered_set< wxString > &  classNames)
static

Gets the full effective class name for the given set of constituent classes.

Definition at line 181 of file component_class_manager.cpp.

References GetFullClassNameForConstituents().

Referenced by GetEffectiveComponentClass(), GetFullClassNameForConstituents(), and BOARD_NETLIST_UPDATER::updateComponentClass().

◆ GetFullClassNameForConstituents() [2/2]

wxString COMPONENT_CLASS_MANAGER::GetFullClassNameForConstituents ( std::vector< wxString > &  classNames)
static

Gets the full effective class name for the given set of constituent classes.

Parameters
classNamesa sorted vector of consituent class names

Definition at line 196 of file component_class_manager.cpp.

◆ GetNoneComponentClass()

const COMPONENT_CLASS * COMPONENT_CLASS_MANAGER::GetNoneComponentClass ( ) const
inline

Returns the unassigned component class.

Definition at line 102 of file component_class_manager.h.

References m_noneClass.

Referenced by BOARD_NETLIST_UPDATER::addNewFootprint(), and PCB_IO_KICAD_SEXPR_PARSER::parseFOOTPRINT_unchecked().

◆ InitNetlistUpdate()

void COMPONENT_CLASS_MANAGER::InitNetlistUpdate ( )

Prepare the manager for a board update Must be called prior to updating the PCB from the netlist.

Definition at line 166 of file component_class_manager.cpp.

References m_classes, m_classesCache, m_effectiveClasses, and m_effectiveClassesCache.

Referenced by BOARD_NETLIST_UPDATER::UpdateNetlist().

◆ Reset()

void COMPONENT_CLASS_MANAGER::Reset ( )

Resets the contents of the manager.

Member Data Documentation

◆ m_classes

std::unordered_map<wxString, std::unique_ptr<COMPONENT_CLASS> > COMPONENT_CLASS_MANAGER::m_classes
protected

All individual component classes.

Definition at line 124 of file component_class_manager.h.

Referenced by GetClasses(), GetEffectiveComponentClass(), and InitNetlistUpdate().

◆ m_classesCache

std::unordered_map<wxString, std::unique_ptr<COMPONENT_CLASS> > COMPONENT_CLASS_MANAGER::m_classesCache
protected

Cache of all individual component classes (for netlist updating)

Definition at line 130 of file component_class_manager.h.

Referenced by FinishNetlistUpdate(), GetEffectiveComponentClass(), and InitNetlistUpdate().

◆ m_effectiveClasses

std::unordered_map<wxString, std::unique_ptr<COMPONENT_CLASS> > COMPONENT_CLASS_MANAGER::m_effectiveClasses
protected

Generated effective component classes.

Definition at line 127 of file component_class_manager.h.

Referenced by GetEffectiveComponentClass(), and InitNetlistUpdate().

◆ m_effectiveClassesCache

std::unordered_map<wxString, std::unique_ptr<COMPONENT_CLASS> > COMPONENT_CLASS_MANAGER::m_effectiveClassesCache
protected

Cache of all generated effective component classes (for netlist updating)

Definition at line 133 of file component_class_manager.h.

Referenced by FinishNetlistUpdate(), GetEffectiveComponentClass(), and InitNetlistUpdate().

◆ m_noneClass

std::unique_ptr<COMPONENT_CLASS> COMPONENT_CLASS_MANAGER::m_noneClass
protected

The class to represent an unassigned component class.

Definition at line 136 of file component_class_manager.h.

Referenced by COMPONENT_CLASS_MANAGER(), GetEffectiveComponentClass(), and GetNoneComponentClass().


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