stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates > Class Template Reference

Basic class implementing a base B+ tree data structure in memory. More...

#include <btree.h>

List of all members.

Public Types

typedef _Key key_type
 First template parameter: The key type of the B+ tree.
typedef _Data data_type
 Second template parameter: The data type associated with each key.
typedef _Value value_type
 Third template parameter: Composition pair of key and data types, this is required by the STL standard.
typedef _Compare key_compare
 Fourth template parameter: Key comparison function object.
typedef _Traits traits
 Fifth template parameter: Traits object used to define more parameters of the B+ tree.
typedef btree< key_type, data_type,
value_type, key_compare,
traits, allow_duplicates
btree_self
 Typedef of our own type.
typedef size_t size_type
 Size type used to count keys.
typedef std::pair< key_type,
data_type
pair_type
 The pair of key_type and data_type, this may be different from value_type.
typedef std::reverse_iterator<
iterator
reverse_iterator
 create mutable reverse iterator by using STL magic
typedef std::reverse_iterator<
const_iterator
const_reverse_iterator
 create constant reverse iterator by using STL magic

Public Member Functions

 btree ()
 Default constructor initializing an empty B+ tree with the standard key comparison function.
 btree (const key_compare &kcf)
 Constructor initializing an empty B+ tree with a special key comparison object.
template<class InputIterator>
 btree (InputIterator first, InputIterator last)
 Constructor initializing a B+ tree with the range [first,last).
template<class InputIterator>
 btree (InputIterator first, InputIterator last, const key_compare &kcf)
 Constructor initializing a B+ tree with the range [first,last) and a special key comparison object.
 ~btree ()
 Frees up all used B+ tree memory pages.
void swap (btree_self &from)
 Fast swapping of two identical B+ tree objects.
key_compare key_comp () const
 Constant access to the key comparison object sorting the B+ tree.
value_compare value_comp () const
 Constant access to a constructed value_type comparison object.
void clear ()
 Frees all key/data pairs and all nodes of the tree.
iterator begin ()
 Constructs a read/data-write iterator that points to the first slot in the first leaf of the B+ tree.
iterator end ()
 Constructs a read/data-write iterator that points to the first invalid slot in the last leaf of the B+ tree.
const_iterator begin () const
 Constructs a read-only constant iterator that points to the first slot in the first leaf of the B+ tree.
const_iterator end () const
 Constructs a read-only constant iterator that points to the first invalid slot in the last leaf of the B+ tree.
reverse_iterator rbegin ()
 Constructs a read/data-write reverse iterator that points to the first invalid slot in the last leaf of the B+ tree.
reverse_iterator rend ()
 Constructs a read/data-write reverse iterator that points to the first slot in the first leaf of the B+ tree.
const_reverse_iterator rbegin () const
 Constructs a read-only reverse iterator that points to the first invalid slot in the last leaf of the B+ tree.
const_reverse_iterator rend () const
 Constructs a read-only reverse iterator that points to the first slot in the first leaf of the B+ tree.
size_type size () const
 Return the number of key/data pairs in the B+ tree.
bool empty () const
 Returns true if there is at least one key/data pair in the B+ tree.
size_type max_size () const
 Returns the largest possible size of the B+ Tree.
tree_statsget_stats () const
 Return a const reference to the current statistics.
bool exists (const key_type &key) const
 Non-STL function checking whether a key is in the B+ tree.
iterator find (const key_type &key)
 Tries to locate a key in the B+ tree and returns an iterator to the key/data slot if found.
const_iterator find (const key_type &key) const
 Tries to locate a key in the B+ tree and returns an constant iterator to the key/data slot if found.
size_type count (const key_type &key) const
 Tries to locate a key in the B+ tree and returns the number of identical key entries found.
iterator lower_bound (const key_type &key)
 Searches the B+ tree and returns an iterator to the first key less or equal to the parameter.
const_iterator lower_bound (const key_type &key) const
 Searches the B+ tree and returns an constant iterator to the first key less or equal to the parameter.
iterator upper_bound (const key_type &key)
 Searches the B+ tree and returns an iterator to the first key greater than the parameter.
const_iterator upper_bound (const key_type &key) const
 Searches the B+ tree and returns an constant iterator to the first key greater than the parameter.
std::pair< iterator, iteratorequal_range (const key_type &key)
 Searches the B+ tree and returns both lower_bound() and upper_bound().
std::pair< const_iterator,
const_iterator
equal_range (const key_type &key) const
 Searches the B+ tree and returns both lower_bound() and upper_bound().
bool operator== (const btree_self &other) const
 Equality relation of B+ trees of the same type.
bool operator!= (const btree_self &other) const
 Inequality relation. Based on operator==.
bool operator< (const btree_self &other) const
 Total ordering relation of B+ trees of the same type.
bool operator> (const btree_self &other) const
 Greater relation. Based on operator<.
bool operator<= (const btree_self &other) const
 Less-equal relation. Based on operator<.
bool operator>= (const btree_self &other) const
 Greater-equal relation. Based on operator<.
btree_selfoperator= (const btree_self &other)
 Assignment operator. All the key/data pairs are copied.
 btree (const btree_self &other)
 Copy constructor.
std::pair< iterator, bool > insert (const pair_type &x)
 Attempt to insert a key/data pair into the B+ tree.
std::pair< iterator, bool > insert (const key_type &key, const data_type &data)
 Attempt to insert a key/data pair into the B+ tree.
std::pair< iterator, bool > insert2 (const key_type &key, const data_type &data)
 Attempt to insert a key/data pair into the B+ tree.
iterator insert (iterator, const pair_type &x)
 Attempt to insert a key/data pair into the B+ tree.
iterator insert2 (iterator, const key_type &key, const data_type &data)
 Attempt to insert a key/data pair into the B+ tree.
template<typename InputIterator>
void insert (InputIterator first, InputIterator last)
 Attempt to insert the range [first,last) of value_type pairs into the B+ tree.
bool erase_one (const key_type &key)
 Erases one (the first) of the key/data pairs associated with the given key.
size_type erase (const key_type &key)
 Erases all the key/data pairs associated with the given key.
void erase (iterator iter)
 Erase the key/data pair referenced by the iterator.
void erase (iterator, iterator)
 Erase all key/data pairs in the range [first,last).
void print (std::ostream &os) const
 Print out the B+ tree structure with keys onto the given ostream.
void print_leaves (std::ostream &os) const
 Print out only the leaves via the double linked list.
void verify () const
 Run a thorough verification of all B+ tree invariants.
void dump (std::ostream &os) const
 Dump the contents of the B+ tree out onto an ostream as a binary image.
bool restore (std::istream &is)
 Restore a binary image of a dumped B+ tree from an istream.

Static Public Attributes

static const bool allow_duplicates = _Duplicates
 Sixth template parameter: Allow duplicate keys in the B+ tree.
static const unsigned short leafslotmax = traits::leafslots
 Base B+ tree parameter: The number of key/data slots in each leaf.
static const unsigned short innerslotmax = traits::innerslots
 Base B+ tree parameter: The number of key slots in each inner node, this can differ from slots in each leaf.
static const unsigned short minleafslots = (leafslotmax / 2)
 Computed B+ tree parameter: The minimum number of key/data slots used in a leaf.
static const unsigned short mininnerslots = (innerslotmax / 2)
 Computed B+ tree parameter: The minimum number of key slots used in an inner node.
static const bool selfverify = traits::selfverify
 Debug parameter: Enables expensive and thorough checking of the B+ tree invariants after each insert/erase operation.
static const bool debug = traits::debug
 Debug parameter: Prints out lots of debug information about how the algorithms change the tree.

Private Types

enum  result_flags_t { btree_ok = 0, btree_not_found = 1, btree_update_lastkey = 2, btree_fixmerge = 4 }
 Result flags of recursive deletion. More...
typedef btree_pair_to_value<
value_type, pair_type
pair_to_value_type
 Using template specialization select the correct converter used by the iterators.

Private Member Functions

bool key_lessequal (const key_type &a, const key_type b) const
 True if a <= b ? constructed from key_less().
bool key_greater (const key_type &a, const key_type &b) const
 True if a > b ? constructed from key_less().
bool key_greaterequal (const key_type &a, const key_type b) const
 True if a >= b ? constructed from key_less().
bool key_equal (const key_type &a, const key_type &b) const
 True if a == b ? constructed from key_less().
leaf_nodeallocate_leaf ()
 Allocate and initialize a leaf node.
inner_nodeallocate_inner (unsigned short l)
 Allocate and initialize an inner node.
void free_node (node *n)
 Correctly free either inner or leaf node, destructs all contained key and value objects.
void clear_recursive (node *n)
 Recursively free up nodes.
template<typename node_type>
int find_lower (const node_type *n, const key_type &key) const
 Searches for the first key in the node n less or equal to key.
template<typename node_type>
int find_upper (const node_type *n, const key_type &key) const
 Searches for the first key in the node n greater than key.
nodecopy_recursive (const node *n)
 Recursively copy nodes from another B+ tree object.
std::pair< iterator, bool > insert_start (const key_type &key, const data_type &value)
 Start the insertion descent at the current root and handle root splits.
std::pair< iterator, bool > insert_descend (node *n, const key_type &key, const data_type &value, key_type *splitkey, node **splitnode)
 Insert an item into the B+ tree.
void split_leaf_node (leaf_node *leaf, key_type *_newkey, node **_newleaf)
 Split up a leaf node into two equally-filled sibling leaves.
void split_inner_node (inner_node *inner, key_type *_newkey, node **_newinner, unsigned int addslot)
 Split up an inner node into two equally-filled sibling nodes.
result_t erase_one_descend (const key_type &key, node *curr, node *left, node *right, inner_node *leftparent, inner_node *rightparent, inner_node *parent, unsigned int parentslot)
 Erase one (the first) key/data pair in the B+ tree matching key.
result_t merge_leaves (leaf_node *left, leaf_node *right, inner_node *parent)
 Merge two leaf nodes.
void verify_node (const node *n, key_type *minkey, key_type *maxkey, tree_stats &vstats) const
 Recursively descend down the tree and verify each node.
void verify_leaflinks () const
 Verify the double linked list of leaves.
void dump_node (std::ostream &os, const node *n) const
 Recursively descend down the tree and dump each node in a precise order.
noderestore_node (std::istream &is)
 Read the dump image and construct a tree from the node order in the serialization.

Static Private Member Functions

static result_t merge_inner (inner_node *left, inner_node *right, inner_node *parent, unsigned int parentslot)
 Merge two inner nodes.
static result_t shift_left_leaf (leaf_node *left, leaf_node *right, inner_node *parent, unsigned int parentslot)
 Balance two leaf nodes.
static void shift_left_inner (inner_node *left, inner_node *right, inner_node *parent, unsigned int parentslot)
 Balance two inner nodes.
static void shift_right_leaf (leaf_node *left, leaf_node *right, inner_node *parent, unsigned int parentslot)
 Balance two leaf nodes.
static void shift_right_inner (inner_node *left, inner_node *right, inner_node *parent, unsigned int parentslot)
 Balance two inner nodes.
static void print_node (std::ostream &os, const node *node, unsigned int depth=0, bool recursive=false)
 Recursively descend down the tree and print out nodes.

Private Attributes

noderoot
 Pointer to the B+ tree's root node, either leaf or inner node.
leaf_nodeheadleaf
 Pointer to first leaf in the double linked leaf chain.
leaf_nodetailleaf
 Pointer to last leaf in the double linked leaf chain.
tree_stats stats
 Other small statistics about the B+ tree.
key_compare key_less
 Key comparison object.

Classes

struct  btree_pair_to_value
struct  btree_pair_to_value< value_type, value_type >
class  const_iterator
 STL-like read-only iterator object for B+ tree items. More...
struct  dump_header
struct  inner_node
 Extended structure of a inner node in-memory. More...
class  iterator
 STL-like iterator object for B+ tree items. More...
struct  leaf_node
 Extended structure of a leaf node in memory. More...
struct  node
 The header structure of each node in-memory. More...
struct  result_t
struct  tree_stats
 A small struct containing basic statistics about the B+ tree. More...
class  value_compare
 Function class to compare value_type objects. Required by the STL. More...


Detailed Description

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
class stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >

Basic class implementing a base B+ tree data structure in memory.

The base implementation of a memory B+ tree. It is based on the implementation in Cormen's Introduction into Algorithms, Jan Jannink's paper and other algorithm resources. Almost all STL-required function calls are implemented. The asymptotic time requirements of the STL are not always fulfilled in theory, however in practice this B+ tree performs better than a red-black tree by using more memory. The insertion function splits the nodes on the recursion unroll. Erase is largely based on Jannink's ideas.

This class is specialized into btree_set, btree_multiset, btree_map and btree_multimap using default template parameters and facade functions.

Definition at line 137 of file btree.h.


Member Typedef Documentation

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
typedef _Key stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::key_type

First template parameter: The key type of the B+ tree.

This is stored in inner nodes and leaves

Definition at line 144 of file btree.h.

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
typedef _Data stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::data_type

Second template parameter: The data type associated with each key.

Stored in the B+ tree's leaves

Definition at line 148 of file btree.h.

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
typedef _Value stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::value_type

Third template parameter: Composition pair of key and data types, this is required by the STL standard.

The B+ tree does not store key and data together. If value_type == key_type then the B+ tree implements a set.

Definition at line 154 of file btree.h.

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
typedef _Compare stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::key_compare

Fourth template parameter: Key comparison function object.

Definition at line 157 of file btree.h.

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
typedef _Traits stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::traits

Fifth template parameter: Traits object used to define more parameters of the B+ tree.

Definition at line 161 of file btree.h.

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
typedef btree<key_type, data_type, value_type, key_compare, traits, allow_duplicates> stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::btree_self

Typedef of our own type.

Definition at line 177 of file btree.h.

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
typedef size_t stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::size_type

Size type used to count keys.

Definition at line 180 of file btree.h.

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
typedef std::pair<key_type, data_type> stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::pair_type

The pair of key_type and data_type, this may be different from value_type.

Definition at line 183 of file btree.h.

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
typedef btree_pair_to_value<value_type, pair_type> stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::pair_to_value_type [private]

Using template specialization select the correct converter used by the iterators.

Definition at line 354 of file btree.h.

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
typedef std::reverse_iterator<iterator> stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::reverse_iterator

create mutable reverse iterator by using STL magic

Definition at line 732 of file btree.h.

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
typedef std::reverse_iterator<const_iterator> stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::const_reverse_iterator

create constant reverse iterator by using STL magic

Definition at line 735 of file btree.h.


Member Enumeration Documentation

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
enum stx::btree::result_flags_t [private]

Result flags of recursive deletion.

Enumerator:
btree_ok  Deletion successful and no fix-ups necessary.
btree_not_found  Deletion not successful because key was not found.
btree_update_lastkey  Deletion successful, the last key was updated so parent slotkeys need updates.

btree_fixmerge  Deletion successful, children nodes were merged and the parent needs to remove the empty node.

Definition at line 1825 of file btree.h.


Constructor & Destructor Documentation

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::btree (  )  [inline]

Default constructor initializing an empty B+ tree with the standard key comparison function.

Definition at line 803 of file btree.h.

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::btree ( const key_compare kcf  )  [inline]

Constructor initializing an empty B+ tree with a special key comparison object.

Definition at line 810 of file btree.h.

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
template<class InputIterator>
stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::btree ( InputIterator  first,
InputIterator  last 
) [inline]

Constructor initializing a B+ tree with the range [first,last).

Definition at line 818 of file btree.h.

References stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::insert().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
template<class InputIterator>
stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::btree ( InputIterator  first,
InputIterator  last,
const key_compare kcf 
) [inline]

Constructor initializing a B+ tree with the range [first,last) and a special key comparison object.

Definition at line 827 of file btree.h.

References stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::insert().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::~btree (  )  [inline]

Frees up all used B+ tree memory pages.

Definition at line 835 of file btree.h.

References stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::clear().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::btree ( const btree_self other  )  [inline]

Copy constructor.

The newly initialized B+ tree object will contain a copy of all key/data pairs.

Definition at line 1444 of file btree.h.

References stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::copy_recursive(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::tree_stats::innernodes, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::tree_stats::leaves, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::root, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::selfverify, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::size(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::stats, and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::verify().


Member Function Documentation

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
void stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::swap ( btree_self from  )  [inline]

Fast swapping of two identical B+ tree objects.

Definition at line 841 of file btree.h.

References stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::headleaf, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::key_less, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::root, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::stats, and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::tailleaf.

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
key_compare stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::key_comp (  )  const [inline]

Constant access to the key comparison object sorting the B+ tree.

Definition at line 877 of file btree.h.

References stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::key_less.

Referenced by stx::btree_set< _Key, _Compare, _Traits >::key_comp(), stx::btree_multiset< _Key, _Compare, _Traits >::key_comp(), stx::btree_multimap< _Key, _Data, _Compare, _Traits >::key_comp(), stx::btree_map< _Key, _Data, _Compare, _Traits >::key_comp(), and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::operator=().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
value_compare stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::value_comp (  )  const [inline]

Constant access to a constructed value_type comparison object.

Required by the STL

Definition at line 884 of file btree.h.

References stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::key_less.

Referenced by stx::btree_set< _Key, _Compare, _Traits >::value_comp(), stx::btree_multiset< _Key, _Compare, _Traits >::value_comp(), stx::btree_multimap< _Key, _Data, _Compare, _Traits >::value_comp(), and stx::btree_map< _Key, _Data, _Compare, _Traits >::value_comp().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
bool stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::key_lessequal ( const key_type a,
const key_type  b 
) const [inline, private]

True if a <= b ? constructed from key_less().

Definition at line 893 of file btree.h.

References stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::key_less.

Referenced by stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::find_lower(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::find_upper(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::verify_leaflinks(), and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::verify_node().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
bool stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::key_greater ( const key_type a,
const key_type b 
) const [inline, private]

True if a > b ? constructed from key_less().

Definition at line 899 of file btree.h.

References stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::key_less.

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
bool stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::key_greaterequal ( const key_type a,
const key_type  b 
) const [inline, private]

True if a >= b ? constructed from key_less().

Definition at line 905 of file btree.h.

References stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::key_less.

Referenced by stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::verify_node().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
bool stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::key_equal ( const key_type a,
const key_type b 
) const [inline, private]

True if a == b ? constructed from key_less().

This requires the < relation to be a total order, otherwise the B+ tree cannot be sorted.

Definition at line 912 of file btree.h.

References stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::key_less.

Referenced by stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::count(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::erase_one_descend(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::exists(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::find(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::insert_descend(), and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::verify_node().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
leaf_node* stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::allocate_leaf (  )  [inline, private]

Allocate and initialize a leaf node.

Definition at line 921 of file btree.h.

References stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::leaf_node::initialize(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::tree_stats::leaves, and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::stats.

Referenced by stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::copy_recursive(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::insert_start(), and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::split_leaf_node().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
inner_node* stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::allocate_inner ( unsigned short  l  )  [inline, private]

Allocate and initialize an inner node.

Definition at line 930 of file btree.h.

References stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::inner_node::initialize(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::tree_stats::innernodes, and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::stats.

Referenced by stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::copy_recursive(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::insert_start(), and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::split_inner_node().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
void stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::free_node ( node n  )  [inline, private]

Correctly free either inner or leaf node, destructs all contained key and value objects.

Definition at line 940 of file btree.h.

References stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::tree_stats::innernodes, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::node::isleafnode(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::tree_stats::leaves, and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::stats.

Referenced by stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::clear(), and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::clear_recursive().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
void stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::clear (  )  [inline]

Frees all key/data pairs and all nodes of the tree.

Definition at line 956 of file btree.h.

References BTREE_ASSERT, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::clear_recursive(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::free_node(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::headleaf, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::tree_stats::itemcount, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::root, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::stats, and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::tailleaf.

Referenced by stx::btree_set< _Key, _Compare, _Traits >::clear(), stx::btree_multiset< _Key, _Compare, _Traits >::clear(), stx::btree_multimap< _Key, _Data, _Compare, _Traits >::clear(), stx::btree_map< _Key, _Data, _Compare, _Traits >::clear(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::operator=(), and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::~btree().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
void stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::clear_recursive ( node n  )  [inline, private]

Recursively free up nodes.

Definition at line 974 of file btree.h.

References stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::free_node(), and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::node::isleafnode().

Referenced by stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::clear().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
iterator stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::begin (  )  [inline]

Constructs a read/data-write iterator that points to the first slot in the first leaf of the B+ tree.

Definition at line 1002 of file btree.h.

References stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::headleaf.

Referenced by stx::btree_set< _Key, _Compare, _Traits >::begin(), stx::btree_multiset< _Key, _Compare, _Traits >::begin(), stx::btree_multimap< _Key, _Data, _Compare, _Traits >::begin(), stx::btree_map< _Key, _Data, _Compare, _Traits >::begin(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::operator<(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::operator==(), and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::rend().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
iterator stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::end (  )  [inline]

Constructs a read/data-write iterator that points to the first invalid slot in the last leaf of the B+ tree.

Definition at line 1009 of file btree.h.

References stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::node::slotuse, and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::tailleaf.

Referenced by stx::btree_set< _Key, _Compare, _Traits >::end(), stx::btree_multiset< _Key, _Compare, _Traits >::end(), stx::btree_multimap< _Key, _Data, _Compare, _Traits >::end(), stx::btree_map< _Key, _Data, _Compare, _Traits >::end(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::find(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::lower_bound(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::operator<(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::operator==(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::rbegin(), and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::upper_bound().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
const_iterator stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::begin (  )  const [inline]

Constructs a read-only constant iterator that points to the first slot in the first leaf of the B+ tree.

Definition at line 1016 of file btree.h.

References stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::headleaf.

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
const_iterator stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::end (  )  const [inline]

Constructs a read-only constant iterator that points to the first invalid slot in the last leaf of the B+ tree.

Definition at line 1023 of file btree.h.

References stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::node::slotuse, and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::tailleaf.

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
reverse_iterator stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::rbegin (  )  [inline]

Constructs a read/data-write reverse iterator that points to the first invalid slot in the last leaf of the B+ tree.

Uses STL magic.

Definition at line 1030 of file btree.h.

References stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::end().

Referenced by stx::btree_set< _Key, _Compare, _Traits >::rbegin(), stx::btree_multiset< _Key, _Compare, _Traits >::rbegin(), stx::btree_multimap< _Key, _Data, _Compare, _Traits >::rbegin(), and stx::btree_map< _Key, _Data, _Compare, _Traits >::rbegin().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
reverse_iterator stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::rend (  )  [inline]

Constructs a read/data-write reverse iterator that points to the first slot in the first leaf of the B+ tree.

Uses STL magic.

Definition at line 1037 of file btree.h.

References stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::begin().

Referenced by stx::btree_set< _Key, _Compare, _Traits >::rend(), stx::btree_multiset< _Key, _Compare, _Traits >::rend(), stx::btree_multimap< _Key, _Data, _Compare, _Traits >::rend(), and stx::btree_map< _Key, _Data, _Compare, _Traits >::rend().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
const_reverse_iterator stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::rbegin (  )  const [inline]

Constructs a read-only reverse iterator that points to the first invalid slot in the last leaf of the B+ tree.

Uses STL magic.

Definition at line 1044 of file btree.h.

References stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::end().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
const_reverse_iterator stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::rend (  )  const [inline]

Constructs a read-only reverse iterator that points to the first slot in the first leaf of the B+ tree.

Uses STL magic.

Definition at line 1051 of file btree.h.

References stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::begin().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
template<typename node_type>
int stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::find_lower ( const node_type *  n,
const key_type key 
) const [inline, private]

Searches for the first key in the node n less or equal to key.

Uses binary search with an optional linear self-verification. This is a template function, because the slotkey array is located at different places in leaf_node and inner_node.

Definition at line 1064 of file btree.h.

References BTREE_ASSERT, BTREE_PRINT, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::key_less, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::key_lessequal(), and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::selfverify.

Referenced by stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::count(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::erase_one_descend(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::exists(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::find(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::insert_descend(), and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::lower_bound().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
template<typename node_type>
int stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::find_upper ( const node_type *  n,
const key_type key 
) const [inline, private]

Searches for the first key in the node n greater than key.

Uses binary search with an optional linear self-verification. This is a template function, because the slotkey array is located at different places in leaf_node and inner_node.

Definition at line 1111 of file btree.h.

References BTREE_ASSERT, BTREE_PRINT, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::key_less, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::key_lessequal(), and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::selfverify.

Referenced by stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::upper_bound().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
size_type stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::size (  )  const [inline]

Return the number of key/data pairs in the B+ tree.

Definition at line 1157 of file btree.h.

References stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::tree_stats::itemcount, and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::stats.

Referenced by stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::btree(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::empty(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::erase_one(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::operator=(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::operator==(), stx::btree_set< _Key, _Compare, _Traits >::size(), stx::btree_multiset< _Key, _Compare, _Traits >::size(), stx::btree_multimap< _Key, _Data, _Compare, _Traits >::size(), and stx::btree_map< _Key, _Data, _Compare, _Traits >::size().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
bool stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::empty (  )  const [inline]

Returns true if there is at least one key/data pair in the B+ tree.

Definition at line 1163 of file btree.h.

References stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::size().

Referenced by stx::btree_set< _Key, _Compare, _Traits >::empty(), stx::btree_multiset< _Key, _Compare, _Traits >::empty(), stx::btree_multimap< _Key, _Data, _Compare, _Traits >::empty(), and stx::btree_map< _Key, _Data, _Compare, _Traits >::empty().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
size_type stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::max_size (  )  const [inline]

Returns the largest possible size of the B+ Tree.

This is just a function required by the STL standard, the B+ Tree can hold more items.

Definition at line 1170 of file btree.h.

Referenced by stx::btree_set< _Key, _Compare, _Traits >::max_size(), stx::btree_multiset< _Key, _Compare, _Traits >::max_size(), stx::btree_multimap< _Key, _Data, _Compare, _Traits >::max_size(), and stx::btree_map< _Key, _Data, _Compare, _Traits >::max_size().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
struct tree_stats& stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::get_stats (  )  const [inline, read]

Return a const reference to the current statistics.

Definition at line 1176 of file btree.h.

References stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::stats.

Referenced by stx::btree_set< _Key, _Compare, _Traits >::get_stats(), stx::btree_multiset< _Key, _Compare, _Traits >::get_stats(), stx::btree_multimap< _Key, _Data, _Compare, _Traits >::get_stats(), and stx::btree_map< _Key, _Data, _Compare, _Traits >::get_stats().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
bool stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::exists ( const key_type key  )  const [inline]

Non-STL function checking whether a key is in the B+ tree.

The same as (find(k) != end()) or (count() != 0).

Definition at line 1186 of file btree.h.

References stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::find_lower(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::node::isleafnode(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::key_equal(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::root, and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::leaf_node::slotkey.

Referenced by stx::btree_set< _Key, _Compare, _Traits >::exists(), stx::btree_multiset< _Key, _Compare, _Traits >::exists(), stx::btree_multimap< _Key, _Data, _Compare, _Traits >::exists(), stx::btree_map< _Key, _Data, _Compare, _Traits >::exists(), and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::insert_start().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
iterator stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::find ( const key_type key  )  [inline]

Tries to locate a key in the B+ tree and returns an iterator to the key/data slot if found.

If unsuccessful it returns end().

Definition at line 1208 of file btree.h.

References stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::end(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::find_lower(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::node::isleafnode(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::key_equal(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::root, and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::leaf_node::slotkey.

Referenced by stx::btree_set< _Key, _Compare, _Traits >::find(), stx::btree_multiset< _Key, _Compare, _Traits >::find(), stx::btree_multimap< _Key, _Data, _Compare, _Traits >::find(), and stx::btree_map< _Key, _Data, _Compare, _Traits >::find().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
const_iterator stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::find ( const key_type key  )  const [inline]

Tries to locate a key in the B+ tree and returns an constant iterator to the key/data slot if found.

If unsuccessful it returns end().

Definition at line 1229 of file btree.h.

References stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::end(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::find_lower(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::node::isleafnode(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::key_equal(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::root, and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::leaf_node::slotkey.

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
size_type stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::count ( const key_type key  )  const [inline]

Tries to locate a key in the B+ tree and returns the number of identical key entries found.

Definition at line 1250 of file btree.h.

References stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::find_lower(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::node::isleafnode(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::key_equal(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::leaf_node::nextleaf, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::root, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::leaf_node::slotkey, and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::node::slotuse.

Referenced by stx::btree_set< _Key, _Compare, _Traits >::count(), stx::btree_multiset< _Key, _Compare, _Traits >::count(), stx::btree_multimap< _Key, _Data, _Compare, _Traits >::count(), and stx::btree_map< _Key, _Data, _Compare, _Traits >::count().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
iterator stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::lower_bound ( const key_type key  )  [inline]

Searches the B+ tree and returns an iterator to the first key less or equal to the parameter.

If unsuccessful it returns end().

Definition at line 1283 of file btree.h.

References stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::end(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::find_lower(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::node::isleafnode(), and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::root.

Referenced by stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::equal_range(), stx::btree_set< _Key, _Compare, _Traits >::lower_bound(), stx::btree_multiset< _Key, _Compare, _Traits >::lower_bound(), stx::btree_multimap< _Key, _Data, _Compare, _Traits >::lower_bound(), and stx::btree_map< _Key, _Data, _Compare, _Traits >::lower_bound().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
const_iterator stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::lower_bound ( const key_type key  )  const [inline]

Searches the B+ tree and returns an constant iterator to the first key less or equal to the parameter.

If unsuccessful it returns end().

Definition at line 1304 of file btree.h.

References stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::end(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::find_lower(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::node::isleafnode(), and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::root.

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
iterator stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::upper_bound ( const key_type key  )  [inline]

Searches the B+ tree and returns an iterator to the first key greater than the parameter.

If unsuccessful it returns end().

Definition at line 1325 of file btree.h.

References stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::end(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::find_upper(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::node::isleafnode(), and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::root.

Referenced by stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::equal_range(), stx::btree_set< _Key, _Compare, _Traits >::upper_bound(), stx::btree_multiset< _Key, _Compare, _Traits >::upper_bound(), stx::btree_multimap< _Key, _Data, _Compare, _Traits >::upper_bound(), and stx::btree_map< _Key, _Data, _Compare, _Traits >::upper_bound().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
const_iterator stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::upper_bound ( const key_type key  )  const [inline]

Searches the B+ tree and returns an constant iterator to the first key greater than the parameter.

If unsuccessful it returns end().

Definition at line 1346 of file btree.h.

References stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::end(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::find_upper(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::node::isleafnode(), and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::root.

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
std::pair<iterator, iterator> stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::equal_range ( const key_type key  )  [inline]

Searches the B+ tree and returns both lower_bound() and upper_bound().

Definition at line 1366 of file btree.h.

References stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::lower_bound(), and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::upper_bound().

Referenced by stx::btree_set< _Key, _Compare, _Traits >::equal_range(), stx::btree_multiset< _Key, _Compare, _Traits >::equal_range(), stx::btree_multimap< _Key, _Data, _Compare, _Traits >::equal_range(), and stx::btree_map< _Key, _Data, _Compare, _Traits >::equal_range().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
std::pair<const_iterator, const_iterator> stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::equal_range ( const key_type key  )  const [inline]

Searches the B+ tree and returns both lower_bound() and upper_bound().

Definition at line 1372 of file btree.h.

References stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::lower_bound(), and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::upper_bound().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
bool stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::operator== ( const btree_self other  )  const [inline]

Equality relation of B+ trees of the same type.

B+ trees of the same size and equal elements (both key and data) are considered equal. Beware of the random ordering of duplicate keys.

Definition at line 1383 of file btree.h.

References stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::begin(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::end(), and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::size().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
bool stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::operator!= ( const btree_self other  )  const [inline]

Inequality relation. Based on operator==.

Definition at line 1389 of file btree.h.

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
bool stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::operator< ( const btree_self other  )  const [inline]

Total ordering relation of B+ trees of the same type.

It uses std::lexicographical_compare() for the actual comparison of elements.

Definition at line 1396 of file btree.h.

References stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::begin(), and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::end().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
bool stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::operator> ( const btree_self other  )  const [inline]

Greater relation. Based on operator<.

Definition at line 1402 of file btree.h.

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
bool stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::operator<= ( const btree_self other  )  const [inline]

Less-equal relation. Based on operator<.

Definition at line 1408 of file btree.h.

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
bool stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::operator>= ( const btree_self other  )  const [inline]

Greater-equal relation. Based on operator<.

Definition at line 1414 of file btree.h.

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
btree_self& stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::operator= ( const btree_self other  )  [inline]

Assignment operator. All the key/data pairs are copied.

Definition at line 1423 of file btree.h.

References stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::clear(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::copy_recursive(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::tree_stats::innernodes, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::key_comp(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::key_less, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::tree_stats::leaves, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::root, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::selfverify, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::size(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::stats, and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::verify().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
struct node* stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::copy_recursive ( const node n  )  [inline, read, private]

Recursively copy nodes from another B+ tree object.

Definition at line 1459 of file btree.h.

References stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::allocate_inner(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::allocate_leaf(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::inner_node::childid, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::headleaf, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::node::isleafnode(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::node::level, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::leaf_node::nextleaf, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::leaf_node::prevleaf, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::leaf_node::slotdata, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::inner_node::slotkey, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::leaf_node::slotkey, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::node::slotuse, and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::tailleaf.

Referenced by stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::btree(), and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::operator=().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
std::pair<iterator, bool> stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::insert ( const pair_type x  )  [inline]

Attempt to insert a key/data pair into the B+ tree.

If the tree does not allow duplicate keys, then the insert may fail if it is already present.

Definition at line 1507 of file btree.h.

References stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::insert_start().

Referenced by stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::btree(), stx::btree_multimap< _Key, _Data, _Compare, _Traits >::insert(), stx::btree_map< _Key, _Data, _Compare, _Traits >::insert(), and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::insert().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
std::pair<iterator, bool> stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::insert ( const key_type key,
const data_type data 
) [inline]

Attempt to insert a key/data pair into the B+ tree.

Beware that if key_type == data_type, then the template iterator insert() is called instead. If the tree does not allow duplicate keys, then the insert may fail if it is already present.

Definition at line 1516 of file btree.h.

References stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::insert_start().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
std::pair<iterator, bool> stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::insert2 ( const key_type key,
const data_type data 
) [inline]

Attempt to insert a key/data pair into the B+ tree.

This function is the same as the other insert, however if key_type == data_type then the non-template function cannot be called. If the tree does not allow duplicate keys, then the insert may fail if it is already present.

Definition at line 1525 of file btree.h.

References stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::insert_start().

Referenced by stx::btree_set< _Key, _Compare, _Traits >::insert(), stx::btree_multiset< _Key, _Compare, _Traits >::insert(), stx::btree_multimap< _Key, _Data, _Compare, _Traits >::insert(), stx::btree_map< _Key, _Data, _Compare, _Traits >::insert(), stx::btree_multimap< _Key, _Data, _Compare, _Traits >::insert2(), and stx::btree_map< _Key, _Data, _Compare, _Traits >::insert2().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
iterator stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::insert ( iterator  ,
const pair_type x 
) [inline]

Attempt to insert a key/data pair into the B+ tree.

The iterator hint is currently ignored by the B+ tree insertion routine.

Definition at line 1532 of file btree.h.

References stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::insert_start().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
iterator stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::insert2 ( iterator  ,
const key_type key,
const data_type data 
) [inline]

Attempt to insert a key/data pair into the B+ tree.

The iterator hint is currently ignored by the B+ tree insertion routine.

Definition at line 1539 of file btree.h.

References stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::insert_start().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
template<typename InputIterator>
void stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::insert ( InputIterator  first,
InputIterator  last 
) [inline]

Attempt to insert the range [first,last) of value_type pairs into the B+ tree.

Each key/data pair is inserted individually.

Definition at line 1547 of file btree.h.

References stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::insert().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
std::pair<iterator, bool> stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::insert_start ( const key_type key,
const data_type value 
) [inline, private]

Start the insertion descent at the current root and handle root splits.

Returns true if the item was inserted

Definition at line 1562 of file btree.h.

References stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::allocate_inner(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::allocate_leaf(), BTREE_ASSERT, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::inner_node::childid, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::debug, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::exists(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::headleaf, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::insert_descend(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::tree_stats::itemcount, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::node::level, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::print(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::root, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::selfverify, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::inner_node::slotkey, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::node::slotuse, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::stats, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::tailleaf, and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::verify().

Referenced by stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::insert(), and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::insert2().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
std::pair<iterator, bool> stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::insert_descend ( node n,
const key_type key,
const data_type value,
key_type splitkey,
node **  splitnode 
) [inline, private]

Insert an item into the B+ tree.

Descend down the nodes to a leaf, insert the key/data pair in a free slot. If the node overflows, then it must be split and the new split node inserted into the parent. Unroll / this splitting up to the root.

Definition at line 1608 of file btree.h.

References stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::allow_duplicates, BTREE_ASSERT, BTREE_PRINT, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::inner_node::childid, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::debug, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::find_lower(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::innerslotmax, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::leaf_node::isfull(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::node::isleafnode(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::key_equal(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::key_less, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::leafslotmax, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::print_node(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::leaf_node::slotdata, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::leaf_node::slotkey, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::node::slotuse, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::split_inner_node(), and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::split_leaf_node().

Referenced by stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::insert_start().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
void stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::split_leaf_node ( leaf_node leaf,
key_type _newkey,
node **  _newleaf 
) [inline, private]

Split up a leaf node into two equally-filled sibling leaves.

Returns the new nodes and it's insertion key in the two parameters.

Definition at line 1746 of file btree.h.

References stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::allocate_leaf(), BTREE_ASSERT, BTREE_PRINT, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::leaf_node::isfull(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::leaf_node::nextleaf, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::leaf_node::prevleaf, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::leaf_node::slotdata, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::leaf_node::slotkey, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::node::slotuse, and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::tailleaf.

Referenced by stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::insert_descend().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
void stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::split_inner_node ( inner_node inner,
key_type _newkey,
node **  _newinner,
unsigned int  addslot 
) [inline, private]

Split up an inner node into two equally-filled sibling nodes.

Returns the new nodes and it's insertion key in the two parameters. Requires the slot of the item will be inserted, so the nodes will be the same size after the insert.

Definition at line 1786 of file btree.h.

References stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::allocate_inner(), BTREE_ASSERT, BTREE_PRINT, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::inner_node::childid, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::inner_node::isfull(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::node::level, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::inner_node::slotkey, and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::node::slotuse.

Referenced by stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::insert_descend().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
bool stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::erase_one ( const key_type key  )  [inline]

Erases one (the first) of the key/data pairs associated with the given key.

Definition at line 1887 of file btree.h.

References stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::btree_not_found, BTREE_PRINT, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::debug, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::erase_one_descend(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::result_t::has(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::tree_stats::itemcount, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::print(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::root, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::selfverify, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::size(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::stats, and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::verify().

Referenced by stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::erase(), stx::btree_set< _Key, _Compare, _Traits >::erase_one(), stx::btree_multiset< _Key, _Compare, _Traits >::erase_one(), stx::btree_multimap< _Key, _Data, _Compare, _Traits >::erase_one(), and stx::btree_map< _Key, _Data, _Compare, _Traits >::erase_one().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
size_type stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::erase ( const key_type key  )  [inline]

Erases all the key/data pairs associated with the given key.

This is implemented using erase_one().

Definition at line 1906 of file btree.h.

References stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::allow_duplicates, and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::erase_one().

Referenced by stx::btree_set< _Key, _Compare, _Traits >::erase(), stx::btree_multiset< _Key, _Compare, _Traits >::erase(), stx::btree_multimap< _Key, _Data, _Compare, _Traits >::erase(), and stx::btree_map< _Key, _Data, _Compare, _Traits >::erase().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
void stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::erase ( iterator  iter  )  [inline]

Erase the key/data pair referenced by the iterator.

Definition at line 1921 of file btree.h.

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
void stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::erase ( iterator  ,
iterator   
) [inline]

Erase all key/data pairs in the range [first,last).

This function is currently not implemented by the B+ Tree.

Definition at line 1930 of file btree.h.

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
result_t stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::erase_one_descend ( const key_type key,
node curr,
node left,
node right,
inner_node leftparent,
inner_node rightparent,
inner_node parent,
unsigned int  parentslot 
) [inline, private]

Erase one (the first) key/data pair in the B+ tree matching key.

Descends down the tree in search of key. During the descent the parent, left and right siblings and their parents are computed and passed down. Once the key/data pair is found, it is removed from the leaf. If the leaf underflows 6 different cases are handled. These cases resolve the underflow by shifting key/data pairs from adjacent sibling nodes, merging two sibling nodes or trimming the tree.

Definition at line 1948 of file btree.h.

References BTREE_ASSERT, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::btree_not_found, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::btree_ok, BTREE_PRINT, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::btree_update_lastkey, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::inner_node::childid, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::find_lower(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::node::isleafnode(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::key_equal(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::merge_leaves(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::root, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::shift_left_leaf(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::shift_right_leaf(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::inner_node::slotkey, and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::node::slotuse.

Referenced by stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::erase_one().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
result_t stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::merge_leaves ( leaf_node left,
leaf_node right,
inner_node parent 
) [inline, private]

Merge two leaf nodes.

The function moves all key/data pairs from right to left and sets right's slotuse to zero. The right slot is then removed by the calling parent node.

Definition at line 2205 of file btree.h.

References BTREE_ASSERT, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::btree_fixmerge, BTREE_PRINT, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::node::isleafnode(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::leafslotmax, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::node::level, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::leaf_node::nextleaf, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::leaf_node::prevleaf, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::leaf_node::slotdata, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::leaf_node::slotkey, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::node::slotuse, and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::tailleaf.

Referenced by stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::erase_one_descend().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
static result_t stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::merge_inner ( inner_node left,
inner_node right,
inner_node parent,
unsigned int  parentslot 
) [inline, static, private]

Merge two inner nodes.

The function moves all key/childid pairs from right to left and sets right's slotuse to zero. The right slot is then removed by the calling parent node.

Definition at line 2236 of file btree.h.

References BTREE_ASSERT, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::btree_fixmerge, BTREE_PRINT, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::inner_node::childid, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::innerslotmax, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::node::level, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::selfverify, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::inner_node::slotkey, and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::node::slotuse.

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
static result_t stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::shift_left_leaf ( leaf_node left,
leaf_node right,
inner_node parent,
unsigned int  parentslot 
) [inline, static, private]

Balance two leaf nodes.

The function moves key/data pairs from right to left so that both nodes are equally filled. The parent node is updated if possible.

Definition at line 2283 of file btree.h.

References BTREE_ASSERT, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::btree_ok, BTREE_PRINT, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::inner_node::childid, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::node::isleafnode(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::leafslotmax, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::node::level, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::leaf_node::nextleaf, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::leaf_node::prevleaf, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::leaf_node::slotdata, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::inner_node::slotkey, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::leaf_node::slotkey, and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::node::slotuse.

Referenced by stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::erase_one_descend().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
static void stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::shift_left_inner ( inner_node left,
inner_node right,
inner_node parent,
unsigned int  parentslot 
) [inline, static, private]

Balance two inner nodes.

The function moves key/data pairs from right to left so that both nodes are equally filled. The parent node is updated if possible.

Definition at line 2330 of file btree.h.

References BTREE_ASSERT, BTREE_PRINT, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::inner_node::childid, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::innerslotmax, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::node::level, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::selfverify, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::inner_node::slotkey, and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::node::slotuse.

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
static void stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::shift_right_leaf ( leaf_node left,
leaf_node right,
inner_node parent,
unsigned int  parentslot 
) [inline, static, private]

Balance two leaf nodes.

The function moves key/data pairs from left to right so that both nodes are equally filled. The parent node is updated if possible.

Definition at line 2390 of file btree.h.

References BTREE_ASSERT, BTREE_PRINT, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::inner_node::childid, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::node::isleafnode(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::leafslotmax, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::node::level, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::leaf_node::nextleaf, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::leaf_node::prevleaf, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::selfverify, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::leaf_node::slotdata, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::inner_node::slotkey, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::leaf_node::slotkey, and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::node::slotuse.

Referenced by stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::erase_one_descend().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
static void stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::shift_right_inner ( inner_node left,
inner_node right,
inner_node parent,
unsigned int  parentslot 
) [inline, static, private]

Balance two inner nodes.

The function moves key/data pairs from left to right so that both nodes are equally filled. The parent node is updated if possible.

Definition at line 2444 of file btree.h.

References BTREE_ASSERT, BTREE_PRINT, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::inner_node::childid, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::innerslotmax, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::node::level, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::selfverify, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::inner_node::slotkey, and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::node::slotuse.

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
void stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::print ( std::ostream &  os  )  const [inline]

Print out the B+ tree structure with keys onto the given ostream.

This function requires that the header is compiled with BTREE_DEBUG and that key_type is printable via std::ostream.

Definition at line 2507 of file btree.h.

References stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::print_node(), and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::root.

Referenced by stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::erase_one(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::insert_start(), stx::btree_set< _Key, _Compare, _Traits >::print(), stx::btree_multiset< _Key, _Compare, _Traits >::print(), stx::btree_multimap< _Key, _Data, _Compare, _Traits >::print(), and stx::btree_map< _Key, _Data, _Compare, _Traits >::print().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
void stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::print_leaves ( std::ostream &  os  )  const [inline]

Print out only the leaves via the double linked list.

Definition at line 2515 of file btree.h.

References stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::headleaf, and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::leaf_node::nextleaf.

Referenced by stx::btree_set< _Key, _Compare, _Traits >::print_leaves(), stx::btree_multiset< _Key, _Compare, _Traits >::print_leaves(), stx::btree_multimap< _Key, _Data, _Compare, _Traits >::print_leaves(), and stx::btree_map< _Key, _Data, _Compare, _Traits >::print_leaves().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
static void stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::print_node ( std::ostream &  os,
const node node,
unsigned int  depth = 0,
bool  recursive = false 
) [inline, static, private]

Recursively descend down the tree and print out nodes.

Definition at line 2532 of file btree.h.

References stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::inner_node::childid, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::node::isleafnode(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::node::level, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::inner_node::slotkey, and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::node::slotuse.

Referenced by stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::insert_descend(), and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::print().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
void stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::verify (  )  const [inline]

Run a thorough verification of all B+ tree invariants.

The program aborts via assert() if something is wrong.

Definition at line 2604 of file btree.h.

References stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::tree_stats::innernodes, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::tree_stats::itemcount, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::tree_stats::leaves, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::root, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::stats, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::verify_leaflinks(), and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::verify_node().

Referenced by stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::btree(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::erase_one(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::insert_start(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::operator=(), stx::btree_set< _Key, _Compare, _Traits >::verify(), stx::btree_multiset< _Key, _Compare, _Traits >::verify(), stx::btree_multimap< _Key, _Data, _Compare, _Traits >::verify(), and stx::btree_map< _Key, _Data, _Compare, _Traits >::verify().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
void stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::verify_node ( const node n,
key_type minkey,
key_type maxkey,
tree_stats vstats 
) const [inline, private]

Recursively descend down the tree and verify each node.

Definition at line 2624 of file btree.h.

References BTREE_PRINT, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::inner_node::childid, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::tree_stats::innernodes, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::node::isleafnode(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::inner_node::isunderflow(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::tree_stats::itemcount, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::key_equal(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::key_greaterequal(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::key_lessequal(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::tree_stats::leaves, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::node::level, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::leaf_node::nextleaf, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::leaf_node::prevleaf, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::root, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::inner_node::slotkey, and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::node::slotuse.

Referenced by stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::verify().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
void stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::verify_leaflinks (  )  const [inline, private]

Verify the double linked list of leaves.

Definition at line 2707 of file btree.h.

References stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::headleaf, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::key_lessequal(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::node::level, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::leaf_node::nextleaf, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::leaf_node::prevleaf, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::leaf_node::slotkey, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::node::slotuse, and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::tailleaf.

Referenced by stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::verify().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
void stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::dump ( std::ostream &  os  )  const [inline]

Dump the contents of the B+ tree out onto an ostream as a binary image.

The image contains memory pointers which will be fixed when the image is restored. For this to work your key_type and data_type must be integral types and contain no pointers or references.

Definition at line 2818 of file btree.h.

References stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::dump_header::fill(), and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::dump_header::itemcount.

Referenced by stx::btree_set< _Key, _Compare, _Traits >::dump(), stx::btree_multiset< _Key, _Compare, _Traits >::dump(), stx::btree_multimap< _Key, _Data, _Compare, _Traits >::dump(), and stx::btree_map< _Key, _Data, _Compare, _Traits >::dump().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
bool stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::restore ( std::istream &  is  )  [inline]

Restore a binary image of a dumped B+ tree from an istream.

The B+ tree pointers are fixed using the dump order. For dump and restore to work your key_type and data_type must be integral types and contain no pointers or references. Returns true if the restore was successful.

Definition at line 2834 of file btree.h.

References BTREE_PRINT, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::dump_header::fill(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::dump_header::itemcount, and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::dump_header::same().

Referenced by stx::btree_set< _Key, _Compare, _Traits >::restore(), stx::btree_multiset< _Key, _Compare, _Traits >::restore(), stx::btree_multimap< _Key, _Data, _Compare, _Traits >::restore(), and stx::btree_map< _Key, _Data, _Compare, _Traits >::restore().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
void stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::dump_node ( std::ostream &  os,
const node n 
) const [inline, private]

Recursively descend down the tree and dump each node in a precise order.

Definition at line 2869 of file btree.h.

References BTREE_PRINT, and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::node::isleafnode().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
node* stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::restore_node ( std::istream &  is  )  [inline, private]

Read the dump image and construct a tree from the node order in the serialization.

Definition at line 2896 of file btree.h.

References BTREE_ASSERT, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::inner_node::childid, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::leaf_node::nextleaf, stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::leaf_node::prevleaf, and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::node::slotuse.


Member Data Documentation

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
const bool stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::allow_duplicates = _Duplicates [static]

Sixth template parameter: Allow duplicate keys in the B+ tree.

Used to implement multiset and multimap.

Definition at line 165 of file btree.h.

Referenced by stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::erase(), and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::insert_descend().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
const unsigned short stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::leafslotmax = traits::leafslots [static]

Base B+ tree parameter: The number of key/data slots in each leaf.

Definition at line 189 of file btree.h.

Referenced by stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::insert_descend(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::leaf_node::isfull(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::merge_leaves(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::shift_left_leaf(), and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::shift_right_leaf().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
const unsigned short stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::innerslotmax = traits::innerslots [static]

Base B+ tree parameter: The number of key slots in each inner node, this can differ from slots in each leaf.

Definition at line 193 of file btree.h.

Referenced by stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::insert_descend(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::inner_node::isfull(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::merge_inner(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::shift_left_inner(), and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::shift_right_inner().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
const unsigned short stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::minleafslots = (leafslotmax / 2) [static]

Computed B+ tree parameter: The minimum number of key/data slots used in a leaf.

If fewer slots are used, the leaf will be merged or slots shifted from it's siblings.

Definition at line 198 of file btree.h.

Referenced by stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::leaf_node::isfew(), and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::leaf_node::isunderflow().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
const unsigned short stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::mininnerslots = (innerslotmax / 2) [static]

Computed B+ tree parameter: The minimum number of key slots used in an inner node.

If fewer slots are used, the inner node will be merged or slots shifted from it's siblings.

Definition at line 203 of file btree.h.

Referenced by stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::inner_node::isfew(), and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::inner_node::isunderflow().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
const bool stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::selfverify = traits::selfverify [static]

Debug parameter: Enables expensive and thorough checking of the B+ tree invariants after each insert/erase operation.

Definition at line 207 of file btree.h.

Referenced by stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::btree(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::erase_one(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::find_lower(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::find_upper(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::insert_start(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::merge_inner(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::operator=(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::shift_left_inner(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::shift_right_inner(), and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::shift_right_leaf().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
const bool stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::debug = traits::debug [static]

Debug parameter: Prints out lots of debug information about how the algorithms change the tree.

Requires the header file to be compiled with BTREE_DEBUG and the key type must be std::ostream printable.

Definition at line 212 of file btree.h.

Referenced by stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::erase_one(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::insert_descend(), and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::insert_start().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
node* stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::root [private]

Pointer to the B+ tree's root node, either leaf or inner node.

Definition at line 783 of file btree.h.

Referenced by stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::btree(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::clear(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::count(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::erase_one(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::erase_one_descend(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::exists(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::find(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::insert_start(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::lower_bound(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::operator=(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::print(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::swap(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::upper_bound(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::verify(), and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::verify_node().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
leaf_node* stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::headleaf [private]

Pointer to first leaf in the double linked leaf chain.

Definition at line 786 of file btree.h.

Referenced by stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::begin(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::clear(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::copy_recursive(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::insert_start(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::print_leaves(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::swap(), and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::verify_leaflinks().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
leaf_node* stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::tailleaf [private]

Pointer to last leaf in the double linked leaf chain.

Definition at line 789 of file btree.h.

Referenced by stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::clear(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::copy_recursive(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::end(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::insert_start(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::merge_leaves(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::split_leaf_node(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::swap(), and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::verify_leaflinks().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
tree_stats stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::stats [private]

Other small statistics about the B+ tree.

Definition at line 792 of file btree.h.

Referenced by stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::allocate_inner(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::allocate_leaf(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::btree(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::clear(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::erase_one(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::free_node(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::get_stats(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::insert_start(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::operator=(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::size(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::swap(), and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::verify().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
key_compare stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::key_less [private]

Key comparison object.

More comparison functions are generated from this < relation.

Definition at line 796 of file btree.h.

Referenced by stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::find_lower(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::find_upper(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::insert_descend(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::key_comp(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::key_equal(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::key_greater(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::key_greaterequal(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::key_lessequal(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::operator=(), stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::swap(), and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::value_comp().


The documentation for this class was generated from the following file:
Generated on Sun May 13 19:24:41 2007 for STX B+ Tree Template Classes by  doxygen 1.5.2