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
13
#include "
gtranslationTable_options.h
"
14
21
class
GTranslationTable
:
public
GBase<GTranslationTable> {
22
23
public
:
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
51
private
:
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
};
GTranslationTable
Provides a translation table for GElectronic objects indexed by a vector-based identity.
Definition
gtranslationTable.h:21
GTranslationTable::GTranslationTable
GTranslationTable(const std::shared_ptr< GOptions > &gopt)
Constructor.
Definition
gtranslationTable.h:28
GTranslationTable::getElectronics
GElectronic getElectronics(const std::vector< int > &identity) const
Retrieves the GElectronic configuration for the provided identity.
Definition
gtranslationTable.cc:68
GTranslationTable::addGElectronicWithIdentity
void addGElectronicWithIdentity(const std::vector< int > &identity, const GElectronic >ron)
Adds a GElectronic configuration with the provided identity.
Definition
gtranslationTable.cc:40
gtranslationTable_options.h
TRANSLATIONTABLE_LOGGER
constexpr const char * TRANSLATIONTABLE_LOGGER
Definition
gtranslationTable_options.h:5
gtranslationTable.h
Generated by
1.10.0