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

#include <odb_eda_data.h>

Inheritance diagram for EDA_DATA:
ATTR_MANAGER

Classes

class  FEATURE_ID
 
class  NET
 
class  PACKAGE
 
class  PIN
 
struct  SHORT_NET
 
class  SUB_NET
 
class  SUB_NET_PLANE
 
class  SUB_NET_TOEPRINT
 
class  SUB_NET_TRACE
 
class  SUB_NET_VIA
 

Public Member Functions

 EDA_DATA ()
 
void Write (std::ostream &ost, const ODB_FORMAT &aFormat) const
 
void WriteShortf (std::ostream &ost, const ODB_FORMAT &aFormat) const
 
size_t GetLyrIdx (const wxString &aLayerName)
 
void AssignNetUids (PCB_IO_ODBPP &aPlugin)
 
bool AddShort (const std::set< int > &aNetCodes, const wxString &aLayer, size_t aFeatureIndex, uint32_t aUid)
 
bool HasShorts () const
 
std::vector< std::shared_ptr< FOOTPRINT > > GetEdaFootprints () const
 
void AddNET (const NETINFO_ITEM *aNet, const wxString &aName)
 
NET & GetNet (size_t aNetcode)
 
void AddPackage (const FOOTPRINT *aFp, const ODB_FORMAT &aFormat)
 
const PACKAGE & GetPackage (size_t aHash) const
 
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::map< size_t, NET > nets_map
 
std::list< NET * > nets
 
std::vector< SHORT_NET > m_shorts
 
std::map< size_t, PACKAGE > packages_map
 
std::list< const PACKAGE * > packages
 
std::map< wxString, size_t > layers_map
 
std::vector< wxString > layers
 
std::vector< std::shared_ptr< FOOTPRINT > > m_eda_footprints
 
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 37 of file odb_eda_data.h.

Constructor & Destructor Documentation

◆ EDA_DATA()

Member Function Documentation

◆ AddNET()

void EDA_DATA::AddNET ( const NETINFO_ITEM * aNet,
const wxString & aName )

Definition at line 68 of file odb_eda_data.cpp.

References NETINFO_ITEM::GetNetCode(), nets, and nets_map.

◆ AddPackage()

◆ AddShort()

bool EDA_DATA::AddShort ( const std::set< int > & aNetCodes,
const wxString & aLayer,
size_t aFeatureIndex,
uint32_t aUid )

Definition at line 91 of file odb_eda_data.cpp.

References GetLyrIdx(), m_shorts, and nets_map.

◆ AddSystemAttribute()

◆ AddUserDefAttribute()

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

◆ AssignNetUids()

void EDA_DATA::AssignNetUids ( PCB_IO_ODBPP & aPlugin)

Definition at line 84 of file odb_eda_data.cpp.

References nets, and PCB_IO_ODBPP::NewUid().

◆ AttrValue2String() [1/5]

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

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)
inlineprivateinherited

◆ AttrValue2String() [3/5]

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

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)
inlineprivateinherited

◆ AttrValue2String() [5/5]

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

◆ GetAttrNameNumber()

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

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)
privateinherited

Definition at line 51 of file odb_attribute.cpp.

References GetTextIndex(), m_attrTexts, and m_attrTextVec.

Referenced by AttrValue2String().

◆ GetEdaFootprints()

std::vector< std::shared_ptr< FOOTPRINT > > EDA_DATA::GetEdaFootprints ( ) const
inline

Definition at line 49 of file odb_eda_data.h.

References m_eda_footprints.

◆ GetLyrIdx()

size_t EDA_DATA::GetLyrIdx ( const wxString & aLayerName)

Definition at line 182 of file odb_eda_data.cpp.

References layers, and layers_map.

Referenced by AddShort().

◆ GetNet()

NET & EDA_DATA::GetNet ( size_t aNetcode)
inline

Definition at line 182 of file odb_eda_data.h.

References nets_map.

◆ GetPackage()

const PACKAGE & EDA_DATA::GetPackage ( size_t aHash) const
inline

Definition at line 263 of file odb_eda_data.h.

References packages_map.

◆ 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 )
privateinherited

Definition at line 26 of file odb_attribute.cpp.

References index.

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

◆ HasShorts()

bool EDA_DATA::HasShorts ( ) const
inline

Definition at line 48 of file odb_eda_data.h.

References m_shorts.

◆ isEmptyText()

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

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

◆ Write()

void EDA_DATA::Write ( std::ostream & ost,
const ODB_FORMAT & aFormat ) const

◆ WriteAttributes()

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

◆ WriteAttributesName()

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

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
protectedinherited

Definition at line 92 of file odb_attribute.cpp.

References m_attrTextVec, and name.

Referenced by WriteAttributes().

◆ WriteShortf()

void EDA_DATA::WriteShortf ( std::ostream & ost,
const ODB_FORMAT & aFormat ) const

Definition at line 482 of file odb_eda_data.cpp.

References layers, m_shorts, and ODB_FORMAT::m_unitsStr.

Member Data Documentation

◆ layers

std::vector<wxString> EDA_DATA::layers
private

Definition at line 282 of file odb_eda_data.h.

Referenced by GetLyrIdx(), Write(), and WriteShortf().

◆ layers_map

std::map<wxString, size_t> EDA_DATA::layers_map
private

Definition at line 281 of file odb_eda_data.h.

Referenced by GetLyrIdx().

◆ m_attrNames

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

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
privateinherited

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
privateinherited

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
privateinherited

Definition at line 457 of file odb_attribute.h.

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

◆ m_eda_footprints

std::vector<std::shared_ptr<FOOTPRINT> > EDA_DATA::m_eda_footprints
private

Definition at line 283 of file odb_eda_data.h.

Referenced by AddPackage(), and GetEdaFootprints().

◆ m_shorts

std::vector<SHORT_NET> EDA_DATA::m_shorts
private

Definition at line 276 of file odb_eda_data.h.

Referenced by AddShort(), HasShorts(), and WriteShortf().

◆ nets

std::list<NET*> EDA_DATA::nets
private

Definition at line 275 of file odb_eda_data.h.

Referenced by AddNET(), AssignNetUids(), EDA_DATA(), and Write().

◆ nets_map

std::map<size_t, NET> EDA_DATA::nets_map
private

Definition at line 274 of file odb_eda_data.h.

Referenced by AddNET(), AddShort(), EDA_DATA(), and GetNet().

◆ packages

std::list<const PACKAGE*> EDA_DATA::packages
private

Definition at line 279 of file odb_eda_data.h.

Referenced by AddPackage(), and Write().

◆ packages_map

std::map<size_t, PACKAGE> EDA_DATA::packages_map
private

Definition at line 278 of file odb_eda_data.h.

Referenced by AddPackage(), and GetPackage().


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