#include <CommonTime.hpp>
Collaboration 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 57 of file CommonTime.hpp.
Public Member Functions | |
| CommonTime (long day=0, long sod=0, double fsod=0.0) throw ( gpstk::InvalidParameter ) | |
| Default Constructor. | |
| CommonTime (long day, double sod) throw ( gpstk::InvalidParameter ) | |
| Constructor that accepts days and second of day. | |
| CommonTime (double day) throw ( gpstk::InvalidParameter ) | |
| Constructor that accepts days only. | |
| 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) throw ( gpstk::InvalidParameter ) |
| Set method that accepts values for day, seconds of day and fractional seconds of day. | |
| CommonTime & | set (long day, double sod=0.0) throw ( gpstk::InvalidParameter ) |
| Set method that accepts values for day and seconds of day. | |
| CommonTime & | set (double day) throw ( gpstk::InvalidParameter ) |
| Set method that accepts a value for day. | |
| CommonTime & | setInternal (long day=0, long msod=0, double fsod=0.0) throw ( gpstk::InvalidParameter ) |
| Set internal values method. | |
| void | get (long &day, long &sod, double &fsod) const throw () |
| Get method. | |
| 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) 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) 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 ). | |
| double | operator- (const CommonTime &right) const throw () |
| Difference two Common Time objects. | |
| CommonTime | operator+ (double seconds) const throw ( InvalidRequest ) |
| Add seconds to a copy of this CommonTime. | |
| CommonTime | operator- (double seconds) const throw ( InvalidRequest ) |
| Subtract seconds from a copy of this CommonTime. | |
| CommonTime & | operator+= (double seconds) throw ( InvalidRequest ) |
| Add seconds to this CommonTime. | |
| CommonTime & | operator-= (double seconds) throw ( InvalidRequest ) |
| Subtract seconds from this CommonTime. | |
| CommonTime & | addSeconds (double seconds) throw ( InvalidRequest ) |
| Add seconds to this CommonTime object. | |
| CommonTime & | addDays (long days) throw ( InvalidRequest ) |
| Add integer days to this CommonTime object. | |
| CommonTime & | addSeconds (long seconds) throw ( InvalidRequest ) |
| Add integer seconds to this CommonTime object. | |
| CommonTime & | addMilliseconds (long ms) throw ( InvalidRequest ) |
| 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 () |
| bool | operator> (const CommonTime &right) const throw () |
| bool | operator<= (const CommonTime &right) const throw () |
| bool | operator>= (const CommonTime &right) const throw () |
| void | reset () throw () |
| std::string | asString () const throw () |
Static Public Attributes | |
| const long | BEGIN_LIMIT_JDAY = 0 |
| 'julian day' of earliest epoch expressible by CommonTime: 1/1/4713 B.C. | |
| const long | END_LIMIT_JDAY = 3442448 |
| '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 | |
Protected Member Functions | |
| bool | add (long days, long msod, double fsod) throw () |
| protected functions | |
| bool | normalize () throw () |
| Normalize the values. | |
Protected Attributes | |
| long | m_day |
| long | m_msod |
| double | m_fsod |
|
||||||||||||||||
|
protected functions
Definition at line 352 of file CommonTime.cpp. References gpstk::normalize(). |
|
|
Definition at line 339 of file CommonTime.cpp. References CommonTime::m_day, and CommonTime::m_msod. Referenced by gpstk::operator<<(). |
|
|
Normalize the values. This takes out of bounds values and rolls other values appropriately.
Definition at line 363 of file CommonTime.cpp. References ABS, CommonTime::m_day, CommonTime::m_fsod, and CommonTime::m_msod. |
|
|
Definition at line 325 of file CommonTime.hpp. |
|
|
Definition at line 352 of file CommonTime.hpp. Referenced by CommonTime::asString(), and CommonTime::normalize(). |
|
|
Definition at line 354 of file CommonTime.hpp. Referenced by CommonTime::normalize(). |
|
|
Definition at line 353 of file CommonTime.hpp. Referenced by CommonTime::asString(), and CommonTime::normalize(). |
1.3.9.1