PMDK C++ bindings
1.7
This is the C++ bindings documentation for PMDK's libpmemobj.
|
Persistent_ptr base class. More...
#include <libpmemobj++/detail/persistent_ptr_base.hpp>
Public Types | |
typedef pmem::detail::sp_element< T >::type | element_type |
Type of an actual object with all qualifier removed, used for easy underlying type access. | |
Public Member Functions | |
persistent_ptr_base () | |
Default constructor, zeroes the PMEMoid. | |
persistent_ptr_base (PMEMoid oid) noexcept | |
PMEMoid constructor. More... | |
persistent_ptr_base (element_type *ptr) | |
Volatile pointer constructor. More... | |
template<typename U , typename = typename std::enable_if< !std::is_same<T, U>::value && std::is_same<typename std::remove_cv<T>::type, U>::value>::type> | |
persistent_ptr_base (persistent_ptr_base< U > const &r) noexcept | |
Copy constructor from a different persistent_ptr<>. More... | |
template<typename U , typename Dummy = void, typename = typename std::enable_if< !std::is_same< typename std::remove_cv<T>::type, typename std::remove_cv<U>::type>::value && !std::is_void<U>::value, decltype(static_cast<T *>(std::declval<U *>()))>::type> | |
persistent_ptr_base (persistent_ptr_base< U > const &r) noexcept | |
Copy constructor from a different persistent_ptr<>. More... | |
template<typename Y , typename = typename std::enable_if< !std::is_same< typename std::remove_cv<T>::type, typename std::remove_cv<Y>::type>::value && !std::is_void<Y>::value, decltype(static_cast<T *>(std::declval<Y *>()))>::type> | |
operator persistent_ptr_base< Y > () noexcept | |
Conversion operator to a different persistent_ptr<>. More... | |
persistent_ptr_base (persistent_ptr_base &&r) noexcept | |
Defaulted move constructor. | |
persistent_ptr_base & | operator= (persistent_ptr_base &&r) |
Defaulted move assignment operator. | |
persistent_ptr_base & | operator= (persistent_ptr_base const &r) |
Assignment operator. More... | |
persistent_ptr_base & | operator= (std::nullptr_t &&) |
Nullptr move assignment operator. More... | |
template<typename Y , typename = typename std::enable_if< std::is_convertible<Y *, T *>::value>::type> | |
persistent_ptr_base & | operator= (persistent_ptr_base< Y > const &r) |
Converting assignment operator from a different persistent_ptr<>. More... | |
void | swap (persistent_ptr_base &other) |
Swaps two persistent_ptr objects of the same type. More... | |
element_type * | get () const noexcept |
Get a direct pointer. More... | |
const PMEMoid & | raw () const noexcept |
Get PMEMoid encapsulated by this object. More... | |
PMEMoid * | raw_ptr () noexcept |
Get pointer to PMEMoid encapsulated by this object. More... | |
Protected Member Functions | |
persistent_ptr_base (element_type *vptr, int) | |
Private constructor enabling persistent_ptrs to volatile objects. More... | |
template<typename U > | |
ptrdiff_t | calculate_offset () const |
Calculate in-object offset for structures with inheritance. More... | |
Persistent_ptr base class.
Implements some of the functionality of the persistent_ptr class. It defines all applicable conversions from and to a persistent_ptr_base. This class is an implementation detail and is not to be instantiated. It cannot be declared as virtual due to the problem with rebuilding the vtable.
|
inlinenoexcept |
PMEMoid constructor.
Provided for easy interoperability between C++ and C API's.
oid | C-style persistent pointer |
|
inline |
Volatile pointer constructor.
If ptr does not point to an address from a valid pool, the persistent pointer will evaluate to nullptr.
ptr | volatile pointer, pointing to persistent memory. |
|
inlinenoexcept |
Copy constructor from a different persistent_ptr<>.
Available only for convertible types.
|
inlinenoexcept |
Copy constructor from a different persistent_ptr<>.
Available only for convertible, non-void types.
|
inlineprotected |
Private constructor enabling persistent_ptrs to volatile objects.
This is internal implementation only needed for the pointer_traits<persistent_ptr>::pointer_to to be able to create valid pointers. This is used in libstdc++'s std::vector::insert().
|
inlineprotected |
Calculate in-object offset for structures with inheritance.
In case of the given inheritance:
A B \ / C
A pointer to B *ptr = &C should be offset by sizeof(A). This function calculates that offset.
|
inlinenoexcept |
Get a direct pointer.
Performs a calculations on the underlying C-style pointer.
|
inlinenoexcept |
Conversion operator to a different persistent_ptr<>.
Available only for convertible, non-void types.
|
inline |
Assignment operator.
Persistent pointer assignment within a transaction automatically registers this operation so that a rollback is possible.
pmem::transaction_error | when adding the object to the transaction failed. |
|
inline |
Converting assignment operator from a different persistent_ptr<>.
Available only for convertible types. Just like regular assignment, also automatically registers itself in a transaction.
pmem::transaction_error | when adding the object to the transaction failed. |
|
inline |
Nullptr move assignment operator.
pmem::transaction_error | when adding the object to the transaction failed. |
|
inlinenoexcept |
Get PMEMoid encapsulated by this object.
For C API compatibility.
|
inlinenoexcept |
Get pointer to PMEMoid encapsulated by this object.
For C API compatibility.
|
inline |
Swaps two persistent_ptr objects of the same type.
[in,out] | other | the other persistent_ptr to swap. |