Jpp  17.2.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 190 of file JDBSupportkit.hh.

Constructor & Destructor Documentation

JDATABASE::JDBTestTypesTuneHV::JDBTestTypesTuneHV ( )
inline

Constructor.

Definition at line 195 of file JDBSupportkit.hh.

196  {
197  DBTestTypesTuneHV.insert("HV-TUNING-GAIN-v1");
198  DBTestTypesTuneHV.insert("HV-TUNING-GAIN-v2");
199  DBTestTypesTuneHV.insert("HV-TUNING-GAIN-v3");
200  }
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 209 of file JDBSupportkit.hh.

210  {
211  using namespace std;
212 
213  for (set<string>::const_iterator i = DBTestTypesTuneHV.cbegin(); i != DBTestTypesTuneHV.cend(); ++i) {
214 
215  if (i->find(to_string(version)) != string::npos) {
216  return *i;
217  }
218  }
219 
220  THROW(JValueOutOfRange, "JDBTestTypesTuneHV::operator(): No HV-tuning database test type corresponding to given version number \'" << version << "\'.");
221  }
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:696
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 230 of file JDBSupportkit.hh.

231  {
232  using namespace std;
233 
234  for (set<string>::const_iterator i = DBTestTypesTuneHV.cbegin(); i != DBTestTypesTuneHV.cend(); ++i) {
235 
236  if (i->compare(testType) == 0) {
237 
238  const int pos = i->find('v') + 1;
239 
240  return stoi(i->substr(pos));
241  }
242  }
243 
244  THROW(JValueOutOfRange, "JDBTestTypesTuneHV::operator(): Given HV-tuning database test type \'" << testType << "\' is invalid.");
245  }
std::set< std::string > DBTestTypesTuneHV
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:696

Member Data Documentation

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

Definition at line 248 of file JDBSupportkit.hh.


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