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 AddFeatureAttribute (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)
 

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 282 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

◆ AddFeatureAttribute()

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

Definition at line 289 of file odb_attribute.h.

References AttrValue2String(), and GetAttrNameNumber().

Referenced by FEATURES_MANAGER::InitFeatureList().

◆ AttrValue2String() [1/3]

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

Definition at line 320 of file odb_attribute.h.

◆ AttrValue2String() [2/3]

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

◆ AttrValue2String() [3/3]

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 AddFeatureAttribute().

◆ 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.

Referenced by GetAttrNameNumber(), and GetAttrTextNumber().

◆ 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 76 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 85 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 332 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 333 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 335 of file odb_attribute.h.

Referenced by GetAttrTextNumber().

◆ m_attrTextVec

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

Definition at line 336 of file odb_attribute.h.

Referenced by GetAttrTextNumber(), and WriteAttributesText().


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