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
21class GTranslationTable : public GBase<GTranslationTable> {
22
23public:
28 explicit GTranslationTable(const std::shared_ptr<GOptions>& gopt) : GBase(gopt, TRANSLATIONTABLE_LOGGER) { }
29
30
39 void addGElectronicWithIdentity(const std::vector<int>& identity, const GElectronic& gtron);
40
49 [[nodiscard]] GElectronic getElectronics(const std::vector<int>& identity) const;
50
51private:
52 // the map uses a string formed by the vector<int> identity as its key
53 std::unordered_map<std::string, GElectronic> tt;
54
63 [[nodiscard]] std::string formTTKey(const std::vector<int>& identity) const;
64
65};
Provides a translation table for GElectronic objects indexed by a vector-based identity.
GTranslationTable(const std::shared_ptr< GOptions > &gopt)
Constructor.
GElectronic getElectronics(const std::vector< int > &identity) const
Retrieves the GElectronic configuration for the provided identity.
void addGElectronicWithIdentity(const std::vector< int > &identity, const GElectronic &gtron)
Adds a GElectronic configuration with the provided identity.
constexpr const char * TRANSLATIONTABLE_LOGGER