|
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 |
| void | InsertBlock (std::unique_ptr< BLOCK_BASE > aBlock) |
| void | ReserveCapacity (size_t aObjectCount, size_t aStringCount, size_t aFileSize) |
| Pre-allocate storage for the expected number of objects and strings. | |
| 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 |
An Allegro board database representing the contents of a .brd (and presumably .dra) file.
Owns all parsed blocks, the string table, the file header, and the key-to-block lookup map.
Definition at line 41 of file allegro_db.h.
| BRD_DB::BRD_DB | ( | ) |
Definition at line 55 of file allegro_db.cpp.
References m_FmtVer, and ALLEGRO::V_UNKNOWN.
|
inline |
Definition at line 46 of file allegro_db.h.
References m_StringTable.
Referenced by ReadStringMap().
|
inline |
|
inline |
Definition at line 51 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 77 of file allegro_db.h.
References empty(), and m_StringTable.
| void BRD_DB::InsertBlock | ( | std::unique_ptr< BLOCK_BASE > | aBlock | ) |
Definition at line 46 of file allegro_db.cpp.
References m_Blocks, and m_ObjectKeyMap.
Referenced by ALLEGRO::PARSER::readObjects().
| void BRD_DB::ReserveCapacity | ( | size_t | aObjectCount, |
| size_t | aStringCount, | ||
| size_t | aFileSize ) |
Pre-allocate storage for the expected number of objects and strings.
Avoids incremental rehashing as elements are inserted.
| aObjectCount | |
| aStringCount | |
| aFileSize | size of the source file, used to bound the header's claimed counts. |
Definition at line 30 of file allegro_db.cpp.
References m_Blocks, m_ObjectKeyMap, and m_StringTable.
| std::vector<std::unique_ptr<BLOCK_BASE> > ALLEGRO::BRD_DB::m_Blocks |
Definition at line 87 of file allegro_db.h.
Referenced by GetObjectCount(), InsertBlock(), and ReserveCapacity().
| FMT_VER ALLEGRO::BRD_DB::m_FmtVer |
Definition at line 84 of file allegro_db.h.
Referenced by BRD_DB(), and ALLEGRO::PARSER::readObjects().
| std::unique_ptr<FILE_HEADER> ALLEGRO::BRD_DB::m_Header |
Definition at line 85 of file allegro_db.h.
Referenced by ALLEGRO::PARSER::readObjects(), and ScanForLayers().
| std::unordered_map<uint32_t, BLOCK_BASE*> ALLEGRO::BRD_DB::m_ObjectKeyMap |
Definition at line 88 of file allegro_db.h.
Referenced by GetObjectByKey(), InsertBlock(), and ReserveCapacity().
| std::unordered_map<uint32_t, wxString> ALLEGRO::BRD_DB::m_StringTable |
Definition at line 89 of file allegro_db.h.
Referenced by AddString(), GetString(), and ReserveCapacity().