|
libxr
1.0
Want to be the best embedded framework
|
普通标志位(非原子)/ Non-atomic flag More...
#include <flag.hpp>
Public Member Functions | |
| Plain ()=default | |
| 构造函数,默认未置位 / Constructor, default cleared | |
| void | Set () noexcept |
| 置位标志 / Set the flag | |
| void | Clear () noexcept |
| 清除标志 / Clear the flag | |
| bool | IsSet () const noexcept |
| 判断是否已置位 / Check whether the flag is set | |
| bool | TestAndSet () noexcept |
| 测试并置位:置位并返回旧状态 / Test-and-set: set and return previous state | |
| bool | TestAndClear () noexcept |
| 测试并清除:清除并返回旧状态 / Test-and-clear: clear and return previous state | |
| bool | Exchange (bool set_value) noexcept |
| 交换:写入指定值并返回旧状态 / Exchange: set to desired value and return previous state | |
Private Attributes | |
| bool | value_ |
| 标志值(false=clear, true=set)/ Flag value (false=clear, true=set) | |
普通标志位(非原子)/ Non-atomic flag
不具备并发安全性;仅适用于单线程环境或外部已保证互斥/临界区保护的场景。 Not thread-safe; use only in single-threaded context or when externally synchronized.
|
inlinenoexcept |
清除标志 / Clear the flag
Definition at line 130 of file flag.hpp.
|
inlinenodiscardnoexcept |
交换:写入指定值并返回旧状态 / Exchange: set to desired value and return previous state
| set_value | 期望写入的值 / Desired value to write |
|
inlinenodiscardnoexcept |
|
inlinenoexcept |
|
inlinenodiscardnoexcept |
|
inlinenodiscardnoexcept |
|
private |