12 namespace duds {
namespace time {
namespace planetary {
62 min(TimePoint::max()),
63 max(TimePoint::min()),
75 ) : total(leaps), min(minimum), max(maximum) { }
83 template <
class OtherClock,
class OtherDuration,
class OtherCount>
89 total = std::chrono::duration_cast<Count>(lb.
leaps());
97 template <
class OtherClock,
class OtherDuration,
class OtherCount>
126 template <
class OtherClock,
class OtherDuration>
130 TimePoint comp = time;
131 return (comp > min) && (comp <=
max);
138 bool within(
const TimePoint &time)
const {
139 return (time > min) && (time <=
max);
const TimePoint & minimum() const
Returns the minimum bound time; the minimum is exclusive.
const TimePoint & maximum() const
Returns the maximum bound time; the maximum is inclusive.
std::chrono::duration< std::int64_t > Seconds
Stores a duration in seconds.
bool within(const TimePoint &time) const
Returns true if the given provided time is within bounds.
LeapBounds(const LeapBounds< OtherClock, OtherDuration, OtherCount > &lb)
Constructs from a different LeapBounds template.
const Count & leaps() const
Returns the leap seconds in this period.
TimePoint max
The maximum bound time.
TimePoint min
The minimum bound time; times within bounds do not include this time.
constexpr LeapBounds()
A default constructor that sets invalid bounds and no leap seconds.
An extention to the C++ std::chrono::time_point template to make time points easier to work with...
Provides Interstellar Time in seconds.
bool within(const duds::time::interstellar::TimePoint< OtherClock, OtherDuration > &time) const
Returns true if the given provided time is within bounds.
duds::time::interstellar::TimePoint< Clock, Duration > TimePoint
The time point type used in this class.
constexpr LeapBounds(const TimePoint &minimum, const TimePoint &maximum, const Count &leaps)
Constructs with specific values.
Count total
The total leap seconds to apply during this period.
bool valid() const
Checks for validity; false if the maximum bound is under the minimum bound.
GenericClock< duds::data::GenericValue, double, duds::time::interstellar::NanoTime, float > Clock
General use clock driver type.
LeapBounds & operator=(const LeapBounds &)=default
A container holding the number of leap seconds and the time bounds over which the leap seconds are ap...