OpenTwin
0.1
OpenTwin
Loading...
Searching...
No Matches
OptionsParameterHandlerFrequency.h
Go to the documentation of this file.
1
#pragma once
2
#include "
OptionsParameterHandler.h
"
3
#include "
Options.h
"
4
5
#include <string>
6
#include <map>
7
8
class
OptionsParameterHandlerFrequency
:
public
OptionsParameterHandler
9
{
10
public
:
11
static
std::string
ToString
(
const
ts::option::Frequency
& frequency)
12
{
13
return
_frequencyParameterToString.find(frequency)->second;
14
}
15
private
:
16
const
std::map<std::string, ts::option::Frequency> _stringToFrequencyParameter = { {
"hz"
,
ts::option::Frequency::Hz
},{
"khz"
,
ts::option::Frequency::kHz
}, {
"mhz"
,
ts::option::Frequency::MHz
},{
"ghz"
,
ts::option::Frequency::GHz
}};
17
inline
static
const
std::map<ts::option::Frequency, std::string> _frequencyParameterToString = { {
ts::option::Frequency::Hz
,
"Hz"
},{
ts::option::Frequency::kHz
,
"kHz"
}, {
ts::option::Frequency::MHz
,
"MHz"
},{
ts::option::Frequency::GHz
,
"GHz"
}};
18
19
virtual
bool
IndividualInterpretation
(
const
std::string& entry,
ts::OptionSettings
& options)
override
;
20
};
21
Options.h
OptionsParameterHandler.h
OptionsParameterHandlerFrequency
Definition
OptionsParameterHandlerFrequency.h:9
OptionsParameterHandlerFrequency::IndividualInterpretation
virtual bool IndividualInterpretation(const std::string &entry, ts::OptionSettings &options) override
Requires a string in lower cases.
Definition
OptionsParameterHandlerFrequency.cpp:3
OptionsParameterHandlerFrequency::ToString
static std::string ToString(const ts::option::Frequency &frequency)
Definition
OptionsParameterHandlerFrequency.h:11
OptionsParameterHandler
Definition
OptionsParameterHandler.h:8
ts::OptionSettings
Definition
OptionSettings.h:7
ts::option::Frequency
Frequency
Definition
Options.h:10
ts::option::Frequency::kHz
@ kHz
ts::option::Frequency::MHz
@ MHz
ts::option::Frequency::Hz
@ Hz
ts::option::Frequency::GHz
@ GHz
Services
ImportParameterizedData
include
OptionsParameterHandlerFrequency.h
Generated by
1.10.0