void Finish(bool bSucceeded)
End the task from outside its poll, and call OnStop() when it was running.
Task()
Construct an idle task.
Definition task.h:24
void Start()
Enter the running state and call OnStart(), unless the task is already running.
virtual void OnStop()
Abandon the work.
Definition task.h:96
void Stop()
Call OnStop() when the task is running, and return to the idle state.
virtual void OnStart()
Begin the work.
Definition task.h:87
virtual ~Task()
Release the task.
virtual void OnPoll()
Advance the work, and set mState to kStateDone when it finishes.
Definition task.h:105
int Poll()
Report the state after giving a running task one poll.
int GetState() const
Report mState.
State
Values of mState.
Definition task.h:12
@ kStateIdle
Definition task.h:13
@ kStateRunning
Definition task.h:14
@ kStateFailed
Definition task.h:16
@ kStateDone
Definition task.h:15