VLink  2.0.0
A high-performance communication middleware
vlink::Schedule::RetStatus类 参考final

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

#include <schedule.h>

类 vlink::Schedule::RetStatus 继承关系图:
vlink::Schedule::RetStatus 的协作图:

Public 成员函数

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

额外继承的成员函数

详细描述

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.

成员函数说明

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

参数
callbackHook invoked on the dispatcher thread when false is returned.
返回
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.

参数
callbackContinuation taking no arguments and returning bool.
返回
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.

参数
statusSource handle to move from.

该类的文档由以下文件生成: