tlx
Loading...
Searching...
No Matches
BTree< Key, Value, KeyOfValue, Compare, Traits, Duplicates, Allocator >::LeafNode Struct Reference

Extended structure of a leaf node in memory. More...

Inheritance diagram for BTree< Key, Value, KeyOfValue, Compare, Traits, Duplicates, Allocator >::LeafNode:
BTree< Key, Value, KeyOfValue, Compare, Traits, Duplicates, Allocator >::node

Public Types

typedef std::allocator_traits< Allocator >::template rebind_alloc< LeafNodealloc_type
 Define an related allocator for the LeafNode structs.
 

Public Member Functions

void initialize ()
 Set variables to initial values.
 
const key_typekey (size_t s) const
 Return key in slot s.
 
bool is_full () const
 True if the node's slots are full.
 
bool is_few () const
 True if few used entries, less than half full.
 
bool is_underflow () const
 True if node has too few entries.
 
void set_slot (unsigned short slot, const value_type &value)
 Set the (key,data) pair in slot.
 
- Public Member Functions inherited from BTree< Key, Value, KeyOfValue, Compare, Traits, Duplicates, Allocator >::node
void initialize (const unsigned short l)
 Delayed initialisation of constructed node.
 
bool is_leafnode () const
 True if this is a leaf node.
 

Public Attributes

LeafNodeprev_leaf
 Double linked list pointers to traverse the leaves.
 
LeafNodenext_leaf
 Double linked list pointers to traverse the leaves.
 
value_type slotdata [leaf_slotmax]
 Array of (key, data) pairs.
 
- Public Attributes inherited from BTree< Key, Value, KeyOfValue, Compare, Traits, Duplicates, Allocator >::node
unsigned short level
 Level in the b-tree, if level == 0 -> leaf node.
 
unsigned short slotuse
 Number of key slotuse use, so the number of valid children or data pointers.
 

Detailed Description

template<typename Key, typename Value, typename KeyOfValue, typename Compare = std::less<Key>, typename Traits = btree_default_traits<Key, Value>, bool Duplicates = false, typename Allocator = std::allocator<Value>>
struct tlx::BTree< Key, Value, KeyOfValue, Compare, Traits, Duplicates, Allocator >::LeafNode

Extended structure of a leaf node in memory.

Contains pairs of keys and data items. Key and data slots are kept together in value_type.

Definition at line 273 of file btree.hpp.

Member Typedef Documentation

◆ alloc_type

template<typename Key , typename Value , typename KeyOfValue , typename Compare = std::less<Key>, typename Traits = btree_default_traits<Key, Value>, bool Duplicates = false, typename Allocator = std::allocator<Value>>
std::allocator_traits<Allocator>::template rebind_alloc<LeafNode> alloc_type

Define an related allocator for the LeafNode structs.

Definition at line 275 of file btree.hpp.

Member Function Documentation

◆ initialize()

template<typename Key , typename Value , typename KeyOfValue , typename Compare = std::less<Key>, typename Traits = btree_default_traits<Key, Value>, bool Duplicates = false, typename Allocator = std::allocator<Value>>
void initialize ( )
inline

Set variables to initial values.

Definition at line 287 of file btree.hpp.

◆ is_few()

template<typename Key , typename Value , typename KeyOfValue , typename Compare = std::less<Key>, typename Traits = btree_default_traits<Key, Value>, bool Duplicates = false, typename Allocator = std::allocator<Value>>
bool is_few ( ) const
inline

True if few used entries, less than half full.

Definition at line 303 of file btree.hpp.

◆ is_full()

template<typename Key , typename Value , typename KeyOfValue , typename Compare = std::less<Key>, typename Traits = btree_default_traits<Key, Value>, bool Duplicates = false, typename Allocator = std::allocator<Value>>
bool is_full ( ) const
inline

True if the node's slots are full.

Definition at line 298 of file btree.hpp.

◆ is_underflow()

template<typename Key , typename Value , typename KeyOfValue , typename Compare = std::less<Key>, typename Traits = btree_default_traits<Key, Value>, bool Duplicates = false, typename Allocator = std::allocator<Value>>
bool is_underflow ( ) const
inline

True if node has too few entries.

Definition at line 308 of file btree.hpp.

◆ key()

template<typename Key , typename Value , typename KeyOfValue , typename Compare = std::less<Key>, typename Traits = btree_default_traits<Key, Value>, bool Duplicates = false, typename Allocator = std::allocator<Value>>
const key_type & key ( size_t s) const
inline

Return key in slot s.

Definition at line 293 of file btree.hpp.

◆ set_slot()

template<typename Key , typename Value , typename KeyOfValue , typename Compare = std::less<Key>, typename Traits = btree_default_traits<Key, Value>, bool Duplicates = false, typename Allocator = std::allocator<Value>>
void set_slot ( unsigned short slot,
const value_type & value )
inline

Set the (key,data) pair in slot.

Overloaded function used by bulk_load().

Definition at line 314 of file btree.hpp.

Member Data Documentation

◆ next_leaf

template<typename Key , typename Value , typename KeyOfValue , typename Compare = std::less<Key>, typename Traits = btree_default_traits<Key, Value>, bool Duplicates = false, typename Allocator = std::allocator<Value>>
LeafNode* next_leaf

Double linked list pointers to traverse the leaves.

Definition at line 281 of file btree.hpp.

◆ prev_leaf

template<typename Key , typename Value , typename KeyOfValue , typename Compare = std::less<Key>, typename Traits = btree_default_traits<Key, Value>, bool Duplicates = false, typename Allocator = std::allocator<Value>>
LeafNode* prev_leaf

Double linked list pointers to traverse the leaves.

Definition at line 278 of file btree.hpp.

◆ slotdata

template<typename Key , typename Value , typename KeyOfValue , typename Compare = std::less<Key>, typename Traits = btree_default_traits<Key, Value>, bool Duplicates = false, typename Allocator = std::allocator<Value>>
value_type slotdata[leaf_slotmax]

Array of (key, data) pairs.

Definition at line 284 of file btree.hpp.


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