Jpp test-rotations-old
the software that should make you happy
Loading...
Searching...
No Matches
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.
 
bool operator() (const JTransmission &first, const JTransmission &second) const
 Compare two transmissions.
 

Public Attributes

const double precision
 

Detailed Description

Auxiliary class to compare transmissions.

Definition at line 228 of file JTransmission.hh.

Constructor & Destructor Documentation

◆ compare()

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

Constructor.

Parameters
precisiontime-of-arrival precision [s]

Definition at line 236 of file JTransmission.hh.

236 :
238 {}
equals(const double precision)
Constructor.

Member Function Documentation

◆ operator()()

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 253 of file JTransmission.hh.

254 {
255 if (static_cast<const equals&>(*this)(first, second)) {
256
257 if (first.getQ() == second.getQ())
258 return first.getToA() < second.getToA();
259 else
260 return first.getQ() > second.getQ();
261
262 } else {
263
264 return first.getToA() < second.getToA();
265 }
266 }

Member Data Documentation

◆ precision

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

Definition at line 221 of file JTransmission.hh.


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