Utility class implementing an atomic boolean on top of an int32.
More...
|
| atomic_boolean (bool value=false) |
| Constructs a new atomic_boolean. More...
|
|
bool | is_set (bool value=true) |
| Checks if the atomic boolean has a certain value. More...
|
|
void | set (bool new_value) |
| Sets a new value for the atomic boolean. More...
|
|
Utility class implementing an atomic boolean on top of an int32.
The mysys lib does not support atomic booleans.
◆ atomic_boolean()
atomic_boolean::atomic_boolean |
( |
bool |
value = false | ) |
|
|
inline |
Constructs a new atomic_boolean.
- Parameters
-
value | The value to initialize the boolean with. |
◆ is_set()
bool atomic_boolean::is_set |
( |
bool |
value = true | ) |
|
|
inline |
Checks if the atomic boolean has a certain value.
if used without an argument checks if the atomic boolean is on.
- Parameters
-
value | the value to check for |
- Return values
-
true | the atomic boolean value matches the argument value |
false | the atomic boolean value is different from the argument value |
◆ set()
void atomic_boolean::set |
( |
bool |
new_value | ) |
|
|
inline |
Sets a new value for the atomic boolean.
- Parameters
-
◆ m_false
const int atomic_boolean::m_false = 1 |
|
staticprivate |
◆ m_true
const int atomic_boolean::m_true = 0 |
|
staticprivate |
constants for true and false
◆ m_value
std::atomic<int32> atomic_boolean::m_value |
|
private |
storage for the boolean's current value
The documentation for this class was generated from the following file: