|
VLink 2.0.0
A high-performance communication middleware
|
RAII handle returned by exec_task() for a bool-returning callback task.
More...
#include <schedule.h>
Public Member Functions | |
| Status & | on_else (Callback &&callback) |
Registers a callback fired when the task returns false. | |
| RetStatus & | on_then (RetCallback &&callback) |
Registers a callback chain element fired when the task returns true. | |
| Status () | |
Constructs an invalid Status (not yet associated with a task). | |
| Status (const Status &)=delete | |
| Status (Status &&status) noexcept | |
| Move constructor. | |
| Public Member Functions inherited from vlink::Schedule::Status | |
| Status () | |
Constructs an invalid Status (not yet associated with a task). | |
| ~Status () | |
| Destructor. | |
| Status (const Status &)=delete | |
| Status & | operator= (const Status &)=delete |
| Status (Status &&status) noexcept | |
| Move constructor. | |
| Status & | operator= (Status &&status) noexcept |
| Move assignment. | |
| void | set_valid (bool valid) |
| Sets whether the status is valid (task was successfully posted). | |
| bool | is_valid () const |
Returns true if the associated task was posted successfully. | |
| Status & | on_schedule_timeout (Callback &&callback) |
Registers a callback fired when the task does not start within schedule_timeout_ms. | |
| Status & | on_execution_timeout (Callback &&callback) |
Registers a callback fired when the task runs longer than execution_timeout_ms. | |
| Status & | on_catch (CatchCallback &&callback) |
| Registers a callback fired when the task throws an exception. | |
Additional Inherited Members | |
| Protected Attributes inherited from vlink::Schedule::Status | |
| friend | Schedule |
| std::shared_ptr< StatusImpl > | impl_ |
RAII handle returned by exec_task() for a bool-returning callback task.
Extends Status with on_then (fired if callback returns true) and on_else (fired if callback returns false).
Registers a callback fired when the task returns false.
| callback | Invoked from the loop thread when the return value is false. |
Status for further chaining. | RetStatus & vlink::Schedule::RetStatus::on_then | ( | RetCallback && | callback | ) |
Registers a callback chain element fired when the task returns true.
Multiple on_then callbacks may be chained; each receives a bool return value from the previous callback in the chain.
| callback | Callback taking no arguments and returning bool. |
*this for further on_then chaining. Constructs an invalid Status (not yet associated with a task).
|
delete |
|
noexcept |
Move constructor.
| status | Source status to move from. |