PMDK C++ bindings  1.13.0-git23.gf49772ac
This is the C++ bindings documentation for PMDK's libpmemobj.
Namespaces | Classes | Typedefs | Functions
pmem::obj Namespace Reference

Main libpmemobj namespace. More...

Namespaces

 experimental
 Experimental implementations.
 
 segment_vector_internal
 Internal implementation of pmem's segment vector.
 

Classes

struct  allocation_flag
 Type of flag which can be passed to make_persistent. More...
 
struct  allocation_flag_atomic
 Type of flag which can be passed to make_persistent_atomic. More...
 
class  object_traits
 Encapsulates object specific allocator functionality. More...
 
class  object_traits< void >
 Object traits specialization for the void type. More...
 
class  standard_alloc_policy
 The allocation policy template for a given type. More...
 
class  standard_alloc_policy< void >
 Void specialization of the standard allocation policy. More...
 
class  allocator
 (EXPERIMENTAL) Encapsulates the information about the persistent memory allocation model using PMDK's libpmemobj. More...
 
class  condition_variable
 Persistent memory resident condition variable. More...
 
struct  array
 pmem::obj::array - persistent container with std::array compatible interface. More...
 
class  basic_string
 pmem::obj::string - persistent container with std::basic_string compatible interface. More...
 
class  concurrent_hash_map
 Persistent memory aware implementation of Intel TBB concurrent_hash_map. More...
 
class  segment_vector
 A persistent version of segment vector implementation. More...
 
class  vector
 pmem::obj::vector - persistent container with std::vector compatible interface. More...
 
class  defrag
 Defrag class. More...
 
class  persistent_ptr
 Persistent pointer class. More...
 
class  mutex
 Persistent memory resident mutex implementation. More...
 
class  p
 Resides on pmem class. More...
 
class  pool
 PMEMobj pool class. More...
 
class  persistent_ptr< void >
 persistent_ptr void specialization. More...
 
class  persistent_ptr< const void >
 persistent_ptr const void specialization. More...
 
class  persistent_ptr_base
 Persistent_ptr base (non-template) class. More...
 
class  pool_base
 The non-template pool base class. More...
 
class  shared_mutex
 Persistent memory resident shared_mutex implementation. More...
 
class  slice
 pmem::obj::slice - provides interface to access sequence of objects. More...
 
class  basic_string_view
 Our partial std::string_view implementation. More...
 
class  timed_mutex
 Persistent memory resident timed_mutex implementation. More...
 
class  basic_transaction
 C++ transaction handler class. More...
 
class  flat_transaction
 C++ flat transaction handler class. More...
 

Typedefs

template<template< typename > class SegmentType = pmem::obj::vector>
using exponential_size_array_policy = segment_vector_internal::exponential_size_policy< segment_vector_internal::array_64, SegmentType >
 Exponential size policy with pmemobj array of size 64 as a type of segment vector, so this is a static array of segments and each segment is of SegmentType. More...
 
template<size_t SegmentSize = 1024, template< typename > class SegmentType = pmem::obj::vector>
using fixed_size_vector_policy = segment_vector_internal::fixed_size_policy< pmem::obj::vector, SegmentType, SegmentSize >
 Fixed size policy with pmemobj vector of a given size as a type of segment vector, so this is a dynamic vector of segments and each segment is of SegmentType. More...
 
template<template< typename > class SegmentType = pmem::obj::vector>
using exponential_size_vector_policy = segment_vector_internal::exponential_size_policy< pmem::obj::vector, SegmentType >
 Exponential size policy with pmemobj vector as a type of segment vector, so this is a dynamic vector of segments and each segment is of SegmentType. More...
 
using transaction = basic_transaction
 By default, pmem::obj::transaction is an alias to pmem::obj::basic_transaction. More...
 

Functions

template<typename T , typename T2 >
bool operator== (standard_alloc_policy< T > const &, standard_alloc_policy< T2 > const &)
 Determines if memory from another allocator can be deallocated from this one. More...
 
template<typename T , typename OtherAllocator >
bool operator== (standard_alloc_policy< T > const &, OtherAllocator const &)
 Determines if memory from another allocator can be deallocated from this one. More...
 
template<typename T , typename P , typename Tr , typename T2 , typename P2 , typename Tr2 >
bool operator== (const allocator< T, P, Tr > &lhs, const allocator< T2, P2, Tr2 > &rhs)
 Determines if memory from another allocator can be deallocated from this one. More...
 
template<typename T , typename P , typename Tr , typename OtherAllocator >
bool operator!= (const allocator< T, P, Tr > &lhs, const OtherAllocator &rhs)
 Determines if memory from another allocator can be deallocated from this one. More...
 
template<typename T , std::size_t N>
bool operator== (const array< T, N > &lhs, const array< T, N > &rhs)
 Non-member equal operator.
 
template<typename T , std::size_t N>
bool operator!= (const array< T, N > &lhs, const array< T, N > &rhs)
 Non-member not-equal operator.
 
template<typename T , std::size_t N>
bool operator< (const array< T, N > &lhs, const array< T, N > &rhs)
 Non-member less than operator.
 
template<typename T , std::size_t N>
bool operator> (const array< T, N > &lhs, const array< T, N > &rhs)
 Non-member greater than operator.
 
template<typename T , std::size_t N>
bool operator>= (const array< T, N > &lhs, const array< T, N > &rhs)
 Non-member greater or equal operator.
 
template<typename T , std::size_t N>
bool operator<= (const array< T, N > &lhs, const array< T, N > &rhs)
 Non-member less or equal operator.
 
template<typename T , std::size_t N>
pmem::obj::array< T, N >::const_iterator cbegin (const pmem::obj::array< T, N > &a)
 Non-member cbegin.
 
template<typename T , std::size_t N>
pmem::obj::array< T, N >::const_iterator cend (const pmem::obj::array< T, N > &a)
 Non-member cend.
 
template<typename T , std::size_t N>
pmem::obj::array< T, N >::const_reverse_iterator crbegin (const pmem::obj::array< T, N > &a)
 Non-member crbegin.
 
template<typename T , std::size_t N>
pmem::obj::array< T, N >::const_reverse_iterator crend (const pmem::obj::array< T, N > &a)
 Non-member crend.
 
template<typename T , std::size_t N>
pmem::obj::array< T, N >::iterator begin (pmem::obj::array< T, N > &a)
 Non-member begin.
 
template<typename T , std::size_t N>
pmem::obj::array< T, N >::const_iterator begin (const pmem::obj::array< T, N > &a)
 Non-member begin.
 
template<typename T , std::size_t N>
pmem::obj::array< T, N >::iterator end (pmem::obj::array< T, N > &a)
 Non-member end.
 
template<typename T , std::size_t N>
pmem::obj::array< T, N >::const_iterator end (const pmem::obj::array< T, N > &a)
 Non-member end.
 
template<typename T , std::size_t N>
pmem::obj::array< T, N >::reverse_iterator rbegin (pmem::obj::array< T, N > &a)
 Non-member rbegin.
 
template<typename T , std::size_t N>
pmem::obj::array< T, N >::const_reverse_iterator rbegin (const pmem::obj::array< T, N > &a)
 Non-member rbegin.
 
template<typename T , std::size_t N>
pmem::obj::array< T, N >::reverse_iterator rend (pmem::obj::array< T, N > &a)
 Non-member rend.
 
template<typename T , std::size_t N>
pmem::obj::array< T, N >::const_reverse_iterator rend (const pmem::obj::array< T, N > &a)
 Non-member rend.
 
template<typename T , size_t N>
void swap (pmem::obj::array< T, N > &lhs, pmem::obj::array< T, N > &rhs)
 Non-member swap function.
 
template<size_t I, typename T , size_t N>
T & get (pmem::obj::array< T, N > &a)
 Non-member get function.
 
template<size_t I, typename T , size_t N>
T && get (pmem::obj::array< T, N > &&a)
 Non-member get function.
 
template<size_t I, typename T , size_t N>
const T & get (const pmem::obj::array< T, N > &a) noexcept
 Non-member get function.
 
template<size_t I, typename T , size_t N>
const T && get (const pmem::obj::array< T, N > &&a) noexcept
 Non-member get function.
 
template<class CharT , class Traits >
bool operator== (const basic_string< CharT, Traits > &lhs, const basic_string< CharT, Traits > &rhs)
 Non-member equal operator.
 
template<class CharT , class Traits >
bool operator!= (const basic_string< CharT, Traits > &lhs, const basic_string< CharT, Traits > &rhs)
 Non-member not equal operator.
 
template<class CharT , class Traits >
bool operator< (const basic_string< CharT, Traits > &lhs, const basic_string< CharT, Traits > &rhs)
 Non-member less than operator.
 
template<class CharT , class Traits >
bool operator<= (const basic_string< CharT, Traits > &lhs, const basic_string< CharT, Traits > &rhs)
 Non-member less or equal operator.
 
template<class CharT , class Traits >
bool operator> (const basic_string< CharT, Traits > &lhs, const basic_string< CharT, Traits > &rhs)
 Non-member greater than operator.
 
template<class CharT , class Traits >
bool operator>= (const basic_string< CharT, Traits > &lhs, const basic_string< CharT, Traits > &rhs)
 Non-member greater or equal operator.
 
template<class CharT , class Traits >
bool operator== (const CharT *lhs, const basic_string< CharT, Traits > &rhs)
 Non-member equal operator.
 
template<class CharT , class Traits >
bool operator!= (const CharT *lhs, const basic_string< CharT, Traits > &rhs)
 Non-member not equal operator.
 
template<class CharT , class Traits >
bool operator< (const CharT *lhs, const basic_string< CharT, Traits > &rhs)
 Non-member less than operator.
 
template<class CharT , class Traits >
bool operator<= (const CharT *lhs, const basic_string< CharT, Traits > &rhs)
 Non-member less or equal operator.
 
template<class CharT , class Traits >
bool operator> (const CharT *lhs, const basic_string< CharT, Traits > &rhs)
 Non-member greater than operator.
 
template<class CharT , class Traits >
bool operator>= (const CharT *lhs, const basic_string< CharT, Traits > &rhs)
 Non-member greater or equal operator.
 
template<class CharT , class Traits >
bool operator== (const basic_string< CharT, Traits > &lhs, const CharT *rhs)
 Non-member equal operator.
 
template<class CharT , class Traits >
bool operator!= (const basic_string< CharT, Traits > &lhs, const CharT *rhs)
 Non-member not equal operator.
 
template<class CharT , class Traits >
bool operator< (const basic_string< CharT, Traits > &lhs, const CharT *rhs)
 Non-member less than operator.
 
template<class CharT , class Traits >
bool operator<= (const basic_string< CharT, Traits > &lhs, const CharT *rhs)
 Non-member less or equal operator.
 
template<class CharT , class Traits >
bool operator> (const basic_string< CharT, Traits > &lhs, const CharT *rhs)
 Non-member greater than operator.
 
template<class CharT , class Traits >
bool operator>= (const basic_string< CharT, Traits > &lhs, const CharT *rhs)
 Non-member greater or equal operator.
 
template<class CharT , class Traits >
bool operator== (const std::basic_string< CharT, Traits > &lhs, const basic_string< CharT, Traits > &rhs)
 Non-member equal operator.
 
template<class CharT , class Traits >
bool operator!= (const std::basic_string< CharT, Traits > &lhs, const basic_string< CharT, Traits > &rhs)
 Non-member not equal operator.
 
template<class CharT , class Traits >
bool operator< (const std::basic_string< CharT, Traits > &lhs, const basic_string< CharT, Traits > &rhs)
 Non-member less than operator.
 
template<class CharT , class Traits >
bool operator<= (const std::basic_string< CharT, Traits > &lhs, const basic_string< CharT, Traits > &rhs)
 Non-member less or equal operator.
 
template<class CharT , class Traits >
bool operator> (const std::basic_string< CharT, Traits > &lhs, const basic_string< CharT, Traits > &rhs)
 Non-member greater than operator.
 
template<class CharT , class Traits >
bool operator>= (const std::basic_string< CharT, Traits > &lhs, const basic_string< CharT, Traits > &rhs)
 Non-member greater or equal operator.
 
template<class CharT , class Traits >
bool operator== (const basic_string< CharT, Traits > &lhs, const std::basic_string< CharT, Traits > &rhs)
 Non-member equal operator.
 
template<class CharT , class Traits >
bool operator!= (const basic_string< CharT, Traits > &lhs, const std::basic_string< CharT, Traits > &rhs)
 Non-member not equal operator.
 
template<class CharT , class Traits >
bool operator< (const basic_string< CharT, Traits > &lhs, const std::basic_string< CharT, Traits > &rhs)
 Non-member less than operator.
 
template<class CharT , class Traits >
bool operator<= (const basic_string< CharT, Traits > &lhs, const std::basic_string< CharT, Traits > &rhs)
 Non-member less or equal operator.
 
template<class CharT , class Traits >
bool operator> (const basic_string< CharT, Traits > &lhs, const std::basic_string< CharT, Traits > &rhs)
 Non-member greater than operator.
 
template<class CharT , class Traits >
bool operator>= (const basic_string< CharT, Traits > &lhs, const std::basic_string< CharT, Traits > &rhs)
 Non-member greater or equal operator.
 
template<class CharT , class Traits >
void swap (basic_string< CharT, Traits > &lhs, basic_string< CharT, Traits > &rhs)
 Swap the content of persistent strings.
 
template<typename T , typename Policy >
void swap (segment_vector< T, Policy > &lhs, segment_vector< T, Policy > &rhs)
 Swaps the contents of lhs and rhs. More...
 
template<typename T , typename Policy >
bool operator== (const segment_vector< T, Policy > &lhs, const segment_vector< T, Policy > &rhs)
 Comparison operator. More...
 
template<typename T , typename Policy >
bool operator!= (const segment_vector< T, Policy > &lhs, const segment_vector< T, Policy > &rhs)
 Comparison operator. More...
 
template<typename T , typename Policy >
bool operator< (const segment_vector< T, Policy > &lhs, const segment_vector< T, Policy > &rhs)
 Comparison operator. More...
 
template<typename T , typename Policy >
bool operator<= (const segment_vector< T, Policy > &lhs, const segment_vector< T, Policy > &rhs)
 Comparison operator. More...
 
template<typename T , typename Policy >
bool operator> (const segment_vector< T, Policy > &lhs, const segment_vector< T, Policy > &rhs)
 Comparison operator. More...
 
template<typename T , typename Policy >
bool operator>= (const segment_vector< T, Policy > &lhs, const segment_vector< T, Policy > &rhs)
 Comparison operator. More...
 
template<typename T , typename Policy >
bool operator== (const segment_vector< T, Policy > &lhs, const std::vector< T > &rhs)
 Comparison operator. More...
 
template<typename T , typename Policy >
bool operator!= (const segment_vector< T, Policy > &lhs, const std::vector< T > &rhs)
 Comparison operator. More...
 
template<typename T , typename Policy >
bool operator< (const segment_vector< T, Policy > &lhs, const std::vector< T > &rhs)
 Comparison operator. More...
 
template<typename T , typename Policy >
bool operator<= (const segment_vector< T, Policy > &lhs, const std::vector< T > &rhs)
 Comparison operator. More...
 
template<typename T , typename Policy >
bool operator> (const segment_vector< T, Policy > &lhs, const std::vector< T > &rhs)
 Comparison operator. More...
 
template<typename T , typename Policy >
bool operator>= (const segment_vector< T, Policy > &lhs, const std::vector< T > &rhs)
 Comparison operator. More...
 
template<typename T , typename Policy >
bool operator== (const std::vector< T > &lhs, const segment_vector< T, Policy > &rhs)
 Comparison operator. More...
 
template<typename T , typename Policy >
bool operator!= (const std::vector< T > &lhs, const segment_vector< T, Policy > &rhs)
 Comparison operator. More...
 
template<typename T , typename Policy >
bool operator< (const std::vector< T > &lhs, const segment_vector< T, Policy > &rhs)
 Comparison operator. More...
 
template<typename T , typename Policy >
bool operator<= (const std::vector< T > &lhs, const segment_vector< T, Policy > &rhs)
 Comparison operator. More...
 
template<typename T , typename Policy >
bool operator> (const std::vector< T > &lhs, const segment_vector< T, Policy > &rhs)
 Comparison operator. More...
 
template<typename T , typename Policy >
bool operator>= (const std::vector< T > &lhs, const segment_vector< T, Policy > &rhs)
 Comparison operator. More...
 
template<typename T >
void swap (vector< T > &lhs, vector< T > &rhs)
 Swaps the contents of lhs and rhs. More...
 
template<typename T >
bool operator== (const vector< T > &lhs, const vector< T > &rhs)
 Comparison operator. More...
 
template<typename T >
bool operator!= (const vector< T > &lhs, const vector< T > &rhs)
 Comparison operator. More...
 
template<typename T >
bool operator< (const vector< T > &lhs, const vector< T > &rhs)
 Comparison operator. More...
 
template<typename T >
bool operator<= (const vector< T > &lhs, const vector< T > &rhs)
 Comparison operator. More...
 
template<typename T >
bool operator> (const vector< T > &lhs, const vector< T > &rhs)
 Comparison operator. More...
 
template<typename T >
bool operator>= (const vector< T > &lhs, const vector< T > &rhs)
 Comparison operator. More...
 
template<typename T >
bool operator== (const vector< T > &lhs, const std::vector< T > &rhs)
 Comparison operator. More...
 
template<typename T >
bool operator!= (const vector< T > &lhs, const std::vector< T > &rhs)
 Comparison operator. More...
 
template<typename T >
bool operator< (const vector< T > &lhs, const std::vector< T > &rhs)
 Comparison operator. More...
 
template<typename T >
bool operator<= (const vector< T > &lhs, const std::vector< T > &rhs)
 Comparison operator. More...
 
template<typename T >
bool operator> (const vector< T > &lhs, const std::vector< T > &rhs)
 Comparison operator. More...
 
template<typename T >
bool operator>= (const vector< T > &lhs, const std::vector< T > &rhs)
 Comparison operator. More...
 
template<typename T >
bool operator== (const std::vector< T > &lhs, const vector< T > &rhs)
 Comparison operator. More...
 
template<typename T >
bool operator!= (const std::vector< T > &lhs, const vector< T > &rhs)
 Comparison operator. More...
 
template<typename T >
bool operator< (const std::vector< T > &lhs, const vector< T > &rhs)
 Comparison operator. More...
 
template<typename T >
bool operator<= (const std::vector< T > &lhs, const vector< T > &rhs)
 Comparison operator. More...
 
template<typename T >
bool operator> (const std::vector< T > &lhs, const vector< T > &rhs)
 Comparison operator. More...
 
template<typename T >
bool operator>= (const std::vector< T > &lhs, const vector< T > &rhs)
 Comparison operator. More...
 
template<typename T , typename... Args>
detail::pp_if_not_array< T >::type make_persistent (allocation_flag flag, Args &&... args)
 Transactionally allocate and construct an object of type T. More...
 
template<typename T , typename... Args>
std::enable_if< !detail::is_first_arg_same< allocation_flag, Args... >::value, typename detail::pp_if_not_array< T >::type >::type make_persistent (Args &&... args)
 Transactionally allocate and construct an object of type T. More...
 
template<typename T >
void delete_persistent (typename detail::pp_if_not_array< T >::type ptr)
 Transactionally free an object of type T held in a persistent_ptr. More...
 
template<typename T >
detail::pp_if_array< T >::type make_persistent (std::size_t N, allocation_flag flag=allocation_flag::none())
 Transactionally allocate and construct an array of objects of type T. More...
 
template<typename T >
detail::pp_if_size_array< T >::type make_persistent (allocation_flag flag=allocation_flag::none())
 Transactionally allocate and construct an array of objects of type T. More...
 
template<typename T >
void delete_persistent (typename detail::pp_if_array< T >::type ptr, std::size_t N)
 Transactionally free an array of objects of type T held in a persistent_ptr. More...
 
template<typename T >
void delete_persistent (typename detail::pp_if_size_array< T >::type ptr)
 Transactionally free an array of objects of type T held in a persistent_ptr. More...
 
template<typename T >
void make_persistent_atomic (pool_base &pool, typename detail::pp_if_array< T >::type &ptr, std::size_t N, allocation_flag_atomic flag=allocation_flag_atomic::none())
 Atomically allocate an array of objects. More...
 
template<typename T >
void make_persistent_atomic (pool_base &pool, typename detail::pp_if_size_array< T >::type &ptr, allocation_flag_atomic flag=allocation_flag_atomic::none())
 Atomically allocate an array of objects. More...
 
template<typename T >
void delete_persistent_atomic (typename detail::pp_if_array< T >::type &ptr, std::size_t)
 Atomically deallocate an array of objects. More...
 
template<typename T >
void delete_persistent_atomic (typename detail::pp_if_size_array< T >::type &ptr)
 Atomically deallocate an array of objects. More...
 
template<typename T , typename... Args>
void make_persistent_atomic (pool_base &pool, typename detail::pp_if_not_array< T >::type &ptr, allocation_flag_atomic flag, Args &&... args)
 Atomically allocate and construct an object. More...
 
template<typename T , typename... Args>
std::enable_if<!detail::is_first_arg_same< allocation_flag_atomic, Args... >::value >::type make_persistent_atomic (pool_base &pool, typename detail::pp_if_not_array< T >::type &ptr, Args &&... args)
 Atomically allocate and construct an object. More...
 
template<typename T >
void delete_persistent_atomic (typename detail::pp_if_not_array< T >::type &ptr) noexcept
 Atomically deallocate an object. More...
 
template<class T >
void swap (p< T > &a, p< T > &b)
 Swaps two p objects of the same type. More...
 
template<class T >
void swap (persistent_ptr< T > &a, persistent_ptr< T > &b)
 Swaps two persistent_ptr objects of the same type. More...
 
template<typename T , typename Y >
bool operator== (persistent_ptr< T > const &lhs, persistent_ptr< Y > const &rhs) noexcept
 Equality operator. More...
 
template<typename T , typename Y >
bool operator!= (persistent_ptr< T > const &lhs, persistent_ptr< Y > const &rhs) noexcept
 Inequality operator.
 
template<typename T >
bool operator== (persistent_ptr< T > const &lhs, std::nullptr_t) noexcept
 Equality operator with nullptr.
 
template<typename T >
bool operator== (std::nullptr_t, persistent_ptr< T > const &lhs) noexcept
 Equality operator with nullptr.
 
template<typename T >
bool operator!= (persistent_ptr< T > const &lhs, std::nullptr_t) noexcept
 Inequality operator with nullptr.
 
template<typename T >
bool operator!= (std::nullptr_t, persistent_ptr< T > const &lhs) noexcept
 Inequality operator with nullptr.
 
template<typename T , typename Y >
bool operator< (persistent_ptr< T > const &lhs, persistent_ptr< Y > const &rhs) noexcept
 Less than operator. More...
 
template<typename T , typename Y >
bool operator<= (persistent_ptr< T > const &lhs, persistent_ptr< Y > const &rhs) noexcept
 Less or equal than operator. More...
 
template<typename T , typename Y >
bool operator> (persistent_ptr< T > const &lhs, persistent_ptr< Y > const &rhs) noexcept
 Greater than operator. More...
 
template<typename T , typename Y >
bool operator>= (persistent_ptr< T > const &lhs, persistent_ptr< Y > const &rhs) noexcept
 Greater or equal than operator. More...
 
template<typename T >
bool operator< (persistent_ptr< T > const &lhs, std::nullptr_t) noexcept
 Compare a persistent_ptr with a null pointer.
 
template<typename T >
bool operator< (std::nullptr_t, persistent_ptr< T > const &rhs) noexcept
 Compare a persistent_ptr with a null pointer.
 
template<typename T >
bool operator<= (persistent_ptr< T > const &lhs, std::nullptr_t) noexcept
 Compare a persistent_ptr with a null pointer.
 
template<typename T >
bool operator<= (std::nullptr_t, persistent_ptr< T > const &rhs) noexcept
 Compare a persistent_ptr with a null pointer.
 
template<typename T >
bool operator> (persistent_ptr< T > const &lhs, std::nullptr_t) noexcept
 Compare a persistent_ptr with a null pointer.
 
template<typename T >
bool operator> (std::nullptr_t, persistent_ptr< T > const &rhs) noexcept
 Compare a persistent_ptr with a null pointer.
 
template<typename T >
bool operator>= (persistent_ptr< T > const &lhs, std::nullptr_t) noexcept
 Compare a persistent_ptr with a null pointer.
 
template<typename T >
bool operator>= (std::nullptr_t, persistent_ptr< T > const &rhs) noexcept
 Compare a persistent_ptr with a null pointer.
 
template<typename T >
persistent_ptr< T > operator+ (persistent_ptr< T > const &lhs, std::ptrdiff_t s)
 Addition operator for persistent pointers.
 
template<typename T >
persistent_ptr< T > operator- (persistent_ptr< T > const &lhs, std::ptrdiff_t s)
 Subtraction operator for persistent pointers.
 
template<typename T , typename Y , typename = typename std::enable_if< std::is_same<typename std::remove_cv<T>::type, typename std::remove_cv<Y>::type>::value>>
ptrdiff_t operator- (persistent_ptr< T > const &lhs, persistent_ptr< Y > const &rhs)
 Subtraction operator for persistent pointers of identical type. More...
 
template<typename T >
std::ostream & operator<< (std::ostream &os, persistent_ptr< T > const &pptr)
 Ostream operator for the persistent pointer.
 
template<typename T >
std::ostream & operator<< (std::ostream &os, const p< T > &pp)
 Ostream operator overload.
 
template<typename T >
std::istream & operator>> (std::istream &is, p< T > &pp)
 Istream operator overload.
 
template<typename T >
p< T > & operator++ (p< T > &pp)
 Prefix increment operator overload.
 
template<typename T >
p< T > & operator-- (p< T > &pp)
 Prefix decrement operator overload.
 
template<typename T >
p< T > operator++ (p< T > &pp, int)
 Postfix increment operator overload.
 
template<typename T >
p< T > operator-- (p< T > &pp, int)
 Postfix decrement operator overload.
 
template<typename T , typename Y >
p< T > & operator+= (p< T > &lhs, const p< Y > &rhs)
 Addition assignment operator overload.
 
template<typename T , typename Y >
p< T > & operator+= (p< T > &lhs, const Y &rhs)
 Addition assignment operator overload.
 
template<typename T , typename Y >
p< T > & operator-= (p< T > &lhs, const p< Y > &rhs)
 Subtraction assignment operator overload.
 
template<typename T , typename Y >
p< T > & operator-= (p< T > &lhs, const Y &rhs)
 Subtraction assignment operator overload.
 
template<typename T , typename Y >
p< T > & operator*= (p< T > &lhs, const p< Y > &rhs)
 Multiplication assignment operator overload.
 
template<typename T , typename Y >
p< T > & operator*= (p< T > &lhs, const Y &rhs)
 Multiplication assignment operator overload.
 
template<typename T , typename Y >
p< T > & operator/= (p< T > &lhs, const p< Y > &rhs)
 Division assignment operator overload.
 
template<typename T , typename Y >
p< T > & operator/= (p< T > &lhs, const Y &rhs)
 Division assignment operator overload.
 
template<typename T , typename Y >
p< T > & operator%= (p< T > &lhs, const p< Y > &rhs)
 Modulo assignment operator overload.
 
template<typename T , typename Y >
p< T > & operator%= (p< T > &lhs, const Y &rhs)
 Modulo assignment operator overload.
 
template<typename T , typename Y >
p< T > & operator&= (p< T > &lhs, const p< Y > &rhs)
 Bitwise AND assignment operator overload.
 
template<typename T , typename Y >
p< T > & operator&= (p< T > &lhs, const Y &rhs)
 Bitwise AND assignment operator overload.
 
template<typename T , typename Y >
p< T > & operator|= (p< T > &lhs, const p< Y > &rhs)
 Bitwise OR assignment operator overload.
 
template<typename T , typename Y >
p< T > & operator|= (p< T > &lhs, const Y &rhs)
 Bitwise OR assignment operator overload.
 
template<typename T , typename Y >
p< T > & operator^= (p< T > &lhs, const p< Y > &rhs)
 Bitwise XOR assignment operator overload.
 
template<typename T , typename Y >
p< T > & operator^= (p< T > &lhs, const Y &rhs)
 Bitwise XOR assignment operator overload.
 
template<typename T , typename Y >
p< T > & operator<<= (p< T > &lhs, const p< Y > &rhs)
 Bitwise left shift assignment operator overload.
 
template<typename T , typename Y >
p< T > & operator<<= (p< T > &lhs, const Y &rhs)
 Bitwise left shift assignment operator overload.
 
template<typename T , typename Y >
p< T > & operator>>= (p< T > &lhs, const p< Y > &rhs)
 Bitwise right shift assignment operator overload.
 
template<typename T , typename Y >
p< T > & operator>>= (p< T > &lhs, const Y &rhs)
 Bitwise right shift assignment operator overload.
 
template<typename T >
ctl_get (const std::string &name)
 Query libpmemobj state at global scope. More...
 
template<typename T >
ctl_set (const std::string &name, T arg)
 Modify libpmemobj state at global scope. More...
 
template<typename T >
ctl_exec (const std::string &name, T arg)
 Execute function at global scope. More...
 
template<typename T >
ctl_get (const std::wstring &name)
 Query libpmemobj state at global scope. More...
 
template<typename T >
ctl_set (const std::wstring &name, T arg)
 Modify libpmemobj state at global scope. More...
 
template<typename T >
ctl_exec (const std::wstring &name, T arg)
 Execute function at global scope. More...
 
template<class CharT , class Traits >
constexpr bool operator== (basic_string_view< CharT, Traits > lhs, basic_string_view< CharT, Traits > rhs)
 Non-member equal operator.
 
template<class CharT , class Traits >
constexpr bool operator== (basic_string_view< CharT, Traits > lhs, typename std::common_type< basic_string_view< CharT, Traits >>::type rhs)
 Non-member equal operator.
 
template<class CharT , class Traits >
constexpr bool operator== (typename std::common_type< basic_string_view< CharT, Traits >>::type lhs, basic_string_view< CharT, Traits > rhs)
 Non-member equal operator.
 
template<class CharT , class Traits >
constexpr bool operator!= (basic_string_view< CharT, Traits > lhs, basic_string_view< CharT, Traits > rhs)
 Non-member not equal operator.
 
template<class CharT , class Traits >
constexpr bool operator!= (typename std::common_type< basic_string_view< CharT, Traits >>::type lhs, basic_string_view< CharT, Traits > rhs)
 Non-member not equal operator.
 
template<class CharT , class Traits >
constexpr bool operator!= (basic_string_view< CharT, Traits > lhs, typename std::common_type< basic_string_view< CharT, Traits >>::type rhs)
 Non-member not equal operator.
 
template<class CharT , class Traits >
constexpr bool operator< (basic_string_view< CharT, Traits > lhs, basic_string_view< CharT, Traits > rhs)
 Non-member less than operator.
 
template<class CharT , class Traits >
constexpr bool operator< (typename std::common_type< basic_string_view< CharT, Traits >>::type lhs, basic_string_view< CharT, Traits > rhs)
 Non-member less than operator.
 
template<class CharT , class Traits >
constexpr bool operator< (basic_string_view< CharT, Traits > lhs, typename std::common_type< basic_string_view< CharT, Traits >>::type rhs)
 Non-member less than operator.
 
template<class CharT , class Traits >
constexpr bool operator<= (basic_string_view< CharT, Traits > lhs, basic_string_view< CharT, Traits > rhs)
 Non-member less or equal operator.
 
template<class CharT , class Traits >
constexpr bool operator<= (basic_string_view< CharT, Traits > lhs, typename std::common_type< basic_string_view< CharT, Traits >>::type rhs)
 Non-member less or equal operator.
 
template<class CharT , class Traits >
constexpr bool operator<= (typename std::common_type< basic_string_view< CharT, Traits >>::type lhs, basic_string_view< CharT, Traits > rhs)
 Non-member less or equal operator.
 
template<class CharT , class Traits >
constexpr bool operator> (basic_string_view< CharT, Traits > lhs, basic_string_view< CharT, Traits > rhs)
 Non-member greater than operator.
 
template<class CharT , class Traits >
constexpr bool operator> (typename std::common_type< basic_string_view< CharT, Traits >>::type lhs, basic_string_view< CharT, Traits > rhs)
 Non-member greater than operator.
 
template<class CharT , class Traits >
constexpr bool operator> (basic_string_view< CharT, Traits > lhs, typename std::common_type< basic_string_view< CharT, Traits >>::type rhs)
 Non-member greater than operator.
 
template<class CharT , class Traits >
constexpr bool operator>= (basic_string_view< CharT, Traits > lhs, basic_string_view< CharT, Traits > rhs)
 Non-member greater or equal operator.
 
template<class CharT , class Traits >
constexpr bool operator>= (typename std::common_type< basic_string_view< CharT, Traits >>::type lhs, basic_string_view< CharT, Traits > rhs)
 Non-member greater or equal operator.
 
template<class CharT , class Traits >
constexpr bool operator>= (basic_string_view< CharT, Traits > lhs, typename std::common_type< basic_string_view< CharT, Traits >>::type rhs)
 Non-member greater or equal operator.
 
template<typename T >
pool_base pool_by_vptr (const T *that)
 Retrieve pool handle for the given pointer. More...
 
template<typename T >
pool_base pool_by_pptr (const persistent_ptr< T > ptr)
 Retrieve pool handle for the given persistent_ptr. More...
 

Detailed Description

Main libpmemobj namespace.

It contains all libpmemobj's public types, enums, classes with their functions and members. It is located within pmem namespace.

Typedef Documentation

◆ exponential_size_array_policy

template<template< typename > class SegmentType = pmem::obj::vector>
using pmem::obj::exponential_size_array_policy = typedef segment_vector_internal::exponential_size_policy< segment_vector_internal::array_64, SegmentType>

Exponential size policy with pmemobj array of size 64 as a type of segment vector, so this is a static array of segments and each segment is of SegmentType.

  • requires more memory than exponential_size_vector_policy
  • is faster and more efficient than exponential_size_vector_policy

◆ exponential_size_vector_policy

template<template< typename > class SegmentType = pmem::obj::vector>
using pmem::obj::exponential_size_vector_policy = typedef segment_vector_internal::exponential_size_policy<pmem::obj::vector, SegmentType>

Exponential size policy with pmemobj vector as a type of segment vector, so this is a dynamic vector of segments and each segment is of SegmentType.

  • requires less memory than exponential_size_array_policy
  • is slower and less efficient than exponential_size_array_policy

◆ fixed_size_vector_policy

template<size_t SegmentSize = 1024, template< typename > class SegmentType = pmem::obj::vector>
using pmem::obj::fixed_size_vector_policy = typedef segment_vector_internal::fixed_size_policy<pmem::obj::vector, SegmentType, SegmentSize>

Fixed size policy with pmemobj vector of a given size as a type of segment vector, so this is a dynamic vector of segments and each segment is of SegmentType.

  • is slower than the exponential one (because it has more segments)
  • causes less fragmentation than the exponential one

◆ transaction

By default, pmem::obj::transaction is an alias to pmem::obj::basic_transaction.

To change it to pmem::obj::flat_transaction define LIBPMEMOBJ_CPP_USE_FLAT_TRANSACTION macro.

To see what is the difference between the two please look at the examples for flat tx:

using namespace pmem::obj;
void
tx_flat_example()
{
/* pool root structure */
struct root {
p<int> count;
};
/* create a pmemobj pool */
auto pop = pool<root>::create("poolfile", "layout", PMEMOBJ_MIN_POOL);
auto proot = pop.root();
try {
proot->count++;
try {
proot->count++;
throw std::runtime_error("some error");
});
} catch (...) {
/* Transaction is not aborted yet (unlike for
* basic_transaction). */
assert(pmemobj_tx_stage() == TX_STAGE_WORK);
assert(proot->count == 2);
throw;
}
});
/* An internal transaction error occurred, outer tx aborted just
* now. Reacquire locks if necessary. */
assert(proot->count == 0);
} catch (...) {
/* Some other exception thrown, outer tx aborted just now.
* Reacquire locks if necessary. */
assert(proot->count == 0);
}
}
static void run(obj::pool_base &pool, std::function< void()> tx, Locks &... locks)
Execute a closure-like transaction and lock locks.
Definition: transaction.hpp:823
static pool< T > create(const std::string &path, const std::string &layout, std::size_t size=PMEMOBJ_MIN_POOL, mode_t mode=DEFAULT_MODE)
Creates a new transactional object store pool.
Definition: pool.hpp:694
Custom transaction error class.
Definition: pexceptions.hpp:81
Persistent_ptr transactional allocation functions for objects.
Main libpmemobj namespace.
Definition: allocation_flag.hpp:18
Persistent smart pointer.
Convenience extensions for the resides on pmem property template.
C++ pmemobj pool.
C++ pmemobj transactions.
using namespace pmem::obj;
template <typename T>
struct simple_ptr {
simple_ptr()
{
assert(pmemobj_tx_stage() == TX_STAGE_WORK);
ptr = make_persistent<T>();
}
~simple_ptr()
{
assert(pmemobj_tx_stage() == TX_STAGE_WORK);
try {
delete_persistent<T>(ptr);
std::cerr << e.what() << std::endl;
std::terminate();
std::cerr << e.what() << std::endl;
std::terminate();
}
}
persistent_ptr<T> ptr;
};
struct A {
A() : ptr1(), ptr2()
{
}
simple_ptr<int> ptr1;
simple_ptr<char[(1ULL << 30)]> ptr2;
};
struct B {
B() : ptr1(), ptr2()
{
auto pop = pool_base(pmemobj_pool_by_ptr(this));
// It would result in a crash!
// basic_transaction::run(pop, [&]{ throw
// std::runtime_error("Error"); });
pop, [&] { throw std::runtime_error("Error"); });
}
simple_ptr<int> ptr1;
simple_ptr<int> ptr2;
};
void
tx_nested_struct_example()
{
/* pool root structure */
struct root {
persistent_ptr<A> ptrA;
persistent_ptr<B> ptrB;
};
/* create a pmemobj pool */
auto pop = pool<root>::create("poolfile", "layout", PMEMOBJ_MIN_POOL);
auto proot = pop.root();
auto create_a = [&] { proot->ptrA = make_persistent<A>(); };
auto create_b = [&] { proot->ptrB = make_persistent<B>(); };
try {
// It would result in a crash!
// basic_transaction::run(pop, create_a);
flat_transaction::run(pop, create_a);
/* To see why flat_transaction is necessary let's
* consider what happens when calling A ctor. The call stack
* will look like this:
*
* | ptr2 ctor |
* |-----------|
* | ptr1 ctor |
* |-----------|
* | A ctor |
*
* Since ptr2 is a pointer to some huge array of elements,
* calling ptr2 ctor will most likely result in make_persistent
* throwing an exception (due to out of memory). This exception
* will, in turn, cause stack unwinding - already constructed
* elements must be destroyed (in this example ptr1 destructor
* will be called).
*
* If we'd use basic_transaction the allocation failure, apart
* from throwing an exception, would also cause the transaction
* to abort (by default, in basic_transaction, all transactional
* functions failures cause tx abort). This is problematic since
* the ptr1 destructor, which is called during stack unwinding,
* expects the transaction to be in WORK stage (and the actual
* stage is ABORTED). As a result the application will fail on
* assert (and probably crash in NDEBUG mode).
*
* Now, consider what will happen if we'd use flat_transaction
* instead. In this case, make_persistent failure will not abort
* the transaction, it will only result in an exception. This
* means that the transaction is still in WORK stage during
* stack unwinding. Only after it completes, the transaction is
* aborted (it's happening at the outermost level, when exiting
* create_a lambda).
*/
} catch (std::runtime_error &) {
}
try {
basic_transaction::run(pop, create_b);
flat_transaction::run(pop, create_b);
/* Running create_b can be done both within basic and flat
* transaction. However, note that the transaction used in the B
* constructor MUST be a flat_transaction. This is because
* flat_transaction does not abort immediately when catching an
* exception. Instead it passes it to the outermost transaction
* - the abort is performed at that outermost level. In case of
* a basic_transaction the abort would be done within the B ctor
* and it would result in the same problems as with the previous
* example.
*/
} catch (std::runtime_error &) {
}
}
static void run(obj::pool_base &pool, std::function< void()> tx, Locks &... locks)
Execute a closure-like transaction and lock locks.
Definition: transaction.hpp:694
Custom transaction error class.
Definition: pexceptions.hpp:158
Custom transaction error class.
Definition: pexceptions.hpp:176

and basic tx:

using namespace pmem::obj;
int
manual_tx_example()
{
/* pool root structure */
struct root {
mutex pmutex;
shared_mutex shared_pmutex;
p<int> count;
persistent_ptr<root> another_root;
};
/* create a pmemobj pool */
auto pop = pool<root>::create("poolfile", "layout", PMEMOBJ_MIN_POOL);
auto proot = pop.root();
try {
transaction::manual tx(pop, proot->pmutex,
proot->shared_pmutex);
/* atomically allocate objects */
proot->another_root = make_persistent<root>();
/* atomically modify objects */
proot->count++;
/* It's necessary to commit the transaction manually and
* it has to be the last operation in the transaction. */
/* an internal transaction error occurred, tx aborted
* reacquire locks if necessary */
} catch (...) {
/* some other exception thrown, tx aborted
* reacquire locks if necessary */
}
/* In complex cases with library calls, remember to check the status of
* the previous transaction. */
return transaction::error();
}
static void commit()
Manually commit a transaction.
Definition: transaction.hpp:325
typename detail::transaction_base< false >::manual manual
C++ manual scope transaction class.
Definition: transaction.hpp:633
Pmem-resident mutex.
Pmem-resident shared mutex.

Function Documentation

◆ ctl_exec() [1/2]

template<typename T >
T pmem::obj::ctl_exec ( const std::string &  name,
arg 
)

Execute function at global scope.

Parameters
[in]namename of entry point
[in]argextra argument
Returns
copy of arg, possibly modified by query

For more details, see: https://pmem.io/pmdk/manpages/linux/master/libpmemobj/pmemobj_ctl_get.3

◆ ctl_exec() [2/2]

template<typename T >
T pmem::obj::ctl_exec ( const std::wstring &  name,
arg 
)

Execute function at global scope.

Parameters
[in]namename of entry point
[in]argextra argument
Returns
copy of arg, possibly modified by query

For more details, see: https://pmem.io/pmdk/manpages/linux/master/libpmemobj/pmemobj_ctl_get.3

◆ ctl_get() [1/2]

template<typename T >
T pmem::obj::ctl_get ( const std::string &  name)

Query libpmemobj state at global scope.

Parameters
[in]namename of entry point
Returns
variable representing internal state

For more details, see: https://pmem.io/pmdk/manpages/linux/master/libpmemobj/pmemobj_ctl_get.3

◆ ctl_get() [2/2]

template<typename T >
T pmem::obj::ctl_get ( const std::wstring &  name)

Query libpmemobj state at global scope.

Parameters
[in]namename of entry point
Returns
variable representing internal state

For more details, see: https://pmem.io/pmdk/manpages/linux/master/libpmemobj/pmemobj_ctl_get.3

◆ ctl_set() [1/2]

template<typename T >
T pmem::obj::ctl_set ( const std::string &  name,
arg 
)

Modify libpmemobj state at global scope.

Parameters
[in]namename of entry point
[in]argextra argument
Returns
copy of arg, possibly modified by query

For more details, see: https://pmem.io/pmdk/manpages/linux/master/libpmemobj/pmemobj_ctl_get.3

◆ ctl_set() [2/2]

template<typename T >
T pmem::obj::ctl_set ( const std::wstring &  name,
arg 
)

Modify libpmemobj state at global scope.

Parameters
[in]namename of entry point
[in]argextra argument
Returns
copy of arg, possibly modified by query

For more details, see: https://pmem.io/pmdk/manpages/linux/master/libpmemobj/pmemobj_ctl_get.3

◆ delete_persistent() [1/3]

template<typename T >
void pmem::obj::delete_persistent ( typename detail::pp_if_array< T >::type  ptr,
std::size_t  N 
)

Transactionally free an array of objects of type T held in a persistent_ptr.

This function can be used to transactionally free an array of objects. Calls the objects' destructors before freeing memory. This overload only participates in overload resolution if T is an array.

To ensure that proper recovery is possible, ptr should be set to null after delete_persistent call and within the same transaction.

Parameters
[in,out]ptrpersistent pointer to an array of objects.
[in]Nthe size of the array.
Exceptions
transaction_scope_errorif called outside of an active transaction
transaction_free_erroron transactional free failure.

◆ delete_persistent() [2/3]

template<typename T >
void pmem::obj::delete_persistent ( typename detail::pp_if_not_array< T >::type  ptr)

Transactionally free an object of type T held in a persistent_ptr.

This function can be used to transactionally free an object. Calls the object's destructor before freeing memory. Cannot be used for array types.

To ensure that proper recovery is possible, ptr should be set to null after delete_persistent call and within the same transaction.

Parameters
[in,out]ptrpersistent pointer to an object that is not an array.
Exceptions
transaction_scope_errorif called outside of an active transaction
transaction_free_erroron transactional free failure.

◆ delete_persistent() [3/3]

template<typename T >
void pmem::obj::delete_persistent ( typename detail::pp_if_size_array< T >::type  ptr)

Transactionally free an array of objects of type T held in a persistent_ptr.

This function can be used to transactionally free an array of objects. Calls the objects' destructors before freeing memory. This overload only participates in overload resolution if T is an array.

To ensure that proper recovery is possible, ptr should be set to null after delete_persistent call and within the same transaction.

Parameters
[in,out]ptrpersistent pointer to an array of objects.
Exceptions
transaction_scope_errorif called outside of an active transaction
transaction_free_erroron transactional free failure.

◆ delete_persistent_atomic() [1/3]

template<typename T >
void pmem::obj::delete_persistent_atomic ( typename detail::pp_if_array< T >::type &  ptr,
std::size_t   
)

Atomically deallocate an array of objects.

There is no way to atomically destroy an object. Any object specific cleanup must be performed elsewhere. Do NOT use this inside transactions, as it might lead to undefined behavior in the presence of transaction aborts.

param[in,out] ptr the persistent_ptr whose pointee is to be deallocated.

◆ delete_persistent_atomic() [2/3]

template<typename T >
void pmem::obj::delete_persistent_atomic ( typename detail::pp_if_not_array< T >::type &  ptr)
noexcept

Atomically deallocate an object.

There is no way to atomically destroy an object. Any object specific cleanup must be performed elsewhere. Do NOT use this inside transactions, as it might lead to undefined behavior in the presence of transaction aborts.

param[in,out] ptr the persistent_ptr whose pointee is to be deallocated.

◆ delete_persistent_atomic() [3/3]

template<typename T >
void pmem::obj::delete_persistent_atomic ( typename detail::pp_if_size_array< T >::type &  ptr)

Atomically deallocate an array of objects.

There is no way to atomically destroy an object. Any object specific cleanup must be performed elsewhere. Do NOT use this inside transactions, as it might lead to undefined behavior in the presence of transaction aborts.

param[in,out] ptr the persistent_ptr whose pointee is to be deallocated.

◆ make_persistent() [1/4]

template<typename T , typename... Args>
detail::pp_if_not_array<T>::type pmem::obj::make_persistent ( allocation_flag  flag,
Args &&...  args 
)

Transactionally allocate and construct an object of type T.

This function can be used to transactionally allocate an object. Cannot be used for array types.

Parameters
[in]flagaffects behaviour of allocator
[in,out]argsa list of parameters passed to the constructor.
Returns
persistent_ptr<T> on success
Exceptions
transaction_scope_errorif called outside of an active transaction
transaction_alloc_erroron transactional allocation failure.
rethrowexception from T constructor

◆ make_persistent() [2/4]

template<typename T >
detail::pp_if_size_array<T>::type pmem::obj::make_persistent ( allocation_flag  flag = allocation_flag::none())

Transactionally allocate and construct an array of objects of type T.

This function can be used to transactionally allocate an array. This overload only participates in overload resolution if T is an array.

Parameters
[in]flagaffects behaviour of allocator
Returns
persistent_ptr<T[N]> on success
Exceptions
transaction_scope_errorif called outside of an active transaction
transaction_alloc_erroron transactional allocation failure.
rethrowexception from T constructor

◆ make_persistent() [3/4]

template<typename T , typename... Args>
std::enable_if< !detail::is_first_arg_same<allocation_flag, Args...>::value, typename detail::pp_if_not_array<T>::type>::type pmem::obj::make_persistent ( Args &&...  args)

Transactionally allocate and construct an object of type T.

This function can be used to transactionally allocate an object. Cannot be used for array types.

Parameters
[in,out]argsa list of parameters passed to the constructor.
Returns
persistent_ptr<T> on success
Exceptions
transaction_scope_errorif called outside of an active transaction
transaction_alloc_erroron transactional allocation failure.
rethrowexception from T constructor

◆ make_persistent() [4/4]

template<typename T >
detail::pp_if_array<T>::type pmem::obj::make_persistent ( std::size_t  N,
allocation_flag  flag = allocation_flag::none() 
)

Transactionally allocate and construct an array of objects of type T.

This function can be used to transactionally allocate an array. This overload only participates in overload resolution if T is an array.

Parameters
[in]Nthe number of array elements.
[in]flagaffects behaviour of allocator
Returns
persistent_ptr<T[]> on success
Exceptions
transaction_scope_errorif called outside of an active transaction
transaction_alloc_erroron transactional allocation failure.
rethrowexception from T constructor

◆ make_persistent_atomic() [1/4]

template<typename T >
void pmem::obj::make_persistent_atomic ( pool_base pool,
typename detail::pp_if_array< T >::type &  ptr,
std::size_t  N,
allocation_flag_atomic  flag = allocation_flag_atomic::none() 
)

Atomically allocate an array of objects.

This function can be used to atomically allocate an array of objects. Cannot be used for simple objects. Do NOT use this inside transactions, as it might lead to undefined behavior in the presence of transaction aborts.

Parameters
[in,out]poolthe pool from which the object will be allocated.
[in,out]ptrthe persistent pointer to which the allocation will take place.
[in]Nthe number of array elements.
[in]flagaffects behaviour of allocator
Exceptions
std::bad_allocon allocation failure.

◆ make_persistent_atomic() [2/4]

template<typename T , typename... Args>
void pmem::obj::make_persistent_atomic ( pool_base pool,
typename detail::pp_if_not_array< T >::type &  ptr,
allocation_flag_atomic  flag,
Args &&...  args 
)

Atomically allocate and construct an object.

Constructor parameters are passed through variadic parameters. Do NOT use this inside transactions, as it might lead to undefined behavior in the presence of transaction aborts.

Parameters
[in,out]poolthe pool from which the object will be allocated.
[in,out]ptrthe persistent pointer to which the allocation will take place.
[in]flagaffects behaviour of allocator
[in]argsvariadic function parameter containing all parameters passed to the objects constructor.
Exceptions
std::bad_allocon allocation failure.

◆ make_persistent_atomic() [3/4]

template<typename T , typename... Args>
std::enable_if<!detail::is_first_arg_same<allocation_flag_atomic, Args...>::value>::type pmem::obj::make_persistent_atomic ( pool_base pool,
typename detail::pp_if_not_array< T >::type &  ptr,
Args &&...  args 
)

Atomically allocate and construct an object.

Constructor parameters are passed through variadic parameters. Do NOT use this inside transactions, as it might lead to undefined behavior in the presence of transaction aborts.

Parameters
[in,out]poolthe pool from which the object will be allocated.
[in,out]ptrthe persistent pointer to which the allocation will take place.
[in]argsvariadic function parameter containing all parameters passed to the objects constructor.
Exceptions
std::bad_allocon allocation failure.

◆ make_persistent_atomic() [4/4]

template<typename T >
void pmem::obj::make_persistent_atomic ( pool_base pool,
typename detail::pp_if_size_array< T >::type &  ptr,
allocation_flag_atomic  flag = allocation_flag_atomic::none() 
)

Atomically allocate an array of objects.

This function can be used to atomically allocate an array of objects. Cannot be used for simple objects. Do NOT use this inside transactions, as it might lead to undefined behavior in the presence of transaction aborts.

Parameters
[in,out]poolthe pool from which the object will be allocated.
[in,out]ptrthe persistent pointer to which the allocation will take place.
[in]flagaffects behaviour of allocator
Exceptions
std::bad_allocon allocation failure.

◆ operator!=() [1/7]

template<typename T , typename P , typename Tr , typename OtherAllocator >
bool pmem::obj::operator!= ( const allocator< T, P, Tr > &  lhs,
const OtherAllocator &  rhs 
)
inline

Determines if memory from another allocator can be deallocated from this one.

Parameters
[in]lhsleft hand side allocator.
[in]rhsright hand side allocator.
Returns
false if allocators are equivalent in terms of deallocation, true otherwise.

◆ operator!=() [2/7]

template<typename T , typename Policy >
bool pmem::obj::operator!= ( const segment_vector< T, Policy > &  lhs,
const segment_vector< T, Policy > &  rhs 
)

Comparison operator.

Compares the contents of two containers.

Checks if containers have the different number of elements or at least one element in lhs is not equal to element in rhs at the same position.

Parameters
[in]lhsis pmem::obj::experimental::segment_vector<T, Policy, SPolicy>.
[in]rhsis pmem::obj::experimental::segment_vector<T, Policy, SPolicy>.
Returns
true if contents of the containers are not equal, false otherwise.

◆ operator!=() [3/7]

template<typename T , typename Policy >
bool pmem::obj::operator!= ( const segment_vector< T, Policy > &  lhs,
const std::vector< T > &  rhs 
)

Comparison operator.

Compares the contents of two containers.

Checks if containers have the same number of elements and each element in lhs is equal to element in rhs at the same position.

Parameters
[in]lhsis pmem::obj::experimental::segment_vector<T, SegmentPolicy, StoragePolicy>
[in]rhsis std::vector<T>.
Returns
true if contents of the containers are not equal, false otherwise.

◆ operator!=() [4/7]

template<typename T , typename Policy >
bool pmem::obj::operator!= ( const std::vector< T > &  lhs,
const segment_vector< T, Policy > &  rhs 
)

Comparison operator.

Compares the contents of two containers.

Checks if containers have the same number of elements and each element in lhs is equal to element in rhs at the same position.

Parameters
[in]lhsis std::vector<T>.
[in]rhsis pmem::obj::experimental::segment_vector<T, Policy, SPolicy>.
Returns
true if contents of the containers are not equal, false otherwise.

◆ operator!=() [5/7]

template<typename T >
bool pmem::obj::operator!= ( const std::vector< T > &  lhs,
const vector< T > &  rhs 
)

Comparison operator.

Compares the contents of two containers.

Checks if containers have the same number of elements and each element in lhs is equal to element in rhs at the same position.

Parameters
[in]lhsfirst vector of type std::vector<T>
[in]rhssecond vector of type pmem::obj::vector<T>
Returns
true if contents of the containers are not equal, false otherwise

◆ operator!=() [6/7]

template<typename T >
bool pmem::obj::operator!= ( const vector< T > &  lhs,
const std::vector< T > &  rhs 
)

Comparison operator.

Compares the contents of two containers.

Checks if containers have the same number of elements and each element in lhs is equal to element in rhs at the same position.

Parameters
[in]lhsfirst vector of type pmem::obj::vector<T>
[in]rhssecond vector of type std::vector<T>
Returns
true if contents of the containers are not equal, false otherwise

◆ operator!=() [7/7]

template<typename T >
bool pmem::obj::operator!= ( const vector< T > &  lhs,
const vector< T > &  rhs 
)

Comparison operator.

Compares the contents of two containers.

Checks if containers have the same number of elements and each element in lhs is equal to element in rhs at the same position.

Parameters
[in]lhsfirst vector of type pmem::obj::vector<T>
[in]rhssecond vector of type pmem::obj::vector<T>
Returns
true if contents of the containers are not equal, false otherwise

◆ operator-()

template<typename T , typename Y , typename = typename std::enable_if< std::is_same<typename std::remove_cv<T>::type, typename std::remove_cv<Y>::type>::value>>
ptrdiff_t pmem::obj::operator- ( persistent_ptr< T > const &  lhs,
persistent_ptr< Y > const &  rhs 
)
inline

Subtraction operator for persistent pointers of identical type.

Calculates the offset difference of PMEMoids in terms of represented objects. Calculating the difference of pointers from objects of different pools is not allowed.

◆ operator<() [1/7]

template<typename T , typename Policy >
bool pmem::obj::operator< ( const segment_vector< T, Policy > &  lhs,
const segment_vector< T, Policy > &  rhs 
)

Comparison operator.

Compares the contents of two containers lexicographically.

Parameters
[in]lhsis pmem::obj::experimental::segment_vector<T, Policy, SPolicy>.
[in]rhsis pmem::obj::experimental::segment_vector<T, Policy, SPolicy>.
Returns
true if contents of lhs are lexicographically less than contents of rhs, false otherwise.

◆ operator<() [2/7]

template<typename T , typename Policy >
bool pmem::obj::operator< ( const segment_vector< T, Policy > &  lhs,
const std::vector< T > &  rhs 
)

Comparison operator.

Compares the contents of two containers lexicographically.

Parameters
[in]lhsis pmem::obj::experimental::segment_vector<T, SegmentPolicy, StoragePolicy>
[in]rhsis std::vector<T>.
Returns
true if contents of lhs are lexicographically less than contents of rhs, false otherwise.

◆ operator<() [3/7]

template<typename T , typename Policy >
bool pmem::obj::operator< ( const std::vector< T > &  lhs,
const segment_vector< T, Policy > &  rhs 
)

Comparison operator.

Compares the contents of two containers lexicographically.

Parameters
[in]lhsis std::vector<T>.
[in]rhsis pmem::obj::experimental::segment_vector<T, Policy, SPolicy>.
Returns
true if contents of lhs are lexicographically less than contents of rhs, false otherwise.

◆ operator<() [4/7]

template<typename T >
bool pmem::obj::operator< ( const std::vector< T > &  lhs,
const vector< T > &  rhs 
)

Comparison operator.

Compares the contents of two containers lexicographically.

Parameters
[in]lhsfirst vector of type std::vector<T>
[in]rhssecond vector of type pmem::obj::vector<T>
Returns
true if contents of lhs are lexicographically less than contents of rhs, false otherwise

◆ operator<() [5/7]

template<typename T >
bool pmem::obj::operator< ( const vector< T > &  lhs,
const std::vector< T > &  rhs 
)

Comparison operator.

Compares the contents of two containers lexicographically.

Parameters
[in]lhsfirst vector of type pmem::obj::vector<T>
[in]rhssecond vector of type std::vector<T>
Returns
true if contents of lhs are lexicographically less than contents of rhs, false otherwise

◆ operator<() [6/7]

template<typename T >
bool pmem::obj::operator< ( const vector< T > &  lhs,
const vector< T > &  rhs 
)

Comparison operator.

Compares the contents of two containers lexicographically.

Parameters
[in]lhsfirst vector of type pmem::obj::vector<T>
[in]rhssecond vector of type pmem::obj::vector<T>
Returns
true if contents of lhs are lexicographically less than contents of rhs, false otherwise

◆ operator<() [7/7]

template<typename T , typename Y >
bool pmem::obj::operator< ( persistent_ptr< T > const &  lhs,
persistent_ptr< Y > const &  rhs 
)
inlinenoexcept

Less than operator.

Returns
true if the uuid_lo of lhs is less than the uuid_lo of rhs, should they be equal, the offsets are compared. Returns false otherwise.

◆ operator<=() [1/7]

template<typename T , typename Policy >
bool pmem::obj::operator<= ( const segment_vector< T, Policy > &  lhs,
const segment_vector< T, Policy > &  rhs 
)

Comparison operator.

Compares the contents of two containers lexicographically.

Parameters
[in]lhsis pmem::obj::experimental::segment_vector<T, Policy, SPolicy>.
[in]rhsis pmem::obj::experimental::segment_vector<T, Policy>.
Returns
true if contents of lhs are lexicographically lesser than or equal to contents of rhs, false otherwise.

◆ operator<=() [2/7]

template<typename T , typename Policy >
bool pmem::obj::operator<= ( const segment_vector< T, Policy > &  lhs,
const std::vector< T > &  rhs 
)

Comparison operator.

Compares the contents of two containers lexicographically.

Parameters
[in]lhsis pmem::obj::experimental::segment_vector<T, SegmentPolicy, StoragePolicy>
[in]rhsis std::vector<T>.
Returns
true if contents of lhs are lexicographically lesser than or equal to contents of rhs, false otherwise.

◆ operator<=() [3/7]

template<typename T , typename Policy >
bool pmem::obj::operator<= ( const std::vector< T > &  lhs,
const segment_vector< T, Policy > &  rhs 
)

Comparison operator.

Compares the contents of two containers lexicographically.

Parameters
[in]lhsis std::vector<T>.
[in]rhsis pmem::obj::experimental::segment_vector<T, Policy, SPolicy>.
Returns
true if contents of lhs are lexicographically lesser than or equal to contents of rhs, false otherwise.

◆ operator<=() [4/7]

template<typename T >
bool pmem::obj::operator<= ( const std::vector< T > &  lhs,
const vector< T > &  rhs 
)

Comparison operator.

Compares the contents of two containers lexicographically.

Parameters
[in]lhsfirst vector of ype std::vector<T>
[in]rhssecond vector of type pmem::obj::vector<T>
Returns
true if contents of lhs are lexicographically lesser than or equal to contents of rhs, false otherwise

◆ operator<=() [5/7]

template<typename T >
bool pmem::obj::operator<= ( const vector< T > &  lhs,
const std::vector< T > &  rhs 
)

Comparison operator.

Compares the contents of two containers lexicographically.

Parameters
[in]lhsfirst vector of type pmem::obj::vector<T>
[in]rhssecond vector of ype std::vector<T>
Returns
true if contents of lhs are lexicographically lesser than or equal to contents of rhs, false otherwise

◆ operator<=() [6/7]

template<typename T >
bool pmem::obj::operator<= ( const vector< T > &  lhs,
const vector< T > &  rhs 
)

Comparison operator.

Compares the contents of two containers lexicographically.

Parameters
[in]lhsfirst vector of type pmem::obj::vector<T>
[in]rhssecond vector of type pmem::obj::vector<T>
Returns
true if contents of lhs are lexicographically lesser than or equal to contents of rhs, false otherwise

◆ operator<=() [7/7]

template<typename T , typename Y >
bool pmem::obj::operator<= ( persistent_ptr< T > const &  lhs,
persistent_ptr< Y > const &  rhs 
)
inlinenoexcept

Less or equal than operator.

See less than operator for comparison rules.

◆ operator==() [1/10]

template<typename T , typename P , typename Tr , typename T2 , typename P2 , typename Tr2 >
bool pmem::obj::operator== ( const allocator< T, P, Tr > &  lhs,
const allocator< T2, P2, Tr2 > &  rhs 
)
inline

Determines if memory from another allocator can be deallocated from this one.

Parameters
[in]lhsleft hand side allocator.
[in]rhsright hand side allocator.
Returns
true if allocators are equivalent in terms of deallocation, false otherwise.

◆ operator==() [2/10]

template<typename T , typename Policy >
bool pmem::obj::operator== ( const segment_vector< T, Policy > &  lhs,
const segment_vector< T, Policy > &  rhs 
)

Comparison operator.

Compares the contents of two containers.

Checks if containers have the same number of elements and each element in lhs is equal to element in rhs at the same position.

Parameters
[in]lhsis pmem::obj::experimental::segment_vector<T, Policy, SPolicy>.
[in]rhsis pmem::obj::experimental::segment_vector<T, Policy, SPolicy>.
Returns
true if contents of the containers are equal, false otherwise.

◆ operator==() [3/10]

template<typename T , typename Policy >
bool pmem::obj::operator== ( const segment_vector< T, Policy > &  lhs,
const std::vector< T > &  rhs 
)

Comparison operator.

Compares the contents of two containers.

Checks if containers have the same number of elements and each element in lhs is equal to element in rhs at the same position.

Parameters
[in]lhsis pmem::obj::experimental::segment_vector<T, SegmentPolicy, StoragePolicy>
[in]rhsis std::vector<T>.
Returns
true if contents of the containers are equal, false otherwise.

◆ operator==() [4/10]

template<typename T , typename Policy >
bool pmem::obj::operator== ( const std::vector< T > &  lhs,
const segment_vector< T, Policy > &  rhs 
)

Comparison operator.

Compares the contents of two containers.

Checks if containers have the same number of elements and each element in lhs is equal to element in rhs at the same position.

Parameters
[in]lhsis std::vector<T>.
[in]rhsis pmem::obj::experimental::segment_vector<T, Policy, SPolicy>.
Returns
true if contents of the containers are equal, false otherwise.

◆ operator==() [5/10]

template<typename T >
bool pmem::obj::operator== ( const std::vector< T > &  lhs,
const vector< T > &  rhs 
)

Comparison operator.

Compares the contents of two containers.

Checks if containers have the same number of elements and each element in lhs is equal to element in rhs at the same position.

Parameters
[in]lhsfirst vector of type std::vector<T>
[in]rhssecond vector of type pmem::obj::vector<T>
Returns
true if contents of the containers are equal, false otherwise

◆ operator==() [6/10]

template<typename T >
bool pmem::obj::operator== ( const vector< T > &  lhs,
const std::vector< T > &  rhs 
)

Comparison operator.

Compares the contents of two containers.

Checks if containers have the same number of elements and each element in lhs is equal to element in rhs at the same position.

Parameters
[in]lhsfirst vector of type pmem::obj::vector<T>
[in]rhssecond vector of type std::vector<T>
Returns
true if contents of the containers are equal, false otherwise

◆ operator==() [7/10]

template<typename T >
bool pmem::obj::operator== ( const vector< T > &  lhs,
const vector< T > &  rhs 
)

Comparison operator.

Compares the contents of two containers.

Checks if containers have the same number of elements and each element in lhs is equal to element in rhs at the same position.

Parameters
[in]lhsfirst vector of type pmem::obj::vector<T>
[in]rhssecond vector of type pmem::obj::vector<T>
Returns
true if contents of the containers are equal, false otherwise

◆ operator==() [8/10]

template<typename T , typename Y >
bool pmem::obj::operator== ( persistent_ptr< T > const &  lhs,
persistent_ptr< Y > const &  rhs 
)
inlinenoexcept

Equality operator.

This checks if underlying PMEMoids are equal.

◆ operator==() [9/10]

template<typename T , typename OtherAllocator >
bool pmem::obj::operator== ( standard_alloc_policy< T > const &  ,
OtherAllocator const &   
)
inline

Determines if memory from another allocator can be deallocated from this one.

Returns
false.

◆ operator==() [10/10]

template<typename T , typename T2 >
bool pmem::obj::operator== ( standard_alloc_policy< T > const &  ,
standard_alloc_policy< T2 > const &   
)
inline

Determines if memory from another allocator can be deallocated from this one.

Returns
true.

◆ operator>() [1/7]

template<typename T , typename Policy >
bool pmem::obj::operator> ( const segment_vector< T, Policy > &  lhs,
const segment_vector< T, Policy > &  rhs 
)

Comparison operator.

Compares the contents of two containers lexicographically.

Parameters
[in]lhsis pmem::obj::experimental::segment_vector<T, Policy, SPolicy>.
[in]rhsis pmem::obj::experimental::segment_vector<T, Policy, SPolicy>.
Returns
true if contents of lhs are lexicographically greater than contents of rhs, false otherwise.

◆ operator>() [2/7]

template<typename T , typename Policy >
bool pmem::obj::operator> ( const segment_vector< T, Policy > &  lhs,
const std::vector< T > &  rhs 
)

Comparison operator.

Compares the contents of two containers lexicographically.

Parameters
[in]lhsis pmem::obj::experimental::segment_vector<T, SegmentPolicy, StoragePolicy>
[in]rhsis std::vector<T>.
Returns
true if contents of lhs are lexicographically greater than contents of rhs, false otherwise.

◆ operator>() [3/7]

template<typename T , typename Policy >
bool pmem::obj::operator> ( const std::vector< T > &  lhs,
const segment_vector< T, Policy > &  rhs 
)

Comparison operator.

Compares the contents of two containers lexicographically.

Parameters
[in]lhsis std::vector<T>.
[in]rhsis pmem::obj::experimental::segment_vector<T, Policy, SPolicy>.
Returns
true if contents of lhs are lexicographically greater than contents of rhs, false otherwise.

◆ operator>() [4/7]

template<typename T >
bool pmem::obj::operator> ( const std::vector< T > &  lhs,
const vector< T > &  rhs 
)

Comparison operator.

Compares the contents of two containers lexicographically.

Parameters
[in]lhsfirst vector of type std::vector<T>
[in]rhssecond vector of type pmem::obj::vector<T>
Returns
true if contents of lhs are lexicographically greater than contents of rhs, false otherwise

◆ operator>() [5/7]

template<typename T >
bool pmem::obj::operator> ( const vector< T > &  lhs,
const std::vector< T > &  rhs 
)

Comparison operator.

Compares the contents of two containers lexicographically.

Parameters
[in]lhsfirst vector of type pmem::obj::vector<T>
[in]rhssecond vector of type std::vector<T>
Returns
true if contents of lhs are lexicographically greater than contents of rhs, false otherwise

◆ operator>() [6/7]

template<typename T >
bool pmem::obj::operator> ( const vector< T > &  lhs,
const vector< T > &  rhs 
)

Comparison operator.

Compares the contents of two containers lexicographically.

Parameters
[in]lhsfirst vector of type pmem::obj::vector<T>
[in]rhssecond vector of type pmem::obj::vector<T>
Returns
true if contents of lhs are lexicographically greater than contents of rhs, false otherwise

◆ operator>() [7/7]

template<typename T , typename Y >
bool pmem::obj::operator> ( persistent_ptr< T > const &  lhs,
persistent_ptr< Y > const &  rhs 
)
inlinenoexcept

Greater than operator.

See less than operator for comparison rules.

◆ operator>=() [1/7]

template<typename T , typename Policy >
bool pmem::obj::operator>= ( const segment_vector< T, Policy > &  lhs,
const segment_vector< T, Policy > &  rhs 
)

Comparison operator.

Compares the contents of two containers lexicographically.

Parameters
[in]lhsis pmem::obj::experimental::segment_vector<T, Policy, SPolicy>.
[in]rhsis pmem::obj::experimental::segment_vector<T, Policy, SPolicy>.
Returns
true if contents of lhs are lexicographically greater than or equal to contents of rhs, false otherwise.

◆ operator>=() [2/7]

template<typename T , typename Policy >
bool pmem::obj::operator>= ( const segment_vector< T, Policy > &  lhs,
const std::vector< T > &  rhs 
)

Comparison operator.

Compares the contents of two containers lexicographically.

Parameters
[in]lhsis pmem::obj::experimental::segment_vector<T, SegmentPolicy, StoragePolicy>
[in]rhsis std::vector<T>.
Returns
true if contents of lhs are lexicographically greater than or equal to contents of rhs, false otherwise.

◆ operator>=() [3/7]

template<typename T , typename Policy >
bool pmem::obj::operator>= ( const std::vector< T > &  lhs,
const segment_vector< T, Policy > &  rhs 
)

Comparison operator.

Compares the contents of two containers lexicographically.

Parameters
[in]lhsis std::vector<T>.
[in]rhsis pmem::obj::experimental::segment_vector<T, Policy, SPolicy>.
Returns
true if contents of lhs are lexicographically greater than or equal to contents of rhs, false otherwise.

◆ operator>=() [4/7]

template<typename T >
bool pmem::obj::operator>= ( const std::vector< T > &  lhs,
const vector< T > &  rhs 
)

Comparison operator.

Compares the contents of two containers lexicographically.

Parameters
[in]lhsfirst vector of type std::vector<T>
[in]rhssecond vector of type pmem::obj::vector<T>
Returns
true if contents of lhs are lexicographically greater than or equal to contents of rhs, false otherwise

◆ operator>=() [5/7]

template<typename T >
bool pmem::obj::operator>= ( const vector< T > &  lhs,
const std::vector< T > &  rhs 
)

Comparison operator.

Compares the contents of two containers lexicographically.

Parameters
[in]lhsfirst vector of type pmem::obj::vector<T>
[in]rhssecond vector of type std::vector<T>
Returns
true if contents of lhs are lexicographically greater than or equal to contents of rhs, false otherwise

◆ operator>=() [6/7]

template<typename T >
bool pmem::obj::operator>= ( const vector< T > &  lhs,
const vector< T > &  rhs 
)

Comparison operator.

Compares the contents of two containers lexicographically.

Parameters
[in]lhsfirst vector of type pmem::obj::vector<T>
[in]rhssecond vector of type pmem::obj::vector<T>
Returns
true if contents of lhs are lexicographically greater than or equal to contents of rhs, false otherwise

◆ operator>=() [7/7]

template<typename T , typename Y >
bool pmem::obj::operator>= ( persistent_ptr< T > const &  lhs,
persistent_ptr< Y > const &  rhs 
)
inlinenoexcept

Greater or equal than operator.

See less than operator for comparison rules.

◆ pool_by_pptr()

template<typename T >
pool_base pmem::obj::pool_by_pptr ( const persistent_ptr< T >  ptr)
inline

Retrieve pool handle for the given persistent_ptr.

Parameters
[in]ptrpointer to an object from a persistent memory pool.
Returns
handle to the pool containing the object.
Exceptions
pool_errorif the given pointer does not belong to an open pool.

◆ pool_by_vptr()

template<typename T >
pool_base pmem::obj::pool_by_vptr ( const T *  that)
inline

Retrieve pool handle for the given pointer.

Parameters
[in]thatpointer to an object from a persistent memory pool.
Returns
handle to the pool containing the object.
Exceptions
pool_errorif the given pointer does not belong to an open pool.

◆ swap() [1/4]

template<class T >
void pmem::obj::swap ( p< T > &  a,
p< T > &  b 
)
inline

Swaps two p objects of the same type.

Non-member swap function as required by Swappable concept. en.cppreference.com/w/cpp/concept/Swappable

◆ swap() [2/4]

template<class T >
void pmem::obj::swap ( persistent_ptr< T > &  a,
persistent_ptr< T > &  b 
)
inline

Swaps two persistent_ptr objects of the same type.

Non-member swap function as required by Swappable concept. en.cppreference.com/w/cpp/concept/Swappable

◆ swap() [3/4]

template<typename T , typename Policy >
void pmem::obj::swap ( segment_vector< T, Policy > &  lhs,
segment_vector< T, Policy > &  rhs 
)

Swaps the contents of lhs and rhs.

Parameters
[in]lhsfirst segment_vector.
[in]rhssecond segment_vector.

◆ swap() [4/4]

template<typename T >
void pmem::obj::swap ( vector< T > &  lhs,
vector< T > &  rhs 
)

Swaps the contents of lhs and rhs.

Parameters
[in]lhsfirst vector
[in]rhssecond vector