Struct astrea::astro::JulianDateClock¶
ClassList > astrea > astro > JulianDateClock
A clock implementation for Julian Dates. More...
#include <JulianDateClock.hpp>
Public Types¶
| Type | Name |
|---|---|
| typedef std::chrono::duration< rep, period > | duration The duration type for the Julian Date , representing the time in days. |
| typedef std::chrono::days::period | period The period type for the Julian Date , typically days. |
| typedef double | rep The representation type for the Julian Date , typically a double for fractional days. |
| typedef std::chrono::time_point< JulianDateClock > | time_point The time point type for the Julian Date , using theJulianDateClock . |
Public Static Attributes¶
| Type | Name |
|---|---|
| constexpr bool | is_steady = /* multi line expression */Indicates that the clock is not steady, meaning it can be adjusted or may have leap seconds. |
Public Static Functions¶
| Type | Name |
|---|---|
| auto | from_sys (std::chrono::sys_time< Duration > const & timePoint) noexcept Converts a system time point to a Julian Date time point. |
| time_point | now () noexcept Gets the current time point in Julian Date format. |
| auto | to_sys (JulianDateTime< Duration > const & timePoint) noexcept Converts a Julian Date time point to a system time point. |
Detailed Description¶
This clock is used to represent time points in Julian Date format, which is commonly used in astronomy. It provides conversions to and from system clocks and supports arithmetic operations on Julian Dates.
Public Types Documentation¶
typedef duration¶
The duration type for the Julian Date , representing the time in days.
typedef period¶
The period type for the Julian Date , typically days.
typedef rep¶
The representation type for the Julian Date , typically a double for fractional days.
typedef time_point¶
The time point type for the Julian Date , using theJulianDateClock .
Public Static Attributes Documentation¶
variable is_steady¶
Indicates that the clock is not steady, meaning it can be adjusted or may have leap seconds.
Public Static Functions Documentation¶
function from_sys¶
Converts a system time point to a Julian Date time point.
template<class Duration>
static inline auto astrea::astro::JulianDateClock::from_sys (
std::chrono::sys_time< Duration > const & timePoint
) noexcept
Template parameters:
DurationThe duration type of the system time point.
Parameters:
timePointThe system time point to convert.
Returns:
JulianDateTime<Duration> The converted Julian Date time point.
function now¶
Gets the current time point in Julian Date format.
Returns:
JulianDateClock::time_point The current time point in Julian Date format.
function to_sys¶
Converts a Julian Date time point to a system time point.
template<class Duration>
static inline auto astrea::astro::JulianDateClock::to_sys (
JulianDateTime < Duration > const & timePoint
) noexcept
Template parameters:
DurationThe duration type of the Julian Date time point.
Parameters:
timePointThe Julian Date time point to convert.
Returns:
std::chrono::sys_time<Duration> The converted system time point.
The documentation for this class was generated from the following file astrea/astro/astro/time/JulianDateClock.hpp