PrevUpHomeNext

Function template uptime_bounds_for

fd::uptime_bounds_for — Determine coalesced uptime bounds for the given time point.

Synopsis

// In header: <fd/algorithm.h>


template<std::ranges::forward_range Rng> 
  std::optional< schedule_time_bounds > 
  uptime_bounds_for(const schedule_timepoint & pt, const Rng & schedules);

Description

A schedule's activity boundary and current interval is treated as a closed range, such that it can be determined for an action schedule whether the action would happen just at the time point of a starting or completing fixed duration schedule.

Parameters:

pt

A reference time point.

schedules

List of timepoint generators.

Returns:

  • std::nullopt if actionSchedule isn't an 'action' schedule or @schedules don't contain any 'fixed duration' schedule.

  • empty time point bounds [{ not_a_date_time, not_a_date_time }] if outside of 'uptime' schedules or within a 'halt' schedule.

  • otherwise the coaleseced uptime bounds (i.e. longest duration period) of all 'fixed duration' schedules, as a closed range.


PrevUpHomeNext