Jpp  18.3.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>

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 194 of file JAHRSCalibrationToolkit.hh.

196  {
197  using namespace std;
198  using namespace JPP;
199 
200  if (!first.empty() && !second.empty()) {
201 
202  if (first[0] == second[0])
203  return to_value<int>(first.substr(1)) < to_value<int>(second.substr(1));
204  else
205  return first[0] < second[0];
206 
207  } else {
208 
209  return first < second;
210  }
211  }
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 221 of file JAHRSCalibrationToolkit.hh.

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

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