Public Member Functions | List of all members
gnsstk::GLONASSTime Class Reference

Detailed Description

This class handles the peculiar representation used in GLONASS nav messages.

Note
The methods for printing (getPrintChars, getDefaultFormat, printf, printError, setFromInfo) are as yet unimplemented. In order for these to be implemented, format tokens would need to be added for the GLONASS-specific representation and there is no immediate call for this (99.999% of the time the time will be displayed in civil format), and the unclaimed tokens are few.

Definition at line 59 of file GLONASSTime.hpp.

#include <GLONASSTime.hpp>

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

Public Member Functions

void convertFromCommonTime (const CommonTime &ct) override
 As it says, convert from a CommonTime object. More...
 
CommonTime convertToCommonTime () const override
 As it says, convert to a CommonTime object. More...
 
 GLONASSTime (const CommonTime &right)
 
 GLONASSTime (const GLONASSTime &right)
 
 GLONASSTime (const TimeTag &right)
 
 GLONASSTime (unsigned leapCount=0, unsigned days=0, double instant=0., TimeSystem ts=TimeSystem::GLO)
 
 ~GLONASSTime ()
 Destructor (nothing to do). More...
 
- Public Member Functions inherited from gnsstk::TimeTag
virtual std::string asString () const
 
bool changeTimeSystem (TimeSystem timeSys)
 
bool changeTimeSystem (TimeSystem timeSys, TimeSystemConverter *conv)
 
TimeSystem getTimeSystem () const
 Obtain time system info (enum). More...
 
virtual operator CommonTime () const
 
virtual void scanf (const std::string &str, const std::string &fmt)
 
void setTimeSystem (const TimeSystem &timeSys)
 Set method for internal variable timeSystem (enum). More...
 
 TimeTag ()
 Default constructor. More...
 
 TimeTag (const TimeSystem &ts)
 Constructor. More...
 
virtual ~TimeTag ()
 Virtual Destructor. More...
 

WeekSecond Comparison Operators

All comparison operators have a parameter "right" which corresponds to the GLONASSTime object to the right of the symbol. All comparison operators are const and return true on success and false on failure.

unsigned epoch
 Number of leap years since 1996 (aka N4). More...
 
unsigned day
 
double sod
 Time of day (seconds of day, aka tb). More...
 
bool operator== (const GLONASSTime &right) const
 
bool operator!= (const GLONASSTime &right) const
 
bool operator< (const GLONASSTime &right) const
 
bool operator> (const GLONASSTime &right) const
 
bool operator<= (const GLONASSTime &right) const
 
bool operator>= (const GLONASSTime &right) const
 
std::string getPrintChars () const override
 
std::string getDefaultFormat () const override
 Return a string containing the default format to use in printing. More...
 
std::string printf (const std::string &fmt) const override
 
std::string printError (const std::string &fmt) const override
 
bool setFromInfo (const IdToValue &info)
 
bool isValid () const override
 Returns true if this object's members are valid, false otherwise. More...
 
void reset () override
 Reset this object to the default state. More...
 

Additional Inherited Members

- Public Types inherited from gnsstk::TimeTag
typedef std::map< char, std::string > IdToValue
 
- Static Public Member Functions inherited from gnsstk::TimeTag
static void checkTimeSystem (TimeSystem ts1, TimeSystem ts2)
 
static std::string getError ()
 This returns the default error string for the TimeTag classes. More...
 
static std::string getFormatPrefixFloat ()
 
static std::string getFormatPrefixInt ()
 
static void getInfo (const std::string &str, const std::string &fmt, IdToValue &info)
 
- Protected Attributes inherited from gnsstk::TimeTag
TimeSystem timeSystem
 time system (representation) of the data More...
 

Constructor & Destructor Documentation

◆ GLONASSTime() [1/4]

gnsstk::GLONASSTime::GLONASSTime ( unsigned  leapCount = 0,
unsigned  days = 0,
double  instant = 0.,
TimeSystem  ts = TimeSystem::GLO 
)

Constructor.

Parameters
[in]leapCountThe number of leap years since 1996 (N4).
[in]daysThe number of days since the January 1 of the most recent leap year (NT or NA).
[in]instantThe time of the day (tb).

Definition at line 46 of file GLONASSTime.cpp.

◆ GLONASSTime() [2/4]

gnsstk::GLONASSTime::GLONASSTime ( const GLONASSTime right)
inline

Copy Constructor.

Parameters
[in]rightthe GLONASSTime object to copy

Definition at line 77 of file GLONASSTime.hpp.

◆ GLONASSTime() [3/4]

gnsstk::GLONASSTime::GLONASSTime ( const TimeTag right)
inline

Alternate Copy Constructor. Takes a const TimeTag reference and copies its contents via conversion to CommonTime.

Parameters
[in]rightthe TimeTag-based object to copy
Exceptions
InvalidRequeston over-/under-flow

Definition at line 89 of file GLONASSTime.hpp.

◆ GLONASSTime() [4/4]

gnsstk::GLONASSTime::GLONASSTime ( const CommonTime right)
inline

Alternate Copy Constructor. Takes a const CommonTime reference and copies its contents via the convertFromCommonTime method.

Parameters
[in]rightthe CommonTime object to copy.
Exceptions
InvalidRequeston over-/under-flow

Definition at line 101 of file GLONASSTime.hpp.

◆ ~GLONASSTime()

gnsstk::GLONASSTime::~GLONASSTime ( )
inline

Destructor (nothing to do).

Definition at line 107 of file GLONASSTime.hpp.

Member Function Documentation

◆ convertFromCommonTime()

void gnsstk::GLONASSTime::convertFromCommonTime ( const CommonTime ct)
overridevirtual

As it says, convert from a CommonTime object.

Implements gnsstk::TimeTag.

Definition at line 110 of file GLONASSTime.cpp.

◆ convertToCommonTime()

CommonTime gnsstk::GLONASSTime::convertToCommonTime ( ) const
overridevirtual

As it says, convert to a CommonTime object.

Note
We don't add the C1 or C2 constants because we don't have any way of determining what year it is independently of the spec. This won't matter until 2119 at the earliest though, and I'll be long dead by then.

Implements gnsstk::TimeTag.

Definition at line 59 of file GLONASSTime.cpp.

◆ getDefaultFormat()

std::string gnsstk::GLONASSTime::getDefaultFormat ( ) const
inlineoverridevirtual

Return a string containing the default format to use in printing.

Implements gnsstk::TimeTag.

Definition at line 137 of file GLONASSTime.hpp.

◆ getPrintChars()

std::string gnsstk::GLONASSTime::getPrintChars ( ) const
inlineoverridevirtual

Return a string containing the characters that this class understands when printing times.

Implements gnsstk::TimeTag.

Definition at line 132 of file GLONASSTime.hpp.

◆ isValid()

bool gnsstk::GLONASSTime::isValid ( ) const
overridevirtual

Returns true if this object's members are valid, false otherwise.

Implements gnsstk::TimeTag.

Definition at line 214 of file GLONASSTime.cpp.

◆ operator!=()

bool gnsstk::GLONASSTime::operator!= ( const GLONASSTime right) const

Definition at line 153 of file GLONASSTime.cpp.

◆ operator<()

bool gnsstk::GLONASSTime::operator< ( const GLONASSTime right) const

Definition at line 160 of file GLONASSTime.cpp.

◆ operator<=()

bool gnsstk::GLONASSTime::operator<= ( const GLONASSTime right) const

Definition at line 186 of file GLONASSTime.cpp.

◆ operator==()

bool gnsstk::GLONASSTime::operator== ( const GLONASSTime right) const

Definition at line 143 of file GLONASSTime.cpp.

◆ operator>()

bool gnsstk::GLONASSTime::operator> ( const GLONASSTime right) const

Definition at line 173 of file GLONASSTime.cpp.

◆ operator>=()

bool gnsstk::GLONASSTime::operator>= ( const GLONASSTime right) const

Definition at line 200 of file GLONASSTime.cpp.

◆ printError()

std::string gnsstk::GLONASSTime::printError ( const std::string &  fmt) const
inlineoverridevirtual

This function works similarly to printf. Instead of filling the format with data, it fills with error messages.

Implements gnsstk::TimeTag.

Definition at line 147 of file GLONASSTime.hpp.

◆ printf()

std::string gnsstk::GLONASSTime::printf ( const std::string &  fmt) const
inlineoverridevirtual

This function formats this time to a string. The exceptions thrown would only be due to problems parsing the fmt string.

Implements gnsstk::TimeTag.

Definition at line 142 of file GLONASSTime.hpp.

◆ reset()

void gnsstk::GLONASSTime::reset ( )
overridevirtual

Reset this object to the default state.

Implements gnsstk::TimeTag.

Definition at line 221 of file GLONASSTime.cpp.

◆ setFromInfo()

bool gnsstk::GLONASSTime::setFromInfo ( const IdToValue info)
inlinevirtual

Set this object using the information provided in info.

Parameters
infothe IdToValue object to which this object shall be set.
Returns
true if this object was successfully set using the data in info, false if not.

Implements gnsstk::TimeTag.

Definition at line 154 of file GLONASSTime.hpp.

Member Data Documentation

◆ day

unsigned gnsstk::GLONASSTime::day

Days since Jan 1 of the current epoch (aka NT or NA.

Definition at line 167 of file GLONASSTime.hpp.

◆ epoch

unsigned gnsstk::GLONASSTime::epoch

Number of leap years since 1996 (aka N4).

Definition at line 164 of file GLONASSTime.hpp.

◆ sod

double gnsstk::GLONASSTime::sod

Time of day (seconds of day, aka tb).

Definition at line 169 of file GLONASSTime.hpp.


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


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