tempoch-cpp
ActiuHeader-only C++17 wrapper for tempoch: typed Julian Date, MJD, UTC, and Period types for astronomical time in C++.
2 estrelles
0 forks
C++
AGPL-3.0
Actualitzat avui
Per què existeix
tempoch-cpp wraps the Rust tempoch-ffi library to provide idiomatic C++ value types for astronomical time. It includes JulianDate, MJD, UTC, and Period with full exception-based error handling and nanosecond precision.
Funcionalitats clau
- JulianDate and MJD strongly-typed value wrappers
- UTC civil date-time with nanosecond precision
- Period intervals with intersection operations
- Exception-based error model (typed C++ exceptions)
- CMake integration with automatic Rust FFI build
Primers passos
// CMakeLists.txt
find_package(tempoch_cpp REQUIRED)
target_link_libraries(myapp PRIVATE tempoch::tempoch_cpp)
// main.cpp
#include <tempoch/tempoch.hpp>
using namespace tempoch;
auto jd = JulianDate::from_utc({2026, 1, 1, 0, 0, 0});
auto mjd = MJD::from_jd(jd);
auto utc = jd.to_utc(); Contribuir
Donem la benvinguda a les contribucions! Aquí tens com pots ajudar:
- 1 Fes un fork del repositori i crea la teva branca des de main
- 2 Fes els teus canvis i afegeix tests si s'escau
- 3 Assegura't que tots els tests passen amb cargo test
- 4 Envia un pull request amb una descripció clara
Llicència
Aquest projecte està llicenciat sota la llicència AGPL-3.0. Consulta el fitxer LICENSE per a més detalls.
Enllaços ràpids
Etiquetes
cpp c++17 time astronomy bindings