Jpp  17.3.0-rc.2
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Public Attributes | List of all members
JACOUSTICS::JTransmission::compare Struct Reference

Auxiliary class to compare transmissions. More...

#include <JTransmission.hh>

Inheritance diagram for JACOUSTICS::JTransmission::compare:
JACOUSTICS::JTransmission::equals

Public Member Functions

 compare (const double precision)
 Constructor. More...
 
bool operator() (const JTransmission &first, const JTransmission &second) const
 Compare two transmissions. More...
 

Public Attributes

const double precision
 

Detailed Description

Auxiliary class to compare transmissions.

Definition at line 184 of file JTransmission.hh.

Constructor & Destructor Documentation

JACOUSTICS::JTransmission::compare::compare ( const double  precision)
inline

Constructor.

Parameters
precisiontime-of-arrival precision [s]

Definition at line 192 of file JTransmission.hh.

192  :
194  {}
equals(const double precision)
Constructor.

Member Function Documentation

bool JACOUSTICS::JTransmission::compare::operator() ( const JTransmission first,
const JTransmission second 
) const
inline

Compare two transmissions.

The transmission wih the earliest time-of-arrival comes first.
If the two transmissions are equal within the specified precision, the transmission with the highest quality comes first.
If also the qualities are the same, the time-of-arrival is again used.

Parameters
firstfirst transmission
secondsecond transmission
Returns
true if time-of-arrival of first transmission earlier than that of second; else false

Definition at line 209 of file JTransmission.hh.

210  {
211  if (static_cast<const equals&>(*this)(first, second)) {
212 
213  if (first.getQ() == second.getQ())
214  return first.getToA() < second.getToA();
215  else
216  return first.getQ() > second.getQ();
217 
218  } else {
219 
220  return first.getToA() < second.getToA();
221  }
222  }
double getQ() const
Get quality.
double getToA() const
Get calibrated time of arrival.

Member Data Documentation

const double JACOUSTICS::JTransmission::equals::precision
inherited

Definition at line 177 of file JTransmission.hh.


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