Go to the documentation of this file.
63 const double CommonTime::eps = 4.*std::numeric_limits<double>::epsilon();
67 : m_day( right.m_day ), m_msod( right.m_msod ), m_fsod( right.m_fsod ),
68 m_timeSystem( right.m_timeSystem )
96 InvalidParameter ip(
"Invalid day: "
103 InvalidParameter ip(
"Invalid seconds of day: "
108 if( fsod < 0.0 || fsod >= 1 )
110 InvalidParameter ip(
"Invalid fractional-seconds: "
116 long msec =
static_cast<long>( fsod *
MS_PER_SEC );
119 fsod -=
static_cast<double>( msec ) *
SEC_PER_MS;
136 long sec =
static_cast<long>(
sod );
147 long lday =
static_cast<long>(
day );
149 return set( lday, sec, timeSystem );
160 InvalidParameter ip(
"Invalid day: "
167 InvalidParameter ip(
"Invalid milliseconds of day: "
174 InvalidParameter ip(
"Invalid fractional-milliseconds: "
257 day =
static_cast<double>(
m_day ) +
301 InvalidRequest ir(
"CommonTime objects not in same time system, cannot be differenced");
317 return CommonTime( *this ).addSeconds( -sec );
334 long days = 0, ms = 0;
344 ms =
static_cast<long>( seconds *
MS_PER_SEC );
345 seconds -=
static_cast<double>( ms ) /
MS_PER_SEC;
348 add( days, ms, seconds );
405 "CommonTime objects not in same time system, cannot be compared: " +
434 return (
operator<(right) ||
operator==(right));
447 << setw(7) <<
m_day <<
" "
448 << setw(8) <<
m_msod <<
" "
449 << fixed << setprecision(15) << setw(17) <<
m_fsod
468 std::numeric_limits<double>
eps;
502 if (
m_fsod >=
static_cast<double>(0.999) )
503 m_fsod -=
static_cast<double>(0.999);
bool operator<(const CommonTime &right) const
static const GNSSTK_EXPORT double eps
Default tolerance for time equality in days.
CommonTime & addSeconds(double seconds)
bool add(long days, long msod, double fsod)
CommonTime & setInternal(long day=0, long msod=0, double fsod=0.0, TimeSystem timeSys=TimeSystem::Unknown)
static GNSSTK_EXPORT std::shared_ptr< TimeSystemConverter > tsConv
const long SEC_PER_DAY
Seconds per day.
const long MS_PER_DAY
Milliseconds in a day.
static const GNSSTK_EXPORT long BEGIN_LIMIT_JDAY
bool operator>=(const CommonTime &right) const
long m_msod
milliseconds-of-day 0 <= val < 86400000
@ Any
wildcard; allows comparison with any other type
std::string asString(IonexStoreStrategy e)
Convert a IonexStoreStrategy to a whitespace-free string name.
const double SEC_PER_MS
Seconds per millisecond.
bool operator!=(const CommonTime &right) const
static const GNSSTK_EXPORT CommonTime BEGINNING_OF_TIME
earliest representable CommonTime
CommonTime(TimeSystem timeSystem=TimeSystem::Unknown)
CommonTime & operator-=(double seconds)
double getSecondOfDay() const
Obtain the seconds of day (ignoring the day).
CommonTime & operator+=(double seconds)
static const GNSSTK_EXPORT CommonTime END_OF_TIME
latest representable CommonTime
const long MS_PER_SEC
Milliseconds in a second.
bool operator==(const CommonTime &right) const
double getDays() const
Obtain the time, in days, including the fraction of a day.
std::ostream & operator<<(std::ostream &s, const ObsEpoch &oe) noexcept
TimeSystem
Definition of various time systems.
bool operator<=(const CommonTime &right) const
void get(long &day, long &sod, double &fsod, TimeSystem &timeSystem) const
virtual bool getOffset(TimeSystem fromSys, TimeSystem toSys, const CommonTime &t, double &offs)=0
static const GNSSTK_EXPORT long END_LIMIT_JDAY
TimeSystem m_timeSystem
time frame (system representation) of the data
TimeSystem getTimeSystem() const
Obtain time system info (enum).
CommonTime & addMilliseconds(long ms)
const double DAY_PER_SEC
Days per second.
double m_fsod
fractional seconds-of-day 0 <= val < 0.001
CommonTime operator+(double seconds) const
#define GNSSTK_THROW(exc)
double operator-(const CommonTime &right) const
bool changeTimeSystem(TimeSystem timeSystem, TimeSystemConverter *conv)
CommonTime & operator=(const CommonTime &right)
std::string asString() const
CommonTime & addDays(long days)
bool operator>(const CommonTime &right) const
CommonTime & set(long day, long sod, double fsod=0.0, TimeSystem timeSystem=TimeSystem::Unknown)
gnsstk
Author(s):
autogenerated on Wed Oct 25 2023 02:40:38