souffle
2.0.2-371-g6315b36
|
The actual implementation of a b-tree data structure. More...
#include <LambdaBTree.h>
Public Types | |
using | parenttype = btree< Key, Comparator, Allocator, blockSize, SearchStrategy, isSet, WeakComparator, Updater > |
Public Types inherited from souffle::detail::btree< Key, Comparator, Allocator, blockSize, SearchStrategy, isSet, Comparator, detail::updater< Key > > | |
using | chunk = range< iterator > |
using | const_iterator = iterator |
using | element_type = Key |
using | key_type = Key |
using | operation_hints = btree_operation_hints< 1 > |
Public Member Functions | |
template<typename Iter > | |
void | insert (const Iter &a, const Iter &b) |
Inserts the given range of elements into this tree. More... | |
Functor::result_type | insert (Key &k, const Functor &f) |
Inserts the given key into this tree. More... | |
Functor::result_type | insert (Key &k, typename parenttype::operation_hints &hints, const Functor &f) |
LambdaBTree (const Comparator &comp=Comparator(), const WeakComparator &weak_comp=WeakComparator()) | |
bool | operator!= (const LambdaBTree &other) const |
LambdaBTree & | operator= (const LambdaBTree &other) |
bool | operator== (const LambdaBTree &other) const |
void | swap (LambdaBTree &other) |
Swaps the content of this tree with the given tree. More... | |
Public Member Functions inherited from souffle::detail::btree< Key, Comparator, Allocator, blockSize, SearchStrategy, isSet, Comparator, detail::updater< Key > > | |
iterator | begin () const |
btree (btree &&other) | |
btree (Comparator comp=Comparator(), Comparator weak_comp=Comparator()) | |
btree (const btree &set) | |
btree (const Iter &a, const Iter &b) | |
bool | check () |
Checks the consistency of this tree. More... | |
void | clear () |
Clears this tree. More... | |
bool | contains (const Key &k) const |
Determines whether the given element is a member of this tree. More... | |
bool | contains (const Key &k, operation_hints &hints) const |
Determines whether the given element is a member of this tree. More... | |
bool | empty () const |
iterator | end () const |
iterator | find (const Key &k) const |
Locates the given key within this tree and returns an iterator referencing its position. More... | |
iterator | find (const Key &k, operation_hints &hints) const |
Locates the given key within this tree and returns an iterator referencing its position. More... | |
std::vector< chunk > | getChunks (size_type num) const |
size_type | getDepth () const |
size_type | getMemoryUsage () const |
size_type | getNumNodes () const |
void | insert (const Iter &a, const Iter &b) |
Inserts the given range of elements into this tree. More... | |
bool | insert (const Key &k) |
Inserts the given key into this tree. More... | |
bool | insert (const Key &k, operation_hints &hints) |
Inserts the given key into this tree. More... | |
iterator | lower_bound (const Key &k) const |
Obtains a lower boundary for the given key – hence an iterator referencing the smallest value that is not less the given key. More... | |
iterator | lower_bound (const Key &k, operation_hints &hints) const |
Obtains a lower boundary for the given key – hence an iterator referencing the smallest value that is not less the given key. More... | |
bool | operator!= (const btree &other) const |
btree & | operator= (const btree &other) |
bool | operator== (const btree &other) const |
std::vector< chunk > | partition (size_type num) const |
Partitions the full range of this set into up to a given number of chunks. More... | |
void | printStats (std::ostream &out=std::cout) const |
Prints a textual summary of statistical properties of this tree to the given output stream (for debugging and tuning). More... | |
void | printTree (std::ostream &out=std::cout) const |
size_type | size () const |
void | swap (btree &other) |
Swaps the content of this tree with the given tree. More... | |
iterator | upper_bound (const Key &k) const |
Obtains an upper boundary for the given key – hence an iterator referencing the first element that the given key is less than the referenced value. More... | |
iterator | upper_bound (const Key &k, operation_hints &hints) const |
Obtains an upper boundary for the given key – hence an iterator referencing the first element that the given key is less than the referenced value. More... | |
~btree () | |
Additional Inherited Members | |
Static Public Member Functions inherited from souffle::detail::btree< Key, Comparator, Allocator, blockSize, SearchStrategy, isSet, Comparator, detail::updater< Key > > | |
static std::enable_if< std::is_same< typename std::iterator_traits< Iter >::iterator_category, std::random_access_iterator_tag >::value, R >::type | load (const Iter &a, const Iter &b) |
A static member enabling the bulk-load of ordered data into an empty tree. More... | |
Static Public Attributes inherited from souffle::detail::btree< Key, Comparator, Allocator, blockSize, SearchStrategy, isSet, Comparator, detail::updater< Key > > | |
static constexpr size_t | max_keys_per_node |
Protected Types inherited from souffle::detail::btree< Key, Comparator, Allocator, blockSize, SearchStrategy, isSet, Comparator, detail::updater< Key > > | |
using | field_index_type = uint8_t |
using | lock_type = OptimisticReadWriteLock |
using | size_type = std::size_t |
Protected Member Functions inherited from souffle::detail::btree< Key, Comparator, Allocator, blockSize, SearchStrategy, isSet, Comparator, detail::updater< Key > > | |
btree (size_type, node *root, leaf_node *leftmost) | |
An internal constructor enabling the specific creation of a tree based on internal parameters. More... | |
bool | covers (const node *node, const Key &k) const |
Determines whether the range covered by the given node is also covering the given key value. More... | |
bool | equal (const Key &a, const Key &b) const |
bool | less (const Key &a, const Key &b) const |
void | update (Key &old_k, const Key &new_k) |
bool | weak_covers (const node *node, const Key &k) const |
Determines whether the range covered by the given node is also covering the given key value. More... | |
bool | weak_equal (const Key &a, const Key &b) const |
bool | weak_less (const Key &a, const Key &b) const |
Protected Attributes inherited from souffle::detail::btree< Key, Comparator, Allocator, blockSize, SearchStrategy, isSet, Comparator, detail::updater< Key > > | |
Comparator | comp |
hint_statistics | hint_stats |
leaf_node * | leftmost |
node * | root |
lock_type | root_lock |
detail::updater< Key > | upd |
Comparator | weak_comp |
Static Protected Attributes inherited from souffle::detail::btree< Key, Comparator, Allocator, blockSize, SearchStrategy, isSet, Comparator, detail::updater< Key > > | |
const static SearchStrategy | search |
The actual implementation of a b-tree data structure.
Key | .. the element type to be stored in this tree |
Comparator | .. a class defining an order on the stored elements |
Allocator | .. utilized for allocating memory for required nodes |
blockSize | .. determines the number of bytes/block utilized by leaf nodes |
SearchStrategy | .. enables switching between linear, binary or any other search strategy |
isSet | .. true = set, false = multiset |
Functor | .. a std::function that is called on successful (new) insert |
Definition at line 66 of file LambdaBTree.h.
using souffle::detail::LambdaBTree< Key, Comparator, Allocator, blockSize, SearchStrategy, isSet, Functor, WeakComparator, Updater >::parenttype = btree<Key, Comparator, Allocator, blockSize, SearchStrategy, isSet, WeakComparator, Updater> |
Definition at line 79 of file LambdaBTree.h.
|
inline |
Definition at line 81 of file LambdaBTree.h.
|
inline |
|
inline |
Inserts the given key into this tree.
Definition at line 87 of file LambdaBTree.h.
|
inline |
Definition at line 93 of file LambdaBTree.h.
|
inline |
Definition at line 582 of file LambdaBTree.h.
|
inline |
Definition at line 531 of file LambdaBTree.h.
|
inline |
Definition at line 558 of file LambdaBTree.h.
|
inline |
Swaps the content of this tree with the given tree.
This is a much more efficient operation than creating a copy and realizing the swap utilizing assignment operations.
Definition at line 524 of file LambdaBTree.h.