20#ifndef PCBNEW_COMPONENT_CLASS_MANAGER_H
21#define PCBNEW_COMPONENT_CLASS_MANAGER_H
24#include <unordered_map>
25#include <unordered_set>
118 const std::unordered_map<wxString, std::unique_ptr<COMPONENT_CLASS>>&
GetClasses()
const
125 std::unordered_map<wxString, std::unique_ptr<COMPONENT_CLASS>>
m_classes;
std::unique_ptr< COMPONENT_CLASS > m_noneClass
The class to represent an unassigned component class.
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_classesCache
Cache of all individual component classes (for netlist updating)
COMPONENT_CLASS * GetEffectiveComponentClass(const std::unordered_set< wxString > &classNames)
Gets an effective component class for the given constituent class names.
void Reset()
Resets the contents of the manager.
static wxString GetFullClassNameForConstituents(const std::unordered_set< wxString > &classNames)
Gets the full effective class name for the given set of constituent classes.
COMPONENT_CLASS_MANAGER()
void FinishNetlistUpdate()
Cleans up the manager after a board update Must be called after updating the PCB from the netlist.
std::unordered_map< wxString, std::unique_ptr< COMPONENT_CLASS > > m_effectiveClassesCache
Cache of all generated effective component classes (for netlist updating)
const COMPONENT_CLASS * GetNoneComponentClass() const
Returns the unassigned component class.
std::unordered_map< wxString, std::unique_ptr< COMPONENT_CLASS > > m_effectiveClasses
Generated effective component classes.
void InitNetlistUpdate()
Prepare the manager for a board update Must be called prior to updating the PCB from the netlist.
const std::unordered_map< wxString, std::unique_ptr< COMPONENT_CLASS > > & GetClasses() const
Fetches a read-only map of the fundamental component classes.
void AddConstituentClass(COMPONENT_CLASS *componentClass)
Adds a constituent component class to an effective component class.
bool ContainsClassName(const wxString &className) const
Determines if this (effective) component class contains a specific sub-class.
std::vector< COMPONENT_CLASS * > m_constituentClasses
The COMPONENT_CLASS objects contributing to this complete component class.
COMPONENT_CLASS(const wxString &name)
const std::vector< COMPONENT_CLASS * > & GetConstituentClasses() const
Fetches a vector of the constituent classes for this (effective) class.
wxString m_name
The full name of the component class.
const wxString & GetFullName() const
Fetches the full name of this component class.
wxString GetName() const
Fetches the display name of this component class.
bool IsEmpty() const
Determines if this (effective) component class is empty (i.e. no classes defined)