|
NexusForce 1.0.0
A rigorously engineered full-stack C++ backend library.
|
多态执行器 更多...
#include <executor.hpp>
类 | |
| struct | executor_base |
| 执行器概念基类 更多... | |
Public 类型 | |
| using | handler_type = function<void()> |
| handler 类型 | |
Public 成员函数 | |
| template<typename Exec, enable_if_t<!is_same_v< decay_t< Exec >, executor >, int > = 0> | |
| executor (Exec exec) | |
| 从任意满足 executor 概念的类型构造 | |
| void | execute (handler_type handler) const |
| 投递 handler 到执行器 | |
| void | post (handler_type handler) const |
| 投递 handler 到执行器 | |
| operator bool () const noexcept | |
| 检查执行器是否有效 | |
| bool | operator== (const executor &other) const noexcept |
| 相等比较 | |
| bool | operator!= (const executor &other) const noexcept |
| 不等比较 | |
多态执行器
类型擦除的执行器句柄,可包装任意满足 executor 概念的类型。 任意拥有一个可调用 execute(handler_type) 方法的类型都可以 通过模板构造函数包装为 executor。
在文件 executor.hpp 第 36 行定义.
|
inline |
从任意满足 executor 概念的类型构造
| Exec | 包装的执行器类型 |
| exec | 要包装的执行器实例 |
在文件 executor.hpp 第 61 行定义.
引用了 execute(), neforce::make_shared() , 以及 neforce::move().
|
inline |
投递 handler 到执行器
| handler | 要执行的 handler |
在文件 executor.hpp 第 75 行定义.
引用了 neforce::move().
被这些函数引用 executor() , 以及 post().
|
inline |
投递 handler 到执行器
| handler | 要执行的 handler |
在文件 executor.hpp 第 85 行定义.
引用了 execute() , 以及 neforce::move().