|
NexusForce 1.0.0
A Modern C++ Library with extended functionality, web components, and utility libraries
|
系统事件类 更多...
#include <system_event.hpp>
Public 类型 | |
| enum class | type { manual_reset , auto_reset } |
| 事件类型枚举 更多... | |
Public 成员函数 | |
| system_event (bool initial_state=false, type t=type::auto_reset) | |
| 构造函数 | |
| ~system_event () | |
| 析构函数 | |
| system_event (system_event &&other) noexcept | |
| 移动构造函数 | |
| system_event & | operator= (system_event &&other) noexcept |
| 移动赋值运算符 | |
| void | set () noexcept |
| 设置事件为有信号状态 | |
| void | reset () noexcept |
| 重置事件为无信号状态 | |
| bool | wait (uint32_t timeout_ms=numeric_traits< uint32_t >::max()) noexcept |
| 等待事件变为有信号状态 | |
| type | event_type () const noexcept |
| 获取事件类型 | |
| void * | native_handle () const noexcept |
| 获取原生事件句柄 | |
|
strong |
事件类型枚举
| 枚举值 | |
|---|---|
| manual_reset | 手动重置,多个等待线程都会被唤醒,需要手动reset |
| auto_reset | 自动重置,只唤醒一个等待线程,之后自动重置为无信号 |
在文件 system_event.hpp 第 39 行定义.
|
explicit |
构造函数
| initial_state | 初始信号状态 |
| t | 事件类型 |
| system_exception | 创建失败时抛出 |
引用了 auto_reset.
被这些函数引用 operator=(), system_event() , 以及 ~system_event().
|
noexcept |
|
inlinenodiscardnoexcept |
|
inlinenodiscardnoexcept |
|
noexcept |
|
noexcept |
设置事件为有信号状态
唤醒等待该事件的线程。
|
noexcept |