This class encapsulates the "ANSITime (seconds since Unix epoch)" time representation.
Definition at line 56 of file ANSITime.hpp.
#include <ANSITime.hpp>
Public Member Functions | |
ANSITime Basic Operations | |
ANSITime (time_t t=0, const TimeSystem &ts=TimeSystem::Unknown) | |
ANSITime (const ANSITime &right) | |
ANSITime (const TimeTag &right) | |
ANSITime (const CommonTime &right) | |
ANSITime & | operator= (const ANSITime &right) |
virtual | ~ANSITime () noexcept |
Virtual Destructor. More... | |
virtual CommonTime | convertToCommonTime () const |
virtual void | convertFromCommonTime (const CommonTime &ct) |
virtual std::string | printf (const std::string &fmt) const |
virtual std::string | printError (const std::string &fmt) const |
virtual bool | setFromInfo (const IdToValue &info) |
virtual std::string | getPrintChars () const |
virtual std::string | getDefaultFormat () const |
Return a string containing the default format to use in printing. More... | |
virtual bool | isValid () const |
Returns true if this object's members are valid, false otherwise. More... | |
virtual void | reset () |
Reset this object to the default state. More... | |
![]() | |
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... | |
ANSITime Comparison Operators | |
All comparison operators have a parameter "right" which corresponds to the ANSITime object to the right of the symbol. All comparison operators are const and return true on success and false on failure. | |
time_t | time |
bool | operator== (const ANSITime &right) const |
bool | operator!= (const ANSITime &right) const |
bool | operator< (const ANSITime &right) const |
bool | operator> (const ANSITime &right) const |
bool | operator<= (const ANSITime &right) const |
bool | operator>= (const ANSITime &right) const |
Additional Inherited Members | |
![]() | |
typedef std::map< char, std::string > | IdToValue |
![]() | |
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) |
![]() | |
TimeSystem | timeSystem |
time system (representation) of the data More... | |
|
inline |
Default Constructor. All elements are initialized to zero.
Definition at line 68 of file ANSITime.hpp.
Copy Constructor.
right | a reference to the ANSITime object to copy |
Definition at line 77 of file ANSITime.hpp.
Alternate Copy Constructor. Takes a const TimeTag reference and copies its contents via conversion to CommonTime.
right | a const reference to the BasicTime object to copy |
InvalidRequest | on over-/under-flow |
Definition at line 88 of file ANSITime.hpp.
|
inline |
Alternate Copy Constructor. Takes a const CommonTime reference and copies its contents via the convertFromCommonTime method.
right | a const reference to the CommonTime object to copy |
InvalidRequest | on over-/under-flow |
Definition at line 100 of file ANSITime.hpp.
|
inlinevirtualnoexcept |
Virtual Destructor.
Definition at line 113 of file ANSITime.hpp.
|
virtual |
InvalidRequest | if ct cannot be correctly represented in this TimeTag object. |
This is the earliest CommonTime for which ANSITimes are valid, = UNIX_MJD = 40587 = Jan 1 1970
This is the latest CommonTime for which ANSITimes are valid. 2^31 - 1 seconds = Jan 19 2038 3:14:7
Implements gnsstk::TimeTag.
Definition at line 71 of file ANSITime.cpp.
|
virtual |
InvalidRequest | if this TimeTag cannot be correctly represented by a CommonTime object. |
Implements gnsstk::TimeTag.
Definition at line 54 of file ANSITime.cpp.
|
inlinevirtual |
Return a string containing the default format to use in printing.
Implements gnsstk::TimeTag.
Definition at line 147 of file ANSITime.hpp.
|
inlinevirtual |
Return a string containing the characters that this class understands when printing times.
Implements gnsstk::TimeTag.
Definition at line 141 of file ANSITime.hpp.
|
virtual |
Returns true if this object's members are valid, false otherwise.
Implements gnsstk::TimeTag.
Definition at line 157 of file ANSITime.cpp.
Definition at line 190 of file ANSITime.cpp.
Any (wildcard) type exception allowed, otherwise must be same time systems
Definition at line 195 of file ANSITime.cpp.
Definition at line 214 of file ANSITime.cpp.
Assignment Operator.
right | a const reference to the ANSITime to copy |
Definition at line 47 of file ANSITime.cpp.
Any (wildcard) type exception allowed, otherwise must be same time systems
Definition at line 174 of file ANSITime.cpp.
Definition at line 209 of file ANSITime.cpp.
Definition at line 220 of file ANSITime.cpp.
|
virtual |
This function works similarly to printf. Instead of filling the format with data, it fills with error messages.
Implements gnsstk::TimeTag.
Definition at line 113 of file ANSITime.cpp.
|
virtual |
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 94 of file ANSITime.cpp.
|
virtual |
Reset this object to the default state.
Implements gnsstk::TimeTag.
Definition at line 168 of file ANSITime.cpp.
Set this object using the information provided in info.
info | the IdToValue object to which this object shall be set. |
Implements gnsstk::TimeTag.
Definition at line 132 of file ANSITime.cpp.
time_t gnsstk::ANSITime::time |
Definition at line 172 of file ANSITime.hpp.