Public Member Functions | Protected Attributes | List of all members
gnsstk::BasicTimeSystemConverter Class Reference

Detailed Description

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>

Inheritance diagram for gnsstk::BasicTimeSystemConverter:
Inheritance graph
[legend]

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

Member Function Documentation

◆ explore()

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.

Parameters
[in]fromSysThe time system to convert from.
[in]toSysThe time system to convert to.
[in]fromTimeThe start of the time range of interest.
[in]toTimeThe end of the time range of interest.
Returns
false if unable to determine the offset.

Definition at line 78 of file BasicTimeSystemConverter.cpp.

◆ getOffset()

bool gnsstk::BasicTimeSystemConverter::getOffset ( TimeSystem  fromSys,
TimeSystem  toSys,
const CommonTime t,
double &  offs 
)
overridevirtual

Get the offset in seconds between fromSys and toSys.

Parameters
[in]fromSysThe time system to convert from.
[in]toSysThe time system to convert to.
[in]tThe time at which the offset is being requested (i.e. the time being converted).
[out]offsThe resulting offset, if available.
Returns
true if successful, false if unavailable.

Implements gnsstk::TimeSystemConverter.

Definition at line 45 of file BasicTimeSystemConverter.cpp.

Member Data Documentation

◆ fromSystem

TimeSystem gnsstk::BasicTimeSystemConverter::fromSystem
protected

Time system being converted from using toffs.

Definition at line 84 of file BasicTimeSystemConverter.hpp.

◆ fromTimeStamp

CommonTime gnsstk::BasicTimeSystemConverter::fromTimeStamp
protected

First time that toffs is known to be valid.

Definition at line 88 of file BasicTimeSystemConverter.hpp.

◆ toffs

double gnsstk::BasicTimeSystemConverter::toffs
protected

Stored offset for time system conversion.

Definition at line 92 of file BasicTimeSystemConverter.hpp.

◆ toSystem

TimeSystem gnsstk::BasicTimeSystemConverter::toSystem
protected

Time system being converted to using toffs.

Definition at line 86 of file BasicTimeSystemConverter.hpp.

◆ toTimeStamp

CommonTime gnsstk::BasicTimeSystemConverter::toTimeStamp
protected

Final time that toffs is known to be valid.

Definition at line 90 of file BasicTimeSystemConverter.hpp.


The documentation for this class was generated from the following files:


gnsstk
Author(s):
autogenerated on Wed Oct 25 2023 02:40:44