|
gtranslationTable
|
Stores and retrieves GElectronic configurations by a vector-based identity. More...
#include <gtranslationTable.h>
Public Member Functions | |
| GTranslationTable (const std::shared_ptr< GOptions > &gopt) | |
| Constructs a translation table bound to the provided options/logger configuration. | |
| void | addGElectronicWithIdentity (const std::vector< int > &identity, const GElectronic >ron) |
| Registers an electronics configuration for a given identity vector. | |
| GElectronic | getElectronics (const std::vector< int > &identity) const |
| Retrieves the electronics configuration associated with a given identity vector. | |
Public Member Functions inherited from GBase< GTranslationTable > | |
| GBase (const std::shared_ptr< GOptions > &gopt, std::string logger_name="") | |
| GBase (const std::shared_ptr< GLogger > &logger) | |
| GBase (const GBase &)=default | |
| GBase (GBase &&) noexcept=default | |
| virtual | ~GBase () |
| GBase & | operator= (const GBase &)=default |
| GBase & | operator= (GBase &&) noexcept=default |
Additional Inherited Members | |
Protected Attributes inherited from GBase< GTranslationTable > | |
| std::shared_ptr< GLogger > | log |
A Translation Table maps an identity expressed as a std::vector<int> to a GElectronic object. Internally, the identity vector is converted into a stable string key (hyphen-separated integers), which is then used as the key in an std::unordered_map.
Design goals:
Error handling:
Definition at line 36 of file gtranslationTable.h.
|
inlineexplicit |
The options are used to configure logging and any module-level behavior supported by the project options infrastructure.
| gopt | Shared pointer to the project options object used by this module. |
Definition at line 47 of file gtranslationTable.h.
| void GTranslationTable::addGElectronicWithIdentity | ( | const std::vector< int > & | identity, |
| const GElectronic & | gtron ) |
This method converts identity into the internal key representation and attempts to insert gtron into the table.
Insertion rules:
Logging behavior:
| identity | A vector of integers representing the unique identity. |
| gtron | The GElectronic configuration to associate with identity. |
Definition at line 27 of file gtranslationTable.cc.
| GElectronic GTranslationTable::getElectronics | ( | const std::vector< int > & | identity | ) | const |
This method derives the internal key from identity and looks it up in the table.
| identity | A vector of integers representing the unique identity. |
identity, or a default-constructed GElectronic if not found. Definition at line 53 of file gtranslationTable.cc.