Sched module

IntervalTrigger

[Trigger]({#ref structicy_1_1sched_1_1Trigger #}) that fires repeatedly at a fixed time interval.

IntervalTrigger

#include <icy/sched/trigger.h>

Inherits: Trigger

Trigger that fires repeatedly at a fixed time interval.

Public Attributes

ReturnNameDescription
TimespanintervalThis value represents the interval to wait before running the task.
intmaxTimesThe maximum number of times the task will be run before it is destroyed. 0 for no effect.

interval

Timespan interval

This value represents the interval to wait before running the task.


maxTimes

int maxTimes

The maximum number of times the task will be run before it is destroyed. 0 for no effect.

Public Methods

ReturnNameDescription
IntervalTriggerConstructs the trigger with type "IntervalTrigger" and maxTimes = 0 (unlimited).
voidupdate virtualAdvances scheduleAt by one interval period.
boolexpired virtualReturns true when maxTimes > 0 and timesRun >= maxTimes.
voidserialize virtualSerializes interval fields (days, hours, minutes, seconds) in addition to base fields.
voiddeserialize virtualDeserializes interval fields from root. Throws if the resulting interval is zero.

IntervalTrigger

IntervalTrigger()

Constructs the trigger with type "IntervalTrigger" and maxTimes = 0 (unlimited).


update

virtual

virtual void update()

Advances scheduleAt by one interval period.


expired

virtual

virtual bool expired()

Returns true when maxTimes > 0 and timesRun >= maxTimes.


serialize

virtual

virtual void serialize(json::Value & root)

Serializes interval fields (days, hours, minutes, seconds) in addition to base fields.

Parameters

  • root JSON object to populate.

deserialize

virtual

virtual void deserialize(json::Value & root)

Deserializes interval fields from root. Throws if the resulting interval is zero.

Parameters