DUDS
Distributed Update of Data from Something
duds::time::planetary::Earth Class Reference

Terran time stuffs. More...

#include <Planetary.hpp>

Collaboration diagram for duds::time::planetary::Earth:

Public Types

typedef duds::time::interstellar::Femtoseconds duration
 
typedef duration::period period
 
typedef duration::rep rep
 
typedef std::chrono::time_point< Earth, durationtime_point
 

Public Member Functions

 Earth ()
 
template<class Clock , class Duration >
void addLeapSeconds (duds::time::interstellar::TimePoint< Clock, Duration > &time)
 Adds leap seconds to the given time in UTC, resulting in TAI. More...
 
boost::gregorian::date date (const duds::time::interstellar::SecondTime &t) const
 Converts from IST to UTC and provides a date result. More...
 
template<class ISTime >
boost::gregorian::date date (const ISTime &t) const
 Converts from IST to UTC and provides a date result. More...
 
template<class ISTime >
void date (ISTime &dest, const boost::gregorian::date &src)
 Converts a Gregorian calendar date into one of the time formats defined inside the duds::time::interstellar namespace. More...
 
boost::gregorian::date dateUtcToTai (const duds::time::interstellar::SecondTime &t) const
 Converts from UTC to TAI and provides a date result. More...
 
template<class ISTime >
boost::gregorian::date dateUtcToTai (const ISTime &t) const
 Converts from IST to UTC and provides a date result. More...
 
time_point now () noexcept
 
boost::posix_time::ptime posix (const duds::time::interstellar::MilliTime &t) const
 Converts from IST to UTC and provides a ptime result. More...
 
template<class ISTime >
boost::posix_time::ptime posix (const ISTime &t) const
 Converts from IST to UTC and provides a ptime result. More...
 
boost::posix_time::ptime posixUtcToTai (const duds::time::interstellar::MilliTime &t) const
 Converts from UTC to TAI and provides a ptime result. More...
 
template<class ISTime >
boost::posix_time::ptime posixUtcToTai (const ISTime &t) const
 Converts from UTC to TAI and provides a ptime result. More...
 
template<class ISTime >
void time (ISTime &dest, const boost::posix_time::ptime &src)
 Converts a POSIX time into one of the time formats defined inside the duds::time::interstellar namespace. More...
 
std::time_t timeUtc (const duds::time::interstellar::SecondTime &t) const
 Converts from IST to UTC and provides a std::time_t result. More...
 
template<class ISTime >
std::time_t timeUtc (const ISTime &t) const
 Converts from IST to UTC and provides a std::time_t result. More...
 

Static Public Member Functions

static const boost::gregorian::date & dateZero ()
 
static void make (const std::string &path="/usr/share/zoneinfo-leaps/UTC")
 Makes the Earth planetary time object using the given zoneinfo file for data on leap seconds. More...
 
static const boost::posix_time::ptime & timeZero ()
 

Public Attributes

LeapSeconds leaps
 

Static Public Attributes

static constexpr bool is_steady = false
 

Private Attributes

LeapBounds bound
 

Detailed Description

Terran time stuffs.

Definition at line 44 of file Planetary.hpp.

Member Typedef Documentation

◆ duration

◆ period

typedef duration::period duds::time::planetary::Earth::period

Definition at line 58 of file Planetary.hpp.

◆ rep

typedef duration::rep duds::time::planetary::Earth::rep

Definition at line 57 of file Planetary.hpp.

◆ time_point

typedef std::chrono::time_point<Earth, duration> duds::time::planetary::Earth::time_point

Definition at line 59 of file Planetary.hpp.

Constructor & Destructor Documentation

◆ Earth()

duds::time::planetary::Earth::Earth ( )

Definition at line 20 of file Planetary.cpp.

Referenced by make().

Member Function Documentation

◆ addLeapSeconds()

template<class Clock , class Duration >
void duds::time::planetary::Earth::addLeapSeconds ( duds::time::interstellar::TimePoint< Clock, Duration > &  time)
inline

Adds leap seconds to the given time in UTC, resulting in TAI.

Parameters
timeThe time that needs leap seconds.

Definition at line 159 of file Planetary.hpp.

◆ date() [1/3]

boost::gregorian::date duds::time::planetary::Earth::date ( const duds::time::interstellar::SecondTime t) const

Converts from IST to UTC and provides a date result.

Definition at line 42 of file Planetary.cpp.

Referenced by date(), and now().

◆ date() [2/3]

template<class ISTime >
boost::gregorian::date duds::time::planetary::Earth::date ( const ISTime &  t) const
inline

Converts from IST to UTC and provides a date result.

Definition at line 76 of file Planetary.hpp.

◆ date() [3/3]

template<class ISTime >
void duds::time::planetary::Earth::date ( ISTime &  dest,
const boost::gregorian::date &  src 
)
inline

Converts a Gregorian calendar date into one of the time formats defined inside the duds::time::interstellar namespace.

Definition at line 175 of file Planetary.hpp.

◆ dateUtcToTai() [1/2]

boost::gregorian::date duds::time::planetary::Earth::dateUtcToTai ( const duds::time::interstellar::SecondTime t) const

Converts from UTC to TAI and provides a date result.

Definition at line 52 of file Planetary.cpp.

Referenced by dateUtcToTai(), and timeUtc().

◆ dateUtcToTai() [2/2]

template<class ISTime >
boost::gregorian::date duds::time::planetary::Earth::dateUtcToTai ( const ISTime &  t) const
inline

Converts from IST to UTC and provides a date result.

Definition at line 111 of file Planetary.hpp.

◆ dateZero()

const boost::gregorian::date & duds::time::planetary::Earth::dateZero ( )
static

Definition at line 22 of file Planetary.cpp.

Referenced by date(), and duds::time::planetary::ToDate().

◆ make()

void duds::time::planetary::Earth::make ( const std::string &  path = "/usr/share/zoneinfo-leaps/UTC")
static

Makes the Earth planetary time object using the given zoneinfo file for data on leap seconds.

Examples:
clockLCD.cpp.

Definition at line 30 of file Planetary.cpp.

◆ now()

time_point duds::time::planetary::Earth::now ( )
inlinenoexcept

Definition at line 61 of file Planetary.hpp.

◆ posix() [1/2]

boost::posix_time::ptime duds::time::planetary::Earth::posix ( const duds::time::interstellar::MilliTime t) const

Converts from IST to UTC and provides a ptime result.

Definition at line 62 of file Planetary.cpp.

Referenced by dateUtcToTai(), and posix().

◆ posix() [2/2]

template<class ISTime >
boost::posix_time::ptime duds::time::planetary::Earth::posix ( const ISTime &  t) const
inline

Converts from IST to UTC and provides a ptime result.

Definition at line 128 of file Planetary.hpp.

◆ posixUtcToTai() [1/2]

boost::posix_time::ptime duds::time::planetary::Earth::posixUtcToTai ( const duds::time::interstellar::MilliTime t) const

Converts from UTC to TAI and provides a ptime result.

Definition at line 72 of file Planetary.cpp.

Referenced by posix(), and posixUtcToTai().

◆ posixUtcToTai() [2/2]

template<class ISTime >
boost::posix_time::ptime duds::time::planetary::Earth::posixUtcToTai ( const ISTime &  t) const
inline

Converts from UTC to TAI and provides a ptime result.

Definition at line 145 of file Planetary.hpp.

◆ time()

template<class ISTime >
void duds::time::planetary::Earth::time ( ISTime &  dest,
const boost::posix_time::ptime &  src 
)
inline

Converts a POSIX time into one of the time formats defined inside the duds::time::interstellar namespace.

Definition at line 187 of file Planetary.hpp.

◆ timeUtc() [1/2]

std::time_t duds::time::planetary::Earth::timeUtc ( const duds::time::interstellar::SecondTime t) const

Converts from IST to UTC and provides a std::time_t result.

Definition at line 35 of file Planetary.cpp.

Referenced by date(), and timeUtc().

◆ timeUtc() [2/2]

template<class ISTime >
std::time_t duds::time::planetary::Earth::timeUtc ( const ISTime &  t) const
inline

Converts from IST to UTC and provides a std::time_t result.

Definition at line 93 of file Planetary.hpp.

◆ timeZero()

const boost::posix_time::ptime & duds::time::planetary::Earth::timeZero ( )
static

Definition at line 26 of file Planetary.cpp.

Referenced by time(), and duds::time::planetary::ToPosix().

Member Data Documentation

◆ bound

LeapBounds duds::time::planetary::Earth::bound
private

Definition at line 45 of file Planetary.hpp.

◆ is_steady

constexpr bool duds::time::planetary::Earth::is_steady = false
static

Definition at line 60 of file Planetary.hpp.

◆ leaps

LeapSeconds duds::time::planetary::Earth::leaps

Definition at line 48 of file Planetary.hpp.

Referenced by date(), dateUtcToTai(), posix(), posixUtcToTai(), and timeUtc().


The documentation for this class was generated from the following files: