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 | List of all members
JDATABASE::JAHRSCalibrationComparator Struct Reference

Auxiliary data structure for sorting of AHRS calibrations. More...

#include <JAHRSCalibrationToolkit.hh>

Inheritance diagram for JDATABASE::JAHRSCalibrationComparator:

Public Member Functions

bool operator() (const std::string &first, const std::string &second) const
 Comparison of operation identifiers. More...
 
bool operator() (const JAHRSCalibration &first, const JAHRSCalibration &second) const
 Comparison of AHRS calibrations. More...
 

Detailed Description

Auxiliary data structure for sorting of AHRS calibrations.

Definition at line 186 of file JAHRSCalibrationToolkit.hh.

Member Function Documentation

bool JDATABASE::JAHRSCalibrationComparator::operator() ( const std::string &  first,
const std::string &  second 
) const
inline

Comparison of operation identifiers.

Parameters
firstfirst operation identifiers
secondsecond operation identifiers
Returns
true if first calibration before second; else false

Definition at line 196 of file JAHRSCalibrationToolkit.hh.

198  {
199  using namespace std;
200  using namespace JPP;
201 
202  if (!first.empty() && !second.empty()) {
203 
204  if (first[0] == second[0])
205  return to_value<int>(first.substr(1)) < to_value<int>(second.substr(1));
206  else
207  return first[0] < second[0];
208 
209  } else {
210 
211  return first < second;
212  }
213  }
then echo The file $DIR KM3NeT_00000001_00000000 root already please rename or remove it first
bool JDATABASE::JAHRSCalibrationComparator::operator() ( const JAHRSCalibration first,
const JAHRSCalibration second 
) const
inline

Comparison of AHRS calibrations.

Parameters
firstfirst AHRS calibration
secondsecond AHRS calibration
Returns
true if first AHRS calibration less then second; else false

Definition at line 223 of file JAHRSCalibrationToolkit.hh.

225  {
226  if (first.SERIALNUMBER == second.SERIALNUMBER) {
227 
228  if (first.TESTEND == second.TESTEND) {
229 
230  if (getVersion(first.TESTNAME) == getVersion(second.TESTNAME))
231  return (*this)(first.TESTOPID, second.TESTOPID);
232  else
233  return getVersion(first.TESTNAME) < getVersion(second.TESTNAME);
234 
235  } else {
236 
237  return first.TESTEND < second.TESTEND;
238  }
239 
240  } else {
241 
242  return first.SERIALNUMBER < second.SERIALNUMBER;
243  }
244  }
int getVersion(const std::string &version)
Get numerical value of AHRS calibration version.

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