fd::interval_schedule_definition — Interface veneer to schedule definition, deliberately hiding unrestricted public access to schedule data.
// 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); };
interval_schedule_definition
public
construct/copy/destructinterval_schedule_definition();
interval_schedule_definition(interval_schedule_data d);
interval_schedule_definition
public member functionsconst std::wstring & name() const;
bool inactive() const;
bool is_action_blueprint() const;Whether the blueprint attribute denotes an action schedule, which is mutually exclusive with `is_duration_blueprint().
bool is_duration_blueprint() const;Whether the blueprint attribute denotes a fixed duration schedule, which is mutually exclusive with `is_action_blueprint().
bool is_subinterval_blueprint() const;Whether the blueprint attribute denotes a subinterval schedule.
bool has_unspecified_duration() const;Whether this schedule definition has no duration value configured.
bool has_relative_duration() const;Whether this schedule definition has a relative (negative) duration value configured.
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.
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: |
|
||
Requires: |
!is_duration_blueprint() && !data().blueprint==onset_series_blueprint::itemized |
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: |
|
||||
Requires: |
is_duration_blueprint() |
interval_schedule_data & data();
const interval_schedule_data & data() const;
std::any & app_data();
const std::any & app_data() const;
interval_schedule_data();Construct yet invalid schedule.
explicit interval_schedule_data(interval_granularity granularity);Construct unnamed schedule with one starting point within the given granularity.
explicit interval_schedule_data(interval_granularity granularity, std::wstring name);Construct schedule with one starting point within the given granularity.