This class is an abstract base class inherited by all the classes that provide a specific time representation. These time representations must ensure or provide a way for the user to verify their own self-consistency.
Definition at line 58 of file TimeTag.hpp.
#include <TimeTag.hpp>
Public Types | |
typedef std::map< char, std::string > | IdToValue |
Public Member Functions | |
virtual std::string | asString () const |
bool | changeTimeSystem (TimeSystem timeSys) |
bool | changeTimeSystem (TimeSystem timeSys, TimeSystemConverter *conv) |
virtual void | convertFromCommonTime (const CommonTime &ct)=0 |
virtual CommonTime | convertToCommonTime () const =0 |
virtual std::string | getDefaultFormat () const =0 |
Return a string containing the default format to use in printing. More... | |
virtual std::string | getPrintChars () const =0 |
TimeSystem | getTimeSystem () const |
Obtain time system info (enum). More... | |
virtual bool | isValid () const =0 |
Returns true if this object's members are valid, false otherwise. More... | |
virtual | operator CommonTime () const |
virtual std::string | printError (const std::string &fmt) const =0 |
virtual std::string | printf (const std::string &fmt) const =0 |
virtual void | reset ()=0 |
Reset this object to the default state. More... | |
virtual void | scanf (const std::string &str, const std::string &fmt) |
virtual bool | setFromInfo (const IdToValue &info)=0 |
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... | |
Static Public Member Functions | |
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 | |
TimeSystem | timeSystem |
time system (representation) of the data More... | |
typedef std::map< char, std::string> gnsstk::TimeTag::IdToValue |
This type maps a character ( from a time format ) to its corresponding value ( from a time string ).
Definition at line 103 of file TimeTag.hpp.
|
inline |
Default constructor.
Definition at line 63 of file TimeTag.hpp.
|
inline |
Constructor.
Definition at line 67 of file TimeTag.hpp.
|
inlinevirtual |
Virtual Destructor.
Definition at line 71 of file TimeTag.hpp.
|
inlinevirtual |
Format this time as a string using a format specified by the inheriting class.
Definition at line 142 of file TimeTag.hpp.
bool gnsstk::TimeTag::changeTimeSystem | ( | TimeSystem | timeSys | ) |
Modify both the time value and time system to reflect a change in time system.
[in] | timeSystem | The time system to convert this time to. |
Definition at line 194 of file TimeTag.cpp.
bool gnsstk::TimeTag::changeTimeSystem | ( | TimeSystem | timeSys, |
TimeSystemConverter * | conv | ||
) |
Modify both the time value and time system to reflect a change in time system.
[in] | timeSystem | The time system to convert this time to. |
[in,out] | conv | The converter object to use to get the offset between the current time system and the requested time system. |
Definition at line 181 of file TimeTag.cpp.
|
static |
Check to see if two time systems are comparable (including "Any" handling).
[in] | ts1 | The first time system. |
[in] | ts2 | The second time system. |
InvalidRequest | if neither ts1 or ts2 are "Any" and they are not equal. |
Definition at line 207 of file TimeTag.cpp.
|
pure virtual |
InvalidRequest | if ct cannot be correctly represented in this TimeTag object. |
Implemented in gnsstk::GLONASSTime, gnsstk::JulianDate, gnsstk::UnixTime, gnsstk::PosixTime, gnsstk::YDSTime, gnsstk::CivilTime, gnsstk::WeekSecond, gnsstk::GPSWeekZcount, gnsstk::ANSITime, and gnsstk::MJD.
|
pure virtual |
InvalidRequest | if this TimeTag cannot be correctly represented by a CommonTime object. |
Implemented in gnsstk::GLONASSTime, gnsstk::JulianDate, gnsstk::UnixTime, gnsstk::PosixTime, gnsstk::YDSTime, gnsstk::CivilTime, gnsstk::WeekSecond, gnsstk::GPSWeekZcount, gnsstk::ANSITime, and gnsstk::MJD.
|
pure virtual |
Return a string containing the default format to use in printing.
Implemented in gnsstk::GLONASSTime, gnsstk::GPSWeek, gnsstk::Week, gnsstk::JulianDate, gnsstk::UnixTime, gnsstk::PosixTime, gnsstk::YDSTime, gnsstk::CivilTime, gnsstk::GPSWeekZcount, gnsstk::ANSITime, gnsstk::MJD, gnsstk::GPSWeekSecond, gnsstk::BDSWeekSecond, gnsstk::IRNWeekSecond, gnsstk::QZSWeekSecond, and gnsstk::GALWeekSecond.
|
inlinestatic |
This returns the default error string for the TimeTag classes.
Definition at line 161 of file TimeTag.hpp.
|
inlinestatic |
This returns the regular expression prefix that is used when searching for float specifiers.
Definition at line 157 of file TimeTag.hpp.
|
inlinestatic |
This returns the regular expression prefix that is used when searching for integer specifiers.
Definition at line 152 of file TimeTag.hpp.
|
static |
This is the workhorse for the scanf family of functions. It parses the given string str with the given format fmt in order to extract a time or part of a time from str.
str | the string from which to cull time information |
fmt | the string containing the time format |
info | a mapping of all of the character identifier to their respective culled time information |
StringException | on problems parsing the strings. |
Definition at line 66 of file TimeTag.cpp.
|
pure virtual |
Return a string containing the characters that this class understands when printing times.
Implemented in gnsstk::GLONASSTime, gnsstk::GPSWeek, gnsstk::Week, gnsstk::JulianDate, gnsstk::UnixTime, gnsstk::PosixTime, gnsstk::YDSTime, gnsstk::CivilTime, gnsstk::GPSWeekZcount, gnsstk::ANSITime, gnsstk::MJD, gnsstk::GPSWeekSecond, gnsstk::BDSWeekSecond, gnsstk::IRNWeekSecond, gnsstk::QZSWeekSecond, and gnsstk::GALWeekSecond.
|
inline |
Obtain time system info (enum).
Definition at line 169 of file TimeTag.hpp.
|
pure virtual |
Returns true if this object's members are valid, false otherwise.
Implemented in gnsstk::GLONASSTime, gnsstk::GPSWeek, gnsstk::Week, gnsstk::JulianDate, gnsstk::UnixTime, gnsstk::PosixTime, gnsstk::YDSTime, gnsstk::CivilTime, gnsstk::GPSWeekZcount, gnsstk::ANSITime, gnsstk::MJD, and gnsstk::WeekSecond.
|
inlinevirtual |
Hey, it's an implicit casting operator! Basically just a lazy way to get at convertToCommonTime().
Definition at line 147 of file TimeTag.hpp.
|
pure virtual |
This function works similarly to printf. Instead of filling the format with data, it fills with error messages.
Implemented in gnsstk::GLONASSTime, gnsstk::GPSWeek, gnsstk::GPSWeekSecond, gnsstk::JulianDate, gnsstk::UnixTime, gnsstk::PosixTime, gnsstk::BDSWeekSecond, gnsstk::IRNWeekSecond, gnsstk::YDSTime, gnsstk::QZSWeekSecond, gnsstk::CivilTime, gnsstk::GALWeekSecond, gnsstk::GPSWeekZcount, gnsstk::ANSITime, and gnsstk::MJD.
|
pure virtual |
This function formats this time to a string. The exceptions thrown would only be due to problems parsing the fmt string.
Implemented in gnsstk::GLONASSTime, gnsstk::GPSWeek, gnsstk::JulianDate, gnsstk::GPSWeekSecond, gnsstk::UnixTime, gnsstk::PosixTime, gnsstk::YDSTime, gnsstk::CivilTime, gnsstk::GPSWeekZcount, gnsstk::ANSITime, gnsstk::MJD, gnsstk::BDSWeekSecond, gnsstk::IRNWeekSecond, gnsstk::QZSWeekSecond, and gnsstk::GALWeekSecond.
|
pure virtual |
Reset this object to the default state.
Implemented in gnsstk::GLONASSTime, gnsstk::GPSWeek, gnsstk::Week, gnsstk::JulianDate, gnsstk::UnixTime, gnsstk::PosixTime, gnsstk::YDSTime, gnsstk::CivilTime, gnsstk::GPSWeekZcount, gnsstk::ANSITime, gnsstk::MJD, and gnsstk::WeekSecond.
This function sets this object to the time stored in the given string str.
str | the string to parse |
fmt | the string containing the time format |
InvalidRequest | if an invalid time is given. |
StringException | on problems parsing the strings. |
Definition at line 44 of file TimeTag.cpp.
Set this object using the information provided in info.
info | the IdToValue object to which this object shall be set. |
Implemented in gnsstk::GPSWeek, gnsstk::GPSWeekSecond, gnsstk::BDSWeekSecond, gnsstk::IRNWeekSecond, gnsstk::GALWeekSecond, gnsstk::QZSWeekSecond, gnsstk::JulianDate, gnsstk::UnixTime, gnsstk::GLONASSTime, gnsstk::PosixTime, gnsstk::YDSTime, gnsstk::CivilTime, gnsstk::GPSWeekZcount, gnsstk::ANSITime, and gnsstk::MJD.
|
inline |
Set method for internal variable timeSystem (enum).
Definition at line 165 of file TimeTag.hpp.
|
protected |
time system (representation) of the data
Definition at line 204 of file TimeTag.hpp.