RAII handle returned by exec_task() for a void-callback task.
More...
#include <schedule.h>
RAII handle returned by exec_task() for a void-callback task.
Holds a shared reference to the internal task state. Destruction does not cancel the task. Callback registration methods return *this to allow chaining.
◆ Status() [1/3]
| vlink::Schedule::Status::Status |
( |
| ) |
|
Constructs an invalid Status (not yet associated with a task).
◆ ~Status()
| vlink::Schedule::Status::~Status |
( |
| ) |
|
◆ Status() [2/3]
| vlink::Schedule::Status::Status |
( |
const Status & | | ) |
|
|
delete |
◆ Status() [3/3]
| vlink::Schedule::Status::Status |
( |
Status && | status | ) |
|
|
noexcept |
Move constructor.
- Parameters
-
| status | Source status to move from. |
◆ is_valid()
| bool vlink::Schedule::Status::is_valid |
( |
| ) |
const |
|
nodiscard |
Returns true if the associated task was posted successfully.
- Returns
true if valid.
◆ on_catch()
Registers a callback fired when the task throws an exception.
The exception is caught inside the wrapper and passed to this callback. The task is considered failed after an exception.
- Parameters
-
| callback | Callback invoked with the caught exception. |
- Returns
- Reference to
*this for chaining.
◆ on_execution_timeout()
| Status & vlink::Schedule::Status::on_execution_timeout |
( |
Callback && | callback | ) |
|
Registers a callback fired when the task runs longer than execution_timeout_ms.
- Parameters
-
| callback | Callback invoked from the loop thread on execution timeout. |
- Returns
- Reference to
*this for chaining.
◆ on_schedule_timeout()
| Status & vlink::Schedule::Status::on_schedule_timeout |
( |
Callback && | callback | ) |
|
Registers a callback fired when the task does not start within schedule_timeout_ms.
- Parameters
-
| callback | Callback invoked from the loop thread on schedule timeout. |
- Returns
- Reference to
*this for chaining.
◆ operator=() [1/2]
| Status & vlink::Schedule::Status::operator= |
( |
const Status & | | ) |
|
|
delete |
◆ operator=() [2/2]
| Status & vlink::Schedule::Status::operator= |
( |
Status && | status | ) |
|
|
noexcept |
Move assignment.
- Parameters
-
| status | Source status to move from. |
- Returns
- Reference to
*this.
◆ set_valid()
| void vlink::Schedule::Status::set_valid |
( |
bool | valid | ) |
|
Sets whether the status is valid (task was successfully posted).
- Parameters
-
| valid | true if the associated task was posted successfully. |
◆ impl_
| std::shared_ptr<StatusImpl> vlink::Schedule::Status::impl_ |
|
protected |
◆ Schedule
| friend vlink::Schedule::Status::Schedule |
|
protected |
The documentation for this class was generated from the following file: