PrevUpHomeNext

Function template within_schedule_uptime

fd::within_schedule_uptime — Determine whether now is within uptime bounds of given schedules.

Synopsis

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


template<auto converter, typename TP, std::ranges::forward_range Rng> 
  std::optional< bool > 
  within_schedule_uptime(const TP & now, const Rng & schedules);

Description

[Note] Note

A schedule's activity boundary is treated as an half-open range of [from, till).

Parameters:

now

Time point since unix epoch (in UTC).

schedules

List of timepoint generators.

Returns:

  • std::nullopt if @schedules don't contain any 'fixed duration' schedule,

  • false if outside of 'uptime' schedules or within a 'halt' schedule,

  • true otherwise - i.e. whether now is within coaleseced uptime bounds (i.e. longest duration period) of all 'fixed duration' schedules, or outside of 'halt' schedules.


PrevUpHomeNext