Skip to content

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.

using astrea::astro::JulianDateClock::duration =  std::chrono::duration<rep, period>;


typedef period

The period type for the Julian Date , typically days.

using astrea::astro::JulianDateClock::period =  std::chrono::days::period;


typedef rep

The representation type for the Julian Date , typically a double for fractional days.

using astrea::astro::JulianDateClock::rep =  double;


typedef time_point

The time point type for the Julian Date , using theJulianDateClock .

using astrea::astro::JulianDateClock::time_point =  std::chrono::time_point<JulianDateClock>;


Public Static Attributes Documentation

variable is_steady

Indicates that the clock is not steady, meaning it can be adjusted or may have leap seconds.

constexpr bool astrea::astro::JulianDateClock::is_steady;


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:

  • Duration The duration type of the system time point.

Parameters:

  • timePoint The 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.

static inline time_point astrea::astro::JulianDateClock::now () noexcept

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:

  • Duration The duration type of the Julian Date time point.

Parameters:

  • timePoint The 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