PrevUpHomeNext

Class interval_schedule_definition

fd::interval_schedule_definition — Interface veneer to schedule definition, deliberately hiding unrestricted public access to schedule data.

Synopsis

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


class interval_schedule_definition : protected fd::interval_schedule_data {
public:
  // construct/copy/destruct
  interval_schedule_definition();
  interval_schedule_definition(interval_schedule_data);

  // public member functions
  const std::wstring & name() const;
  bool inactive() const;
  bool is_action_blueprint() const;
  bool is_duration_blueprint() const;
  bool is_subinterval_blueprint() const;
  bool has_unspecified_duration() const;
  bool has_relative_duration() const;
  void sanitize();
  void equalize_startof_onsets(interval_onset);
  void equalize_startof_onset_pairs(interval_onset, interval_onset);
  interval_schedule_data & data();
  const interval_schedule_data & data() const;
  std::any & app_data();
  const std::any & app_data() const;
   interval_schedule_data();
  explicit  interval_schedule_data(interval_granularity);
  explicit  interval_schedule_data(interval_granularity, std::wstring);
};

Description

interval_schedule_definition public construct/copy/destruct

  1. interval_schedule_definition();
  2. interval_schedule_definition(interval_schedule_data d);

interval_schedule_definition public member functions

  1. const std::wstring & name() const;
  2. bool inactive() const;
  3. bool is_action_blueprint() const;
    Whether the blueprint attribute denotes an action schedule, which is mutually exclusive with `is_duration_blueprint().
  4. bool is_duration_blueprint() const;
    Whether the blueprint attribute denotes a fixed duration schedule, which is mutually exclusive with `is_action_blueprint().
  5. bool is_subinterval_blueprint() const;
    Whether the blueprint attribute denotes a subinterval schedule.
  6. bool has_unspecified_duration() const;
    Whether this schedule definition has no duration value configured.
  7. bool has_relative_duration() const;
    Whether this schedule definition has a relative (negative) duration value configured.
  8. void sanitize();

    Sanitizes the schedule data according to the following rules:

    • Equalizes the start of all onsets except for freely specified onsets.

    • Sets unneeded duration specification parts to 0 (depending on granularity).

    • Ensures an even number of onsets for range-based schedules.

  9. void equalize_startof_onsets(interval_onset source);
    Sets the start of all onsets in the cycle to the specified one, at the subgranularity level.

    Equalisation is actually performed for the purpose of simplifying the reasoning how a schedule will run, and additionally and greatly eases crafting user interfaces. Consider a weekly interval schedule with multiple onsets for specific weekdays: It's much easier to choose a time of day for ALL weekdays - you just know the onset is e.g. at 3AM on Monday, Wednesday and Friday, the user interface would have only one time control plus a dropdown to select the weekdays.

    Parameters:

    source

    Initial onset point. A copy is taken deliberately, such that an onset of the schedule definition's cycle can be used as an argument.

    Requires:

    !is_duration_blueprint() && !data().blueprint==onset_series_blueprint::itemized

  10. void equalize_startof_onset_pairs(interval_onset onset0, 
                                      interval_onset until0);
    Sets the start/completion of all onset pairs in the cycle to the ones specified, at the subgranularity level, links seconds of start/completion for day and month based schedules (yearly, monthly, weekly)

    See equalize_startof_onsets(interval_onset) for more details about equalisation.

    Parameters:

    onset0

    Initial onset point. A copy is taken deliberately, such that an onset of the schedule definition's cycle can be used as an argument.

    until0

    Initial completion point.

    Requires:

    is_duration_blueprint()

  11. interval_schedule_data & data();
  12. const interval_schedule_data & data() const;
  13. std::any & app_data();
  14. const std::any & app_data() const;
  15.  interval_schedule_data();
    Construct yet invalid schedule.
  16. explicit  interval_schedule_data(interval_granularity granularity);
    Construct unnamed schedule with one starting point within the given granularity.
  17. explicit  interval_schedule_data(interval_granularity granularity, 
                                     std::wstring name);
    Construct schedule with one starting point within the given granularity.

PrevUpHomeNext