An atomic primitive which support versioning. The type which is wrapper has additional meta data.
More...
#include <Versioning.hh>
|
template<typename ... Args> |
| VersionedAtomic (Meta meta, Args &&... args) |
|
| VersionedAtomic (ValType value, Meta meta={}) |
|
| VersionedAtomic (const VersionedAtomic &rhs) |
|
auto | load () const noexcept -> Referenced< ValType, Meta > * |
| Load the value stored inside.
|
|
auto | store (ValType new_value, std::optional< Meta > new_meta={}) noexcept |
| Store a value inside.
|
|
template<typename Fun > |
auto | transform (Fun fun) const |
| Apply a function to the value inside. More...
|
|
auto | version () const noexcept -> VersionNum |
|
auto | compare_exchange_weak (const ValType &expected, std::optional< versioning::VersionNum > expected_version_opt, ValType desired, Meta desired_meta, ContentionFailureCounter &failures) -> std::optional< bool > |
| Performs a CAS on the value stored inside. More...
|
|
template<typename ... Args> |
auto | compare_exchange_strong (Args &&... args) -> bool |
|
auto | has_modified_bit () const noexcept -> bool |
|
void | clear_modified_bit () noexcept |
|
template<typename ValType, typename Meta = void>
class telamon_simulator::versioning::VersionedAtomic< ValType, Meta >
An atomic primitive which support versioning. The type which is wrapper has additional meta data.
- Note
- T has to implement comparison operators VersionedAtomic is used by the user to implement the required functions of CasWithVersioning, requirement of the NormalizedRepresentation concept
◆ compare_exchange_weak()
template<typename ValType , typename Meta = void>
Performs a CAS on the value stored inside.
- Parameters
-
expected | The expected value |
desired | The value which will placed |
failures | The contention counter \ret None if failed (contention) False if some of the requirements were not met True if the CAS was performed successfully |
◆ transform()
template<typename ValType , typename Meta = void>
template<typename Fun >
Apply a function to the value inside.
- Template Parameters
-
R | The return type of the function. Also used as the return type of transform |
- Parameters
-
fun | The function applied to the value inside |
The documentation for this class was generated from the following file: