VLink 2.0.0
A high-performance communication middleware
载入中...
搜索中...
未找到
vlink::Schedule::Status类 参考

RAII handle returned by exec_task() for a void-callback task. 更多...

#include <schedule.h>

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

struct  StatusImpl

Public 成员函数

 Status ()
 Constructs an invalid Status (not yet associated with a task).
 ~Status ()
 Destructor.
 Status (const Status &)=delete
Statusoperator= (const Status &)=delete
 Status (Status &&status) noexcept
 Move constructor.
Statusoperator= (Status &&status) noexcept
 Move assignment.
void set_valid (bool valid)
 Sets whether the status is valid (task was successfully posted).
bool is_valid () const
 Returns true if the associated task was posted successfully.
Statuson_schedule_timeout (Callback &&callback)
 Registers a callback fired when the task does not start within schedule_timeout_ms.
Statuson_execution_timeout (Callback &&callback)
 Registers a callback fired when the task runs longer than execution_timeout_ms.
Statuson_catch (CatchCallback &&callback)
 Registers a callback fired when the task throws an exception.

Protected 属性

friend Schedule
std::shared_ptr< StatusImplimpl_

详细描述

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

Destructor.

◆ Status() [2/3]

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

◆ Status() [3/3]

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

Move constructor.

参数
statusSource status to move from.
函数调用图:

成员函数说明

◆ is_valid()

bool vlink::Schedule::Status::is_valid ( ) const
nodiscard

Returns true if the associated task was posted successfully.

返回
true if valid.

◆ on_catch()

Status & vlink::Schedule::Status::on_catch ( CatchCallback && callback)

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.

参数
callbackCallback invoked with the caught exception.
返回
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.

参数
callbackCallback invoked from the loop thread on execution timeout.
返回
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.

参数
callbackCallback invoked from the loop thread on schedule timeout.
返回
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.

参数
statusSource status to move from.
返回
Reference to *this.
函数调用图:

◆ set_valid()

void vlink::Schedule::Status::set_valid ( bool valid)

Sets whether the status is valid (task was successfully posted).

参数
validtrue if the associated task was posted successfully.

类成员变量说明

◆ impl_

std::shared_ptr<StatusImpl> vlink::Schedule::Status::impl_
protected

◆ Schedule

friend vlink::Schedule::Status::Schedule
protected

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