gtranslationTable
Loading...
Searching...
No Matches
gtranslationTable.h
Go to the documentation of this file.
1#pragma once
2
3// gemc
4#include "gelectronic.h"
5#include "gbase.h"
6
7// c++
8#include <string>
9#include <unordered_map>
10#include <vector>
11
12// tt
14
36class GTranslationTable : public GBase<GTranslationTable> {
37
38public:
47 explicit GTranslationTable(const std::shared_ptr<GOptions>& gopt)
49
67 void addGElectronicWithIdentity(const std::vector<int>& identity, const GElectronic& gtron);
68
80 [[nodiscard]] GElectronic getElectronics(const std::vector<int>& identity) const;
81
82private:
83 // The map uses a string formed from the identity vector as its key.
84 // Key format: hyphen-separated integers (e.g. "1-2-3-4-5").
85 std::unordered_map<std::string, GElectronic> tt;
86
101 [[nodiscard]] std::string formTTKey(const std::vector<int>& identity) const;
102
103};
Stores and retrieves GElectronic configurations by a vector-based identity.
GTranslationTable(const std::shared_ptr< GOptions > &gopt)
Constructs a translation table bound to the provided options/logger configuration.
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 &gtron)
Registers an electronics configuration for a given identity vector.
Option definitions for the Translation Table module.
constexpr const char * TRANSLATIONTABLE_LOGGER