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

#include <odb_attribute.h>

Inheritance diagram for ATTR_MANAGER:
COMPONENTS_MANAGER EDA_DATA FEATURES_MANAGER

Public Member Functions

 ATTR_MANAGER ()=default
 
virtual ~ATTR_MANAGER ()=default
 
template<typename Tr, typename Ta>
void AddSystemAttribute (Tr &r, Ta v)
 
template<typename Tr, typename Ta>
void AddUserDefAttribute (Tr &r, Ta v)
 

Protected Member Functions

size_t GetAttrNameNumber (const wxString &name)
 
void WriteAttributes (std::ostream &ost, const std::string &prefix="") const
 
void WriteAttributesName (std::ostream &ost, const std::string &prefix="") const
 
void WriteAttributesText (std::ostream &ost, const std::string &prefix="") const
 

Private Member Functions

size_t GetAttrTextNumber (const wxString &aName)
 
size_t GetTextIndex (std::unordered_map< std::string, size_t > &aMap, std::vector< std::pair< size_t, std::string > > &aVec, const std::string &aText)
 
template<typename T, unsigned int n>
std::string AttrValue2String (ODB_ATTR::FloatAttribute< T, n > a)
 
template<typename T>
std::string AttrValue2String (ODB_ATTR::BooleanAttribute< T > a)
 
template<typename T>
std::string AttrValue2String (ODB_ATTR::TextAttribute< T > a)
 
template<typename T>
std::string AttrValue2String (ODB_ATTR::ListTextAttribute< T > a)
 
template<typename T>
std::string AttrValue2String (ODB_ATTR::IntegerAttribute< T > a)
 

Static Private Member Functions

template<typename Ta>
static bool isEmptyText (const Ta &v)
 An empty TEXT value is the attribute's default and has no legal text table entry.
 

Private Attributes

std::unordered_map< std::string, size_t > m_attrNames
 
std::vector< std::pair< size_t, std::string > > m_attrNameVec
 
std::unordered_map< std::string, size_t > m_attrTexts
 
std::vector< std::pair< size_t, std::string > > m_attrTextVec
 

Detailed Description

Definition at line 363 of file odb_attribute.h.

Constructor & Destructor Documentation

◆ ATTR_MANAGER()

ATTR_MANAGER::ATTR_MANAGER ( )
default

◆ ~ATTR_MANAGER()

virtual ATTR_MANAGER::~ATTR_MANAGER ( )
virtualdefault

Member Function Documentation

◆ AddSystemAttribute()

◆ AddUserDefAttribute()

template<typename Tr, typename Ta>
void ATTR_MANAGER::AddUserDefAttribute ( Tr & r,
Ta v )
inline

◆ AttrValue2String() [1/5]

template<typename T>
std::string ATTR_MANAGER::AttrValue2String ( ODB_ATTR::BooleanAttribute< T > a)
inlineprivate

Definition at line 429 of file odb_attribute.h.

◆ AttrValue2String() [2/5]

template<typename T, unsigned int n>
std::string ATTR_MANAGER::AttrValue2String ( ODB_ATTR::FloatAttribute< T, n > a)
inlineprivate

◆ AttrValue2String() [3/5]

template<typename T>
std::string ATTR_MANAGER::AttrValue2String ( ODB_ATTR::IntegerAttribute< T > a)
inlineprivate

Definition at line 447 of file odb_attribute.h.

References ODB_ATTR::AttributeBase< T, AttrType >::value.

◆ AttrValue2String() [4/5]

template<typename T>
std::string ATTR_MANAGER::AttrValue2String ( ODB_ATTR::ListTextAttribute< T > a)
inlineprivate

◆ AttrValue2String() [5/5]

template<typename T>
std::string ATTR_MANAGER::AttrValue2String ( ODB_ATTR::TextAttribute< T > a)
inlineprivate

◆ GetAttrNameNumber()

size_t ATTR_MANAGER::GetAttrNameNumber ( const wxString & name)
protected

Definition at line 45 of file odb_attribute.cpp.

References GetTextIndex(), m_attrNames, and m_attrNameVec.

Referenced by AddSystemAttribute(), and AddUserDefAttribute().

◆ GetAttrTextNumber()

size_t ATTR_MANAGER::GetAttrTextNumber ( const wxString & aName)
private

Definition at line 51 of file odb_attribute.cpp.

References GetTextIndex(), m_attrTexts, and m_attrTextVec.

Referenced by AttrValue2String().

◆ GetTextIndex()

size_t ATTR_MANAGER::GetTextIndex ( std::unordered_map< std::string, size_t > & aMap,
std::vector< std::pair< size_t, std::string > > & aVec,
const std::string & aText )
private

Definition at line 26 of file odb_attribute.cpp.

References index.

Referenced by AttrValue2String(), GetAttrNameNumber(), and GetAttrTextNumber().

◆ isEmptyText()

template<typename Ta>
static bool ATTR_MANAGER::isEmptyText ( const Ta & v)
inlinestaticprivate

An empty TEXT value is the attribute's default and has no legal text table entry.

Definition at line 409 of file odb_attribute.h.

Referenced by AddSystemAttribute(), and AddUserDefAttribute().

◆ WriteAttributes()

void ATTR_MANAGER::WriteAttributes ( std::ostream & ost,
const std::string & prefix = "" ) const
protected

◆ WriteAttributesName()

void ATTR_MANAGER::WriteAttributesName ( std::ostream & ost,
const std::string & prefix = "" ) const
protected

Definition at line 83 of file odb_attribute.cpp.

References m_attrNameVec, and name.

Referenced by WriteAttributes().

◆ WriteAttributesText()

void ATTR_MANAGER::WriteAttributesText ( std::ostream & ost,
const std::string & prefix = "" ) const
protected

Definition at line 92 of file odb_attribute.cpp.

References m_attrTextVec, and name.

Referenced by WriteAttributes().

Member Data Documentation

◆ m_attrNames

std::unordered_map<std::string, size_t> ATTR_MANAGER::m_attrNames
private

Definition at line 453 of file odb_attribute.h.

Referenced by GetAttrNameNumber().

◆ m_attrNameVec

std::vector<std::pair<size_t, std::string> > ATTR_MANAGER::m_attrNameVec
private

Definition at line 454 of file odb_attribute.h.

Referenced by GetAttrNameNumber(), and WriteAttributesName().

◆ m_attrTexts

std::unordered_map<std::string, size_t> ATTR_MANAGER::m_attrTexts
private

Definition at line 456 of file odb_attribute.h.

Referenced by AttrValue2String(), and GetAttrTextNumber().

◆ m_attrTextVec

std::vector<std::pair<size_t, std::string> > ATTR_MANAGER::m_attrTextVec
private

Definition at line 457 of file odb_attribute.h.

Referenced by AttrValue2String(), GetAttrTextNumber(), and WriteAttributesText().


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