IntervalTrigger
IntervalTrigger
#include <icy/sched/trigger.h>struct IntervalTriggerDefined in src/sched/include/icy/sched/trigger.h:133
Inherits:
Trigger
Trigger that fires repeatedly at a fixed time interval.
List of all members
| Name | Kind | Owner |
|---|---|---|
interval | variable | Declared here |
maxTimes | variable | Declared here |
IntervalTrigger | function | Declared here |
update | function | Declared here |
expired | function | Declared here |
serialize | function | Declared here |
deserialize | function | Declared here |
type | variable | Inherited from Trigger |
name | variable | Inherited from Trigger |
timesRun | variable | Inherited from Trigger |
createdAt | variable | Inherited from Trigger |
scheduleAt | variable | Inherited from Trigger |
lastRunAt | variable | Inherited from Trigger |
Trigger | function | Inherited from Trigger |
update | function | Inherited from Trigger |
remaining | function | Inherited from Trigger |
timeout | function | Inherited from Trigger |
expired | function | Inherited from Trigger |
serialize | function | Inherited from Trigger |
deserialize | function | Inherited from Trigger |
~ISerializable | function | Inherited from ISerializable |
serialize | function | Inherited from ISerializable |
deserialize | function | Inherited from ISerializable |
Inherited from Trigger
| Kind | Name | Description |
|---|---|---|
variable | type | The type of this trigger class. |
variable | name | The display name of this trigger class. |
variable | timesRun | The number of times the task has run since creation; |
variable | createdAt | The time the task was created. |
variable | scheduleAt | The time the task is scheduled to run. |
variable | lastRunAt | The time the task was last run. |
function | Trigger | |
function | update virtual | Updates the scheduleAt value to the next scheduled time. |
function | remaining virtual | Returns the milliseconds remaining until the next scheduled timeout. |
function | timeout virtual | Returns true if the task is ready to be run, false otherwise. |
function | expired virtual | Returns true if the task is expired and should be destroyed. Returns false by default. |
function | serialize virtual override | Serializes timing state (type, name, createdAt, scheduleAt, lastRunAt, timesRun) to root. |
function | deserialize virtual override | Deserializes timing state from root. |
Inherited from ISerializable
| Kind | Name | Description |
|---|---|---|
function | ~ISerializable virtual | Defaulted destructor. |
function | serialize virtual | Serializes this object's state into root. |
function | deserialize virtual | Populates this object's state from root. |
Public Attributes
| Return | Name | Description |
|---|---|---|
Timespan | interval | This value represents the interval to wait before running the task. |
int | maxTimes | The maximum number of times the task will be run before it is destroyed. 0 for no effect. |
interval
Timespan intervalDefined in src/sched/include/icy/sched/trigger.h:155
This value represents the interval to wait before running the task.
maxTimes
int maxTimesDefined in src/sched/include/icy/sched/trigger.h:160
The maximum number of times the task will be run before it is destroyed. 0 for no effect.
Public Methods
| Return | Name | Description |
|---|---|---|
IntervalTrigger | Constructs the trigger with type "IntervalTrigger" and maxTimes = 0 (unlimited). | |
void | update virtual override | Advances scheduleAt by one interval period. |
bool | expired virtual override | Returns true when maxTimes > 0 and timesRun >= maxTimes. |
void | serialize virtual override | Serializes interval fields (days, hours, minutes, seconds) in addition to base fields. |
void | deserialize virtual override | Deserializes interval fields from root. Throws if the resulting interval is zero. |
IntervalTrigger
IntervalTrigger()Defined in src/sched/include/icy/sched/trigger.h:136
Constructs the trigger with type "IntervalTrigger" and maxTimes = 0 (unlimited).
update
virtual override
virtual void update() overrideDefined in src/sched/include/icy/sched/trigger.h:139
Advances scheduleAt by one interval period.
Reimplements
expired
virtual override
virtual bool expired() overrideDefined in src/sched/include/icy/sched/trigger.h:142
Returns true when maxTimes > 0 and timesRun >= maxTimes.
Reimplements
serialize
virtual override
virtual void serialize(json::Value & root) overrideDefined in src/sched/include/icy/sched/trigger.h:146
Serializes interval fields (days, hours, minutes, seconds) in addition to base fields.
Parameters
rootJSON object to populate.
Reimplements
deserialize
virtual override
virtual void deserialize(json::Value & root) overrideDefined in src/sched/include/icy/sched/trigger.h:151
Deserializes interval fields from root. Throws if the resulting interval is zero.
Parameters
rootJSON object previously produced by serialize().
