AIStatefulTask ‐ Asynchronous, Stateful Task Scheduler library.

Threads-like task objects evolving through user-defined states.

Functions
Running tasks

Functions

void AIStatefulTask::run (Handler default_handler, std::function< void(bool)> cb_function)
 
void AIStatefulTask::run (std::function< void(bool)> cb_function)
 The same as above but use the immediate Handler.
 
void AIStatefulTask::run (Handler default_handler, AIStatefulTask *parent, condition_type condition, on_abort_st on_abort=abort_parent)
 
void AIStatefulTask::run (AIStatefulTask *parent, condition_type condition, on_abort_st on_abort=abort_parent)
 
void AIStatefulTask::run (Handler default_handler=Handler::immediate)
 

Detailed Description

Start a new task or restart an existing task that just finished. These functions may be called directly after creation, or from within finish_impl , or from the call back function.

See also
page_default_engine

Function Documentation

◆ run() [1/4]

void AIStatefulTask::run ( AIStatefulTask parent,
condition_type  condition,
on_abort_st  on_abort = abort_parent 
)
inline

The same as above but use the immediate Handler.

◆ run() [2/4]

void AIStatefulTask::run ( Handler  default_handler,
AIStatefulTask parent,
condition_type  condition,
on_abort_st  on_abort = abort_parent 
)

(Re)run a task with default handler default_handler, requesting to signal the parent on condition condition when successfully finished.

Upon an abort the parent can either still be signaled, also aborted or be left in limbo (do nothing).

Parameters
default_handlerThe way that this task should be handled by default.
parentThe parent task.
conditionThe condition of the parent that will be signaled.
on_abortWhat to do with the parent when this task is aborted.

◆ run() [3/4]

void AIStatefulTask::run ( Handler  default_handler,
std::function< void(bool)>  cb_function 
)

(Re)run a task with default handler default_handler, requesting a call back to a function void cb_function(bool success). The parameter success will be true when the task finished successfully, or false when it was aborted.

Parameters
default_handlerThe way that this task should be handled by default.
cb_functionThe call back function. This function will be called with a single parameter with type bool.

◆ run() [4/4]

void AIStatefulTask::run ( Handler  default_handler = Handler::immediate)
inline

Just run the bloody task (no call back).

Parameters
default_handlerThe default engine or thread pool queue that the task be added to.