Jpp  16.0.1
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 191 of file JDBSupportkit.hh.

Constructor & Destructor Documentation

JDATABASE::JDBTestTypesTuneHV::JDBTestTypesTuneHV ( )
inline

Constructor.

Definition at line 196 of file JDBSupportkit.hh.

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

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

232  {
233  using namespace std;
234 
235  for (set<string>::const_iterator i = DBTestTypesTuneHV.cbegin(); i != DBTestTypesTuneHV.cend(); ++i) {
236 
237  if (i->compare(testType) == 0) {
238 
239  const int pos = i->find('v') + 1;
240 
241  return stoi(i->substr(pos));
242  }
243  }
244 
245  THROW(JValueOutOfRange, "JDBTestTypesTuneHV::operator(): Given HV-tuning database test type \'" << testType << "\' is invalid.");
246  }
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 249 of file JDBSupportkit.hh.


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