PrevUpHomeNext

Function template uptime_bounds_for

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

Synopsis

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


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

Description

Parameters:

pt

A reference timepoint.

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 timepoint 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.


PrevUpHomeNext