PMDK C++ bindings  1.13.0-git107.g7e59f08f
This is the C++ bindings documentation for PMDK's libpmemobj.
pmem::obj::experimental::radix_tree< Key, Value, BytesView, MtMode >::node Struct Reference

This is internal node. More...

#include <libpmemobj++/experimental/radix_tree.hpp>

Public Types

using reverse_iterator = std::reverse_iterator< forward_iterator >
 
template<bool Direction>
using iterator = typename std::conditional< Direction==direction::Forward, forward_iterator, reverse_iterator >::type
 

Public Member Functions

 node (pointer_type parent, byten_t byte, bitn_t bit)
 
template<bool Direction = direction::Forward>
std::enable_if< Direction==radix_tree< Key, Value, BytesView, MtMode >::node::direction::Forward, typename radix_tree< Key, Value, BytesView, MtMode >::node::forward_iterator >::type begin () const
 
template<bool Direction = direction::Forward>
std::enable_if< Direction==radix_tree< Key, Value, BytesView, MtMode >::node::direction::Forward, typename radix_tree< Key, Value, BytesView, MtMode >::node::forward_iterator >::type end () const
 
template<bool Direction = direction::Forward>
std::enable_if< Direction==radix_tree< Key, Value, BytesView, MtMode >::node::direction::Reverse, typename radix_tree< Key, Value, BytesView, MtMode >::node::reverse_iterator >::type begin () const
 
template<bool Direction = direction::Forward>
std::enable_if< Direction==radix_tree< Key, Value, BytesView, MtMode >::node::direction::Reverse, typename radix_tree< Key, Value, BytesView, MtMode >::node::reverse_iterator >::type end () const
 
template<bool Direction = direction::Forward, typename Ptr >
iterator< Direction > find_child (const Ptr &n) const
 
template<bool Direction = direction::Forward, typename Enable = typename std::enable_if< Direction == direction::Forward>::type>
iterator< Direction > make_iterator (const atomic_pointer_type *ptr) const
 
template<bool Direction, typename Ptr >
radix_tree< Key, Value, BytesView, MtMode >::node::template iterator< Direction > find_child (const Ptr &n) const
 
template<bool Direction, typename Enable >
radix_tree< Key, Value, BytesView, MtMode >::node::template iterator< Direction > make_iterator (const atomic_pointer_type *ptr) const
 

Public Attributes

atomic_pointer_type parent
 Pointer to a parent node. More...
 
atomic_pointer_type embedded_entry
 The embedded_entry ptr is used only for nodes for which length of the path from root is a multiple of byte (n->bit == FIRST_NIB). More...
 
atomic_pointer_type child [SLNODES]
 
byten_t byte
 Byte and bit together are used to calculate the NIB which is used to index the child array. More...
 
bitn_t bit
 
uint8_t padding [256 - sizeof(parent) - sizeof(leaf) - sizeof(child) - sizeof(byte) - sizeof(bit)]
 

Detailed Description

template<typename Key, typename Value, typename BytesView = bytes_view<Key>, bool MtMode = false>
struct pmem::obj::experimental::radix_tree< Key, Value, BytesView, MtMode >::node

This is internal node.

It does not hold any values directly, but can contain pointer to an embedded entry (see below).

Member Data Documentation

◆ byte

template<typename Key , typename Value , typename BytesView = bytes_view<Key>, bool MtMode = false>
byten_t pmem::obj::experimental::radix_tree< Key, Value, BytesView, MtMode >::node::byte

Byte and bit together are used to calculate the NIB which is used to index the child array.

The calculations are done in slice_index function.

Let's say we have a key = 0xABCD

For byte = 0, bit = 4 we have NIB = 0xA For byte = 0, bit = 0 we have NIB = 0xB

◆ embedded_entry

template<typename Key , typename Value , typename BytesView = bytes_view<Key>, bool MtMode = false>
atomic_pointer_type pmem::obj::experimental::radix_tree< Key, Value, BytesView, MtMode >::node::embedded_entry

The embedded_entry ptr is used only for nodes for which length of the path from root is a multiple of byte (n->bit == FIRST_NIB).

This entry holds a key which represents the entire subtree prefix (path from root).

◆ parent

template<typename Key , typename Value , typename BytesView = bytes_view<Key>, bool MtMode = false>
atomic_pointer_type pmem::obj::experimental::radix_tree< Key, Value, BytesView, MtMode >::node::parent

Pointer to a parent node.

Used by iterators.


The documentation for this struct was generated from the following file: