VLink 2.0.0
A high-performance communication middleware
载入中...
搜索中...
未找到
vlink::Schedule结构体 参考final

Non-constructible utility struct providing task scheduling primitives. 更多...

#include <schedule.h>

vlink::Schedule 的协作图:

struct  Config
 Scheduling parameters for a task posted via MessageLoop::exec_task(). 更多...
class  Status
 RAII handle returned by exec_task() for a void-callback task. 更多...
class  RetStatus
 RAII handle returned by exec_task() for a bool-returning callback task. 更多...

Public 类型

using Callback = std::function<void()>
 Callback type for void tasks and lifecycle hooks (schedule/execution timeout, else).
using RetCallback = std::function<bool()>
 Callback type for tasks that return a boolean result.
using CatchCallback = std::function<void(std::exception&)>
 Callback type invoked when an exception is caught inside the task.

Public 成员函数

 Schedule ()=delete
 Schedule (const Schedule &)=delete
Scheduleoperator= (const Schedule &)=delete
 Schedule (Schedule &&)=delete
Scheduleoperator= (Schedule &&)=delete

静态 Public 成员函数

static Status process (const Config &config, Callback &&callback, Callback &wrapper_callback)
 Wraps a void callback in a Config envelope and produces a wrapper task.
static RetStatus process_with_ret (const Config &config, RetCallback &&callback, Callback &wrapper_callback)
 Wraps a bool-returning callback in a Config envelope and produces a wrapper task.

详细描述

Non-constructible utility struct providing task scheduling primitives.

Contains Config, Status, RetStatus, process() and process_with_ret(). Users interact with this struct primarily via MessageLoop::exec_task().

成员类型定义说明

◆ Callback

using vlink::Schedule::Callback = std::function<void()>

Callback type for void tasks and lifecycle hooks (schedule/execution timeout, else).

◆ CatchCallback

using vlink::Schedule::CatchCallback = std::function<void(std::exception&)>

Callback type invoked when an exception is caught inside the task.

◆ RetCallback

using vlink::Schedule::RetCallback = std::function<bool()>

Callback type for tasks that return a boolean result.

构造及析构函数说明

◆ Schedule() [1/3]

vlink::Schedule::Schedule ( )
delete
这是这个函数的调用关系图:

◆ Schedule() [2/3]

vlink::Schedule::Schedule ( const Schedule & )
delete
函数调用图:

◆ Schedule() [3/3]

vlink::Schedule::Schedule ( Schedule && )
delete
函数调用图:

成员函数说明

◆ operator=() [1/2]

Schedule & vlink::Schedule::operator= ( const Schedule & )
delete
函数调用图:

◆ operator=() [2/2]

Schedule & vlink::Schedule::operator= ( Schedule && )
delete
函数调用图:

◆ process()

Status vlink::Schedule::process ( const Config & config,
Callback && callback,
Callback & wrapper_callback )
staticnodiscard

Wraps a void callback in a Config envelope and produces a wrapper task.

Called internally by MessageLoop::exec_task(). Creates the Status and populates wrapper_callback with the task wrapper ready to be posted to the queue.

参数
configScheduling configuration.
callbackVoid callable to execute.
wrapper_callbackOutput: the wrapped task to be posted.
返回
Status handle for chaining callbacks.
这是这个函数的调用关系图:

◆ process_with_ret()

RetStatus vlink::Schedule::process_with_ret ( const Config & config,
RetCallback && callback,
Callback & wrapper_callback )
staticnodiscard

Wraps a bool-returning callback in a Config envelope and produces a wrapper task.

Called internally by MessageLoop::exec_task(). Creates the RetStatus and populates wrapper_callback with the task wrapper ready to be posted to the queue.

参数
configScheduling configuration.
callbackBool-returning callable to execute.
wrapper_callbackOutput: the wrapped task to be posted.
返回
RetStatus handle for chaining callbacks.
这是这个函数的调用关系图:

该结构体的文档由以下文件生成: