stx::btree_multimap< _Key, _Data, _Compare, _Traits > Class Template Reference

Specialized B+ tree template class implementing STL's multimap container. More...

#include <btree_multimap.h>

List of all members.

Public Types

typedef _Key key_type
 First template parameter: The key type of the btree.
typedef _Data data_type
 Second template parameter: The data type associated with each key.
typedef _Compare key_compare
 Third template parameter: Key comparison function object.
typedef _Traits traits
 Fourth template parameter: Traits object used to define more parameters of the B+ tree.
typedef btree_multimap< key_type,
data_type, key_compare, traits
self
 Typedef of our own type.
typedef std::pair< key_type,
data_type
value_type
 Construct the STL-required value_type as a composition pair of key and data types.
typedef stx::btree< key_type,
data_type, value_type, key_compare,
traits, true > 
btree_impl
 Implementation type of the btree_base.
typedef btree_impl::value_compare value_compare
 Function class comparing two value_type pairs.
typedef btree_impl::size_type size_type
 Size type used to count keys.
typedef btree_impl::tree_stats tree_stats
 Small structure containing statistics about the tree.
typedef btree_impl::iterator iterator
 STL-like iterator object for B+ tree items.
typedef btree_impl::const_iterator const_iterator
 STL-like iterator object for B+ tree items.
typedef btree_impl::reverse_iterator reverse_iterator
 create mutable reverse iterator by using STL magic
typedef btree_impl::const_reverse_iterator const_reverse_iterator
 create constant reverse iterator by using STL magic

Public Member Functions

 btree_multimap ()
 Default constructor initializing an empty B+ tree with the standard key comparison function.
 btree_multimap (const key_compare &kcf)
 Constructor initializing an empty B+ tree with a special key comparison object.
template<class InputIterator>
 btree_multimap (InputIterator first, InputIterator last)
 Constructor initializing a B+ tree with the range [first,last).
template<class InputIterator>
 btree_multimap (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_multimap ()
 Frees up all used B+ tree memory pages.
void swap (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.
const 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 self &other) const
 Equality relation of B+ trees of the same type.
bool operator!= (const self &other) const
 Inequality relation. Based on operator==.
bool operator< (const self &other) const
 Total ordering relation of B+ trees of the same type.
bool operator> (const self &other) const
 Greater relation. Based on operator<.
bool operator<= (const self &other) const
 Less-equal relation. Based on operator<.
bool operator>= (const self &other) const
 Greater-equal relation. Based on operator<.
selfoperator= (const self &other)
 Assignment operator. All the key/data pairs are copied.
 btree_multimap (const self &other)
 Copy constructor.
iterator insert (const value_type &x)
 Attempt to insert a key/data pair into the B+ tree.
iterator insert (const key_type &key, const data_type &data)
 Attempt to insert a key/data pair into the B+ tree.
iterator insert2 (const key_type &key, const data_type &data)
 Attempt to insert a key/data pair into the B+ tree.
iterator insert (iterator hint, const value_type &x)
 Attempt to insert a key/data pair into the B+ tree.
iterator insert2 (iterator hint, 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 () const
 Print out the B+ tree structure with keys onto std::cout.
void print_leaves () 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 unsigned short leafslotmax = btree_impl::leafslotmax
 Base B+ tree parameter: The number of key/data slots in each leaf.
static const unsigned short innerslotmax = btree_impl::innerslotmax
 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 = btree_impl::minleafslots
 Computed B+ tree parameter: The minimum number of key/data slots used in a leaf.
static const unsigned short mininnerslots = btree_impl::mininnerslots
 Computed B+ tree parameter: The minimum number of key slots used in an inner node.
static const bool selfverify = btree_impl::selfverify
 Debug parameter: Enables expensive and thorough checking of the B+ tree invariants after each insert/erase operation.
static const bool debug = btree_impl::debug
 Debug parameter: Prints out lots of debug information about how the algorithms change the tree.
static const bool allow_duplicates = btree_impl::allow_duplicates
 Operational parameter: Allow duplicate keys in the btree.


Detailed Description

template<typename _Key, typename _Data, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>>
class stx::btree_multimap< _Key, _Data, _Compare, _Traits >

Specialized B+ tree template class implementing STL's multimap container.

Implements the STL multimap using a B+ tree. It can be used as a drop-in replacement for std::multimap. Not all asymptotic time requirements are met in theory. There is no allocator template parameter, instead the class has a traits class defining B+ tree properties like slots and self-verification.

Most noteworthy difference to the default red-black implementation of std::multimap is that the B+ tree does not hold key and data pair together in memory. Instead each B+ tree node has two arrays of keys and data values. This design directly generates many problems in implementing the iterator's operator's which return value_type composition pairs.

Definition at line 49 of file btree_multimap.h.


Member Typedef Documentation

template<typename _Key, typename _Data, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>>
typedef _Key stx::btree_multimap< _Key, _Data, _Compare, _Traits >::key_type

First template parameter: The key type of the btree.

This is stored in inner nodes and leaves

Definition at line 56 of file btree_multimap.h.

template<typename _Key, typename _Data, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>>
typedef _Data stx::btree_multimap< _Key, _Data, _Compare, _Traits >::data_type

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

Stored in the B+ tree's leaves

Definition at line 60 of file btree_multimap.h.

template<typename _Key, typename _Data, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>>
typedef _Compare stx::btree_multimap< _Key, _Data, _Compare, _Traits >::key_compare

Third template parameter: Key comparison function object.

Definition at line 63 of file btree_multimap.h.

template<typename _Key, typename _Data, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>>
typedef _Traits stx::btree_multimap< _Key, _Data, _Compare, _Traits >::traits

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

Definition at line 67 of file btree_multimap.h.

template<typename _Key, typename _Data, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>>
typedef btree_multimap<key_type, data_type, key_compare, traits> stx::btree_multimap< _Key, _Data, _Compare, _Traits >::self

Typedef of our own type.

Definition at line 73 of file btree_multimap.h.

template<typename _Key, typename _Data, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>>
typedef std::pair<key_type, data_type> stx::btree_multimap< _Key, _Data, _Compare, _Traits >::value_type

Construct the STL-required value_type as a composition pair of key and data types.

Definition at line 77 of file btree_multimap.h.

template<typename _Key, typename _Data, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>>
typedef stx::btree<key_type, data_type, value_type, key_compare, traits, true> stx::btree_multimap< _Key, _Data, _Compare, _Traits >::btree_impl

Implementation type of the btree_base.

Definition at line 80 of file btree_multimap.h.

template<typename _Key, typename _Data, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>>
typedef btree_impl::value_compare stx::btree_multimap< _Key, _Data, _Compare, _Traits >::value_compare

Function class comparing two value_type pairs.

Definition at line 83 of file btree_multimap.h.

template<typename _Key, typename _Data, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>>
typedef btree_impl::size_type stx::btree_multimap< _Key, _Data, _Compare, _Traits >::size_type

Size type used to count keys.

Definition at line 86 of file btree_multimap.h.

template<typename _Key, typename _Data, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>>
typedef btree_impl::tree_stats stx::btree_multimap< _Key, _Data, _Compare, _Traits >::tree_stats

Small structure containing statistics about the tree.

Definition at line 89 of file btree_multimap.h.

template<typename _Key, typename _Data, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>>
typedef btree_impl::iterator stx::btree_multimap< _Key, _Data, _Compare, _Traits >::iterator

STL-like iterator object for B+ tree items.

The iterator points to a specific slot number in a leaf.

Definition at line 128 of file btree_multimap.h.

template<typename _Key, typename _Data, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>>
typedef btree_impl::const_iterator stx::btree_multimap< _Key, _Data, _Compare, _Traits >::const_iterator

STL-like iterator object for B+ tree items.

The iterator points to a specific slot number in a leaf.

Definition at line 132 of file btree_multimap.h.

template<typename _Key, typename _Data, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>>
typedef btree_impl::reverse_iterator stx::btree_multimap< _Key, _Data, _Compare, _Traits >::reverse_iterator

create mutable reverse iterator by using STL magic

Definition at line 135 of file btree_multimap.h.

template<typename _Key, typename _Data, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>>
typedef btree_impl::const_reverse_iterator stx::btree_multimap< _Key, _Data, _Compare, _Traits >::const_reverse_iterator

create constant reverse iterator by using STL magic

Definition at line 138 of file btree_multimap.h.


Constructor & Destructor Documentation

template<typename _Key, typename _Data, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>>
stx::btree_multimap< _Key, _Data, _Compare, _Traits >::btree_multimap (  )  [inline]

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

Definition at line 151 of file btree_multimap.h.

template<typename _Key, typename _Data, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>>
stx::btree_multimap< _Key, _Data, _Compare, _Traits >::btree_multimap ( const key_compare kcf  )  [inline]

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

Definition at line 158 of file btree_multimap.h.

template<typename _Key, typename _Data, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>>
template<class InputIterator>
stx::btree_multimap< _Key, _Data, _Compare, _Traits >::btree_multimap ( InputIterator  first,
InputIterator  last 
) [inline]

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

Definition at line 165 of file btree_multimap.h.

template<typename _Key, typename _Data, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>>
template<class InputIterator>
stx::btree_multimap< _Key, _Data, _Compare, _Traits >::btree_multimap ( 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 173 of file btree_multimap.h.

template<typename _Key, typename _Data, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>>
stx::btree_multimap< _Key, _Data, _Compare, _Traits >::~btree_multimap (  )  [inline]

Frees up all used B+ tree memory pages.

Definition at line 179 of file btree_multimap.h.

template<typename _Key, typename _Data, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>>
stx::btree_multimap< _Key, _Data, _Compare, _Traits >::btree_multimap ( const self other  )  [inline]

Copy constructor.

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

Definition at line 429 of file btree_multimap.h.


Member Function Documentation

template<typename _Key, typename _Data, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>>
void stx::btree_multimap< _Key, _Data, _Compare, _Traits >::swap ( self from  )  [inline]

Fast swapping of two identical B+ tree objects.

Definition at line 184 of file btree_multimap.h.

References stx::btree_multimap< _Key, _Data, _Compare, _Traits >::tree.

template<typename _Key, typename _Data, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>>
key_compare stx::btree_multimap< _Key, _Data, _Compare, _Traits >::key_comp (  )  const [inline]

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

Definition at line 193 of file btree_multimap.h.

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

template<typename _Key, typename _Data, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>>
value_compare stx::btree_multimap< _Key, _Data, _Compare, _Traits >::value_comp (  )  const [inline]

Constant access to a constructed value_type comparison object.

required by the STL

Definition at line 200 of file btree_multimap.h.

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

template<typename _Key, typename _Data, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>>
void stx::btree_multimap< _Key, _Data, _Compare, _Traits >::clear (  )  [inline]

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

Definition at line 209 of file btree_multimap.h.

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

template<typename _Key, typename _Data, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>>
iterator stx::btree_multimap< _Key, _Data, _Compare, _Traits >::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 219 of file btree_multimap.h.

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

template<typename _Key, typename _Data, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>>
iterator stx::btree_multimap< _Key, _Data, _Compare, _Traits >::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 226 of file btree_multimap.h.

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

template<typename _Key, typename _Data, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>>
const_iterator stx::btree_multimap< _Key, _Data, _Compare, _Traits >::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 233 of file btree_multimap.h.

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

template<typename _Key, typename _Data, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>>
const_iterator stx::btree_multimap< _Key, _Data, _Compare, _Traits >::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 240 of file btree_multimap.h.

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

template<typename _Key, typename _Data, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>>
reverse_iterator stx::btree_multimap< _Key, _Data, _Compare, _Traits >::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 247 of file btree_multimap.h.

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

template<typename _Key, typename _Data, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>>
reverse_iterator stx::btree_multimap< _Key, _Data, _Compare, _Traits >::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 254 of file btree_multimap.h.

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

template<typename _Key, typename _Data, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>>
const_reverse_iterator stx::btree_multimap< _Key, _Data, _Compare, _Traits >::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 261 of file btree_multimap.h.

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

template<typename _Key, typename _Data, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>>
const_reverse_iterator stx::btree_multimap< _Key, _Data, _Compare, _Traits >::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 268 of file btree_multimap.h.

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

template<typename _Key, typename _Data, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>>
size_type stx::btree_multimap< _Key, _Data, _Compare, _Traits >::size (  )  const [inline]

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

Definition at line 277 of file btree_multimap.h.

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

template<typename _Key, typename _Data, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>>
bool stx::btree_multimap< _Key, _Data, _Compare, _Traits >::empty (  )  const [inline]

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

Definition at line 283 of file btree_multimap.h.

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

template<typename _Key, typename _Data, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>>
size_type stx::btree_multimap< _Key, _Data, _Compare, _Traits >::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 290 of file btree_multimap.h.

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

template<typename _Key, typename _Data, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>>
const tree_stats& stx::btree_multimap< _Key, _Data, _Compare, _Traits >::get_stats (  )  const [inline]

Return a const reference to the current statistics.

Definition at line 296 of file btree_multimap.h.

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

template<typename _Key, typename _Data, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>>
bool stx::btree_multimap< _Key, _Data, _Compare, _Traits >::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 306 of file btree_multimap.h.

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

template<typename _Key, typename _Data, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>>
iterator stx::btree_multimap< _Key, _Data, _Compare, _Traits >::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 313 of file btree_multimap.h.

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

template<typename _Key, typename _Data, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>>
const_iterator stx::btree_multimap< _Key, _Data, _Compare, _Traits >::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 320 of file btree_multimap.h.

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

template<typename _Key, typename _Data, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>>
size_type stx::btree_multimap< _Key, _Data, _Compare, _Traits >::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 327 of file btree_multimap.h.

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

template<typename _Key, typename _Data, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>>
iterator stx::btree_multimap< _Key, _Data, _Compare, _Traits >::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 334 of file btree_multimap.h.

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

template<typename _Key, typename _Data, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>>
const_iterator stx::btree_multimap< _Key, _Data, _Compare, _Traits >::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 341 of file btree_multimap.h.

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

template<typename _Key, typename _Data, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>>
iterator stx::btree_multimap< _Key, _Data, _Compare, _Traits >::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 348 of file btree_multimap.h.

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

template<typename _Key, typename _Data, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>>
const_iterator stx::btree_multimap< _Key, _Data, _Compare, _Traits >::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 355 of file btree_multimap.h.

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

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

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

Definition at line 361 of file btree_multimap.h.

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

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

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

Definition at line 367 of file btree_multimap.h.

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

template<typename _Key, typename _Data, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>>
bool stx::btree_multimap< _Key, _Data, _Compare, _Traits >::operator== ( const 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 378 of file btree_multimap.h.

References stx::btree_multimap< _Key, _Data, _Compare, _Traits >::tree.

template<typename _Key, typename _Data, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>>
bool stx::btree_multimap< _Key, _Data, _Compare, _Traits >::operator!= ( const self other  )  const [inline]

Inequality relation. Based on operator==.

Definition at line 384 of file btree_multimap.h.

References stx::btree_multimap< _Key, _Data, _Compare, _Traits >::tree.

template<typename _Key, typename _Data, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>>
bool stx::btree_multimap< _Key, _Data, _Compare, _Traits >::operator< ( const 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 391 of file btree_multimap.h.

References stx::btree_multimap< _Key, _Data, _Compare, _Traits >::tree.

template<typename _Key, typename _Data, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>>
bool stx::btree_multimap< _Key, _Data, _Compare, _Traits >::operator> ( const self other  )  const [inline]

Greater relation. Based on operator<.

Definition at line 397 of file btree_multimap.h.

References stx::btree_multimap< _Key, _Data, _Compare, _Traits >::tree.

template<typename _Key, typename _Data, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>>
bool stx::btree_multimap< _Key, _Data, _Compare, _Traits >::operator<= ( const self other  )  const [inline]

Less-equal relation. Based on operator<.

Definition at line 403 of file btree_multimap.h.

References stx::btree_multimap< _Key, _Data, _Compare, _Traits >::tree.

template<typename _Key, typename _Data, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>>
bool stx::btree_multimap< _Key, _Data, _Compare, _Traits >::operator>= ( const self other  )  const [inline]

Greater-equal relation. Based on operator<.

Definition at line 409 of file btree_multimap.h.

References stx::btree_multimap< _Key, _Data, _Compare, _Traits >::tree.

template<typename _Key, typename _Data, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>>
self& stx::btree_multimap< _Key, _Data, _Compare, _Traits >::operator= ( const self other  )  [inline]

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

Definition at line 418 of file btree_multimap.h.

References stx::btree_multimap< _Key, _Data, _Compare, _Traits >::tree.

template<typename _Key, typename _Data, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>>
iterator stx::btree_multimap< _Key, _Data, _Compare, _Traits >::insert ( const value_type x  )  [inline]

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

As this tree allows duplicates insertion never fails.

Definition at line 439 of file btree_multimap.h.

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

template<typename _Key, typename _Data, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>>
iterator stx::btree_multimap< _Key, _Data, _Compare, _Traits >::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. As this tree allows duplicates insertion never fails.

Definition at line 447 of file btree_multimap.h.

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

template<typename _Key, typename _Data, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>>
iterator stx::btree_multimap< _Key, _Data, _Compare, _Traits >::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. As this tree allows duplicates insertion never fails.

Definition at line 456 of file btree_multimap.h.

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

template<typename _Key, typename _Data, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>>
iterator stx::btree_multimap< _Key, _Data, _Compare, _Traits >::insert ( iterator  hint,
const value_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 463 of file btree_multimap.h.

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

template<typename _Key, typename _Data, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>>
iterator stx::btree_multimap< _Key, _Data, _Compare, _Traits >::insert2 ( iterator  hint,
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 470 of file btree_multimap.h.

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