Public Member Functions | Private Attributes | List of all members
lariov::CalibrationExtraInfo Class Reference

#include <CalibrationExtraInfo.h>

Public Member Functions

 CalibrationExtraInfo (std::string const &name)
 
virtual ~CalibrationExtraInfo ()=default
 
std::string const & GetName () const
 
void AddOrReplaceBoolData (std::string const &label, bool const data)
 
void AddOrReplaceIntData (std::string const &label, int const data)
 
void AddOrReplaceVecIntData (std::string const &label, std::vector< int > const &data)
 
void AddOrReplaceFloatData (std::string const &label, float const data)
 
void AddOrReplaceVecFloatData (std::string const &label, std::vector< float > const &data)
 
void AddOrReplaceStringData (std::string const &label, std::string const &data)
 
bool GetBoolData (std::string const &label) const
 
int GetIntData (std::string const &label) const
 
std::vector< int > const & GetVecIntData (std::string const &label) const
 
float GetFloatData (std::string const &label) const
 
std::vector< float > const & GetVecFloatData (std::string const &label) const
 
std::string const & GetStringData (std::string const &label) const
 
void ClearDataByLabel (std::string const &label)
 
void ClearAllData ()
 

Private Attributes

std::string fName
 
std::map< std::string, boolfBoolData
 
std::map< std::string, int > fIntData
 
std::map< std::string, std::vector< int > > fVecIntData
 
std::map< std::string, float > fFloatData
 
std::map< std::string, std::vector< float > > fVecFloatData
 
std::map< std::string, std::stringfStringData
 

Detailed Description

Definition at line 10 of file CalibrationExtraInfo.h.

Constructor & Destructor Documentation

lariov::CalibrationExtraInfo::CalibrationExtraInfo ( std::string const &  name)
inline

Definition at line 14 of file CalibrationExtraInfo.h.

14  :
15  fName(name) {}
static QCString name
Definition: declinfo.cpp:673
virtual lariov::CalibrationExtraInfo::~CalibrationExtraInfo ( )
virtualdefault

Member Function Documentation

void lariov::CalibrationExtraInfo::AddOrReplaceBoolData ( std::string const &  label,
bool const  data 
)

Definition at line 6 of file CalibrationExtraInfo.cxx.

6  {
8  }
std::map< std::string, bool > fBoolData
void lariov::CalibrationExtraInfo::AddOrReplaceFloatData ( std::string const &  label,
float const  data 
)

Definition at line 18 of file CalibrationExtraInfo.cxx.

18  {
20  }
std::map< std::string, float > fFloatData
void lariov::CalibrationExtraInfo::AddOrReplaceIntData ( std::string const &  label,
int const  data 
)

Definition at line 10 of file CalibrationExtraInfo.cxx.

10  {
11  fIntData[label] = data;
12  }
std::map< std::string, int > fIntData
void lariov::CalibrationExtraInfo::AddOrReplaceStringData ( std::string const &  label,
std::string const &  data 
)

Definition at line 26 of file CalibrationExtraInfo.cxx.

26  {
28  }
std::map< std::string, std::string > fStringData
void lariov::CalibrationExtraInfo::AddOrReplaceVecFloatData ( std::string const &  label,
std::vector< float > const &  data 
)

Definition at line 22 of file CalibrationExtraInfo.cxx.

22  {
24  }
std::map< std::string, std::vector< float > > fVecFloatData
void lariov::CalibrationExtraInfo::AddOrReplaceVecIntData ( std::string const &  label,
std::vector< int > const &  data 
)

Definition at line 14 of file CalibrationExtraInfo.cxx.

14  {
16  }
std::map< std::string, std::vector< int > > fVecIntData
void lariov::CalibrationExtraInfo::ClearAllData ( )

Definition at line 45 of file CalibrationExtraInfo.cxx.

45  {
46  fBoolData.clear();
47  fIntData.clear();
48  fVecIntData.clear();
49  fFloatData.clear();
50  fVecFloatData.clear();
51  fStringData.clear();
52  }
std::map< std::string, std::vector< float > > fVecFloatData
std::map< std::string, std::string > fStringData
std::map< std::string, int > fIntData
std::map< std::string, bool > fBoolData
std::map< std::string, std::vector< int > > fVecIntData
std::map< std::string, float > fFloatData
void lariov::CalibrationExtraInfo::ClearDataByLabel ( std::string const &  label)

Definition at line 30 of file CalibrationExtraInfo.cxx.

30  {
31  unsigned int n_erased = 0;
32 
33  n_erased += fBoolData.erase(label);
34  n_erased += fIntData.erase(label);
35  n_erased += fVecIntData.erase(label);
36  n_erased += fFloatData.erase(label);
37  n_erased += fVecFloatData.erase(label);
38  n_erased += fStringData.erase(label);
39 
40  if (n_erased > 1) {
41  std::cout<<"INFO(CalibrationExtraInfo): Erased more than one entry with label "<<label<<". Recommend that you do not use identical labels"<<std::endl;
42  }
43  }
std::map< std::string, std::vector< float > > fVecFloatData
std::map< std::string, std::string > fStringData
std::map< std::string, int > fIntData
std::map< std::string, bool > fBoolData
std::map< std::string, std::vector< int > > fVecIntData
std::map< std::string, float > fFloatData
QTextStream & endl(QTextStream &s)
bool lariov::CalibrationExtraInfo::GetBoolData ( std::string const &  label) const

Definition at line 54 of file CalibrationExtraInfo.cxx.

54  {
55  if (fBoolData.find(label) != fBoolData.end()) {
56  return fBoolData.at(label);
57  }
58 
59  throw IOVDataError("CalibrationExtraInfo: Could not find extra bool data "+label+" for calibration "+fName);
60 
61  }
std::map< std::string, bool > fBoolData
float lariov::CalibrationExtraInfo::GetFloatData ( std::string const &  label) const

Definition at line 81 of file CalibrationExtraInfo.cxx.

81  {
82  if (fFloatData.find(label) != fFloatData.end()) {
83  return fFloatData.at(label);
84  }
85 
86  throw IOVDataError("CalibrationExtraInfo: Could not find extra float data "+label+" for calibration "+fName);
87 
88  }
std::map< std::string, float > fFloatData
int lariov::CalibrationExtraInfo::GetIntData ( std::string const &  label) const

Definition at line 63 of file CalibrationExtraInfo.cxx.

63  {
64  if (fIntData.find(label) != fIntData.end()) {
65  return fIntData.at(label);
66  }
67 
68  throw IOVDataError("CalibrationExtraInfo: Could not find extra int data "+label+" for calibration "+fName);
69 
70  }
std::map< std::string, int > fIntData
std::string const& lariov::CalibrationExtraInfo::GetName ( void  ) const
inline

Definition at line 20 of file CalibrationExtraInfo.h.

21  { return fName; }
std::string const & lariov::CalibrationExtraInfo::GetStringData ( std::string const &  label) const

Definition at line 99 of file CalibrationExtraInfo.cxx.

99  {
100  if (fStringData.find(label) != fStringData.end()) {
101  return fStringData.at(label);
102  }
103 
104  throw IOVDataError("CalibrationExtraInfo: Could not find extra string data "+label+" for calibration "+fName);
105 
106  }
std::map< std::string, std::string > fStringData
std::vector< float > const & lariov::CalibrationExtraInfo::GetVecFloatData ( std::string const &  label) const

Definition at line 90 of file CalibrationExtraInfo.cxx.

90  {
91  if (fVecFloatData.find(label) != fVecFloatData.end()) {
92  return fVecFloatData.at(label);
93  }
94 
95  throw IOVDataError("CalibrationExtraInfo: Could not find extra vector float data "+label+" for calibration "+fName);
96 
97  }
std::map< std::string, std::vector< float > > fVecFloatData
std::vector< int > const & lariov::CalibrationExtraInfo::GetVecIntData ( std::string const &  label) const

Definition at line 72 of file CalibrationExtraInfo.cxx.

72  {
73  if (fVecIntData.find(label) != fVecIntData.end()) {
74  return fVecIntData.at(label);
75  }
76 
77  throw IOVDataError("CalibrationExtraInfo: Could not find extra vector int data "+label+" for calibration "+fName);
78 
79  }
std::map< std::string, std::vector< int > > fVecIntData

Member Data Documentation

std::map<std::string, bool> lariov::CalibrationExtraInfo::fBoolData
private

Definition at line 46 of file CalibrationExtraInfo.h.

std::map<std::string, float> lariov::CalibrationExtraInfo::fFloatData
private

Definition at line 51 of file CalibrationExtraInfo.h.

std::map<std::string, int> lariov::CalibrationExtraInfo::fIntData
private

Definition at line 48 of file CalibrationExtraInfo.h.

std::string lariov::CalibrationExtraInfo::fName
private

Definition at line 44 of file CalibrationExtraInfo.h.

std::map<std::string, std::string> lariov::CalibrationExtraInfo::fStringData
private

Definition at line 54 of file CalibrationExtraInfo.h.

std::map<std::string, std::vector<float> > lariov::CalibrationExtraInfo::fVecFloatData
private

Definition at line 52 of file CalibrationExtraInfo.h.

std::map<std::string, std::vector<int> > lariov::CalibrationExtraInfo::fVecIntData
private

Definition at line 49 of file CalibrationExtraInfo.h.


The documentation for this class was generated from the following files: