#include <Time.h>
ssfTime is used to encapsulate a representation of time and provide the functionality for converting between different time representations (ie Mean Solar, Sidereal, Julian Date, etc.) The ssfTime object includes both a stored time, as well as an epoch that the time can be measured from.
ssfTime simTime; ssfSeconds integrationTime = 10; simTime.Set(integrationTime); ssfTime nowTime(Now());
Definition at line 61 of file Time.h.
Public Member Functions | |
ssfTime () | |
Default constructor. Initializes the time to 0 seconds. | |
ssfTime (tm _Time) | |
Constructor creates a time object as a copy of a time struct. | |
ssfTime (timeval _Time) | |
Constructor creates a time object as a copy of a timeval struct. | |
ssfTime (ssfSeconds _Time) | |
Constructor creates time object based on number of seconds. | |
ssfTime (int year, int month, int day, int hour, int minute, double seconds) | |
Constructor creates time object based on a calendar date. | |
void | Set (tm _newTime) |
Set the ssfTime object to a specified time struct. | |
void | Set (timeval _Time) |
Set the time object as a copy of a timeval struct. | |
void | Set (ssfSeconds _newTime) |
Set the ssfTime object to a specified time in seconds. | |
void | SetJulianDate (ssfJulianDate _newJD) |
Set the ssfTime object to a specified Julian Date. | |
void | SetEpochJulianDate (ssfJulianDate _newJD) |
Set the Epoch to a specified Julian Date. | |
void | Set (int year, int month, int day, int hour, int minute, double seconds) |
Set the ssfTime object based on a calendar date. | |
void | SetTimeAfterEpoch (ssfSeconds _timeAfter) |
Set the current time after epoch. | |
void | SetEpoch (ssfSeconds _newEpochTime) |
Set the epoch time. | |
void | SetEpoch (tm _newEpochTime) |
Set the epoch time. | |
void | SetEpoch (const timeval &_Time) |
Set the epoch time from a timeval struct. | |
void | SetEpoch (int year, int month, int day, int hour, int minute, double seconds) |
Set the epoch of the ssfTime object based on a calendar date. | |
ssfSeconds | GetSeconds () const |
Return the current time in seconds. | |
tm | GetDateTime () const |
Return a tm struct of the date, time of the stored time. | |
tm | GetEpochDateTime () const |
Return the epoch in a tm struct of the date-time . | |
ssfSeconds | GetEpoch () const |
Return the current Epoch. | |
ssfJulianDate | GetJulianDate () const |
Get the Julian Date of the time object. | |
ssfJulianDate | GetEpochJulianDate () const |
Get the Julian Date of the time object's epoch. | |
Angle | GetGreenwichMeanSiderealTime () const |
Calculate the Greenwich sidereal time of the stored time. | |
Angle | GetEpochGreenwichMeanSiderealTime () const |
Get the Julian Date of the time object's epoch. | |
ssfSeconds | SecondsSinceEpoch () const |
Return the current Epoch Return the time since epoch. | |
ssfTime | operator+ (const int &rhsSeconds) const |
Add specified number of seconds to the current time and return a new object. | |
ssfTime | operator+= (const int &rhsSeconds) |
Add specified number of seconds to the current time. | |
ssfTime | operator+ (const long &rhsSeconds) const |
Add specified number of seconds to the current time and return a new object. | |
ssfTime | operator+= (const long &rhsSeconds) |
Add specified number of seconds to the current time. | |
ssfTime | operator+ (const ssfSeconds &rhsSeconds) const |
Add specified number of seconds to the current time and return a new object. | |
ssfTime | operator+= (const ssfSeconds &rhsSeconds) |
Add specified number of seconds to the current time. | |
ssfSeconds | operator- (const ssfTime &rhs) const |
Subtract two time objects (the stored times). | |
bool | operator> (const ssfTime &rhs) const |
Greater than comparison two time objects (the stored times). | |
bool | operator>= (const ssfTime &rhs) const |
Greater than or equal comparison two time objects (the stored times). | |
bool | operator< (const ssfTime &rhs) const |
Less than comparison two time objects (the stored times). | |
bool | operator<= (const ssfTime &rhs) const |
Less than or equal comparison two time objects (the stored times). | |
bool | operator== (const ssfTime &rhs) const |
Compare the equality of two time objects (the stored times). | |
bool | operator!= (const ssfTime &rhs) const |
Compare the inequality of two time objects (the stored times). | |
Private Attributes | |
ssfSeconds | m_StoredTime |
ssfSeconds | m_EpochTime |
Friends | |
ostream & | operator<< (ostream &s, ssfTime &t) |
output the time in seconds format | |
Related Functions | |
(Note that these are not member functions.) | |
ssfJulianDate | JulianDate (const ssfSeconds &_time) |
Calculates the Julian Date given a time in seconds since the system epoch. |
|
Default constructor. Initializes the time to 0 seconds.
|
|
Constructor creates a time object as a copy of a time struct.
|
|
Constructor creates a time object as a copy of a timeval struct. struct timeval { long tv_sec; // seconds long tv_usec; // and microseconds };
|
|
Constructor creates time object based on number of seconds.
|
|
Constructor creates time object based on a calendar date.
|
|
Set the ssfTime object to a specified time struct.
|
|
Set the time object as a copy of a timeval struct. struct timeval { long tv_sec; // seconds long tv_usec; // and microseconds };
|
|
Set the ssfTime object to a specified time in seconds.
|
|
Set the ssfTime object to a specified Julian Date.
|
|
Set the Epoch to a specified Julian Date.
|
|
Set the ssfTime object based on a calendar date.
|
|
Set the current time after epoch.
|
|
Set the epoch time.
|
|
Set the epoch time.
|
|
Set the epoch time from a timeval struct. struct timeval { long tv_sec; // seconds long tv_usec; // and microseconds };
|
|
Set the epoch of the ssfTime object based on a calendar date.
|
|
Return the current time in seconds.
|
|
Return a tm struct of the date, time of the stored time.
|
|
Return the epoch in a tm struct of the date-time .
int tm_sec; // seconds (0 - 60) int tm_min; // minutes (0 - 59) int tm_hour; // hours (0 - 23) int tm_mday; // day of month (1 - 31) int tm_mon; // month of year (0 - 11) int tm_year; // year - 1900 int tm_wday; // day of week (Sunday = 0) int tm_yday; // day of year (0 - 365) int tm_isdst; // is summer time in effect? char *tm_zone; // abbreviation of timezone name long tm_gmtoff; // offset from UTC in seconds
|
|
Return the current Epoch.
|
|
Get the Julian Date of the time object.
|
|
Get the Julian Date of the time object's epoch.
|
|
Calculate the Greenwich sidereal time of the stored time.
|
|
Get the Julian Date of the time object's epoch. ref Vallado p.61-63
|
|
Return the current Epoch Return the time since epoch.
|
|
Add specified number of seconds to the current time and return a new object.
|
|
Add specified number of seconds to the current time.
|
|
Add specified number of seconds to the current time and return a new object.
|
|
Add specified number of seconds to the current time.
|
|
Add specified number of seconds to the current time and return a new object.
|
|
Add specified number of seconds to the current time.
|
|
Subtract two time objects (the stored times).
|
|
Greater than comparison two time objects (the stored times).
|
|
Greater than or equal comparison two time objects (the stored times).
|
|
Less than comparison two time objects (the stored times).
|
|
Less than or equal comparison two time objects (the stored times).
|
|
Compare the equality of two time objects (the stored times).
|
|
Compare the inequality of two time objects (the stored times).
|
|
output the time in seconds format
|
|
Internally stored time (seconds) |
|
Internatlly stored Epoch time (seconds) |