mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
Timespec comparisons

Comparison of timespec structures

Functions

bool mx::sys::tscomp::operator< (timespec const &tsL, timespec const &tsR)
 Timespec comparison operator < (see caveats) More...
 
bool mx::sys::tscomp::operator> (timespec const &tsL, timespec const &tsR)
 Timespec comparison operator > (see caveats) More...
 
bool mx::sys::tscomp::operator== (timespec const &tsL, timespec const &tsR)
 Timespec comparison operator == (see caveats) More...
 
bool mx::sys::tscomp::operator<= (timespec const &tsL, timespec const &tsR)
 Timespec comparison operator <= (see caveats) More...
 
bool mx::sys::tscomp::operator>= (timespec const &tsL, timespec const &tsR)
 Timespec comparison operator >= (see caveats) More...
 

Function Documentation

◆ operator<()

bool mx::sys::tscomp::operator< ( timespec const &  tsL,
timespec const &  tsR 
)

Timespec comparison operator < (see caveats)

Caveats:

  • If the inputs are in UTC (or similar scale) this does not account for leap seconds
  • Assumes that the tv_nsec field does not exceed 999999999 nanoseconds
Returns
true if tsL is earlier than tsR
false otherwise
Parameters
[in]tsLthe left hand side of the comparison
[in]tsRthe right hand side of the comparison

Definition at line 306 of file timeUtils.cpp.

◆ operator<=()

bool mx::sys::tscomp::operator<= ( timespec const &  tsL,
timespec const &  tsR 
)

Timespec comparison operator <= (see caveats)

Caveats:

  • If the inputs are in UTC (or similar scale) this does not account for leap seconds
  • Assumes that the tv_nsec field does not exceed 999999999 nanoseconds.
Returns
true if tsL is earlier than or exactly equal to tsR
false otherwise
Parameters
[in]tsLthe left hand side of the comparison
[in]tsRthe right hand side of the comparison

Definition at line 327 of file timeUtils.cpp.

◆ operator==()

bool mx::sys::tscomp::operator== ( timespec const &  tsL,
timespec const &  tsR 
)

Timespec comparison operator == (see caveats)

Caveats:

  • If the inputs are in UTC (or similar scale) this does not account for leap seconds
  • Assumes that the tv_nsec field does not exceed 999999999 nanoseconds
Returns
true if tsL is exactly the same as tsR
false otherwise
Parameters
[in]tsLthe left hand side of the comparison
[in]tsRthe right hand side of the comparison

Definition at line 320 of file timeUtils.cpp.

◆ operator>()

bool mx::sys::tscomp::operator> ( timespec const &  tsL,
timespec const &  tsR 
)

Timespec comparison operator > (see caveats)

Caveats:

  • If the inputs are in UTC (or similar scale) this does not account for leap seconds
  • Assumes that the tv_nsec field does not exceed 999999999 nanoseconds
Returns
true if tsL is later than tsR
false otherwise
Parameters
[in]tsLthe left hand side of the comparison
[in]tsRthe right hand side of the comparison

Definition at line 313 of file timeUtils.cpp.

◆ operator>=()

bool mx::sys::tscomp::operator>= ( timespec const &  tsL,
timespec const &  tsR 
)

Timespec comparison operator >= (see caveats)

Caveats:

  • If the inputs are in UTC (or similar scale) this does not account for leap seconds
  • Assumes that the tv_nsec field does not exceed 999999999 nanoseconds
Returns
true if tsL is exactly equal to or is later than tsR
false otherwise
Parameters
[in]tsLthe left hand side of the comparison
[in]tsRthe right hand side of the comparison

Definition at line 334 of file timeUtils.cpp.