This class encapsulates the representation of time consisting of year, month, day (of month), hour (of day), minute (of hour), and second (of minute).
Definition at line 55 of file CivilTime.hpp.
#include <CivilTime.hpp>
CivilTime Basic Operations | |
static const char * | MonthNames [] |
Long month names for converstion from numbers to strings. More... | |
static const char * | MonthAbbrevNames [] |
Short month names for converstion from numbers to strings. More... | |
CivilTime (int yr=0, int mo=0, int dy=0, int hr=0, int mn=0, double s=0.0, const TimeSystem &ts=TimeSystem::Unknown) | |
CivilTime (const CivilTime &right) | |
CivilTime (const TimeTag &right) | |
CivilTime (const CommonTime &right) | |
CivilTime & | operator= (const CivilTime &right) |
virtual | ~CivilTime () |
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... | |
static int | monthAbbrev (const std::string &amonStr) |
static int | monthLong (const std::string &monStr) |
CivilTime Comparison Operators | |
All comparison operators have a parameter "right" which corresponds to the CivilTime object to the right of the symbol. All comparison operators are const and return true on success and false on failure. | |
int | year |
int | month |
int | day |
int | hour |
int | minute |
double | second |
bool | operator== (const CivilTime &right) const |
bool | operator!= (const CivilTime &right) const |
bool | operator< (const CivilTime &right) const |
bool | operator> (const CivilTime &right) const |
bool | operator<= (const CivilTime &right) const |
bool | operator>= (const CivilTime &right) const |
double | getUTHour () const |
Get the "universal time"-esque fractional hour of day. More... | |
Additional Inherited Members | |
![]() | |
typedef std::map< char, std::string > | IdToValue |
![]() | |
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... | |
![]() | |
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 default to zero.
Definition at line 67 of file CivilTime.hpp.
Copy Constructor.
right | a const reference to the CivilTime object to copy |
Definition at line 81 of file CivilTime.hpp.
Alternate Copy Constructor. Takes a const TimeTag reference and copies its contents via conversion to CommonTime.
right | a const reference to the TimeTag-based object to copy |
InvalidRequest | on over-/under-flow |
Definition at line 93 of file CivilTime.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 105 of file CivilTime.hpp.
|
inlinevirtual |
Virtual Destructor.
Definition at line 118 of file CivilTime.hpp.
|
virtual |
InvalidRequest | if ct cannot be correctly represented in this TimeTag object. |
Implements gnsstk::TimeTag.
Definition at line 97 of file CivilTime.cpp.
|
virtual |
InvalidRequest | if this TimeTag cannot be correctly represented by a CommonTime object. |
Implements gnsstk::TimeTag.
Definition at line 75 of file CivilTime.cpp.
|
inlinevirtual |
Return a string containing the default format to use in printing.
Implements gnsstk::TimeTag.
Definition at line 157 of file CivilTime.hpp.
|
inlinevirtual |
Return a string containing the characters that this class understands when printing times.
Implements gnsstk::TimeTag.
Definition at line 151 of file CivilTime.hpp.
|
inline |
Get the "universal time"-esque fractional hour of day.
Definition at line 195 of file CivilTime.hpp.
|
virtual |
Returns true if this object's members are valid, false otherwise.
Implements gnsstk::TimeTag.
Definition at line 262 of file CivilTime.cpp.
|
static |
Translate a month abbreviation to its integer equivalent. Comparisons are case-insensitive.
amonStr | the abbreviated month name. |
Definition at line 282 of file CivilTime.cpp.
|
static |
Translate a month name to its integer equivalent. Comparisons are case-insensitive.
monStr | the month name. |
Definition at line 293 of file CivilTime.cpp.
Definition at line 324 of file CivilTime.cpp.
Any (wildcard) type exception allowed, otherwise must be same time systems
Definition at line 329 of file CivilTime.cpp.
Definition at line 393 of file CivilTime.cpp.
Assignment Operator.
right | a const reference to the CivilTime object to copy |
Definition at line 63 of file CivilTime.cpp.
Any (wildcard) type exception allowed, otherwise must be same time systems
Definition at line 304 of file CivilTime.cpp.
Definition at line 388 of file CivilTime.cpp.
Definition at line 398 of file CivilTime.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 148 of file CivilTime.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 111 of file CivilTime.cpp.
|
virtual |
Reset this object to the default state.
Implements gnsstk::TimeTag.
Definition at line 273 of file CivilTime.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 185 of file CivilTime.cpp.
int gnsstk::CivilTime::day |
Definition at line 200 of file CivilTime.hpp.
int gnsstk::CivilTime::hour |
Definition at line 201 of file CivilTime.hpp.
int gnsstk::CivilTime::minute |
Definition at line 202 of file CivilTime.hpp.
int gnsstk::CivilTime::month |
Definition at line 199 of file CivilTime.hpp.
|
static |
Short month names for converstion from numbers to strings.
Definition at line 126 of file CivilTime.hpp.
|
static |
Long month names for converstion from numbers to strings.
Definition at line 123 of file CivilTime.hpp.
double gnsstk::CivilTime::second |
Definition at line 203 of file CivilTime.hpp.
int gnsstk::CivilTime::year |
Definition at line 198 of file CivilTime.hpp.