PMDK C++ bindings  1.13.0-git107.g7e59f08f
This is the C++ bindings documentation for PMDK's libpmemobj.
pmem::detail Namespace Reference

Implementation details. More...

Classes

class  concurrent_skip_list
 Persistent memory aware implementation of the concurrent skip list. More...
 
struct  contiguous_iterator
 Base class for iterators which satisfies RandomAccessIterator and operate on contiguous memory. More...
 
struct  range_snapshotting_iterator
 Non-const iterator which adds elements to a transaction in a bulk. More...
 
struct  basic_contiguous_iterator
 Default non-const iterator which adds element to a transaction on every access. More...
 
class  ebr
 Epoch-based reclamation (EBR). More...
 
struct  id_manager
 This structure is used for assigning unique thread ids so that those ids will be reused in case of thread exit. More...
 
struct  thread_id_type
 RAII-style structure for holding thread id. More...
 
class  enumerable_thread_specific
 Class for storing thread local data. More...
 
struct  is_output_iterator
 Type trait to determine if a given parameter type satisfies requirements of OutputIterator. More...
 
struct  is_input_iterator
 Type trait to determine if a given parameter type satisfies requirements of InputIterator. More...
 
struct  is_forward_iterator
 Type trait to determine if a given parameter type satisfies requirements of ForwardIterator. More...
 
struct  is_bidirectional_iterator
 Type trait to determine if a given parameter type satisfies requirements of BidirectionalIterator. More...
 
struct  is_random_access_iterator
 Type trait to determine if a given parameter type satisfies requirements of RandomAccessIterator. More...
 
class  self_relative_ptr_base_impl
 self_relative_ptr base template class More...
 
class  self_relative_accessor
 Static class accessor to self_relative_ptr_base. More...
 
struct  temp_value
 Template class for caching objects based on constructor's variadic template arguments and LIBPMEMOBJ_CPP_MAX_STACK_ALLOC_SIZE. More...
 
class  volatile_state
 Global key value store which allows persistent objects to use volatile memory. More...
 
struct  can_do_snapshot< std::atomic< obj::experimental::self_relative_ptr< T > > >
 pmem::detail::can_do_snapshot atomic specialization for self_relative_ptr. More...
 
struct  can_do_snapshot
 A structure that checks if it is possible to snapshot the specified memory. More...
 
class  transaction_base
 Common functionality for basic_transaction and flat_transaction. More...
 

Typedefs

using for_each_ptr_function = void(*)(obj::persistent_ptr_base &ptr)
 
template<typename T >
using t_has_for_each_ptr = typename std::enable_if< std::is_same< decltype(std::declval< T >().for_each_ptr(std::declval< for_each_ptr_function >())), void >::value >::type
 
template<typename T >
using t_is_defragmentable = supports< T, t_has_for_each_ptr >
 
template<size_t... Indices>
using index_sequence = integer_sequence< size_t, Indices... >
 
template<typename T , T N>
using make_integer_sequence = typename make_integer_seq_impl< T, N, void >::type
 
template<size_t N>
using make_index_sequence = make_integer_sequence< size_t, N >
 
template<class... Types>
using index_sequence_for = make_index_sequence< sizeof...(Types)>
 
template<typename P1 , typename P2 >
using tagged_ptr = tagged_ptr_impl< P1, P2, obj::experimental::self_relative_ptr< void > >
 
template<typename... Ts>
using void_t = typename make_void< Ts... >::type
 
template<typename T , template< typename > class... Checks>
using supports = typename supports_impl< T, void, Checks... >::type
 
template<typename Compare >
using is_transparent = typename Compare::is_transparent
 
template<typename Compare >
using has_is_transparent = detail::supports< Compare, is_transparent >
 
template<typename Iterator >
using subtraction = decltype(std::declval< Iterator >() - std::declval< Iterator >())
 
template<typename Iterator >
using has_subtraction = supports< Iterator, subtraction >
 
template<typename Iterator >
using pre_decrement = decltype(std::declval< Iterator >().operator--())
 
template<typename Iterator >
using has_pre_decrement = supports< Iterator, pre_decrement >
 
template<typename Iterator >
using indexing = decltype(std::declval< Iterator >().operator[](std::declval< typename std::iterator_traits< Iterator >::difference_type >()))
 
template<typename Iterator >
using has_indexing = supports< Iterator, indexing >
 

Functions

void try_insert_node_finish_marker ()
 
template<typename MyAlloc , typename OtherAlloc >
void allocator_copy_assignment (MyAlloc &my_allocator, OtherAlloc &other_allocator, std::true_type)
 Copy assignment implementation for allocator if propagate_on_container_copy_assignment == true_type.
 
template<typename MyAlloc , typename OtherAlloc >
void allocator_copy_assignment (MyAlloc &, OtherAlloc &, std::false_type)
 Copy assignment implementation for allocator if propagate_on_container_copy_assignment == false_type.
 
template<typename MyAlloc , typename OtherAlloc >
void allocator_move_assignment (MyAlloc &my_allocator, OtherAlloc &other_allocator, std::true_type)
 Move assignment implementation for allocator if propagate_on_container_move_assignment == true_type.
 
template<typename MyAlloc , typename OtherAlloc >
void allocator_move_assignment (MyAlloc &, OtherAlloc &, std::false_type)
 Move assignment implementation for allocator if propagate_on_container_move_assignment == false_type.
 
template<typename MyAlloc , typename OtherAlloc >
void allocator_swap (MyAlloc &my_allocator, OtherAlloc &other_allocator, std::true_type)
 Swap implementation for allocators if propagate_on_container_swap == true_type.
 
template<typename MyAlloc , typename OtherAlloc >
void allocator_swap (MyAlloc &, OtherAlloc &, std::false_type)
 Swap implementation for allocators if propagate_on_container_swap == false_type.
 
template<typename T , bool M, bool U>
bool operator== (const skip_list_iterator< T, M > &lhs, const skip_list_iterator< T, U > &rhs)
 
template<typename T , bool M, bool U>
bool operator!= (const skip_list_iterator< T, M > &lhs, const skip_list_iterator< T, U > &rhs)
 
template<typename T >
void conditional_add_to_tx (const T *that, std::size_t count=1, uint64_t flags=0)
 Conditionally add 'count' objects to a transaction. More...
 
template<typename T >
uint64_t type_num ()
 Return type number for given type.
 
uint64_t next_pow_2 (uint64_t v)
 Round up to the next lowest power of 2. More...
 
uint64_t next_pow_2 (uint32_t v)
 Round up to the next lowest power of 2. More...
 
static int Log2 (uint64_t x)
 
static uint8_t mssb_index64 (unsigned long long value)
 Returns index of most significant set bit.
 
static uint8_t mssb_index (unsigned int value)
 Returns index of most significant set bit.
 
static constexpr size_t align_up (size_t size, size_t align)
 
static constexpr size_t align_down (size_t size, size_t align)
 
template<typename Clock , typename Duration = typename Clock::duration>
timespec timepoint_to_timespec (const std::chrono::time_point< Clock, Duration > &timepoint)
 Convert std::chrono::time_point to posix timespec. More...
 
template<typename T , typename... Args>
void create (typename if_not_array< T >::type *ptr, Args &&... args)
 
template<typename T , typename... Args>
void create (typename if_size_array< T >::type *ptr, Args &&... args)
 
template<typename T , size_t... Indices, typename Tuple >
void create_from_tuple (void *ptr, index_sequence< Indices... >, Tuple tuple)
 
template<typename T , typename Tuple , typename... Args>
int c_style_construct (void *ptr, void *arg)
 
template<typename T , typename = typename std::enable_if< !std::is_trivially_destructible<T>::value>::type>
void destroy (typename if_not_array< T >::type &arg)
 
template<typename T , typename dummy = void, typename = typename std::enable_if< std::is_trivially_destructible<T>::value>::type>
void destroy (typename if_not_array< T >::type &)
 
template<typename T >
void destroy (typename if_size_array< T >::type &arg)
 
template<typename T , typename Tuple , typename... Args>
int obj_constructor (PMEMobjpool *pop, void *ptr, void *arg)
 
template<typename T >
int array_constructor (PMEMobjpool *pop, void *ptr, void *arg)
 
template<class T1 , class T2 >
bool operator== (const pair< T1, T2 > &lhs, const pair< T1, T2 > &rhs)
 
template<class T1 , class T2 >
bool operator!= (const pair< T1, T2 > &lhs, const pair< T1, T2 > &rhs)
 
template<class T , class U >
persistent_pool_ptr< T > static_persistent_pool_pointer_cast (const persistent_pool_ptr< U > &r)
 
std::string errormsg (void)
 Return last libpmemobj error message as a std::string.
 
template<typename ExcT , size_t... I, typename Tuple >
ExcT exception_with_errormsg_helper (index_sequence< I... >, Tuple &&args)
 Helper for exception_with_errormsg. More...
 
template<class ExcT , typename... Args>
ExcT exception_with_errormsg (Args &&... args)
 Generic error message decorator for pmemobj-based exceptions. More...
 

Detailed Description

Implementation details.

It contains libpmemobj's implementation details, not needed in public headers. It is located within pmem namespace.

Function Documentation

◆ conditional_add_to_tx()

template<typename T >
void pmem::detail::conditional_add_to_tx ( const T *  that,
std::size_t  count = 1,
uint64_t  flags = 0 
)
inline

Conditionally add 'count' objects to a transaction.

Adds count objects starting from that to the transaction if '*that' is within a pmemobj pool and there is an active transaction. Does nothing otherwise.

Parameters
[in]thatpointer to the first object being added to the transaction.
[in]countnumber of elements to be added to the transaction.
[in]flagsis a bitmask of values which are described in libpmemobj manpage (pmemobj_tx_xadd_range method)

◆ exception_with_errormsg()

template<class ExcT , typename... Args>
ExcT pmem::detail::exception_with_errormsg ( Args &&...  args)

Generic error message decorator for pmemobj-based exceptions.

It accepts arbitrary number of parameters. The last parameter must be an error message.

◆ exception_with_errormsg_helper()

template<typename ExcT , size_t... I, typename Tuple >
ExcT pmem::detail::exception_with_errormsg_helper ( index_sequence< I... >  ,
Tuple &&  args 
)

Helper for exception_with_errormsg.

Accepts tuple with arguments and index_sequence which correspond to all but last argument. The last element in tuple is assumed to be an error message. Before passing it to ExcT constructor it is merged with detail::errormsg()

◆ next_pow_2() [1/2]

uint64_t pmem::detail::next_pow_2 ( uint32_t  v)
inline

Round up to the next lowest power of 2.

Overload for uint32_t argument.

◆ next_pow_2() [2/2]

uint64_t pmem::detail::next_pow_2 ( uint64_t  v)
inline

Round up to the next lowest power of 2.

Overload for uint64_t argument.

◆ timepoint_to_timespec()

template<typename Clock , typename Duration = typename Clock::duration>
timespec pmem::detail::timepoint_to_timespec ( const std::chrono::time_point< Clock, Duration > &  timepoint)

Convert std::chrono::time_point to posix timespec.

Parameters
[in]timepointpoint in time to be converted.
Returns
converted timespec structure.