15 static constexpr float kNever = 1.0e30f;
89 mNextTime = fNextTime;
93 std::unique_ptr<Task> mTask;
int Poll()
Start the task once its time comes, poll it, and schedule the next run once it ends.
void Suspend()
Stop the schedule from starting the task.
void SetTask(Task *pTask)
Set the task, which the schedule then deletes.
void RunNow()
Run the task at the next Poll().
static constexpr float kNever
The time a schedule that waits for nothing records.
Definition periodictask.h:15
~PeriodicTask()
Stop and delete the task.
float GetNextTime() const
Definition periodictask.h:79
Task * GetTask() const
Definition periodictask.h:69
float GetPeriod() const
Definition periodictask.h:74
void SetNextTime(float fNextTime)
Set when the task starts next.
Definition periodictask.h:88
PeriodicTask(float fPeriod)
Construct a schedule with no task.
Unit of work an owner starts, polls until it reports that it is done, and stops.
Definition task.h:9