Jpp test-rotations-old
the software that should make you happy
Loading...
Searching...
No Matches
JDATABASE::JDBTestTypesTuneHV Struct Reference

Table listing HV-tuning database test types. More...

#include <JDBSupportkit.hh>

Public Member Functions

 JDBTestTypesTuneHV ()
 Constructor.
 
const std::string & operator() (const int version) const
 Get HV-tuning DB test type corresponding to given version number.
 
const int operator() (const std::string &testType) const
 Get version number corresponding to given HV-tuning DB test type.
 

Protected Attributes

std::set< std::string > DBTestTypesTuneHV
 

Detailed Description

Table listing HV-tuning database test types.

Definition at line 135 of file JDBSupportkit.hh.

Constructor & Destructor Documentation

◆ JDBTestTypesTuneHV()

JDATABASE::JDBTestTypesTuneHV::JDBTestTypesTuneHV ( )
inline

Constructor.

Definition at line 140 of file JDBSupportkit.hh.

141 {
142 DBTestTypesTuneHV.insert("HV-TUNING-GAIN-v1");
143 DBTestTypesTuneHV.insert("HV-TUNING-GAIN-v2");
144 DBTestTypesTuneHV.insert("HV-TUNING-GAIN-v3");
145 }
std::set< std::string > DBTestTypesTuneHV

Member Function Documentation

◆ operator()() [1/2]

const std::string & JDATABASE::JDBTestTypesTuneHV::operator() ( const int version) const
inline

Get HV-tuning DB test type corresponding to given version number.

Parameters
versionversion number
Returns
HV-tuning database test type

Definition at line 154 of file JDBSupportkit.hh.

155 {
156 using namespace std;
157
158 for (set<string>::const_iterator i = DBTestTypesTuneHV.cbegin(); i != DBTestTypesTuneHV.cend(); ++i) {
159
160 if (i->find(to_string(version)) != string::npos) {
161 return *i;
162 }
163 }
164
165 THROW(JValueOutOfRange, "JDBTestTypesTuneHV::operator(): No HV-tuning database test type corresponding to given version number \'" << version << "\'.");
166 }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
std::string to_string(const T &value)
Convert value to string.

◆ operator()() [2/2]

const int JDATABASE::JDBTestTypesTuneHV::operator() ( const std::string & testType) const
inline

Get version number corresponding to given HV-tuning DB test type.

Parameters
testTypeHV-tuning database test type
Returns
version number

Definition at line 175 of file JDBSupportkit.hh.

176 {
177 using namespace std;
178
179 for (set<string>::const_iterator i = DBTestTypesTuneHV.cbegin(); i != DBTestTypesTuneHV.cend(); ++i) {
180
181 if (i->compare(testType) == 0) {
182
183 const int pos = i->find('v') + 1;
184
185 return stoi(i->substr(pos));
186 }
187 }
188
189 THROW(JValueOutOfRange, "JDBTestTypesTuneHV::operator(): Given HV-tuning database test type \'" << testType << "\' is invalid.");
190 }

Member Data Documentation

◆ DBTestTypesTuneHV

std::set<std::string> JDATABASE::JDBTestTypesTuneHV::DBTestTypesTuneHV
protected

Definition at line 193 of file JDBSupportkit.hh.


The documentation for this struct was generated from the following file: