GroupItem Class
class Tasking::GroupItemThe GroupItem class represents the basic element for composing nested tree structures. More...
Header: | #include <solutions/tasking/tasktree.h> |
Public Types
Detailed Description
Member Type Documentation
[alias]
GroupItem::GroupEndHandler
Type alias for std::function\<void()\>
.
The GroupEndHandler is used when constructing the onGroupDone and onGroupError elements. Any function with the above signature, when passed as a group done or error handler, will be called by the running task tree when the group ends with success or an error, respectively.
See also onGroupDone and onGroupError.
[alias]
GroupItem::GroupSetupHandler
Type alias for std::function<TaskAction()>
.
The GroupSetupHandler is used when constructing the onGroupSetup element. Any function with the above signature, when passed as a group setup handler, will be called by the running task tree when the group executions starts.
The return value of the handler instructs the running group on how to proceed after the handler's invocation is finished. The default return value of TaskAction::Continue instructs the group to continue running, i.e. to start executing its child tasks. The return value of TaskAction::StopWithDone or TaskAction::StopWithError instructs the group to skip the child tasks' execution and finish immediately with success or an error, respectively.
When the return type is either TaskAction::StopWithDone of TaskAction::StopWithError, the group's done or error handler (if provided) is called synchronously immediately afterwards.
Note: Even if the group setup handler returns StopWithDone or StopWithError, one of the group's done or error handlers is invoked. This behavior differs from that of task handlers and might change in the future.
The onGroupSetup accepts also functions in the shortened form of std::function<void()>
, i.e. the return value is void. In this case it's assumed that the return value is TaskAction::Continue by default.
See also onGroupSetup.