7std::string GTranslationTable::formTTKey(
const std::vector<int> &identity)
const {
10 if (identity.empty()) {
11 log->
warning(
"Empty identity vector provided to formTTKey");
16 std::ostringstream oss;
17 for (
size_t i = 0; i < identity.size(); ++i) {
19 if (i != identity.size() - 1)
28 std::string ttKey = formTTKey(identity);
32 auto search = tt.find(ttKey);
34 if (search == tt.end()) {
38 log->
warning(
"Key <" + ttKey +
"> already present in TT map");
42 log->
info(1,
"Added GElectronic with identity <", ttKey,
"> to TT map");
46 for (
auto &thisItem: tt) {
54 std::string ttKey = formTTKey(identity);
55 auto search = tt.find(ttKey);
57 if (search != tt.end()) {
58 log->
debug(
NORMAL,
"Retrieved Electronic using key <", ttKey,
"> in TT map: ", search->second);
59 return search->second;
std::shared_ptr< GLogger > log
void warning(Args &&... args) const
void debug(debug_type type, Args &&... args) const
void info(int level, Args &&... args) const
void error(int exit_code, Args &&... args) const
GElectronic getElectronics(const std::vector< int > &identity) const
Retrieves the electronics configuration associated with a given identity vector.
void addGElectronicWithIdentity(const std::vector< int > &identity, const GElectronic >ron)
Registers an electronics configuration for a given identity vector.
Conventions (primarily exit/error codes) for the Translation Table module.
#define EC__TTNOTFOUNDINTT
Error code used when a translation table entry is not found for a given key.