Define a class for doing time system conversions using only a hard-coded table of second-resolution offsets from TAI.
Definition at line 51 of file BasicTimeSystemConverter.hpp.
#include <BasicTimeSystemConverter.hpp>
Public Member Functions | |
bool | explore (TimeSystem fromSys, TimeSystem toSys, const CommonTime &fromTime, const CommonTime &toTime) |
bool | getOffset (TimeSystem fromSys, TimeSystem toSys, const CommonTime &t, double &offs) override |
Protected Attributes | |
TimeSystem | fromSystem |
Time system being converted from using toffs. More... | |
CommonTime | fromTimeStamp |
First time that toffs is known to be valid. More... | |
double | toffs |
Stored offset for time system conversion. More... | |
TimeSystem | toSystem |
Time system being converted to using toffs. More... | |
CommonTime | toTimeStamp |
Final time that toffs is known to be valid. More... | |
bool gnsstk::BasicTimeSystemConverter::explore | ( | TimeSystem | fromSys, |
TimeSystem | toSys, | ||
const CommonTime & | fromTime, | ||
const CommonTime & | toTime | ||
) |
Attempt to "prime" internal data over a desired time range so that when doing a large number of conversions over a time range, if the offset is the same across that time range, we don't do a conversion every single call. If the offset at fromTime is the same as at toTime, any calls to getOffset after calling explore will use the internally stored offset as opposed to attempting to do conversions. This is a performance enhancement and is not strictly necessary.
[in] | fromSys | The time system to convert from. |
[in] | toSys | The time system to convert to. |
[in] | fromTime | The start of the time range of interest. |
[in] | toTime | The end of the time range of interest. |
Definition at line 78 of file BasicTimeSystemConverter.cpp.
|
overridevirtual |
Get the offset in seconds between fromSys and toSys.
[in] | fromSys | The time system to convert from. |
[in] | toSys | The time system to convert to. |
[in] | t | The time at which the offset is being requested (i.e. the time being converted). |
[out] | offs | The resulting offset, if available. |
Implements gnsstk::TimeSystemConverter.
Definition at line 45 of file BasicTimeSystemConverter.cpp.
|
protected |
Time system being converted from using toffs.
Definition at line 84 of file BasicTimeSystemConverter.hpp.
|
protected |
First time that toffs is known to be valid.
Definition at line 88 of file BasicTimeSystemConverter.hpp.
|
protected |
Stored offset for time system conversion.
Definition at line 92 of file BasicTimeSystemConverter.hpp.
|
protected |
Time system being converted to using toffs.
Definition at line 86 of file BasicTimeSystemConverter.hpp.
|
protected |
Final time that toffs is known to be valid.
Definition at line 90 of file BasicTimeSystemConverter.hpp.