GLOW API version 1.0 reference

Back to
Table of contents

abstract GlowDeferredTask

General information

type: abstract
inherits: GlowTimerReceiver
module: glowUtilities

GlowDeferredTask is a convenience API for GlowTimerReceiver. It allows you to construct a single task, and schedule it for a certain time in the future. You may also query the task to determine if it has already been executed.

Some GLOW programs may wish to use the deferred task API for scheduling periodic or background tasks.




Automatically unschedules the task.

Scheduling information
You can schedule a task, unschedule it, or query it to see if it is pending.

void Schedule(int msecs)

Schedules a task for the given number of milliseconds in the future. It will be executed as soon as possible after the specified time period. If the task is already scheduled, the method first unschedules the original instance.

void Unschedule(void)

Unschedules the task. Has no effect if the task is not already scheduled.

bool IsScheduled(void)

Returns true if and only if the task is currently pending.

Inherited methods
These methods are inherited from GlowTimerReceiver. Normally you should not call them.

int NumSenders(void)

Returns the number of senders bound to this receiver. Should be equal to 1 if the task is scheduled, or 0 if it is not scheduled.

Overrideable methods

Executing the task

virtual void Task(void) = 0

This is a pure virtual method that must be overridden by a subclass. It is called when the task is to be executed.

Inherited methods
These methods are inherited from GlowTimerReceiver.

virtual void OnMessage(int id)

This method receives the timer event and executes the task. It is implemented by GlowDeferredTask and should not normally be overridden.

Back to
Table of contents

The GLOW Toolkit