|
NexusForce 1.0.0
A Modern C++ Library with extended functionality, web components, and utility libraries
|
信号类 更多...
#include <signals.hpp>
Public 成员函数 | |
| template<typename Self, typename MemFn, typename... Tag> | |
| connection | connect (Self self, MemFn memfn, Tag... tag) |
| 连接成员函数(默认优先级0) | |
| template<typename Func> | |
| connection | connect (Func callback, int priority=0) |
| 连接普通函数/lambda | |
| template<typename Self, typename MemFn, typename... Tag> | |
| connection | connect (Self self, MemFn memfn, int priority, Tag... tag) |
| 连接成员函数 | |
| void | emit (Types... args) |
| 触发信号 | |
| template<typename Executor> | |
| void | emit_executor (Executor &executor, Types... args) |
| 执行器触发信号 | |
| template<typename... Args> | |
| void | operator() (Args &&... args) |
| 函数调用操作符 | |
| void | disconnect_all () |
| 断开所有连接 | |
| connection | connect_signal (signal &other, int priority=0) |
| 连接另一个信号 | |
| connection | connect_signal (signal *other, int priority=0) |
| 连接另一个信号(指针版本) | |
| template<typename Func, typename Predicate> | |
| connection | connect_if (Func callback, Predicate pred, int priority=0) |
| 条件连接 | |
| template<typename Self, typename MemFn, typename Predicate, typename... Tag> | |
| connection | connect_if (Self self, MemFn memfn, Predicate pred, int priority, Tag... tag) |
| 条件连接(成员函数版本) | |
| template<typename Func, typename Filter> | |
| connection | connect_filtered (Func callback, Filter filter, int priority=0) |
| 过滤连接 | |
| template<typename Func, typename Transform> | |
| connection | connect_transformed (Func callback, Transform transform, int priority=0) |
| 变换连接 | |
| shared_ptr< bool > | block_flag () const noexcept |
| 获取阻塞标志 | |
| bool | is_blocked () const noexcept |
| 检查信号是否被阻塞 | |
| size_t | slot_count () const noexcept |
| 获取活跃槽的数量 | |
| NEFORCE_NODISCARD bool | empty () const noexcept |
| 检查信号是否为空(无活跃槽) | |
信号类
| Types | 信号参数类型列表 |
多播委托实现。
在文件 signals.hpp 第 240 行定义.
|
inlinenoexcept |
|
inline |
连接普通函数/lambda
| Func | 函数类型 |
| callback | 回调函数 |
| priority | 优先级(值越大优先级越高) |
在文件 signals.hpp 第 444 行定义.
引用了 move() , 以及 priority().
|
inline |
连接成员函数
| Self | 对象类型 |
| MemFn | 成员函数类型 |
| Tag | 连接标签类型 |
| self | 对象指针/智能指针 |
| memfn | 成员函数指针 |
| priority | 优先级 |
| tag | 连接标签(可选) |
在文件 signals.hpp 第 462 行定义.
引用了 move() , 以及 priority().
|
inline |
连接成员函数(默认优先级0)
| Self | 对象类型 |
| MemFn | 成员函数类型 |
| Tag | 连接标签类型 |
| self | 对象指针/智能指针 |
| memfn | 成员函数指针 |
| tag | 连接标签(可选) |
在文件 signals.hpp 第 432 行定义.
被这些函数引用 connect(), connect_filtered(), connect_if(), connect_if(), connect_signal(), connect_signal() , 以及 connect_transformed().
|
inline |
过滤连接
| Func | 回调函数类型 |
| Filter | 过滤器类型 |
| callback | 回调函数 |
| filter | 过滤器 |
| priority | 优先级 |
过滤器可以修改或抑制参数。
在文件 signals.hpp 第 659 行定义.
引用了 connect(), keep, move() , 以及 priority().
|
inline |
条件连接
| Func | 回调函数类型 |
| Predicate | 谓词类型 |
| callback | 回调函数 |
| pred | 谓词 |
| priority | 优先级 |
仅当谓词返回true时才调用回调。
在文件 signals.hpp 第 602 行定义.
引用了 connect(), is_boolean_v, keep, move() , 以及 priority().
|
inline |
条件连接(成员函数版本)
| Self | 对象类型 |
| MemFn | 成员函数类型 |
| Predicate | 谓词类型 |
| Tag | 连接标签类型 |
| self | 对象指针/智能指针 |
| memfn | 成员函数指针 |
| pred | 谓词 |
| priority | 优先级 |
| tag | 连接标签 |
在文件 signals.hpp 第 630 行定义.
引用了 connect(), is_boolean_v, keep, move() , 以及 priority().
|
inline |
连接另一个信号
| other | 另一个信号 |
| priority | 优先级 |
当此信号触发时,会转发给other信号。
在文件 signals.hpp 第 562 行定义.
引用了 connect() , 以及 priority().
|
inline |
连接另一个信号(指针版本)
| other | 另一个信号指针 |
| priority | 优先级 |
当此信号触发时,如果指针非空,则转发给other信号。
在文件 signals.hpp 第 579 行定义.
引用了 connect(), keep , 以及 priority().
|
inline |
变换连接
| Func | 回调函数类型 |
| Transform | 变换函数类型 |
| callback | 回调函数 |
| transform | 变换函数 |
| priority | 优先级 |
变换函数将参数转换为新类型后传递给回调。
在文件 signals.hpp 第 690 行定义.
引用了 connect(), is_invocable_v, move() , 以及 priority().
|
inline |
触发信号
| args | 信号参数 |
同步调用所有已连接的槽函数。会自动清理已断开或请求擦除的槽。 如果信号被阻塞,则什么也不做。
在文件 signals.hpp 第 485 行定义.
引用了 erase, is_blocked() , 以及 remove_if().
被这些函数引用 emit_executor() , 以及 operator()().
|
inline |
执行器触发信号
| Executor | 执行器类型 |
| executor | 执行器对象 |
| args | 信号参数 |
在指定的执行器上异步调用emit。
在文件 signals.hpp 第 524 行定义.
引用了 apply(), emit(), forward(), make_tuple() , 以及 move().
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |