VLink  2.0.0
A high-performance communication middleware
vlink::Schedule::RetStatus Class Referencefinal

RAII handle returned by exec_task() when the wrapped callback returns bool. More...

#include <schedule.h>

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

Public Member Functions

Statuson_else (Callback &&callback)
 Installs the callback fired when the wrapped task returns false. More...
 
RetStatuson_then (RetCallback &&callback)
 Appends a continuation that runs only when the previous callback returned true. More...
 
 Status ()
 Constructs a fresh handle backed by a newly allocated task state. More...
 
 Status (const Status &)=delete
 
 Status (Status &&status) noexcept
 Move-constructs from status, transferring its task state. More...
 

Additional Inherited Members

Detailed Description

RAII handle returned by exec_task() when the wrapped callback returns bool.

Extends Status with the on_then chain and the on_else fallback so callers can express success/failure branches inline.

Member Function Documentation

◆ on_else()

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

Installs the callback fired when the wrapped task returns false.

Only one else callback may be registered; late registrations are dropped.

Parameters
callbackHook invoked on the dispatcher thread when false is returned.
Returns
Reference to the base Status for further chaining.

◆ on_then()

RetStatus& vlink::Schedule::RetStatus::on_then ( RetCallback &&  callback)

Appends a continuation that runs only when the previous callback returned true.

Multiple on_then callbacks may be chained. Each is invoked in registration order until one returns false, at which point the chain stops and the registered on_else (if any) fires.

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

◆ Status() [1/3]

vlink::Schedule::Status::Status

Constructs a fresh handle backed by a newly allocated task state.

◆ Status() [2/3]

vlink::Schedule::Status::Status
delete

◆ Status() [3/3]

vlink::Schedule::Status::Status
noexcept

Move-constructs from status, transferring its task state.

Parameters
statusSource handle to move from.

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