Class TimerQueue::TimerJob

TimerJob is the type of job handled by the TimerQueue object.

Public type

enum JobState {Waiting, Running, Canceled};
JobState describe the current state of the job. Waiting means that the job is posted but not yet running. Only in this state can the job be killed. Running means that the job is currently running. Cancel that the job as been canceled while it was waiting. It will not be run.

Constructor and destructor

TimerJob(JobTime the_starting_time = 0)

the_starting_time is the time at which the job should start running. Any time in the past will cause the job to run as soon as it is posted.

virtual ~TimerJob()
Note that the job is deleted upon completion.

Public methods

virtual void run();
run is called by the TimerQueue object to start the job. Note that since the TimerQueue has only one thread of control job should be short so that good accuracy is maintained (See WorkFram for managing long running job)
void repost(JobTime new_starting_time)
repost can be used while running a job so that it will be automatically reposted at the end current run. new_starting_time is the time at which the job should be schedule to run.

Protected Methods


Public fields


Protected fields