#include <CommonTime.hpp>
Inheritance diagram for CommonTime:


This allows the decoupling of inter-format conversions.
The interface is based on three quantites: days, seconds of day, and fractional seconds of day. The internal representation, however, is slightly different. It consists of a day, milliseconds of day, and fractional seconds of day. Their valid ranges are shown below:
Quantity >= < -------- --- --- day 0 2^31 msod 0 86400000 fsod 0 0.001
The above is somewhat difficult to grasp at first, but the reason for keeping the fractional part of time in units of seconds is due to the fact that the time formats usually break at seconds and partial seconds not at milliseconds and partial milliseconds. By keeping the value in seconds, we save ourselves additional work and loss of precision through conversion of fractional seconds to fractional milliseconds.
Definition at line 71 of file CommonTime.hpp.
Public Member Functions | |
| CommonTime (TimeSystem timeSystem=TimeSystem::Unknown) throw ( InvalidParameter ) | |
| Default Constructor. | |
| CommonTime (const CommonTime &right) throw () | |
| Copy Constructor. | |
| CommonTime & | operator= (const CommonTime &right) throw () |
| Assignment Operator. | |
| virtual | ~CommonTime () throw () |
| Destructor. | |
| CommonTime & | set (long day, long sod, double fsod=0.0, TimeSystem timeSystem=TimeSystem::Unknown) throw ( InvalidParameter ) |
| Set method that accepts values for day, seconds of day and fractional seconds of day. | |
| CommonTime & | set (long day, double sod=0.0, TimeSystem timeSystem=TimeSystem::Unknown) throw ( InvalidParameter ) |
| Set method that accepts values for day and seconds of day. | |
| CommonTime & | set (double day, TimeSystem timeSys=TimeSystem::Unknown) throw ( InvalidParameter ) |
| Set method that accepts a value for day. | |
| CommonTime & | setInternal (long day=0, long msod=0, double fsod=0.0, TimeSystem timeSys=TimeSystem::Unknown) throw ( InvalidParameter ) |
| Set internal values method. | |
| void | setTimeSystem (const TimeSystem &timeSystem) throw () |
| Set method for internal variable m_timeSystem. | |
| void | get (long &day, long &sod, double &fsod, TimeSystem &timeSystem) const throw () |
| Get method. | |
| void | get (long &day, long &sod, double &fsod) const throw () |
| Get method. | |
| void | get (long &day, double &sod, TimeSystem &timeSystem) const throw () |
| Get method through which one may obtain values for day and second of day which includes the fractional second of day, plus the time frame. | |
| void | get (long &day, double &sod) const throw () |
| Get method through which one may obtain values for day and second of day which includes the fractional second of day. | |
| void | get (double &day, TimeSystem &timeSystem) const throw () |
| Get method through which one may obtain a value for day which includes the fraction of a day, plus the time frame. | |
| void | get (double &day) const throw () |
| Get method through which one may obtain a value for day which includes the fraction of a day. | |
| void | getInternal (long &day, long &msod, double &fsod, TimeSystem &timeSystem) const throw () |
| Get internal values method. | |
| void | getInternal (long &day, long &msod, double &fsod) const throw () |
| Get internal values method. | |
| double | getDays () const throw () |
| Obtain the time, in days, including the fraction of a day. | |
| double | getSecondOfDay () const throw () |
| Obtain the seconds of day (ignoring the day). | |
| TimeSystem | getTimeSystem () const throw () |
| Obtain time system info (enum). | |
| double | operator- (const CommonTime &right) const throw ( InvalidRequest ) |
| Difference two Common Time objects. | |
| CommonTime | operator+ (double seconds) const throw () |
| Add seconds to a copy of this CommonTime. | |
| CommonTime | operator- (double seconds) const throw () |
| Subtract seconds from a copy of this CommonTime. | |
| CommonTime & | operator+= (double seconds) throw () |
| Add seconds to this CommonTime. | |
| CommonTime & | operator-= (double seconds) throw () |
| Subtract seconds from this CommonTime. | |
| CommonTime & | addSeconds (double seconds) throw () |
| Add seconds to this CommonTime object. | |
| CommonTime & | addDays (long days) throw () |
| Add integer days to this CommonTime object. | |
| CommonTime & | addSeconds (long seconds) throw () |
| Add integer seconds to this CommonTime object. | |
| CommonTime & | addMilliseconds (long ms) throw () |
| Add integer milliseconds to this CommonTime object. | |
| bool | operator== (const CommonTime &right) const throw () |
| bool | operator!= (const CommonTime &right) const throw () |
| bool | operator< (const CommonTime &right) const throw ( InvalidRequest ) |
| bool | operator> (const CommonTime &right) const throw ( InvalidRequest ) |
| bool | operator<= (const CommonTime &right) const throw ( InvalidRequest ) |
| bool | operator>= (const CommonTime &right) const throw ( InvalidRequest ) |
| void | reset () throw () |
| std::string | asString () const throw () |
Static Public Attributes | |
| const long | BEGIN_LIMIT_JDAY = 0L |
| 'julian day' of earliest epoch expressible by CommonTime: 1/1/4713 B.C. | |
| const long | END_LIMIT_JDAY = 3442448L |
| 'julian day' of latest epoch expressible by CommonTime: 1/1/4713 A.D. | |
| const CommonTime | BEGINNING_OF_TIME |
| earliest representable CommonTime | |
| const CommonTime | END_OF_TIME |
| latest representable CommonTime | |
| const double | eps = 4.*std::numeric_limits<double>::epsilon() |
| Default tolerance for time equality, applied to milliseconds. | |
Protected Member Functions | |
| CommonTime (long day, long sod, double fsod, TimeSystem timeSystem=TimeSystem::Unknown) throw ( InvalidParameter ) | |
| bool | add (long days, long msod, double fsod) throw () |
| protected functions | |
| bool | normalize () throw () |
| Normalize the values. | |
Protected Attributes | |
| long | m_day |
| days (as a Julian Day) 0 <= val < 2^31 | |
| long | m_msod |
| milliseconds-of-day 0 <= val < 86400000 | |
| double | m_fsod |
| fractional seconds-of-day 0 <= val < 0.001 | |
| TimeSystem | m_timeSystem |
| time frame (system representation) of the data | |
|
||||||||||||||||||||
|
Definition at line 389 of file CommonTime.hpp. |
|
||||||||||||||||
|
protected functions
Definition at line 440 of file CommonTime.cpp. References gpstk::normalize(). |
|
|
Definition at line 426 of file CommonTime.cpp. References TimeSystem::asString(), CommonTime::m_day, CommonTime::m_fsod, CommonTime::m_msod, and CommonTime::m_timeSystem. Referenced by gpstk::operator<<(), and Rinex3ClockHeader::ParseHeaderRecord(). |
|
|
Normalize the values. This takes out of bounds values and rolls other values appropriately.
Definition at line 452 of file CommonTime.cpp. References ABS, CommonTime::m_day, CommonTime::m_fsod, CommonTime::m_msod, and gpstk::SEC_PER_MS. |
|
|
Definition at line 380 of file CommonTime.hpp. |
|
|
days (as a Julian Day) 0 <= val < 2^31
Definition at line 414 of file CommonTime.hpp. Referenced by CommonTime::asString(), and CommonTime::normalize(). |
|
|
fractional seconds-of-day 0 <= val < 0.001
Definition at line 416 of file CommonTime.hpp. Referenced by CommonTime::asString(), and CommonTime::normalize(). |
|
|
milliseconds-of-day 0 <= val < 86400000
Definition at line 415 of file CommonTime.hpp. Referenced by CommonTime::asString(), and CommonTime::normalize(). |
|
|
time frame (system representation) of the data
Definition at line 418 of file CommonTime.hpp. Referenced by CommonTime::asString(). |
1.3.9.1