![]() |
tempoch-cpp
Header-only C++ wrapper for tempoch
|
A time period [start, end] in MJD. More...
#include <tempoch/period.hpp>
Public Member Functions | |
| Period (double start_mjd, double end_mjd) | |
| Construct a period from start/end MJD values. | |
| Period (const MJD &start, const MJD &end) | |
| Construct a period from typed MJD values. | |
| double | start_mjd () const |
| Inclusive period start as raw MJD days. | |
| double | end_mjd () const |
| Inclusive period end as raw MJD days. | |
| MJD | start () const |
| Inclusive period start as a typed MJD value. | |
| MJD | end () const |
| Inclusive period end as a typed MJD value. | |
| double | duration_days () const |
| Duration in days. | |
| Period | intersection (const Period &other) const |
| Compute the overlapping interval with another period. | |
| const tempoch_period_mjd_t & | c_inner () const |
| Access the underlying FFI POD value. | |
Static Public Member Functions | |
| static Period | from_c (const tempoch_period_mjd_t &c) |
| Construct from the C struct (unchecked). | |
A time period [start, end] in MJD.
Wraps tempoch_period_mjd_t and provides duration, intersection, and easy access to the start/end as MJD objects.
Definition at line 33 of file period.hpp.
|
inline |
Construct a period from start/end MJD values.
| start_mjd | Inclusive start instant, in MJD days. |
| end_mjd | Inclusive end instant, in MJD days. |
| InvalidPeriodError | If start_mjd is greater than end_mjd. |
Definition at line 43 of file period.hpp.
References tempoch::check_status(), end_mjd(), and start_mjd().
Construct a period from typed MJD values.
| start | Inclusive start instant. |
| end | Inclusive end instant. |
Definition at line 55 of file period.hpp.
|
inline |
Access the underlying FFI POD value.
Definition at line 98 of file period.hpp.
|
inline |
Duration in days.
Definition at line 78 of file period.hpp.
|
inline |
Inclusive period end as a typed MJD value.
Definition at line 75 of file period.hpp.
|
inline |
Inclusive period end as raw MJD days.
Definition at line 69 of file period.hpp.
|
inlinestatic |
Construct from the C struct (unchecked).
Definition at line 59 of file period.hpp.
Referenced by intersection().
Compute the overlapping interval with another period.
| other | The period to intersect with. |
| NoIntersectionError | If the two periods do not overlap. |
Definition at line 88 of file period.hpp.
References tempoch::check_status(), and from_c().
Referenced by main().
|
inline |
Inclusive period start as a typed MJD value.
Definition at line 72 of file period.hpp.
|
inline |
Inclusive period start as raw MJD days.
Definition at line 66 of file period.hpp.