PrevUpHomeNext

Struct timepiece_settings

fd::timepiece_settings — Settings for a schedule_timepiece.

Synopsis

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


struct timepiece_settings {

  // Facilitate 'downtime' schedules - only valid for fixed duration schedules. 
  enum fixed_duration_as { fixed_duration = false, 
                           inverse_fixed_duration = true };

  // public member functions
  shared_date_adjustment_function date_adjustor() const;

  // public data members
  boost::posix_time::time_duration onsetDelay;  // How much time an onset should be delayed; this is an additional static offset added to each onset. 
  fixed_duration_as inverseFixedDuration;  // Facilitate 'downtime' schedules - only valid for fixed duration schedules. 
  std::u8string dateAdjustmentRule;  // Facilitate advanced yearly calendar date schedules on fixed dates using named rules. 
  shared_date_adjustor_map dateAdjustors;
};

Description

timepiece_settings public member functions

  1. shared_date_adjustment_function date_adjustor() const;

timepiece_settings public public data members

  1. boost::posix_time::time_duration onsetDelay;
    [Important] Important

    Currently, the delay must not be greater than the uptime for a downtime schedule.

    [Note] Note

    (technical) A delay has the effect of offsetting each onset time point, effectively moving the onset nearer to the ending. It is applied when comparing to 'now' (while advancing) and when retrieving the currently scheduled time point - or in other words after all time point calculations have been performed. This means that the ending point doesn't change, also not if a duration is specified (which already has separated the ending from the next onset like in anticipating the length of a note).

  2. fixed_duration_as inverseFixedDuration;

    It greatly simplifies iterating over periods (for the application); Effectively, an interval schedule swaps the onset/completion onsets of a fixed 'downtime' duration schedule, such turning the schedule into a fixed 'uptime' duration schedule.

  3. std::u8string dateAdjustmentRule;

    The built-in rules are:

    1. us_federal_holiday_observance_rule

    2. us_inauguration_day_observance_rule


PrevUpHomeNext