Jpp  19.0.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Attributes | List of all members
JDATABASE::JDBTestTypesTuneHV Struct Reference

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

#include <JDBSupportkit.hh>

Public Member Functions

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

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

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

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  }
std::set< std::string > DBTestTypesTuneHV
version
Definition: JEditTuneHV.sh:5
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:712
std::string to_string(const T &value)
Convert value to string.
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  }
std::set< std::string > DBTestTypesTuneHV
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:712

Member Data Documentation

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: