VLink 2.0.0
A high-performance communication middleware
Loading...
Searching...
No Matches
vlink::Schedule::RetStatus Class Referencefinal

RAII handle returned by exec_task() for a bool-returning callback task. More...

#include <schedule.h>

Inheritance diagram for vlink::Schedule::RetStatus:
Collaboration diagram for vlink::Schedule::RetStatus:

Public Member Functions

Statuson_else (Callback &&callback)
 Registers a callback fired when the task returns false.
RetStatuson_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.

Additional Inherited Members

Detailed Description

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).

Member Function Documentation

◆ on_else()

Status & vlink::Schedule::RetStatus::on_else ( Callback && callback)

Registers a callback fired when the task returns false.

Parameters
callbackInvoked from the loop thread when the return value is false.
Returns
Reference to the base Status for further chaining.
Here is the call graph for this function:

◆ on_then()

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.

Parameters
callbackCallback taking no arguments and returning bool.
Returns
Reference to *this for further on_then chaining.

◆ Status() [1/3]

Constructs an invalid Status (not yet associated with a task).

Here is the caller graph for this function:

◆ Status() [2/3]

vlink::Schedule::Status::Status ( const Status & )
delete

◆ Status() [3/3]

vlink::Schedule::Status::Status ( Status && status)
noexcept

Move constructor.

Parameters
statusSource status to move from.

The documentation for this class was generated from the following file: