![]() |
Arene Base
Fundamental Utilities For Safety Critical C++
|
A thread-safe atomic counter. More...
Public Types | |
| using | value_type = std::uint64_t |
| The value type of the counter. | |
Public Member Functions | |
| constexpr | atomic_monotonic_counter () noexcept |
| Default constructor initializing counter to 0. | |
| constexpr | atomic_monotonic_counter (value_type const initial_value) noexcept |
| Constructor with initial value. | |
| auto | load () const noexcept -> value_type |
| Atomically loads and returns the current counter value. | |
| operator value_type () const noexcept | |
| Implicit conversion to the counter's value type. | |
| auto | operator++ () noexcept -> value_type |
| Pre-increment operator. | |
| auto | operator++ (int) noexcept -> value_type |
| Post-increment operator. | |
A thread-safe atomic counter.
A 64-bit unsigned monotonic counter using compiler atomic intrinsics, intended for use when the C++ standard library atomic header is not available.
Note: All operations use sequentially consistent memory ordering.
The value type of the counter.
|
inlineconstexprnoexcept |
Default constructor initializing counter to 0.
|
inlineexplicitconstexprnoexcept |
Constructor with initial value.
| initial_value | The initial value for the counter |
|
inlinenoexcept |
Atomically loads and returns the current counter value.
|
inlinenoexcept |
Implicit conversion to the counter's value type.
|
inlinenoexcept |
Pre-increment operator.
Note: This returns a copy of the counter value, not a reference to the counter.
|
inlinenoexcept |
Post-increment operator.
Note: This returns a copy of the counter value, not a reference to the counter.