xentara-utils v2.0.4
The Xentara Utility Library
|
An atomic version of std::unique_ptr. More...
#include <xentara/utils/atomic/UniquePointer.hpp>
Public Types | |
using | UnownedPointer = tools::UnownedPointer< Element, Deleter > |
A pointer that is used as the value in cases where ownership is not transferred. | |
Public Member Functions | |
constexpr | UniquePointer () noexcept=default |
Default constructor. | |
UniquePointer (std::unique_ptr< Element, Deleter > &&value) noexcept | |
Constructor that initializes the value from an std::unique_ptr. | |
UniquePointer (typename std::unique_ptr< Element, Deleter >::pointer object) noexcept | |
Constructor that takes ownership of en externally created value. | |
template<typename RelatedElement , typename RelatedDeleter > requires std::is_constructible_v<std::unique_ptr<Element, Deleter>, std::unique_ptr<RelatedElement, RelatedDeleter> &&> | |
UniquePointer (std::unique_ptr< RelatedElement, RelatedDeleter > &&value) noexcept | |
Constructor that initializes the value from a related std::unique_ptr. | |
constexpr | UniquePointer (std::nullptr_t) noexcept |
Constructor that creates an empty pointer. | |
~UniquePointer () noexcept | |
Destructor. | |
auto | operator= (std::unique_ptr< Element, Deleter > &&value) noexcept -> void |
Atomically transfers an object from an std::unique_ptr using std::memory_order::seq_cst. | |
template<typename RelatedElement , typename RelatedDeleter > requires std::is_constructible_v<std::unique_ptr<Element, Deleter>, std::unique_ptr<RelatedElement, RelatedDeleter> &&> | |
auto | operator= (std::unique_ptr< RelatedElement, RelatedDeleter > &&value) noexcept -> void |
Atomically transfers an object from a related std::unique_ptr using std::memory_order::seq_cst. | |
auto | operator= (std::nullptr_t) noexcept -> void |
Atomically empties the pointer using std::memory_order::seq_cst. | |
operator UnownedPointer () const &noexcept | |
Atomically fetches the stored object using std::memory_order::seq_cst without taking ownership. | |
operator std::unique_ptr< Element, Deleter > () &&noexcept | |
Atomically fetches the stored object using std::memory_order::seq_cst and takes ownership. | |
auto | load (std::memory_order memoryOrder=std::memory_order::seq_cst) const noexcept -> UnownedPointer |
Atomically loads the stored pointer. | |
auto | store (std::unique_ptr< Element, Deleter > value, std::memory_order memoryOrder=std::memory_order::seq_cst) noexcept -> void |
Atomically transfers an object from an std::unique_ptr. | |
template<typename RelatedElement , typename RelatedDeleter > requires std::is_constructible_v<std::unique_ptr<Element, Deleter>, std::unique_ptr<RelatedElement, RelatedDeleter> &&> | |
auto | store (std::unique_ptr< RelatedElement, RelatedDeleter > value, std::memory_order memoryOrder=std::memory_order::seq_cst) noexcept -> void |
Atomically transfers an object from a related std::unique_ptr using std::memory_order::seq_cst. | |
auto | store (std::nullptr_t, std::memory_order memoryOrder=std::memory_order::seq_cst) noexcept -> void |
Atomically empties the pointer using std::memory_order::seq_cst. | |
auto | exchange (std::unique_ptr< Element, Deleter > &&value, std::memory_order memoryOrder=std::memory_order::seq_cst) noexcept -> std::unique_ptr< Element, Deleter > |
Atomically transfers an object from an std::unique_ptr and returns the previous object. | |
template<typename RelatedElement , typename RelatedDeleter > requires std::is_constructible_v<std::unique_ptr<Element, Deleter>, std::unique_ptr<RelatedElement, RelatedDeleter> &&> | |
auto | exchange (std::unique_ptr< RelatedElement, RelatedDeleter > &&value, std::memory_order memoryOrder=std::memory_order::seq_cst) noexcept -> std::unique_ptr< Element, Deleter > |
Atomically transfers an object from an std::unique_ptr and returns the previous object. | |
auto | exchange (std::nullptr_t, std::memory_order memoryOrder) noexcept -> std::unique_ptr< Element, Deleter > |
Atomically empties the pointer and returns the contained object. | |
auto | compare_exchange_weak (UnownedPointer &expectedValue, std::unique_ptr< Element, Deleter > &&newValue, std::memory_order memoryOrder=std::memory_order::seq_cst) noexcept -> bool |
Conditionally atomically exchanges the value with the object contained in an std::unique_ptr. | |
auto | compare_exchange_weak (UnownedPointer &expectedValue, std::unique_ptr< Element, Deleter > &&newValue, std::memory_order memoryOrderForSuccess, std::memory_order memoryOrderForFailure) noexcept -> bool |
Conditionally atomically exchanges the value with the object contained in an std::unique_ptr. | |
auto | compare_exchange_weak (UnownedPointer &expectedValue, std::unique_ptr< Element, Deleter > &oldValue, std::unique_ptr< Element, Deleter > &&newValue, std::memory_order memoryOrder=std::memory_order::seq_cst) noexcept -> bool |
Conditionally atomically exchanges the value with the object contained in an std::unique_ptr and retreives the previous object. | |
auto | compare_exchange_weak (UnownedPointer &expectedValue, std::unique_ptr< Element, Deleter > &oldValue, std::unique_ptr< Element, Deleter > &&newValue, std::memory_order memoryOrderForSuccess, std::memory_order memoryOrderForFailure) noexcept -> bool |
Conditionally atomically exchanges the value with the object contained in an std::unique_ptr and retreives the previous object. | |
template<typename RelatedElement , typename RelatedDeleter > requires std::is_constructible_v<std::unique_ptr<Element, Deleter>, std::unique_ptr<RelatedElement, RelatedDeleter> &&> | |
auto | compare_exchange_weak (UnownedPointer &expectedValue, std::unique_ptr< RelatedElement, RelatedDeleter > &&newValue, std::memory_order memoryOrder=std::memory_order::seq_cst) noexcept -> bool |
Conditionally atomically exchanges the value with the object contained in a related std::unique_ptr. | |
template<typename RelatedElement , typename RelatedDeleter > requires std::is_constructible_v<std::unique_ptr<Element, Deleter>, std::unique_ptr<RelatedElement, RelatedDeleter> &&> | |
auto | compare_exchange_weak (UnownedPointer &expectedValue, std::unique_ptr< RelatedElement, RelatedDeleter > &&newValue, std::memory_order memoryOrderForSuccess, std::memory_order memoryOrderForFailure) noexcept -> bool |
Conditionally atomically exchanges the value with the object contained in a related std::unique_ptr. | |
template<typename RelatedElement , typename RelatedDeleter > requires std::is_constructible_v<std::unique_ptr<Element, Deleter>, std::unique_ptr<RelatedElement, RelatedDeleter> &&> | |
auto | compare_exchange_weak (UnownedPointer &expectedValue, std::unique_ptr< Element, Deleter > &oldValue, std::unique_ptr< RelatedElement, RelatedDeleter > &&newValue, std::memory_order memoryOrder=std::memory_order::seq_cst) noexcept -> bool |
Conditionally atomically exchanges the value with the object contained in a related std::unique_ptr and retreives the previous object. | |
template<typename RelatedElement , typename RelatedDeleter > requires std::is_constructible_v<std::unique_ptr<Element, Deleter>, std::unique_ptr<RelatedElement, RelatedDeleter> &&> | |
auto | compare_exchange_weak (UnownedPointer &expectedValue, std::unique_ptr< Element, Deleter > &oldValue, std::unique_ptr< RelatedElement, RelatedDeleter > &&newValue, std::memory_order memoryOrderForSuccess, std::memory_order memoryOrderForFailure) noexcept -> bool |
Conditionally atomically exchanges the value with the object contained in a related std::unique_ptr and retreives the previous object. | |
auto | compare_exchange_weak (UnownedPointer &expectedValue, std::nullptr_t, std::memory_order memoryOrder=std::memory_order::seq_cst) noexcept -> bool |
Conditionally atomically exchanges the value with with an empty pointer. | |
auto | compare_exchange_weak (UnownedPointer &expectedValue, std::nullptr_t, std::memory_order memoryOrderForSuccess, std::memory_order memoryOrderForFailure) noexcept -> bool |
Conditionally atomically exchanges the value with an empty pointer. | |
auto | compare_exchange_weak (UnownedPointer &expectedValue, std::unique_ptr< Element, Deleter > &oldValue, std::nullptr_t, std::memory_order memoryOrder=std::memory_order::seq_cst) noexcept -> bool |
Conditionally atomically exchanges the value with with an empty pointer and retreives the previous object. | |
auto | compare_exchange_weak (UnownedPointer &expectedValue, std::unique_ptr< Element, Deleter > &oldValue, std::nullptr_t, std::memory_order memoryOrderForSuccess, std::memory_order memoryOrderForFailure) noexcept -> bool |
Conditionally atomically exchanges the value with an empty pointer and retreives the previous object. | |
auto | compare_exchange_strong (UnownedPointer &expectedValue, std::unique_ptr< Element, Deleter > &&newValue, std::memory_order memoryOrder=std::memory_order::seq_cst) noexcept -> bool |
Conditionally atomically exchanges the value with the object contained in an std::unique_ptr. | |
auto | compare_exchange_strong (UnownedPointer &expectedValue, std::unique_ptr< Element, Deleter > &&newValue, std::memory_order memoryOrderForSuccess, std::memory_order memoryOrderForFailure) noexcept -> bool |
Conditionally atomically exchanges the value with the object contained in an std::unique_ptr. | |
auto | compare_exchange_strong (UnownedPointer &expectedValue, std::unique_ptr< Element, Deleter > &oldValue, std::unique_ptr< Element, Deleter > &&newValue, std::memory_order memoryOrder=std::memory_order::seq_cst) noexcept -> bool |
Conditionally atomically exchanges the value with the object contained in an std::unique_ptr and retreives the previous object. | |
auto | compare_exchange_strong (UnownedPointer &expectedValue, std::unique_ptr< Element, Deleter > &oldValue, std::unique_ptr< Element, Deleter > &&newValue, std::memory_order memoryOrderForSuccess, std::memory_order memoryOrderForFailure) noexcept -> bool |
Conditionally atomically exchanges the value with the object contained in an std::unique_ptr and retreives the previous object. | |
template<typename RelatedElement , typename RelatedDeleter > requires std::is_constructible_v<std::unique_ptr<Element, Deleter>, std::unique_ptr<RelatedElement, RelatedDeleter> &&> | |
auto | compare_exchange_strong (UnownedPointer &expectedValue, std::unique_ptr< RelatedElement, RelatedDeleter > &&newValue, std::memory_order memoryOrder=std::memory_order::seq_cst) noexcept -> bool |
Conditionally atomically exchanges the value with the object contained in a related std::unique_ptr. | |
template<typename RelatedElement , typename RelatedDeleter > requires std::is_constructible_v<std::unique_ptr<Element, Deleter>, std::unique_ptr<RelatedElement, RelatedDeleter> &&> | |
auto | compare_exchange_strong (UnownedPointer &expectedValue, std::unique_ptr< RelatedElement, RelatedDeleter > &&newValue, std::memory_order memoryOrderForSuccess, std::memory_order memoryOrderForFailure) noexcept -> bool |
Conditionally atomically exchanges the value with the object contained in a related std::unique_ptr. | |
template<typename RelatedElement , typename RelatedDeleter > requires std::is_constructible_v<std::unique_ptr<Element, Deleter>, std::unique_ptr<RelatedElement, RelatedDeleter> &&> | |
auto | compare_exchange_strong (UnownedPointer &expectedValue, std::unique_ptr< Element, Deleter > &oldValue, std::unique_ptr< RelatedElement, RelatedDeleter > &&newValue, std::memory_order memoryOrder=std::memory_order::seq_cst) noexcept -> bool |
Conditionally atomically exchanges the value with the object contained in a related std::unique_ptr and retreives the previous object. | |
template<typename RelatedElement , typename RelatedDeleter > requires std::is_constructible_v<std::unique_ptr<Element, Deleter>, std::unique_ptr<RelatedElement, RelatedDeleter> &&> | |
auto | compare_exchange_strong (UnownedPointer &expectedValue, std::unique_ptr< Element, Deleter > &oldValue, std::unique_ptr< RelatedElement, RelatedDeleter > &&newValue, std::memory_order memoryOrderForSuccess, std::memory_order memoryOrderForFailure) noexcept -> bool |
Conditionally atomically exchanges the value with the object contained in a related std::unique_ptr and retreives the previous object. | |
auto | compare_exchange_strong (UnownedPointer &expectedValue, std::nullptr_t, std::memory_order memoryOrder=std::memory_order::seq_cst) noexcept -> bool |
Conditionally atomically exchanges the value with with an empty pointer. | |
auto | compare_exchange_strong (UnownedPointer &expectedValue, std::nullptr_t, std::memory_order memoryOrderForSuccess, std::memory_order memoryOrderForFailure) noexcept -> bool |
Conditionally atomically exchanges the value with an empty pointer. | |
auto | compare_exchange_strong (UnownedPointer &expectedValue, std::unique_ptr< Element, Deleter > &oldValue, std::nullptr_t, std::memory_order memoryOrder=std::memory_order::seq_cst) noexcept -> bool |
Conditionally atomically exchanges the value with with an empty pointer and retreives the previous object. | |
auto | compare_exchange_strong (UnownedPointer &expectedValue, std::unique_ptr< Element, Deleter > &oldValue, std::nullptr_t, std::memory_order memoryOrderForSuccess, std::memory_order memoryOrderForFailure) noexcept -> bool |
Conditionally atomically exchanges the value with an empty pointer and retreives the previous object. | |
auto | is_lock_free () const noexcept -> bool |
Determines whether operations on this object are lock free. | |
UniquePointer (const UniquePointer &)=delete | |
Deleted copy constructor. | |
auto | operator= (const UniquePointer &)=delete |
Deleted assignment opertaor. | |
Static Public Attributes | |
static constexpr bool | is_always_lock_free |
Determines whether operations on all objects of thsi class are lock free. | |
Related Symbols | |
(Note that these are not member symbols.) | |
template<typename LhsElement , typename LhsDeleter , typename RhsElement , typename RhsDeleter > | |
constexpr auto | operator== (const UniquePointer< LhsElement, LhsDeleter > &lhs, const UniquePointer< RhsElement, RhsDeleter > &rhs) -> bool |
Comparison between two atomic unique pointers. | |
template<typename LhsElement , typename LhsDeleter , typename RhsElement , typename RhsDeleter > | |
constexpr auto | operator== (const UniquePointer< LhsElement, LhsDeleter > &lhs, const tools::UnownedPointer< RhsElement, RhsDeleter > &rhs) -> bool |
Comparison between an atomic unique pointer and an unowned pointer. | |
template<typename LhsElement , typename LhsDeleter , typename RhsElement , typename RhsDeleter > | |
constexpr auto | operator== (const UniquePointer< LhsElement, LhsDeleter > &lhs, const std::unique_ptr< RhsElement, RhsDeleter > &rhs) -> bool |
Comparison between an atomic unique pointer and an std::unique_ptr. | |
template<typename Element , typename Deleter > | |
constexpr auto | operator== (const UniquePointer< Element, Deleter > &lhs, std::nullptr_t) -> bool |
Comparison between an atomic unique pointer and a null pointer. | |
template<typename LhsElement , typename LhsDeleter , typename RhsElement , typename RhsDeleter > | |
constexpr auto | operator (const UniquePointer< LhsElement, LhsDeleter > &lhs, const UniquePointer< RhsElement, RhsDeleter > &rhs) -> auto |
Tree-way comparison between two unowned pointers. | |
template<typename LhsElement , typename LhsDeleter , typename RhsElement , typename RhsDeleter > | |
constexpr auto | operator (const UniquePointer< LhsElement, LhsDeleter > &lhs, const tools::UnownedPointer< RhsElement, RhsDeleter > &rhs) -> auto |
Tree-way comparison between an atomic unique pointer and an unowned pointer. | |
template<typename LhsElement , typename LhsDeleter , typename RhsElement , typename RhsDeleter > | |
constexpr auto | operator (const UniquePointer< LhsElement, LhsDeleter > &lhs, const std::unique_ptr< RhsElement, RhsDeleter > &rhs) -> auto |
Tree-way comparison between an atomic unique pointer and an std::unique_ptr. | |
template<typename Element , typename Deleter > | |
constexpr auto | operator (const UniquePointer< Element, Deleter > &lhs, std::nullptr_t) -> auto |
Tree-way comparison between an atomic unique pointer and a null pointer. | |
An atomic version of std::unique_ptr.
Element | The type of object the pointer controls |
Deleter | The deleter to use to delete objects. This must be an empty type. The deleter must be stateless, meaning that one deleter can be replacable by any other default constructed deleter. This is necessary because the deleter cannot be stored atomically, so it will be destroyed when a value is stored, and a new deleter will be created when the value is retreived. In addition, if Deleter has a member type named pointer, that type must be suitable for use with std::atomic. |
using xentara::utils::atomic::UniquePointer< Element, Deleter >::UnownedPointer = tools::UnownedPointer<Element, Deleter> |
A pointer that is used as the value in cases where ownership is not transferred.
|
constexprdefaultnoexcept |
Default constructor.
This constructor creates an empty pointer that does not hold an object.
|
noexcept |
Constructor that initializes the value from an std::unique_ptr.
value | The pointer to initialize from. Any object the pointer holds will be transferred to the atomic. |
|
explicitnoexcept |
Constructor that takes ownership of en externally created value.
object | The object, or nullpt to create an empty value. The atomic will take ownership of the object. |
|
noexcept |
Constructor that initializes the value from a related std::unique_ptr.
value | The pointer to initialize from. Any object the pointer holds will be transferred to the atomic. |
|
constexprnoexcept |
Constructor that creates an empty pointer.
This constructor creates a pointer that does not contain an object. It is equivalient to the default constructor.
|
noexcept |
Destructor.
This destructor deletes any object the atomic may be holding.
|
delete |
Deleted copy constructor.
|
noexcept |
Conditionally atomically exchanges the value with with an empty pointer.
If the comparison succeeds and the values are exchanged, the previous object (if any) is destroyed.
expectedValue | The expected value. The atomic will only be emptied if it currently contains this value. If the comparison fails, expectedValue will be set to the actual value of the atomic. |
memoryOrder | The memory order used to exchange the value. |
|
noexcept |
Conditionally atomically exchanges the value with an empty pointer.
If the comparison succeeds and the values are exchanged, the previous object (if any) is destroyed.
expectedValue | The expected value. The atomic will only be emptied if it currently contains this value. If the comparison fails, expectedValue will be set to the actual value of the atomic. |
memoryOrderForSuccess | The memory order used if the comparison succeeds. |
memoryOrderForFailure | The memory order used if the comparison fails. |
|
noexcept |
Conditionally atomically exchanges the value with the object contained in an std::unique_ptr.
If the comparison succeeds and the values are exchanged, the previous object (if any) is destroyed.
expectedValue | The expected value. The new value will only be set if the atomic currently contains this value. If the comparison fails, expectedValue will be set to the actual value of the atomic. |
newValue | The pointer to transfer the object from if the comparison is successful. Any object the pointer holds will then be transferred to the atomic. If the comparison fails, newValue will retain the object, so the function can be called again. |
memoryOrder | The memory order used to exchange the value. |
|
noexcept |
Conditionally atomically exchanges the value with the object contained in an std::unique_ptr.
If the comparison succeeds and the values are exchanged, the previous object (if any) is destroyed.
expectedValue | The expected value. The new value will only be set if the atomic currently contains this value. If the comparison fails, expectedValue will be set to the actual value of the atomic. |
newValue | The pointer to transfer the object from if the comparison is successful. Any object the pointer holds will then be transferred to the atomic. If the comparison fails, newValue will retain the object, so the function can be called again. |
memoryOrderForSuccess | The memory order used if the comparison succeeds. |
memoryOrderForFailure | The memory order used if the comparison fails. |
|
noexcept |
Conditionally atomically exchanges the value with with an empty pointer and retreives the previous object.
expectedValue | The expected value. The atomic will only be emptied if it currently contains this value. If the comparison fails, expectedValue will be set to the actual value of the atomic. |
oldValue | If the comparison succeeds and the values are exchanged, ownership of the previous object (if any) is transferred to this pointer. |
memoryOrder | The memory order used to exchange the value. |
|
noexcept |
Conditionally atomically exchanges the value with an empty pointer and retreives the previous object.
expectedValue | The expected value. The atomic will only be emptied if it currently contains this value. If the comparison fails, expectedValue will be set to the actual value of the atomic. |
oldValue | If the comparison succeeds and the values are exchanged, ownership of the previous object (if any) is transferred to this pointer. |
memoryOrderForSuccess | The memory order used if the comparison succeeds. |
memoryOrderForFailure | The memory order used if the comparison fails. |
|
noexcept |
Conditionally atomically exchanges the value with the object contained in an std::unique_ptr and retreives the previous object.
expectedValue | The expected value. The new value will only be set if the atomic currently contains this value. If the comparison fails, expectedValue will be set to the actual value of the atomic. |
oldValue | If the comparison succeeds and the values are exchanged, ownership of the previous object (if any) is transferred to this pointer. |
newValue | The pointer to transfer the object from if the comparison is successful. Any object the pointer holds will then be transferred to the atomic. If the comparison fails, newValue will retain the object, so the function can be called again. |
memoryOrder | The memory order used to exchange the value. |
|
noexcept |
Conditionally atomically exchanges the value with the object contained in an std::unique_ptr and retreives the previous object.
expectedValue | The expected value. The new value will only be set if the atomic currently contains this value. If the comparison fails, expectedValue will be set to the actual value of the atomic. |
oldValue | If the comparison succeeds and the values are exchanged, ownership of the previous object (if any) is transferred to this pointer. |
newValue | The pointer to transfer the object from if the comparison is successful. Any object the pointer holds will then be transferred to the atomic. If the comparison fails, newValue will retain the object, so the function can be called again. |
memoryOrderForSuccess | The memory order used if the comparison succeeds. |
memoryOrderForFailure | The memory order used if the comparison fails. |
|
noexcept |
Conditionally atomically exchanges the value with the object contained in a related std::unique_ptr and retreives the previous object.
expectedValue | The expected value. The new value will only be set if the atomic currently contains this value. If the comparison fails, expectedValue will be set to the actual value of the atomic. |
oldValue | If the comparison succeeds and the values are exchanged, ownership of the previous object (if any) is transferred to this pointer. |
newValue | The pointer to transfer the object from if the comparison is successful. Any object the pointer holds will then be transferred to the atomic. If the comparison fails, newValue will retain the object, so the function can be called again. |
memoryOrder | The memory order used to exchange the value. |
|
noexcept |
Conditionally atomically exchanges the value with the object contained in a related std::unique_ptr and retreives the previous object.
expectedValue | The expected value. The new value will only be set if the atomic currently contains this value. If the comparison fails, expectedValue will be set to the actual value of the atomic. |
oldValue | If the comparison succeeds and the values are exchanged, ownership of the previous object (if any) is transferred to this pointer. |
newValue | The pointer to transfer the object from if the comparison is successful. Any object the pointer holds will then be transferred to the atomic. If the comparison fails, newValue will retain the object, so the function can be called again. |
memoryOrderForSuccess | The memory order used if the comparison succeeds. |
memoryOrderForFailure | The memory order used if the comparison fails. |
|
noexcept |
Conditionally atomically exchanges the value with the object contained in a related std::unique_ptr.
If the comparison succeeds and the values are exchanged, the previous object (if any) is destroyed.
expectedValue | The expected value. The new value will only be set if the atomic currently contains this value. If the comparison fails, expectedValue will be set to the actual value of the atomic. |
newValue | The pointer to transfer the object from if the comparison is successful. Any object the pointer holds will then be transferred to the atomic. If the comparison fails, newValue will retain the object, so the function can be called again. |
memoryOrder | The memory order used to exchange the value. |
|
noexcept |
Conditionally atomically exchanges the value with the object contained in a related std::unique_ptr.
If the comparison succeeds and the values are exchanged, the previous object (if any) is destroyed.
expectedValue | The expected value. The new value will only be set if the atomic currently contains this value. If the comparison fails, expectedValue will be set to the actual value of the atomic. |
newValue | The pointer to transfer the object from if the comparison is successful. Any object the pointer holds will then be transferred to the atomic. If the comparison fails, newValue will retain the object, so the function can be called again. |
memoryOrderForSuccess | The memory order used if the comparison succeeds. |
memoryOrderForFailure | The memory order used if the comparison fails. |
|
noexcept |
Conditionally atomically exchanges the value with with an empty pointer.
If the comparison succeeds and the values are exchanged, the previous object (if any) is destroyed.
expectedValue | The expected value. The atomic will only be emptied if it currently contains this value. If the comparison fails, expectedValue will be set to the actual value of the atomic. |
memoryOrder | The memory order used to exchange the value. |
|
noexcept |
Conditionally atomically exchanges the value with an empty pointer.
If the comparison succeeds and the values are exchanged, the previous object (if any) is destroyed.
expectedValue | The expected value. The atomic will only be emptied if it currently contains this value. If the comparison fails, expectedValue will be set to the actual value of the atomic. |
memoryOrderForSuccess | The memory order used if the comparison succeeds. |
memoryOrderForFailure | The memory order used if the comparison fails. |
|
noexcept |
Conditionally atomically exchanges the value with the object contained in an std::unique_ptr.
If the comparison succeeds and the values are exchanged, the previous object (if any) is destroyed.
expectedValue | The expected value. The new value will only be set if the atomic currently contains this value. If the comparison fails, expectedValue will be set to the actual value of the atomic. |
newValue | The pointer to transfer the object from if the comparison is successful. Any object the pointer holds will then be transferred to the atomic. If the comparison fails, newValue will retain the object, so the function can be called again. |
memoryOrder | The memory order used to exchange the value. |
|
noexcept |
Conditionally atomically exchanges the value with the object contained in an std::unique_ptr.
If the comparison succeeds and the values are exchanged, the previous object (if any) is destroyed.
expectedValue | The expected value. The new value will only be set if the atomic currently contains this value. If the comparison fails, expectedValue will be set to the actual value of the atomic. |
newValue | The pointer to transfer the object from if the comparison is successful. Any object the pointer holds will then be transferred to the atomic. If the comparison fails, newValue will retain the object, so the function can be called again. |
memoryOrderForSuccess | The memory order used if the comparison succeeds. |
memoryOrderForFailure | The memory order used if the comparison fails. |
|
noexcept |
Conditionally atomically exchanges the value with with an empty pointer and retreives the previous object.
expectedValue | The expected value. The atomic will only be emptied if it currently contains this value. If the comparison fails, expectedValue will be set to the actual value of the atomic. |
oldValue | If the comparison succeeds and the values are exchanged, ownership of the previous object (if any) is transferred to this pointer. |
memoryOrder | The memory order used to exchange the value. |
|
noexcept |
Conditionally atomically exchanges the value with an empty pointer and retreives the previous object.
expectedValue | The expected value. The atomic will only be emptied if it currently contains this value. If the comparison fails, expectedValue will be set to the actual value of the atomic. |
oldValue | If the comparison succeeds and the values are exchanged, ownership of the previous object (if any) is transferred to this pointer. |
memoryOrderForSuccess | The memory order used if the comparison succeeds. |
memoryOrderForFailure | The memory order used if the comparison fails. |
|
noexcept |
Conditionally atomically exchanges the value with the object contained in an std::unique_ptr and retreives the previous object.
expectedValue | The expected value. The new value will only be set if the atomic currently contains this value. If the comparison fails, expectedValue will be set to the actual value of the atomic. |
oldValue | If the comparison succeeds and the values are exchanged, ownership of the previous object (if any) is transferred to this pointer. |
newValue | The pointer to transfer the object from if the comparison is successful. Any object the pointer holds will then be transferred to the atomic. If the comparison fails, newValue will retain the object, so the function can be called again. |
memoryOrder | The memory order used to exchange the value. |
|
noexcept |
Conditionally atomically exchanges the value with the object contained in an std::unique_ptr and retreives the previous object.
expectedValue | The expected value. The new value will only be set if the atomic currently contains this value. If the comparison fails, expectedValue will be set to the actual value of the atomic. |
oldValue | If the comparison succeeds and the values are exchanged, ownership of the previous object (if any) is transferred to this pointer. |
newValue | The pointer to transfer the object from if the comparison is successful. Any object the pointer holds will then be transferred to the atomic. If the comparison fails, newValue will retain the object, so the function can be called again. |
memoryOrderForSuccess | The memory order used if the comparison succeeds. |
memoryOrderForFailure | The memory order used if the comparison fails. |
|
noexcept |
Conditionally atomically exchanges the value with the object contained in a related std::unique_ptr and retreives the previous object.
expectedValue | The expected value. The new value will only be set if the atomic currently contains this value. If the comparison fails, expectedValue will be set to the actual value of the atomic. |
oldValue | If the comparison succeeds and the values are exchanged, ownership of the previous object (if any) is transferred to this pointer. |
newValue | The pointer to transfer the object from if the comparison is successful. Any object the pointer holds will then be transferred to the atomic. If the comparison fails, newValue will retain the object, so the function can be called again. |
memoryOrder | The memory order used to exchange the value. |
|
noexcept |
Conditionally atomically exchanges the value with the object contained in a related std::unique_ptr and retreives the previous object.
expectedValue | The expected value. The new value will only be set if the atomic currently contains this value. If the comparison fails, expectedValue will be set to the actual value of the atomic. |
oldValue | If the comparison succeeds and the values are exchanged, ownership of the previous object (if any) is transferred to this pointer. |
newValue | The pointer to transfer the object from if the comparison is successful. Any object the pointer holds will then be transferred to the atomic. If the comparison fails, newValue will retain the object, so the function can be called again. |
memoryOrderForSuccess | The memory order used if the comparison succeeds. |
memoryOrderForFailure | The memory order used if the comparison fails. |
|
noexcept |
Conditionally atomically exchanges the value with the object contained in a related std::unique_ptr.
If the comparison succeeds and the values are exchanged, the previous object (if any) is destroyed.
expectedValue | The expected value. The new value will only be set if the atomic currently contains this value. If the comparison fails, expectedValue will be set to the actual value of the atomic. |
newValue | The pointer to transfer the object from if the comparison is successful. Any object the pointer holds will then be transferred to the atomic. If the comparison fails, newValue will retain the object, so the function can be called again. |
memoryOrder | The memory order used to exchange the value. |
|
noexcept |
Conditionally atomically exchanges the value with the object contained in a related std::unique_ptr.
If the comparison succeeds and the values are exchanged, the previous object (if any) is destroyed.
expectedValue | The expected value. The new value will only be set if the atomic currently contains this value. If the comparison fails, expectedValue will be set to the actual value of the atomic. |
newValue | The pointer to transfer the object from if the comparison is successful. Any object the pointer holds will then be transferred to the atomic. If the comparison fails, newValue will retain the object, so the function can be called again. |
memoryOrderForSuccess | The memory order used if the comparison succeeds. |
memoryOrderForFailure | The memory order used if the comparison fails. |
|
noexcept |
Atomically empties the pointer and returns the contained object.
memoryOrder | The memory order to use |
|
noexcept |
Atomically transfers an object from an std::unique_ptr and returns the previous object.
value | The pointer to transfer the object from. Any object the pointer holds will be transferred to the atomic. |
memoryOrder | The memory order to use |
|
noexcept |
Atomically transfers an object from an std::unique_ptr and returns the previous object.
value | The pointer to transfer the object from. Any object the pointer holds will be transferred to the atomic. |
memoryOrder | The memory order to use |
|
noexcept |
Determines whether operations on this object are lock free.
|
noexcept |
Atomically loads the stored pointer.
|
noexcept |
Atomically fetches the stored object using std::memory_order::seq_cst and takes ownership.
The object will be removed from the atomic, and ownership will be transferred to the returned std::unique_ptr, leaving the atomic empty. For this reason, this operator can only be called on rvalue references. This means that you must use std::move to retreive the value.
Example:
This function is equivalent to calling exchange(nullptr).
|
noexcept |
Atomically fetches the stored object using std::memory_order::seq_cst without taking ownership.
This function does not take ownership of the returned object. To take owneship, you use std::move, which will cause the conversion operator for an std::unique_ptr to be called instead.
Example:
|
delete |
Deleted assignment opertaor.
|
noexcept |
Atomically empties the pointer using std::memory_order::seq_cst.
Any previously held object will be deleted.
|
noexcept |
Atomically transfers an object from an std::unique_ptr using std::memory_order::seq_cst.
Any previously held object will be deleted.
value | The pointer to transfer the object from. Any object the pointer holds will be transferred to the atomic. |
|
noexcept |
Atomically transfers an object from a related std::unique_ptr using std::memory_order::seq_cst.
Any previously held object will be deleted.
value | The pointer to transfer the object from. Any object the pointer holds will be transferred to the atomic. |
|
noexcept |
Atomically empties the pointer using std::memory_order::seq_cst.
Any previously held object will be deleted.
memoryOrder | The memory order to use |
|
noexcept |
Atomically transfers an object from an std::unique_ptr.
Any previously held object will be deleted.
value | The pointer to transfer the object from. Any object the pointer holds will be transferred to the atomic. |
memoryOrder | The memory order to use |
|
noexcept |
Atomically transfers an object from a related std::unique_ptr using std::memory_order::seq_cst.
Any previously held object will be deleted.
value | The pointer to transfer the object from. Any object the pointer holds will be transferred to the atomic. |
memoryOrder | The memory order to use |
|
related |
Tree-way comparison between an atomic unique pointer and a null pointer.
|
related |
Tree-way comparison between an atomic unique pointer and an std::unique_ptr.
|
related |
Tree-way comparison between an atomic unique pointer and an unowned pointer.
|
related |
Tree-way comparison between two unowned pointers.
|
related |
Comparison between an atomic unique pointer and a null pointer.
|
related |
Comparison between an atomic unique pointer and an std::unique_ptr.
|
related |
Comparison between an atomic unique pointer and an unowned pointer.
|
related |
Comparison between two atomic unique pointers.
|
staticconstexpr |
Determines whether operations on all objects of thsi class are lock free.