PMDK C++ bindings
1.13.0-git107.g7e59f08f
This is the C++ bindings documentation for PMDK's libpmemobj.
|
Atomic specialization of a persistent ptr (self_relative_ptr) that manages its persistence by itself. More...
#include <libpmemobj++/experimental/atomic_persistent_aware_ptr.hpp>
Public Types | |
using | this_type = atomic_persistent_aware_ptr |
using | value_type = pmem::obj::experimental::self_relative_ptr< T > |
using | difference_type = typename value_type::difference_type |
Public Member Functions | |
atomic_persistent_aware_ptr (value_type value) | |
Constructors. More... | |
atomic_persistent_aware_ptr (const atomic_persistent_aware_ptr &)=delete | |
Deleted copy constructor. | |
template<typename OPT = ReadOptimized> | |
std::enable_if< std::is_same< OPT, std::true_type >::value >::type | store (value_type desired, std::memory_order order=std::memory_order_seq_cst) noexcept |
Read-optimized store does the flush already in the store function. More... | |
template<typename OPT = ReadOptimized> | |
std::enable_if<!std::is_same< OPT, std::true_type >::value >::type | store (value_type desired, std::memory_order order=std::memory_order_seq_cst) noexcept |
Write-optimized store relies on a consequent load to do the flush. More... | |
template<typename OPT = ReadOptimized> | |
std::enable_if< std::is_same< OPT, std::true_type >::value, value_type >::type | load (std::memory_order order=std::memory_order_seq_cst) noexcept |
Read-optimized load. More... | |
template<typename OPT = ReadOptimized> | |
std::enable_if<!std::is_same< OPT, std::true_type >::value, value_type >::type | load (std::memory_order order=std::memory_order_seq_cst) noexcept |
Write-optimized load flushes the data. More... | |
bool | is_lock_free () const noexcept |
operator value_type () const noexcept | |
Returns the value of the atomic_persistent_aware_ptr. | |
value_type | operator= (value_type desired) noexcept |
Assignment operator. More... | |
atomic_persistent_aware_ptr & | operator= (const atomic_persistent_aware_ptr &)=delete |
Deleted assignment operator. | |
Atomic specialization of a persistent ptr (self_relative_ptr) that manages its persistence by itself.
In a multi-threaded scenario, the persistence of this ptr is guaranteed when it is visible to (or read by) other threads. Performance-wise, two different versions of this struct are provided:
|
inline |
|
inlinenoexcept |
Read-optimized load.
It relies on a store function to flush the data.
|
inlinenoexcept |
Write-optimized load flushes the data.
|
inlinenoexcept |
Assignment operator.
desired | value to be stored in the atomic_persistent_aware_ptr. |
|
inlinenoexcept |
Read-optimized store does the flush already in the store function.
[in] | desired | the self_relative_ptr to be stored. |
|
inlinenoexcept |
Write-optimized store relies on a consequent load to do the flush.
[in] | desired | the self_relative_ptr to be stored. |