|
fennec
|
Wrapper for atomic variables. More...
#include <atomic.h>
| T | The type of the atomic variable |
Public Member Functions | |
| constexpr | atomic () noexcept |
| Default Constructor. | |
| constexpr | atomic (const T value) noexcept |
| Value Constructor. | |
| T | operator= (const T x) noexcept |
| T | operator= (const T x) volatile noexcept |
| Stores a value into an atomic object. | |
| void | store (const T x, memory_order order=memory_order_seq_cst) noexcept |
| void | store (const T x, memory_order order=memory_order_seq_cst) volatile noexcept |
| Atomically replaces the value of the atomic object with a non-atomic argument. | |
| T | load (memory_order order=memory_order_seq_cst) const noexcept |
| T | load (memory_order order=memory_order_seq_cst) const volatile noexcept |
| Atomically obtains the value of the atomic object. | |
| operator T () const noexcept | |
| operator T () const volatile noexcept | |
| Loads a value from an atomic object. | |
| T | exchange (const T x, memory_order order=memory_order_seq_cst) noexcept |
| T | exchange (const T x, memory_order order=memory_order_seq_cst) volatile noexcept |
| Atomically replaces the value of the atomic object and obtains the value held previously. | |
| bool | compare_exchange_weak (T &exp, T x, memory_order succ, memory_order fail) noexcept |
| bool | compare_exchange_weak (T &exp, T x, memory_order succ, memory_order fail) volatile noexcept |
| bool | compare_exchange_weak (T &exp, T x, memory_order order=memory_order_seq_cst) noexcept |
| bool | compare_exchange_weak (T &exp, T x, memory_order order=memory_order_seq_cst) volatile noexcept |
| Atomically compares the value of the atomic object with non-atomic argument and performs atomic exchange if equal or atomic load if not. | |
| bool | compare_exchange_strong (T &exp, T x, memory_order succ, memory_order fail) noexcept |
| bool | compare_exchange_strong (T &exp, T x, memory_order succ, memory_order fail) volatile noexcept |
| bool | compare_exchange_strong (T &exp, T x, memory_order order=memory_order_seq_cst) noexcept |
| bool | compare_exchange_strong (T &exp, T x, memory_order order=memory_order_seq_cst) volatile noexcept |
| Atomically compares the value of the atomic object with non-atomic argument and performs atomic exchange if equal or atomic load if not. | |
|
inlineconstexprnoexcept |
Initializes the held atomic variable with 0.
|
inlineconstexprnoexcept |
Initializes the held atomic variable with value.
| value | The value to initialize the atomic variable with. |
|
inlinenoexcept |
Atomically assigns x to the atomic variable.
| x | The value to assign |
x
|
inlinenoexcept |
Atomically assigns x to the atomic variable.
| x | The value to assign |
x
|
inlinenoexcept |
Atomically replaces the current value with x. Memory is affected according to the value of order.
| x | The value to store into the atomic variable |
| order | Memory order constraints to enforce |
|
inlinenoexcept |
Atomically replaces the current value with x. Memory is affected according to the value of order.
| x | The value to store into the atomic variable |
| order | Memory order constraints to enforce |
|
inlinenoexcept |
Atomically loads and returns the current value of the atomic variable. Memory is affected according to the value of order.
| order | Memory order constraints to enforce |
|
inlinenoexcept |
Atomically loads and returns the current value of the atomic variable. Memory is affected according to the value of order.
| order | Memory order constraints to enforce |
|
inlinenoexcept |
Atomically loads and returns the current value of the atomic variable. Equivalent to load().
|
inlinenoexcept |
Atomically loads and returns the current value of the atomic variable. Equivalent to load().
|
inlinenoexcept |
Atomically replaces the underlying value with x (a read-modify-write operation). Memory is affected according to the value of order.
| x | Value to assign |
| order | Memory order constraints to enforce |
|
inlinenoexcept |
Atomically replaces the underlying value with x (a read-modify-write operation). Memory is affected according to the value of order.
| x | Value to assign |
| order | Memory order constraints to enforce |
|
inlinenoexcept |
Atomically compares the value of *this with that of exp. If they are equal, replaces the former with x (performs read-modify-write operation). Otherwise, loads the actual value stored in *this into exp (performs load operation).
| exp | Reference to the value expected to be found in the atomic object. |
| x | The value to store in the atomic object if it is as expected. |
| succ | The memory synchronization ordering for the read-modify-write operation if the comparison succeeds. |
| fail | The memory synchronization ordering for the load operation if the comparison fails. |
| order | The memory synchronization ordering for both operations. |
true if the underlying atomic value was successfully changed, false otherwise.
|
inlinenoexcept |
Atomically compares the value of *this with that of exp. If they are equal, replaces the former with x (performs read-modify-write operation). Otherwise, loads the actual value stored in *this into exp (performs load operation).
| exp | Reference to the value expected to be found in the atomic object. |
| x | The value to store in the atomic object if it is as expected. |
| succ | The memory synchronization ordering for the read-modify-write operation if the comparison succeeds. |
| fail | The memory synchronization ordering for the load operation if the comparison fails. |
| order | The memory synchronization ordering for both operations. |
true if the underlying atomic value was successfully changed, false otherwise.
|
inlinenoexcept |
Atomically compares the value of *this with that of exp. If they are equal, replaces the former with x (performs read-modify-write operation). Otherwise, loads the actual value stored in *this into exp (performs load operation).
| exp | Reference to the value expected to be found in the atomic object. |
| x | The value to store in the atomic object if it is as expected. |
| succ | The memory synchronization ordering for the read-modify-write operation if the comparison succeeds. |
| fail | The memory synchronization ordering for the load operation if the comparison fails. |
| order | The memory synchronization ordering for both operations. |
true if the underlying atomic value was successfully changed, false otherwise.
|
inlinenoexcept |
Atomically compares the value of *this with that of exp. If they are equal, replaces the former with x (performs read-modify-write operation). Otherwise, loads the actual value stored in *this into exp (performs load operation).
| exp | Reference to the value expected to be found in the atomic object. |
| x | The value to store in the atomic object if it is as expected. |
| succ | The memory synchronization ordering for the read-modify-write operation if the comparison succeeds. |
| fail | The memory synchronization ordering for the load operation if the comparison fails. |
| order | The memory synchronization ordering for both operations. |
true if the underlying atomic value was successfully changed, false otherwise.
|
inlinenoexcept |
Atomically compares the value of *this with that of exp. If they are equal, replaces the former with x (performs read-modify-write operation). Otherwise, loads the actual value stored in *this into exp (performs load operation).
| exp | Reference to the value expected to be found in the atomic object. |
| x | The value to store in the atomic object if it is as expected. |
| succ | The memory synchronization ordering for the read-modify-write operation if the comparison succeeds. |
| fail | The memory synchronization ordering for the load operation if the comparison fails. |
| order | The memory synchronization ordering for both operations. |
true if the underlying atomic value was successfully changed, false otherwise.
|
inlinenoexcept |
Atomically compares the value of *this with that of exp. If they are equal, replaces the former with x (performs read-modify-write operation). Otherwise, loads the actual value stored in *this into exp (performs load operation).
| exp | Reference to the value expected to be found in the atomic object. |
| x | The value to store in the atomic object if it is as expected. |
| succ | The memory synchronization ordering for the read-modify-write operation if the comparison succeeds. |
| fail | The memory synchronization ordering for the load operation if the comparison fails. |
| order | The memory synchronization ordering for both operations. |
true if the underlying atomic value was successfully changed, false otherwise.
|
inlinenoexcept |
Atomically compares the value of *this with that of exp. If they are equal, replaces the former with x (performs read-modify-write operation). Otherwise, loads the actual value stored in *this into exp (performs load operation).
| exp | Reference to the value expected to be found in the atomic object. |
| x | The value to store in the atomic object if it is as expected. |
| succ | The memory synchronization ordering for the read-modify-write operation if the comparison succeeds. |
| fail | The memory synchronization ordering for the load operation if the comparison fails. |
| order | The memory synchronization ordering for both operations. |
true if the underlying atomic value was successfully changed, false otherwise.
|
inlinenoexcept |
Atomically compares the value of *this with that of exp. If they are equal, replaces the former with x (performs read-modify-write operation). Otherwise, loads the actual value stored in *this into exp (performs load operation).
| exp | Reference to the value expected to be found in the atomic object. |
| x | The value to store in the atomic object if it is as expected. |
| succ | The memory synchronization ordering for the read-modify-write operation if the comparison succeeds. |
| fail | The memory synchronization ordering for the load operation if the comparison fails. |
| order | The memory synchronization ordering for both operations. |
true if the underlying atomic value was successfully changed, false otherwise.