|
Hegel 0.18.3
Property-based testing for C++
|
A library that answers offset lookups but does not expose its zone data, probed into explicit transitions over the years first_year to last_year. More...
#include <zone_source.h>
Public Attributes | |
| std::function< ZoneType(int64_t instant)> | offset_at |
| std::function< std::optional< int64_t >(int64_t after)> | next_transition |
| int32_t | first_year = 1900 |
| The first year probed. | |
| int32_t | last_year = 2100 |
| AfterProbe | after = AfterProbe::Hold |
| What is in force after last_year. | |
A library that answers offset lookups but does not expose its zone data, probed into explicit transitions over the years first_year to last_year.
With next_transition the probe asks for each transition in turn; without it, it samples offset_at once a day and bisects each change to the second, which misses a pair of changes less than a day apart. Before first_year the type at its start holds; after last_year, after decides. Both callbacks are called on the thread that calls ZoneSource::add_oracle, during the call only. An exception a callback throws fails the call with std::invalid_argument carrying its message.
| int32_t hegel::generators::temporal::ZoneOracle::last_year = 2100 |
The last year probed; at least first_year + 1 for AfterProbe::Infer.
| std::function<std::optional<int64_t>(int64_t after)> hegel::generators::temporal::ZoneOracle::next_transition |
Optional: the first instant after after at which the type in force changes, or std::nullopt when it never changes again.
| std::function<ZoneType(int64_t instant)> hegel::generators::temporal::ZoneOracle::offset_at |
Required: the type in force at an instant, in seconds since the Unix epoch.