Go to the documentation of this file.
41 #ifndef GNSSTK_EPOCH_HPP
42 #define GNSSTK_EPOCH_HPP
352 template <
class TimeTagType>
357 TimeTagType
get()
const;
363 inline long double JD()
const;
369 inline long double MJD()
const;
373 inline short year()
const;
377 inline short month()
const;
381 inline short day()
const;
385 inline short dow()
const;
389 inline short hour()
const;
393 inline short minute()
const;
397 inline double second()
const;
401 inline double sod()
const;
433 inline double GPSsow()
const;
441 inline double BDSsow()
const;
453 inline double QZSsow()
const;
465 inline double GALsow()
const;
477 inline short doy()
const;
713 std::ostream& operator<<(
std::ostream& s,
718 template <class TimeTagType>
721 try {
return TimeTagType(
core); }
724 EpochException ee(e);
734 return get<JulianDate>().jd;
742 return get<gnsstk::MJD>().mjd;
748 return static_cast<short>(get<CivilTime>().year);
754 return static_cast<short>(get<CivilTime>().month);
760 return static_cast<short>(get<CivilTime>().day);
766 return (((
static_cast<long>(
JD()) % 7) + 1) % 7) ;
772 return static_cast<short>(get<CivilTime>().hour);
778 return static_cast<short>(get<CivilTime>().minute);
784 return get<CivilTime>().second;
790 return get<YDSTime>().sod;
802 return static_cast<short>(get<GPSWeekSecond>().getModWeek());
808 return get<GPSWeekZcount>().zcount;
814 Epoch e = *
this + .75;
823 return get<GPSWeekZcount>().getZcount32();
829 Epoch e = *
this + .75;
836 return get<GPSWeekSecond>().sow;
842 return static_cast<short>(get<GPSWeekSecond>().week);
848 return get<BDSWeekSecond>().sow;
854 return static_cast<short>(get<BDSWeekSecond>().week);
860 return static_cast<short>(get<BDSWeekSecond>().getModWeek());
866 return get<QZSWeekSecond>().sow;
872 return static_cast<short>(get<QZSWeekSecond>().week);
878 return static_cast<short>(get<QZSWeekSecond>().getModWeek());
884 return get<GALWeekSecond>().sow;
890 return static_cast<short>(get<GALWeekSecond>().week);
896 return static_cast<short>(get<GALWeekSecond>().getModWeek());
902 return static_cast<short>(get<YDSTime>().doy);
908 return get<UnixTime>().tv;
913 #endif // GNSSTK_EPOCH_HPP
static const double ONE_SEC_TOLERANCE
One second tolerance.
Epoch & setDate(const CommonTime &ct)
bool operator<(const Epoch &right) const noexcept
short QZSweek() const
Get full QZS week.
static const double ONE_NSEC_TOLERANCE
One nanosecond tolerance.
static std::string PRINT_FORMAT
This is how an Epoch is printed by default.
bool operator==(const Epoch &right) const noexcept
Epoch & addMicroSeconds(long usec)
double operator-(const Epoch &right) const noexcept
~Epoch() noexcept
Destructor.
Epoch operator+(double sec) const
std::string printf(const std::string &fmt=PRINT_FORMAT) const
static double EPOCH_TOLERANCE
Default tolerance for time equality in days.
short doy() const
Get day of year.
double sod() const
Get seconds of day.
Epoch & operator-=(double sec)
static double getEpochTolerance() noexcept
Returns the current EPOCH_TOLERANCE.
double second() const
Get seconds of minute.
short hour() const
Get hour of day.
Epoch & setTolerance(double tol) noexcept
Epoch & operator=(const Epoch &right) noexcept
Assignment operator.
bool operator<=(const Epoch &right) const noexcept
short month() const
Get month of year.
short GPSweek10() const
Get 10-bit GPS week. Deprecated, used GPSModWeek()
long GPSzcount() const
Get normal (19 bit) zcount.
static const double ONE_MIN_TOLERANCE
One minute tolerance.
short QZSModWeek() const
Get mod (short) QZS week.
static const double ONE_HOUR_TOLERANCE
One hour tolerance.
Epoch(const TimeTag &tt=SystemTime())
Epoch & scanf(const std::string &str, const std::string &fmt)
double BDSsow() const
Get BDS second of week.
Epoch & addMilliSeconds(long msec)
unsigned long GPSzcount32Floor() const
Same as fullZcount() but without rounding to nearest zcount.
long GPSzcountFloor() const
Same as GPSzcount() but without rounding to nearest zcount.
double tolerance
double tolerance used in comparisons (seconds)
short year() const
Get year.
short GALweek() const
Get full GAL week.
static const double ONE_USEC_TOLERANCE
One microsecond tolerance.
double getTolerance() const noexcept
short GPSweek() const
Get full (>10 bits) week.
short GPSModWeek() const
Get 10-bit GPS week.
bool operator!=(const Epoch &right) const noexcept
static double setEpochTolerance(double tol) noexcept
Changes the EPOCH_TOLERANCE for all Epoch objects.
short day() const
Get day of month.
short minute() const
Get minutes of hour.
static const Epoch END_OF_TIME
Latest Representable Epoch.
struct timeval unixTime() const
Get object time in UNIX timeval structure.
double GALsow() const
Get GAL second of week.
double GPSsow() const
Get GPS second of week.
double QZSsow() const
Get QZS second of week.
short BDSweek() const
Get full BDS week.
static const double ONE_MSEC_TOLERANCE
One millisecond tolerance.
#define GNSSTK_THROW(exc)
short GALModWeek() const
Get mod (short) GAL week.
Epoch & set(const TimeTag &tt=SystemTime())
short dow() const
Get day of week.
unsigned long GPSzcount32() const
static const Epoch BEGINNING_OF_TIME
Earliest representable Epoch.
Epoch & operator+=(double sec)
short BDSModWeek() const
Get mod (short) BDS week.
bool operator>(const Epoch &right) const noexcept
Epoch & setTime(const CommonTime &ct)
bool operator>=(const Epoch &right) const noexcept
NEW_EXCEPTION_CLASS(EpochException, gnsstk::Exception)
Epoch & addSeconds(double seconds)
gnsstk
Author(s):
autogenerated on Wed Oct 25 2023 02:40:39