|
tempoch-cpp 0.5.3
Header-only C++ wrapper for tempoch
|
tempoch-cpp is a modern, header-only C++17 library for astronomical time primitives. It wraps the Rust-based tempoch through its C FFI layer (tempoch-ffi), exposing the same two-axis model as Rust: physical scale and external format are separate type parameters.
| Feature | Description |
|---|---|
**CivilTime** | Civil UTC date-time struct (year/month/day/hour/min/sec) with nanosecond precision |
**Time<scale::S>** | Canonical instant on a physical timescale, stored as split J2000 seconds |
**EncodedTime<S, F>** | Typed external encoding such as JulianDate<scale::TT> or ModifiedJulianDate<scale::UTC> |
**TimeContext** | Explicit context for UT1 and historical UTC routes |
**Period<T>** | Half-open [start, end) interval over any supported time representation |
| Exception hierarchy | All FFI status codes map to typed C++ exceptions |
| Header-only | Drop into any project — no separate compilation step |
tempoch/tempoch.hpp — umbrella include for the full public APItempoch/scales/scales.hpp — scale tag index headertempoch/formats/formats.hpp — format tag index headertempoch/time.hpp — CivilTime, TT-default JulianDate / MJD, explicit Time<scale::S>, and TimeContexttempoch/period.hpp — Period interval typetempoch/ffi_core.hpp — FFI helpers and exception hierarchyJulianDate, MJD, and Period.JulianDate<scale::TT>::from_utc(...) and ModifiedJulianDate<scale::TT>::from_utc(...).Time<scale::S> and EncodedTime<S, F> for mixed-scale work.FFI tempoch_status_t codes are translated into typed C++ exceptions:
| Exception | When thrown |
|---|---|
TempochException | Base class for all tempoch errors |
NullPointerError | FFI returned a null handle |
UtcConversionError | Invalid or out-of-range calendar fields |
InvalidPeriodError | start > end or malformed period |
NoIntersectionError | Period intersection on non-overlapping intervals |
cargo) — tempoch-ffi is built automaticallyThen open:
build/docs/doxygen/html/index.html