|
HOPS
HOPS class reference
|
Self-contained (link-free) reimplementation of the small slice of the date library's tz facilities that HOPS actually uses: the utc/tai/gps clocks and leap-second lookup. HOPS uses ZERO timezone functionality, so the only runtime data the compiled libdate-tz supplied was the leap-second table. More...
#include <algorithm>#include <chrono>#include <cstdint>#include <vector>#include "date/date.h"Go to the source code of this file.
Classes | |
| struct | hops::gps_clock |
| GPS clock: SI seconds since 1980-01-06; constant offset from UTC. More... | |
| struct | hops::leap_detail::leap_entry |
| struct | hops::leap_second_info |
| Result of a leap-second lookup, mirroring date::leap_second_info. elapsed = number of leap seconds inserted strictly before the query instant; is_leap_second = true iff the instant falls inside an inserted (23:59:60) second. More... | |
| struct | hops::tai_clock |
| TAI clock: SI seconds since 1958-01-01; constant offset from UTC. More... | |
| struct | hops::utc_clock |
| UTC clock: real SI seconds since 1970-01-01 including leap seconds. More... | |
Namespaces | |
| hops | |
| hops::leap_detail | |
Typedefs | |
| template<class Duration > | |
| using | hops::gps_time = std::chrono::time_point< gps_clock, Duration > |
| template<class Duration > | |
| using | hops::tai_time = std::chrono::time_point< tai_clock, Duration > |
| template<class Duration > | |
| using | hops::utc_time = std::chrono::time_point< utc_clock, Duration > |
Functions | |
| template<class Duration > | |
| leap_second_info | hops::get_leap_second_info (const utc_time< Duration > &ut) |
| Leap-second lookup for a utc_time, matching date::get_leap_second_info. More... | |
| const std::vector< leap_entry > & | hops::leap_detail::leap_table () |
| std::int64_t | hops::leap_detail::offset_at_sys (std::int64_t sys_seconds) |
Self-contained (link-free) reimplementation of the small slice of the date library's tz facilities that HOPS actually uses: the utc/tai/gps clocks and leap-second lookup. HOPS uses ZERO timezone functionality, so the only runtime data the compiled libdate-tz supplied was the leap-second table.
That table is short, well known, and last changed 2017-01-01 (CGPM Res. 4, 2022 commits to abolishing leap seconds by ~2035, so none are expected). We hardcode it here. This is so we can have: 1) no link against libdate-tz, 2) no runtime dependency on the host's /usr/share/zoneinfo (deterministic and reproducible across the manylinux / Ubuntu-LTS distribution targets), However, this is important! : the hard-coded leap second table is now our maintenance responsibility. If IERS Bulletin C ever announces a new leap second, append one entry to the events[] list in leap_table() below: the day AFTER the event and a signed delta (+1 for the usual inserted 23:59:60 second, -1 for a negative/removed leap second where 23:59:59 is skipped). TestLeapSecondDrift cross-checks the table against the installed system tz db at build time....which should catch a problem in most cases
All 27 leap seconds so far are +1; We have not had any negative leap seconds yet, but the signed representation below should in theory be able to handle either sign.
Conventions match date exactly (so results are interchangeable):
| struct hops::leap_second_info |