|
KiCad PCB EDA Suite
|
An Allegro board database representing the contents of a .brd (and presumably .dra) file. More...
#include <allegro_db.h>
Public Member Functions | |
| BRD_DB () | |
| void | AddString (uint32_t aKey, wxString &&aStr) |
| size_t | GetObjectCount () const |
| bool | IsSentinel (uint32_t aKey) const |
| void | AddSentinelKey (uint32_t aKey) |
| void | InsertBlock (std::unique_ptr< BLOCK_BASE > aBlock) |
| void | ReserveCapacity (size_t aObjectCount, size_t aStringCount) |
| Pre-allocate storage for the expected number of objects and strings. | |
| bool | ResolveAndValidate () |
| Populate sentinel keys from the file header linked lists. | |
| const BLOCK_BASE * | GetObjectByKey (uint32_t aKey) const |
| Get a block by its key. | |
| const wxString & | GetString (uint32_t aKey) const |
| Get a string from the string table by key. | |
Public Attributes | |
| FMT_VER | m_FmtVer |
| std::unique_ptr< FILE_HEADER > | m_Header |
| std::vector< std::unique_ptr< BLOCK_BASE > > | m_Blocks |
| std::unordered_map< uint32_t, BLOCK_BASE * > | m_ObjectKeyMap |
| std::unordered_map< uint32_t, wxString > | m_StringTable |
Private Attributes | |
| std::unordered_set< uint32_t > | m_SentinelKeys |
An Allegro board database representing the contents of a .brd (and presumably .dra) file.
Owns all parsed blocks, the string table, sentinel keys, file header, and the key-to-block lookup map.
Definition at line 46 of file allegro_db.h.
| BRD_DB::BRD_DB | ( | ) |
Definition at line 101 of file allegro_db.cpp.
References m_FmtVer, and ALLEGRO::V_UNKNOWN.
|
inline |
Definition at line 63 of file allegro_db.h.
References m_SentinelKeys.
Referenced by collectSentinelKeys().
|
inline |
Definition at line 51 of file allegro_db.h.
References m_StringTable.
Referenced by ReadStringMap().
|
inline |
|
inline |
Definition at line 56 of file allegro_db.h.
References m_Blocks.
Referenced by ALLEGRO::PARSER::readObjects().
|
inline |
Get a string from the string table by key.
Definition at line 94 of file allegro_db.h.
References empty(), and m_StringTable.
| void BRD_DB::InsertBlock | ( | std::unique_ptr< BLOCK_BASE > | aBlock | ) |
Definition at line 50 of file allegro_db.cpp.
References m_Blocks, and m_ObjectKeyMap.
Referenced by ALLEGRO::PARSER::readObjects().
|
inline |
Definition at line 58 of file allegro_db.h.
References m_SentinelKeys.
| void BRD_DB::ReserveCapacity | ( | size_t | aObjectCount, |
| size_t | aStringCount ) |
Pre-allocate storage for the expected number of objects and strings.
Avoids incremental rehashing as elements are inserted.
Definition at line 37 of file allegro_db.cpp.
References m_Blocks, m_ObjectKeyMap, and m_StringTable.
| bool BRD_DB::ResolveAndValidate | ( | ) |
Populate sentinel keys from the file header linked lists.
Definition at line 107 of file allegro_db.cpp.
References collectSentinelKeys(), m_FmtVer, m_Header, and ALLEGRO::V_180.
| std::vector<std::unique_ptr<BLOCK_BASE> > ALLEGRO::BRD_DB::m_Blocks |
Definition at line 104 of file allegro_db.h.
Referenced by GetObjectCount(), InsertBlock(), and ReserveCapacity().
| FMT_VER ALLEGRO::BRD_DB::m_FmtVer |
Definition at line 101 of file allegro_db.h.
Referenced by BRD_DB(), ALLEGRO::PARSER::readObjects(), and ResolveAndValidate().
| std::unique_ptr<FILE_HEADER> ALLEGRO::BRD_DB::m_Header |
Definition at line 102 of file allegro_db.h.
Referenced by ALLEGRO::PARSER::readObjects(), ResolveAndValidate(), and ScanForLayers().
| std::unordered_map<uint32_t, BLOCK_BASE*> ALLEGRO::BRD_DB::m_ObjectKeyMap |
Definition at line 105 of file allegro_db.h.
Referenced by GetObjectByKey(), InsertBlock(), and ReserveCapacity().
|
private |
Definition at line 110 of file allegro_db.h.
Referenced by AddSentinelKey(), and IsSentinel().
| std::unordered_map<uint32_t, wxString> ALLEGRO::BRD_DB::m_StringTable |
Definition at line 106 of file allegro_db.h.
Referenced by AddString(), GetString(), and ReserveCapacity().