0.2.0
Loading...
Searching...
No Matches
InsTime.hpp File Reference

The class is responsible for all time-related tasks. More...

Go to the source code of this file.

Classes

struct  std::hash< NAV::InsTime >
 Hash function for InsTime (needed for unordered_map) More...
 
class  NAV::InsTime
 The class is responsible for all time-related tasks. More...
 
struct  NAV::InsTime_GPSweekTow
 GPS week and time of week in GPS standard time [GPST]. More...
 
struct  NAV::InsTime_JD
 Julien Date [UTC]. More...
 
struct  NAV::InsTime_MJD
 Modified Julien Date [UTC]. More...
 
struct  NAV::InsTime_YDoySod
 GPS year and day of year in GPS standard time [GPST]. More...
 
struct  NAV::InsTime_YMDHMS
 Universal Time Coordinated [UTC]. More...
 

Namespaces

namespace  NAV::InsTimeUtil
 Utility Namespace for Time related tasks.
 

Typedefs

using json
 json namespace
 

Functions

constexpr int32_t NAV::InsTimeUtil::daysInMonth (int32_t month, int32_t year)
 Returns the number of days in the specified month of the year.
 
void NAV::from_json (const json &j, InsTime &insTime)
 Converts the provided json object into an InsTime.
 
constexpr bool NAV::InsTimeUtil::isLeapYear (int32_t year)
 Returns true if the provided year is a leap year, false otherwise.
 
std::ostream & NAV::operator<< (std::ostream &os, const InsTime &insTime)
 Stream insertion operator overload.
 
std::ostream & NAV::operator<< (std::ostream &os, const InsTime_GPSweekTow &gpsWeekTow)
 Stream insertion operator overload.
 
std::ostream & NAV::operator<< (std::ostream &os, const InsTime_JD &jd)
 Stream insertion operator overload.
 
std::ostream & NAV::operator<< (std::ostream &os, const InsTime_MJD &mjd)
 Stream insertion operator overload.
 
std::ostream & NAV::operator<< (std::ostream &os, const InsTime_YDoySod &yDoySod)
 Stream insertion operator overload.
 
std::ostream & NAV::operator<< (std::ostream &os, const InsTime_YMDHMS &ymdhms)
 Stream insertion operator overload.
 
void NAV::to_json (json &j, const InsTime &insTime)
 Converts the provided InsTime into a json object.
 

Variables

constexpr int32_t NAV::InsTimeUtil::DAYS_PER_WEEK
 Days / Week.
 
constexpr int32_t NAV::InsTimeUtil::DAYS_PER_YEAR
 Days / Year.
 
constexpr int32_t NAV::InsTimeUtil::DIFF_BDT_WEEK_TO_GPST_WEEK
 BeiDou starts zero at 1-Jan-2006 and GPS starts 6-Jan-1980.
 
constexpr int32_t NAV::InsTimeUtil::DIFF_MJD_TO_JD_DAYS
 Difference of the days between MJD and JD.
 
constexpr long double NAV::InsTimeUtil::DIFF_MJD_TO_JD_FRAC
 Difference of the fraction between MJD and JD.
 
constexpr int32_t NAV::InsTimeUtil::DIFF_TO_1_1_1970_MJD
 01.01.1970 00:00:00 UTC in Modified Julian Date (UNIX epoch)
 
constexpr int32_t NAV::InsTimeUtil::DIFF_TO_6_1_1980_MJD
 06.01.1980 in Modified Julian Date
 
constexpr int32_t NAV::InsTimeUtil::END_OF_THE_CENTURY_MJD
 Modified Julian Date of the end of the century (15.01.2954)
 
constexpr long double NAV::InsTimeUtil::EPSILON
 
constexpr std::array< int32_t, 20 > NAV::InsTimeUtil::GPS_LEAP_SEC_MJD
 Maps GPS leap seconds to a time: array<mjd_day>, index + 1 is amount of leap seconds.
 
constexpr int32_t NAV::InsTimeUtil::HOURS_PER_DAY
 Hours / Day.
 
constexpr int32_t NAV::InsTimeUtil::HOURS_PER_WEEK
 Hours / Week.
 
constexpr int32_t NAV::InsTimeUtil::MINUTES_PER_DAY
 Minutes / Day.
 
constexpr int32_t NAV::InsTimeUtil::MINUTES_PER_HOUR
 Minutes / Hour.
 
constexpr int32_t NAV::InsTimeUtil::MINUTES_PER_WEEK
 Minutes / Week.
 
constexpr int32_t NAV::InsTimeUtil::MONTHS_PER_YEAR
 Months / Year.
 
constexpr int32_t NAV::InsTimeUtil::SECONDS_PER_DAY
 Seconds / Day.
 
constexpr int32_t NAV::InsTimeUtil::SECONDS_PER_HOUR
 Seconds / Hour.
 
constexpr int32_t NAV::InsTimeUtil::SECONDS_PER_MINUTE
 Seconds / Minute.
 
constexpr int32_t NAV::InsTimeUtil::SECONDS_PER_WEEK
 Seconds / Week.
 
constexpr int32_t NAV::InsTimeUtil::WEEKS_PER_GPS_CYCLE
 Weeks per GPS cycle.
 

Detailed Description

The class is responsible for all time-related tasks.

Author
T. Topp (topp@.nosp@m.ins..nosp@m.uni-s.nosp@m.tutt.nosp@m.gart..nosp@m.de)
T. Lambertus (tomke.nosp@m.-jan.nosp@m.tje.l.nosp@m.ambe.nosp@m.rtus@.nosp@m.nav..nosp@m.uni-s.nosp@m.tutt.nosp@m.gart..nosp@m.de)
Date
2020-12-02

This class contains all time-transformations functions. One instance is created for each InsTime object (defined in the structs). Internally, only the MJD-time (Modified Julien Date) is stored (here MJD is a struct which has mjd_day and mjd_frac).

Function Documentation

◆ from_json()

void NAV::from_json ( const json & j,
InsTime & insTime )

Converts the provided json object into an InsTime.

Parameters
[in]jJson object with the time values
[out]insTimeTime to return

◆ operator<<() [1/6]

std::ostream & NAV::operator<< ( std::ostream & os,
const InsTime & insTime )

Stream insertion operator overload.

Parameters
[in,out]osOutput stream object to stream the time into
[in]insTimeObject to print
Returns
Returns the output stream object in order to chain stream insertions

◆ operator<<() [2/6]

std::ostream & NAV::operator<< ( std::ostream & os,
const InsTime_GPSweekTow & gpsWeekTow )

Stream insertion operator overload.

Parameters
[in,out]osOutput stream object to stream the time into
[in]gpsWeekTowObject to print
Returns
Returns the output stream object in order to chain stream insertions

◆ operator<<() [3/6]

std::ostream & NAV::operator<< ( std::ostream & os,
const InsTime_JD & jd )

Stream insertion operator overload.

Parameters
[in,out]osOutput stream object to stream the time into
[in]jdObject to print
Returns
Returns the output stream object in order to chain stream insertions

◆ operator<<() [4/6]

std::ostream & NAV::operator<< ( std::ostream & os,
const InsTime_MJD & mjd )

Stream insertion operator overload.

Parameters
[in,out]osOutput stream object to stream the time into
[in]mjdObject to print
Returns
Returns the output stream object in order to chain stream insertions

◆ operator<<() [5/6]

std::ostream & NAV::operator<< ( std::ostream & os,
const InsTime_YDoySod & yDoySod )

Stream insertion operator overload.

Parameters
[in,out]osOutput stream object to stream the time into
[in]yDoySodObject to print
Returns
Returns the output stream object in order to chain stream insertions

◆ operator<<() [6/6]

std::ostream & NAV::operator<< ( std::ostream & os,
const InsTime_YMDHMS & ymdhms )

Stream insertion operator overload.

Parameters
[in,out]osOutput stream object to stream the time into
[in]ymdhmsObject to print
Returns
Returns the output stream object in order to chain stream insertions

◆ to_json()

void NAV::to_json ( json & j,
const InsTime & insTime )

Converts the provided InsTime into a json object.

Parameters
[out]jReturn Json object
[in]insTimeTime to convert