OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
OptionsParameterHandlerFrequency.h
Go to the documentation of this file.
1#pragma once
3#include "Options.h"
4
5#include <string>
6#include <map>
7
9{
10public:
11 static std::string ToString(const ts::option::Frequency& frequency)
12 {
13 return _frequencyParameterToString.find(frequency)->second;
14 }
15private:
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
Definition OptionsParameterHandlerFrequency.h:9
virtual bool IndividualInterpretation(const std::string &entry, ts::OptionSettings &options) override
Requires a string in lower cases.
Definition OptionsParameterHandlerFrequency.cpp:3
static std::string ToString(const ts::option::Frequency &frequency)
Definition OptionsParameterHandlerFrequency.h:11
Definition OptionsParameterHandler.h:8
Definition OptionSettings.h:7
Frequency
Definition Options.h:10