Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

709 lines (691 sloc) 99.381 kb
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>STX B+ Tree Template Classes: stx/btree_multiset.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
</head>
<body>
<div id="top"><!-- do not remove this div! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">STX B+ Tree Template Classes
&#160;<span id="projectnumber">0.9</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- Generated by Doxygen 1.7.6.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&#160;List</span></a></li>
<li><a href="globals.html"><span>File&#160;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="headertitle">
<div class="title">stx/btree_multiset.h</div> </div>
</div><!--header-->
<div class="contents">
<a href="a00032.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/** \file btree_multiset.h</span>
<a name="l00002"></a>00002 <span class="comment"> * Contains the specialized B+ tree template class btree_multiset</span>
<a name="l00003"></a>00003 <span class="comment"> */</span>
<a name="l00004"></a>00004
<a name="l00005"></a>00005 <span class="comment">/*</span>
<a name="l00006"></a>00006 <span class="comment"> * STX B+ Tree Template Classes v0.9</span>
<a name="l00007"></a>00007 <span class="comment"> * Copyright (C) 2008-2013 Timo Bingmann</span>
<a name="l00008"></a>00008 <span class="comment"> *</span>
<a name="l00009"></a>00009 <span class="comment"> * Boost Software License - Version 1.0 - August 17th, 2003</span>
<a name="l00010"></a>00010 <span class="comment"> *</span>
<a name="l00011"></a>00011 <span class="comment"> * Permission is hereby granted, free of charge, to any person or organization</span>
<a name="l00012"></a>00012 <span class="comment"> * obtaining a copy of the software and accompanying documentation covered by</span>
<a name="l00013"></a>00013 <span class="comment"> * this license (the &quot;Software&quot;) to use, reproduce, display, distribute,</span>
<a name="l00014"></a>00014 <span class="comment"> * execute, and transmit the Software, and to prepare derivative works of the</span>
<a name="l00015"></a>00015 <span class="comment"> * Software, and to permit third-parties to whom the Software is furnished to</span>
<a name="l00016"></a>00016 <span class="comment"> * do so, all subject to the following:</span>
<a name="l00017"></a>00017 <span class="comment"> *</span>
<a name="l00018"></a>00018 <span class="comment"> * The copyright notices in the Software and this entire statement, including</span>
<a name="l00019"></a>00019 <span class="comment"> * the above license grant, this restriction and the following disclaimer, must</span>
<a name="l00020"></a>00020 <span class="comment"> * be included in all copies of the Software, in whole or in part, and all</span>
<a name="l00021"></a>00021 <span class="comment"> * derivative works of the Software, unless such copies or derivative works are</span>
<a name="l00022"></a>00022 <span class="comment"> * solely in the form of machine-executable object code generated by a source</span>
<a name="l00023"></a>00023 <span class="comment"> * language processor.</span>
<a name="l00024"></a>00024 <span class="comment"> *</span>
<a name="l00025"></a>00025 <span class="comment"> * THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
<a name="l00026"></a>00026 <span class="comment"> * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
<a name="l00027"></a>00027 <span class="comment"> * FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT</span>
<a name="l00028"></a>00028 <span class="comment"> * SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE</span>
<a name="l00029"></a>00029 <span class="comment"> * FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,</span>
<a name="l00030"></a>00030 <span class="comment"> * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER</span>
<a name="l00031"></a>00031 <span class="comment"> * DEALINGS IN THE SOFTWARE.</span>
<a name="l00032"></a>00032 <span class="comment"> */</span>
<a name="l00033"></a>00033
<a name="l00034"></a>00034 <span class="preprocessor">#ifndef _STX_BTREE_MULTISET_H_</span>
<a name="l00035"></a>00035 <span class="preprocessor"></span><span class="preprocessor">#define _STX_BTREE_MULTISET_H_</span>
<a name="l00036"></a>00036 <span class="preprocessor"></span>
<a name="l00037"></a>00037 <span class="preprocessor">#include &lt;<a class="code" href="a00026.html" title="Contains the main B+ tree implementation template class btree.">stx/btree.h</a>&gt;</span>
<a name="l00038"></a>00038
<a name="l00039"></a>00039 <span class="keyword">namespace </span>stx {
<a name="l00040"></a>00040 <span class="comment"></span>
<a name="l00041"></a>00041 <span class="comment">/** @brief Specialized B+ tree template class implementing STL&#39;s multiset</span>
<a name="l00042"></a>00042 <span class="comment"> * container.</span>
<a name="l00043"></a>00043 <span class="comment"> *</span>
<a name="l00044"></a>00044 <span class="comment"> * Implements the STL multiset using a B+ tree. It can be used as a drop-in</span>
<a name="l00045"></a>00045 <span class="comment"> * replacement for std::multiset. Not all asymptotic time requirements are met</span>
<a name="l00046"></a>00046 <span class="comment"> * in theory. The class has a traits class defining B+ tree properties like</span>
<a name="l00047"></a>00047 <span class="comment"> * slots and self-verification. Furthermore an allocator can be specified for</span>
<a name="l00048"></a>00048 <span class="comment"> * tree nodes.</span>
<a name="l00049"></a>00049 <span class="comment"> *</span>
<a name="l00050"></a>00050 <span class="comment"> * It is somewhat inefficient to implement a multiset using a B+ tree, a plain</span>
<a name="l00051"></a>00051 <span class="comment"> * B tree would hold fewer copies of the keys.</span>
<a name="l00052"></a>00052 <span class="comment"> *</span>
<a name="l00053"></a>00053 <span class="comment"> * The set class is derived from the base implementation class btree by</span>
<a name="l00054"></a>00054 <span class="comment"> * specifying an empty struct as data_type. All function are adapted to provide</span>
<a name="l00055"></a>00055 <span class="comment"> * the inner class with placeholder objects. Most tricky to get right were the</span>
<a name="l00056"></a>00056 <span class="comment"> * return type&#39;s of iterators which as value_type should be the same as</span>
<a name="l00057"></a>00057 <span class="comment"> * key_type, and not a pair of key and dummy-struct. This is taken case of</span>
<a name="l00058"></a>00058 <span class="comment"> * using some template magic in the btree class.</span>
<a name="l00059"></a>00059 <span class="comment"> */</span>
<a name="l00060"></a>00060 <span class="keyword">template</span> &lt;<span class="keyword">typename</span> _Key,
<a name="l00061"></a>00061 <span class="keyword">typename</span> _Compare = std::less&lt;_Key&gt;,
<a name="l00062"></a>00062 <span class="keyword">typename</span> _Traits = btree_default_set_traits&lt;_Key&gt;,
<a name="l00063"></a>00063 <span class="keyword">typename</span> _Alloc = std::allocator&lt;_Key&gt; &gt;
<a name="l00064"></a><a class="code" href="a00006.html">00064</a> <span class="keyword">class </span><a class="code" href="a00006.html" title="Specialized B+ tree template class implementing STL&#39;s multiset container.">btree_multiset</a>
<a name="l00065"></a>00065 {
<a name="l00066"></a>00066 <span class="keyword">public</span>:
<a name="l00067"></a>00067 <span class="comment">// *** Template Parameter Types</span>
<a name="l00068"></a>00068 <span class="comment"></span>
<a name="l00069"></a>00069 <span class="comment"> /// First template parameter: The key type of the btree. This is stored in</span>
<a name="l00070"></a>00070 <span class="comment"> /// inner nodes and leaves</span>
<a name="l00071"></a><a class="code" href="a00006.html#adaf86bdcdf48a7d4ed87ae020436287e">00071</a> <span class="comment"></span> <span class="keyword">typedef</span> _Key <a class="code" href="a00006.html#adaf86bdcdf48a7d4ed87ae020436287e" title="First template parameter: The key type of the btree.">key_type</a>;
<a name="l00072"></a>00072 <span class="comment"></span>
<a name="l00073"></a>00073 <span class="comment"> /// Second template parameter: Key comparison function object</span>
<a name="l00074"></a><a class="code" href="a00006.html#ab4d81bc53597e88abe6617421837df21">00074</a> <span class="comment"></span> <span class="keyword">typedef</span> _Compare <a class="code" href="a00006.html#ab4d81bc53597e88abe6617421837df21" title="Second template parameter: Key comparison function object.">key_compare</a>;
<a name="l00075"></a>00075 <span class="comment"></span>
<a name="l00076"></a>00076 <span class="comment"> /// Third template parameter: Traits object used to define more parameters</span>
<a name="l00077"></a>00077 <span class="comment"> /// of the B+ tree</span>
<a name="l00078"></a><a class="code" href="a00006.html#adf34a1c10a3b0e0c1caa0358b9d4f059">00078</a> <span class="comment"></span> <span class="keyword">typedef</span> _Traits <a class="code" href="a00006.html#adf34a1c10a3b0e0c1caa0358b9d4f059" title="Third template parameter: Traits object used to define more parameters of the B+ tree.">traits</a>;
<a name="l00079"></a>00079 <span class="comment"></span>
<a name="l00080"></a>00080 <span class="comment"> /// Fourth template parameter: STL allocator</span>
<a name="l00081"></a><a class="code" href="a00006.html#a3bd75b696bde37ad47838d8058503799">00081</a> <span class="comment"></span> <span class="keyword">typedef</span> _Alloc <a class="code" href="a00006.html#a3bd75b696bde37ad47838d8058503799" title="Fourth template parameter: STL allocator.">allocator_type</a>;
<a name="l00082"></a>00082
<a name="l00083"></a>00083 <span class="comment">// The macro BTREE_FRIENDS can be used by outside class to access the B+</span>
<a name="l00084"></a>00084 <span class="comment">// tree internals. This was added for wxBTreeDemo to be able to draw the</span>
<a name="l00085"></a>00085 <span class="comment">// tree.</span>
<a name="l00086"></a>00086 <a class="code" href="a00026.html#aec07a93b351ce398f789007a441a4320" title="The macro BTREE_FRIENDS can be used by outside class to access the B+ tree internals.">BTREE_FRIENDS</a>
<a name="l00087"></a>00087
<a name="l00088"></a>00088 <span class="keyword">private</span>:
<a name="l00089"></a>00089 <span class="comment">// *** The Data_Type</span>
<a name="l00090"></a>00090 <span class="comment"></span>
<a name="l00091"></a>00091 <span class="comment"> /// The empty struct used as a placeholder for the data_type.</span>
<a name="l00092"></a><a class="code" href="a00014.html">00092</a> <span class="comment"></span> <span class="keyword">struct </span><a class="code" href="a00014.html" title="The empty struct used as a placeholder for the data_type.">empty_struct</a>
<a name="l00093"></a>00093 {
<a name="l00094"></a>00094 };
<a name="l00095"></a>00095
<a name="l00096"></a>00096 <span class="keyword">public</span>:
<a name="l00097"></a>00097 <span class="comment">// *** Constructed Types</span>
<a name="l00098"></a>00098 <span class="comment"></span>
<a name="l00099"></a>00099 <span class="comment"> /// The empty data_type</span>
<a name="l00100"></a><a class="code" href="a00006.html#a4797d9899509ebbd391f6478f85fefd9">00100</a> <span class="comment"></span> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="a00014.html" title="The empty struct used as a placeholder for the data_type.">empty_struct</a> <a class="code" href="a00014.html" title="The empty struct used as a placeholder for the data_type.">data_type</a>;
<a name="l00101"></a>00101 <span class="comment"></span>
<a name="l00102"></a>00102 <span class="comment"> /// Construct the set value_type: the key_type.</span>
<a name="l00103"></a><a class="code" href="a00006.html#a5fe61553bb02818305fde84b5342e753">00103</a> <span class="comment"></span> <span class="keyword">typedef</span> <a class="code" href="a00006.html#adaf86bdcdf48a7d4ed87ae020436287e" title="First template parameter: The key type of the btree.">key_type</a> <a class="code" href="a00006.html#a5fe61553bb02818305fde84b5342e753" title="Construct the set value_type: the key_type.">value_type</a>;
<a name="l00104"></a>00104 <span class="comment"></span>
<a name="l00105"></a>00105 <span class="comment"> /// Typedef of our own type</span>
<a name="l00106"></a><a class="code" href="a00006.html#a99552060748673aa8a60e7d663f8f4a4">00106</a> <span class="comment"></span> <span class="keyword">typedef</span> <a class="code" href="a00006.html" title="Specialized B+ tree template class implementing STL&#39;s multiset container.">btree_multiset&lt;key_type, key_compare, traits, allocator_type&gt;</a> <span class="keyword">self</span>;
<a name="l00107"></a>00107 <span class="comment"></span>
<a name="l00108"></a>00108 <span class="comment"> /// Implementation type of the btree_base</span>
<a name="l00109"></a>00109 <span class="comment"></span> <span class="keyword">typedef</span> <a class="code" href="a00001.html" title="Basic class implementing a base B+ tree data structure in memory.">stx::btree</a>&lt;<a class="code" href="a00006.html#adaf86bdcdf48a7d4ed87ae020436287e" title="First template parameter: The key type of the btree.">key_type</a>, <a class="code" href="a00006.html#a4797d9899509ebbd391f6478f85fefd9" title="The empty data_type.">data_type</a>, <a class="code" href="a00006.html#a5fe61553bb02818305fde84b5342e753" title="Construct the set value_type: the key_type.">value_type</a>, <a class="code" href="a00006.html#ab4d81bc53597e88abe6617421837df21" title="Second template parameter: Key comparison function object.">key_compare</a>,
<a name="l00110"></a><a class="code" href="a00006.html#a8dd7ea83ed8beaba51c5578b1283e306">00110</a> <a class="code" href="a00006.html#adf34a1c10a3b0e0c1caa0358b9d4f059" title="Third template parameter: Traits object used to define more parameters of the B+ tree.">traits</a>, <span class="keyword">true</span>, <a class="code" href="a00006.html#a3bd75b696bde37ad47838d8058503799" title="Fourth template parameter: STL allocator.">allocator_type</a>, <span class="keyword">true</span>&gt; <a class="code" href="a00006.html#a8dd7ea83ed8beaba51c5578b1283e306" title="Implementation type of the btree_base.">btree_impl</a>;
<a name="l00111"></a>00111 <span class="comment"></span>
<a name="l00112"></a>00112 <span class="comment"> /// Function class comparing two value_type keys.</span>
<a name="l00113"></a><a class="code" href="a00006.html#a7ef41640ce62bdd8b1857ae6c3ef1c51">00113</a> <span class="comment"></span> <span class="keyword">typedef</span> <span class="keyword">typename</span> btree_impl::value_compare <a class="code" href="a00006.html#a7ef41640ce62bdd8b1857ae6c3ef1c51" title="Function class comparing two value_type keys.">value_compare</a>;
<a name="l00114"></a>00114 <span class="comment"></span>
<a name="l00115"></a>00115 <span class="comment"> /// Size type used to count keys</span>
<a name="l00116"></a><a class="code" href="a00006.html#acb308af84d816e44d6fcaaf075b08a22">00116</a> <span class="comment"></span> <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="a00001.html#aa692f5303dd2c4fee4958cbbfc3db5da" title="Size type used to count keys.">btree_impl::size_type</a> <a class="code" href="a00006.html#acb308af84d816e44d6fcaaf075b08a22" title="Size type used to count keys.">size_type</a>;
<a name="l00117"></a>00117 <span class="comment"></span>
<a name="l00118"></a>00118 <span class="comment"> /// Small structure containing statistics about the tree</span>
<a name="l00119"></a><a class="code" href="a00006.html#a268704f56c398ed05b600262f8c1d558">00119</a> <span class="comment"></span> <span class="keyword">typedef</span> <span class="keyword">typename</span> btree_impl::tree_stats <a class="code" href="a00006.html#a268704f56c398ed05b600262f8c1d558" title="Small structure containing statistics about the tree.">tree_stats</a>;
<a name="l00120"></a>00120
<a name="l00121"></a>00121 <span class="keyword">public</span>:
<a name="l00122"></a>00122 <span class="comment">// *** Static Constant Options and Values of the B+ Tree</span>
<a name="l00123"></a>00123 <span class="comment"></span>
<a name="l00124"></a>00124 <span class="comment"> /// Base B+ tree parameter: The number of key/data slots in each leaf</span>
<a name="l00125"></a><a class="code" href="a00006.html#ad3e346ec9ff913e6b17857f7de7fa6f0">00125</a> <span class="comment"></span> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> <a class="code" href="a00006.html#ad3e346ec9ff913e6b17857f7de7fa6f0" title="Base B+ tree parameter: The number of key/data slots in each leaf.">leafslotmax</a> = <a class="code" href="a00001.html#ac6c274f39fce8e14f6a881fc1da39cf8" title="Base B+ tree parameter: The number of key/data slots in each leaf.">btree_impl::leafslotmax</a>;
<a name="l00126"></a>00126 <span class="comment"></span>
<a name="l00127"></a>00127 <span class="comment"> /// Base B+ tree parameter: The number of key slots in each inner node,</span>
<a name="l00128"></a>00128 <span class="comment"> /// this can differ from slots in each leaf.</span>
<a name="l00129"></a><a class="code" href="a00006.html#a291d8f653427c2dac2870ddd1e93a326">00129</a> <span class="comment"></span> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> <a class="code" href="a00006.html#a291d8f653427c2dac2870ddd1e93a326" title="Base B+ tree parameter: The number of key slots in each inner node, this can differ from slots in eac...">innerslotmax</a> = <a class="code" href="a00001.html#a78ae296638b9d6961f9101ddf45bf3e0" title="Base B+ tree parameter: The number of key slots in each inner node, this can differ from slots in eac...">btree_impl::innerslotmax</a>;
<a name="l00130"></a>00130 <span class="comment"></span>
<a name="l00131"></a>00131 <span class="comment"> /// Computed B+ tree parameter: The minimum number of key slots used in a</span>
<a name="l00132"></a>00132 <span class="comment"> /// leaf. If fewer slots are used, the leaf will be merged or slots shifted</span>
<a name="l00133"></a>00133 <span class="comment"> /// from it&#39;s siblings.</span>
<a name="l00134"></a><a class="code" href="a00006.html#a52ff2314ff166b6aec7ad572d37291cf">00134</a> <span class="comment"></span> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> <a class="code" href="a00006.html#a52ff2314ff166b6aec7ad572d37291cf" title="Computed B+ tree parameter: The minimum number of key slots used in a leaf.">minleafslots</a> = <a class="code" href="a00001.html#ad8525611bf3b079ca4ab13dbab9b23c0" title="Computed B+ tree parameter: The minimum number of key/data slots used in a leaf.">btree_impl::minleafslots</a>;
<a name="l00135"></a>00135 <span class="comment"></span>
<a name="l00136"></a>00136 <span class="comment"> /// Computed B+ tree parameter: The minimum number of key slots used</span>
<a name="l00137"></a>00137 <span class="comment"> /// in an inner node. If fewer slots are used, the inner node will be</span>
<a name="l00138"></a>00138 <span class="comment"> /// merged or slots shifted from it&#39;s siblings.</span>
<a name="l00139"></a><a class="code" href="a00006.html#a568261850e92855ce6dd296e969cf12d">00139</a> <span class="comment"></span> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> <a class="code" href="a00006.html#a568261850e92855ce6dd296e969cf12d" title="Computed B+ tree parameter: The minimum number of key slots used in an inner node.">mininnerslots</a> = <a class="code" href="a00001.html#aefbcc95b60d5bae8dd7ba9c25e5b6654" title="Computed B+ tree parameter: The minimum number of key slots used in an inner node.">btree_impl::mininnerslots</a>;
<a name="l00140"></a>00140 <span class="comment"></span>
<a name="l00141"></a>00141 <span class="comment"> /// Debug parameter: Enables expensive and thorough checking of the B+ tree</span>
<a name="l00142"></a>00142 <span class="comment"> /// invariants after each insert/erase operation.</span>
<a name="l00143"></a><a class="code" href="a00006.html#ad58d175cab81f7f1947cdc54547fbf85">00143</a> <span class="comment"></span> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">bool</span> <a class="code" href="a00006.html#ad58d175cab81f7f1947cdc54547fbf85" title="Debug parameter: Enables expensive and thorough checking of the B+ tree invariants after each insert/...">selfverify</a> = <a class="code" href="a00001.html#a598601fa16cfb97b8b60a4eae6bde5ae" title="Debug parameter: Enables expensive and thorough checking of the B+ tree invariants after each insert/...">btree_impl::selfverify</a>;
<a name="l00144"></a>00144 <span class="comment"></span>
<a name="l00145"></a>00145 <span class="comment"> /// Debug parameter: Prints out lots of debug information about how the</span>
<a name="l00146"></a>00146 <span class="comment"> /// algorithms change the tree. Requires the header file to be compiled</span>
<a name="l00147"></a>00147 <span class="comment"> /// with BTREE_DEBUG and the key type must be std::ostream printable.</span>
<a name="l00148"></a><a class="code" href="a00006.html#a1f660e9d76a8bc2d8afa950dec6f8fda">00148</a> <span class="comment"></span> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">bool</span> <a class="code" href="a00006.html#a1f660e9d76a8bc2d8afa950dec6f8fda" title="Debug parameter: Prints out lots of debug information about how the algorithms change the tree...">debug</a> = <a class="code" href="a00001.html#a224f31a88d50490e14f0f291d70ef2fc" title="Debug parameter: Prints out lots of debug information about how the algorithms change the tree...">btree_impl::debug</a>;
<a name="l00149"></a>00149 <span class="comment"></span>
<a name="l00150"></a>00150 <span class="comment"> /// Operational parameter: Allow duplicate keys in the btree.</span>
<a name="l00151"></a><a class="code" href="a00006.html#a2a11e2ee03e9bb4cb206826de0b135b2">00151</a> <span class="comment"></span> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">bool</span> <a class="code" href="a00006.html#a2a11e2ee03e9bb4cb206826de0b135b2" title="Operational parameter: Allow duplicate keys in the btree.">allow_duplicates</a> = <a class="code" href="a00001.html#acd41575a35d1c5d55e955aafc9762454" title="Sixth template parameter: Allow duplicate keys in the B+ tree.">btree_impl::allow_duplicates</a>;
<a name="l00152"></a>00152
<a name="l00153"></a>00153 <span class="keyword">public</span>:
<a name="l00154"></a>00154 <span class="comment">// *** Iterators and Reverse Iterators</span>
<a name="l00155"></a>00155 <span class="comment"></span>
<a name="l00156"></a>00156 <span class="comment"> /// STL-like iterator object for B+ tree items. The iterator points to a</span>
<a name="l00157"></a>00157 <span class="comment"> /// specific slot number in a leaf.</span>
<a name="l00158"></a><a class="code" href="a00006.html#a0d0c6764234271152a77643d5f160889">00158</a> <span class="comment"></span> <span class="keyword">typedef</span> <span class="keyword">typename</span> btree_impl::iterator <a class="code" href="a00006.html#a0d0c6764234271152a77643d5f160889" title="STL-like iterator object for B+ tree items.">iterator</a>;
<a name="l00159"></a>00159 <span class="comment"></span>
<a name="l00160"></a>00160 <span class="comment"> /// STL-like iterator object for B+ tree items. The iterator points to a</span>
<a name="l00161"></a>00161 <span class="comment"> /// specific slot number in a leaf.</span>
<a name="l00162"></a><a class="code" href="a00006.html#ac3b6e263ec2f54cab4e541b02e2156bf">00162</a> <span class="comment"></span> <span class="keyword">typedef</span> <span class="keyword">typename</span> btree_impl::const_iterator <a class="code" href="a00006.html#ac3b6e263ec2f54cab4e541b02e2156bf" title="STL-like iterator object for B+ tree items.">const_iterator</a>;
<a name="l00163"></a>00163 <span class="comment"></span>
<a name="l00164"></a>00164 <span class="comment"> /// create mutable reverse iterator by using STL magic</span>
<a name="l00165"></a><a class="code" href="a00006.html#aa20cfd7ed6236bc3c51b20d5a77a5286">00165</a> <span class="comment"></span> <span class="keyword">typedef</span> <span class="keyword">typename</span> btree_impl::reverse_iterator <a class="code" href="a00006.html#aa20cfd7ed6236bc3c51b20d5a77a5286" title="create mutable reverse iterator by using STL magic">reverse_iterator</a>;
<a name="l00166"></a>00166 <span class="comment"></span>
<a name="l00167"></a>00167 <span class="comment"> /// create constant reverse iterator by using STL magic</span>
<a name="l00168"></a><a class="code" href="a00006.html#aa137474f07b11232834fc838c96f89b4">00168</a> <span class="comment"></span> <span class="keyword">typedef</span> <span class="keyword">typename</span> btree_impl::const_reverse_iterator <a class="code" href="a00006.html#aa137474f07b11232834fc838c96f89b4" title="create constant reverse iterator by using STL magic">const_reverse_iterator</a>;
<a name="l00169"></a>00169
<a name="l00170"></a>00170 <span class="keyword">private</span>:
<a name="l00171"></a>00171 <span class="comment">// *** Tree Implementation Object</span>
<a name="l00172"></a>00172 <span class="comment"></span>
<a name="l00173"></a>00173 <span class="comment"> /// The contained implementation object</span>
<a name="l00174"></a><a class="code" href="a00006.html#aa78a74c628ee6ef25c5bffce7a9aacb2">00174</a> <span class="comment"></span> <a class="code" href="a00001.html">btree_impl</a> <a class="code" href="a00006.html#aa78a74c628ee6ef25c5bffce7a9aacb2" title="The contained implementation object.">tree</a>;
<a name="l00175"></a>00175
<a name="l00176"></a>00176 <span class="keyword">public</span>:
<a name="l00177"></a>00177 <span class="comment">// *** Constructors and Destructor</span>
<a name="l00178"></a>00178 <span class="comment"></span>
<a name="l00179"></a>00179 <span class="comment"> /// Default constructor initializing an empty B+ tree with the standard key</span>
<a name="l00180"></a>00180 <span class="comment"> /// comparison function</span>
<a name="l00181"></a><a class="code" href="a00006.html#ae51979526a758ca48dff71269509d30d">00181</a> <span class="comment"></span> <span class="keyword">explicit</span> <span class="keyword">inline</span> <a class="code" href="a00006.html#ae51979526a758ca48dff71269509d30d" title="Default constructor initializing an empty B+ tree with the standard key comparison function...">btree_multiset</a>(<span class="keyword">const</span> <a class="code" href="a00006.html#a3bd75b696bde37ad47838d8058503799" title="Fourth template parameter: STL allocator.">allocator_type</a> &amp;alloc = <a class="code" href="a00006.html#a3bd75b696bde37ad47838d8058503799" title="Fourth template parameter: STL allocator.">allocator_type</a>())
<a name="l00182"></a>00182 : <a class="code" href="a00006.html#aa78a74c628ee6ef25c5bffce7a9aacb2" title="The contained implementation object.">tree</a>(alloc)
<a name="l00183"></a>00183 {
<a name="l00184"></a>00184 }
<a name="l00185"></a>00185 <span class="comment"></span>
<a name="l00186"></a>00186 <span class="comment"> /// Constructor initializing an empty B+ tree with a special key</span>
<a name="l00187"></a>00187 <span class="comment"> /// comparison object</span>
<a name="l00188"></a><a class="code" href="a00006.html#a4411a079d52cdac10490c9f44827ed63">00188</a> <span class="comment"></span> <span class="keyword">explicit</span> <span class="keyword">inline</span> <a class="code" href="a00006.html#ae51979526a758ca48dff71269509d30d" title="Default constructor initializing an empty B+ tree with the standard key comparison function...">btree_multiset</a>(<span class="keyword">const</span> <a class="code" href="a00006.html#ab4d81bc53597e88abe6617421837df21" title="Second template parameter: Key comparison function object.">key_compare</a> &amp;kcf,
<a name="l00189"></a>00189 <span class="keyword">const</span> <a class="code" href="a00006.html#a3bd75b696bde37ad47838d8058503799" title="Fourth template parameter: STL allocator.">allocator_type</a> &amp;alloc = <a class="code" href="a00006.html#a3bd75b696bde37ad47838d8058503799" title="Fourth template parameter: STL allocator.">allocator_type</a>())
<a name="l00190"></a>00190 : <a class="code" href="a00006.html#aa78a74c628ee6ef25c5bffce7a9aacb2" title="The contained implementation object.">tree</a>(kcf, alloc)
<a name="l00191"></a>00191 {
<a name="l00192"></a>00192 }
<a name="l00193"></a>00193 <span class="comment"></span>
<a name="l00194"></a>00194 <span class="comment"> /// Constructor initializing a B+ tree with the range [first,last)</span>
<a name="l00195"></a>00195 <span class="comment"></span> <span class="keyword">template</span> &lt;<span class="keyword">class</span> InputIterator&gt;
<a name="l00196"></a><a class="code" href="a00006.html#a6dcabc7e14031cfe33c2e476b1c42e0b">00196</a> <span class="keyword">inline</span> <a class="code" href="a00006.html#ae51979526a758ca48dff71269509d30d" title="Default constructor initializing an empty B+ tree with the standard key comparison function...">btree_multiset</a>(InputIterator first, InputIterator last,
<a name="l00197"></a>00197 <span class="keyword">const</span> <a class="code" href="a00006.html#a3bd75b696bde37ad47838d8058503799" title="Fourth template parameter: STL allocator.">allocator_type</a> &amp;alloc = <a class="code" href="a00006.html#a3bd75b696bde37ad47838d8058503799" title="Fourth template parameter: STL allocator.">allocator_type</a>())
<a name="l00198"></a>00198 : <a class="code" href="a00006.html#aa78a74c628ee6ef25c5bffce7a9aacb2" title="The contained implementation object.">tree</a>(alloc)
<a name="l00199"></a>00199 {
<a name="l00200"></a>00200 <a class="code" href="a00006.html#ad35b00f9ff7f148dbb5cfee7ac8102af" title="Attempt to insert a key into the B+ tree.">insert</a>(first, last);
<a name="l00201"></a>00201 }
<a name="l00202"></a>00202 <span class="comment"></span>
<a name="l00203"></a>00203 <span class="comment"> /// Constructor initializing a B+ tree with the range [first,last) and a</span>
<a name="l00204"></a>00204 <span class="comment"> /// special key comparison object</span>
<a name="l00205"></a>00205 <span class="comment"></span> <span class="keyword">template</span> &lt;<span class="keyword">class</span> InputIterator&gt;
<a name="l00206"></a><a class="code" href="a00006.html#a850ad8cd4782cf8dd11ef9ec7660dbf1">00206</a> <span class="keyword">inline</span> <a class="code" href="a00006.html#ae51979526a758ca48dff71269509d30d" title="Default constructor initializing an empty B+ tree with the standard key comparison function...">btree_multiset</a>(InputIterator first, InputIterator last, <span class="keyword">const</span> <a class="code" href="a00006.html#ab4d81bc53597e88abe6617421837df21" title="Second template parameter: Key comparison function object.">key_compare</a> &amp;kcf,
<a name="l00207"></a>00207 <span class="keyword">const</span> <a class="code" href="a00006.html#a3bd75b696bde37ad47838d8058503799" title="Fourth template parameter: STL allocator.">allocator_type</a> &amp;alloc = <a class="code" href="a00006.html#a3bd75b696bde37ad47838d8058503799" title="Fourth template parameter: STL allocator.">allocator_type</a>())
<a name="l00208"></a>00208 : <a class="code" href="a00006.html#aa78a74c628ee6ef25c5bffce7a9aacb2" title="The contained implementation object.">tree</a>(kcf, alloc)
<a name="l00209"></a>00209 {
<a name="l00210"></a>00210 <a class="code" href="a00006.html#ad35b00f9ff7f148dbb5cfee7ac8102af" title="Attempt to insert a key into the B+ tree.">insert</a>(first, last);
<a name="l00211"></a>00211 }
<a name="l00212"></a>00212 <span class="comment"></span>
<a name="l00213"></a>00213 <span class="comment"> /// Frees up all used B+ tree memory pages</span>
<a name="l00214"></a><a class="code" href="a00006.html#aec3bb61dacff05a504ae53889d8e3bf3">00214</a> <span class="comment"></span> <span class="keyword">inline</span> <a class="code" href="a00006.html#aec3bb61dacff05a504ae53889d8e3bf3" title="Frees up all used B+ tree memory pages.">~btree_multiset</a>()
<a name="l00215"></a>00215 {
<a name="l00216"></a>00216 }
<a name="l00217"></a>00217 <span class="comment"></span>
<a name="l00218"></a>00218 <span class="comment"> /// Fast swapping of two identical B+ tree objects.</span>
<a name="l00219"></a><a class="code" href="a00006.html#aad820bbc85b7beaaca43fbdb1b610b56">00219</a> <span class="comment"></span> <span class="keywordtype">void</span> <a class="code" href="a00006.html#aad820bbc85b7beaaca43fbdb1b610b56" title="Fast swapping of two identical B+ tree objects.">swap</a>(<span class="keyword">self</span>&amp; from)
<a name="l00220"></a>00220 {
<a name="l00221"></a>00221 <a class="code" href="a00006.html#aad820bbc85b7beaaca43fbdb1b610b56" title="Fast swapping of two identical B+ tree objects.">std::swap</a>(<a class="code" href="a00006.html#aa78a74c628ee6ef25c5bffce7a9aacb2" title="The contained implementation object.">tree</a>, from.tree);
<a name="l00222"></a>00222 }
<a name="l00223"></a>00223
<a name="l00224"></a>00224 <span class="keyword">public</span>:
<a name="l00225"></a>00225 <span class="comment">// *** Key and Value Comparison Function Objects</span>
<a name="l00226"></a>00226 <span class="comment"></span>
<a name="l00227"></a>00227 <span class="comment"> /// Constant access to the key comparison object sorting the B+ tree</span>
<a name="l00228"></a><a class="code" href="a00006.html#a3ecbf097192ab41b7a29db4349ce2d3e">00228</a> <span class="comment"></span> <span class="keyword">inline</span> <a class="code" href="a00006.html#ab4d81bc53597e88abe6617421837df21" title="Second template parameter: Key comparison function object.">key_compare</a> <a class="code" href="a00006.html#a3ecbf097192ab41b7a29db4349ce2d3e" title="Constant access to the key comparison object sorting the B+ tree.">key_comp</a>()<span class="keyword"> const</span>
<a name="l00229"></a>00229 <span class="keyword"> </span>{
<a name="l00230"></a>00230 <span class="keywordflow">return</span> <a class="code" href="a00006.html#aa78a74c628ee6ef25c5bffce7a9aacb2" title="The contained implementation object.">tree</a>.<a class="code" href="a00001.html#a6200a8a00989f77f053e1200da7f816b" title="Constant access to the key comparison object sorting the B+ tree.">key_comp</a>();
<a name="l00231"></a>00231 }
<a name="l00232"></a>00232 <span class="comment"></span>
<a name="l00233"></a>00233 <span class="comment"> /// Constant access to a constructed value_type comparison object. Required</span>
<a name="l00234"></a>00234 <span class="comment"> /// by the STL</span>
<a name="l00235"></a><a class="code" href="a00006.html#a84f47ce04fb5330cb2d766a105b278a2">00235</a> <span class="comment"></span> <span class="keyword">inline</span> <a class="code" href="a00006.html#a7ef41640ce62bdd8b1857ae6c3ef1c51" title="Function class comparing two value_type keys.">value_compare</a> <a class="code" href="a00006.html#a84f47ce04fb5330cb2d766a105b278a2" title="Constant access to a constructed value_type comparison object.">value_comp</a>()<span class="keyword"> const</span>
<a name="l00236"></a>00236 <span class="keyword"> </span>{
<a name="l00237"></a>00237 <span class="keywordflow">return</span> <a class="code" href="a00006.html#aa78a74c628ee6ef25c5bffce7a9aacb2" title="The contained implementation object.">tree</a>.<a class="code" href="a00001.html#a35152f783bc65c97504cd22d1812f673" title="Constant access to a constructed value_type comparison object.">value_comp</a>();
<a name="l00238"></a>00238 }
<a name="l00239"></a>00239
<a name="l00240"></a>00240 <span class="keyword">public</span>:
<a name="l00241"></a>00241 <span class="comment">// *** Allocators</span>
<a name="l00242"></a>00242 <span class="comment"></span>
<a name="l00243"></a>00243 <span class="comment"> /// Return the base node allocator provided during construction.</span>
<a name="l00244"></a><a class="code" href="a00006.html#ac2fc089101a5d6fdf86ee2d09b9eacce">00244</a> <span class="comment"></span> <a class="code" href="a00006.html#a3bd75b696bde37ad47838d8058503799" title="Fourth template parameter: STL allocator.">allocator_type</a> <a class="code" href="a00006.html#ac2fc089101a5d6fdf86ee2d09b9eacce" title="Return the base node allocator provided during construction.">get_allocator</a>()<span class="keyword"> const</span>
<a name="l00245"></a>00245 <span class="keyword"> </span>{
<a name="l00246"></a>00246 <span class="keywordflow">return</span> <a class="code" href="a00006.html#aa78a74c628ee6ef25c5bffce7a9aacb2" title="The contained implementation object.">tree</a>.<a class="code" href="a00001.html#ad7b097e1a4301e319d8a7e6f6bb661fd" title="Return the base node allocator provided during construction.">get_allocator</a>();
<a name="l00247"></a>00247 }
<a name="l00248"></a>00248
<a name="l00249"></a>00249 <span class="keyword">public</span>:
<a name="l00250"></a>00250 <span class="comment">// *** Fast Destruction of the B+ Tree</span>
<a name="l00251"></a>00251 <span class="comment"></span>
<a name="l00252"></a>00252 <span class="comment"> /// Frees all keys and all nodes of the tree</span>
<a name="l00253"></a><a class="code" href="a00006.html#a77cc7f5486c5add7feb4c9e601c4d921">00253</a> <span class="comment"></span> <span class="keywordtype">void</span> <a class="code" href="a00006.html#a77cc7f5486c5add7feb4c9e601c4d921" title="Frees all keys and all nodes of the tree.">clear</a>()
<a name="l00254"></a>00254 {
<a name="l00255"></a>00255 <a class="code" href="a00006.html#aa78a74c628ee6ef25c5bffce7a9aacb2" title="The contained implementation object.">tree</a>.<a class="code" href="a00001.html#aa2acf975007740100b9803fcea573036" title="Frees all key/data pairs and all nodes of the tree.">clear</a>();
<a name="l00256"></a>00256 }
<a name="l00257"></a>00257
<a name="l00258"></a>00258 <span class="keyword">public</span>:
<a name="l00259"></a>00259 <span class="comment">// *** STL Iterator Construction Functions</span>
<a name="l00260"></a>00260 <span class="comment"></span>
<a name="l00261"></a>00261 <span class="comment"> /// Constructs a read/data-write iterator that points to the first slot in</span>
<a name="l00262"></a>00262 <span class="comment"> /// the first leaf of the B+ tree.</span>
<a name="l00263"></a><a class="code" href="a00006.html#a0c8b01c05f01540fe8e7c87f7e798557">00263</a> <span class="comment"></span> <span class="keyword">inline</span> <a class="code" href="a00006.html#a0d0c6764234271152a77643d5f160889" title="STL-like iterator object for B+ tree items.">iterator</a> <a class="code" href="a00006.html#a0c8b01c05f01540fe8e7c87f7e798557" title="Constructs a read/data-write iterator that points to the first slot in the first leaf of the B+ tree...">begin</a>()
<a name="l00264"></a>00264 {
<a name="l00265"></a>00265 <span class="keywordflow">return</span> <a class="code" href="a00006.html#aa78a74c628ee6ef25c5bffce7a9aacb2" title="The contained implementation object.">tree</a>.<a class="code" href="a00001.html#a564a6ea78bcc0de0bbc1fdff65f547fd" title="Constructs a read/data-write iterator that points to the first slot in the first leaf of the B+ tree...">begin</a>();
<a name="l00266"></a>00266 }
<a name="l00267"></a>00267 <span class="comment"></span>
<a name="l00268"></a>00268 <span class="comment"> /// Constructs a read/data-write iterator that points to the first invalid</span>
<a name="l00269"></a>00269 <span class="comment"> /// slot in the last leaf of the B+ tree.</span>
<a name="l00270"></a><a class="code" href="a00006.html#a3b3fdd20ed1c32051e6e8e9762789178">00270</a> <span class="comment"></span> <span class="keyword">inline</span> <a class="code" href="a00006.html#a0d0c6764234271152a77643d5f160889" title="STL-like iterator object for B+ tree items.">iterator</a> <a class="code" href="a00006.html#a3b3fdd20ed1c32051e6e8e9762789178" title="Constructs a read/data-write iterator that points to the first invalid slot in the last leaf of the B...">end</a>()
<a name="l00271"></a>00271 {
<a name="l00272"></a>00272 <span class="keywordflow">return</span> <a class="code" href="a00006.html#aa78a74c628ee6ef25c5bffce7a9aacb2" title="The contained implementation object.">tree</a>.<a class="code" href="a00001.html#a8f1fbaf7eabefca66188e2bf6996573d" title="Constructs a read/data-write iterator that points to the first invalid slot in the last leaf of the B...">end</a>();
<a name="l00273"></a>00273 }
<a name="l00274"></a>00274 <span class="comment"></span>
<a name="l00275"></a>00275 <span class="comment"> /// Constructs a read-only constant iterator that points to the first slot</span>
<a name="l00276"></a>00276 <span class="comment"> /// in the first leaf of the B+ tree.</span>
<a name="l00277"></a><a class="code" href="a00006.html#acca702924e73cc5df9f8e27f59259f7c">00277</a> <span class="comment"></span> <span class="keyword">inline</span> <a class="code" href="a00006.html#ac3b6e263ec2f54cab4e541b02e2156bf" title="STL-like iterator object for B+ tree items.">const_iterator</a> <a class="code" href="a00006.html#a0c8b01c05f01540fe8e7c87f7e798557" title="Constructs a read/data-write iterator that points to the first slot in the first leaf of the B+ tree...">begin</a>()<span class="keyword"> const</span>
<a name="l00278"></a>00278 <span class="keyword"> </span>{
<a name="l00279"></a>00279 <span class="keywordflow">return</span> <a class="code" href="a00006.html#aa78a74c628ee6ef25c5bffce7a9aacb2" title="The contained implementation object.">tree</a>.<a class="code" href="a00001.html#a564a6ea78bcc0de0bbc1fdff65f547fd" title="Constructs a read/data-write iterator that points to the first slot in the first leaf of the B+ tree...">begin</a>();
<a name="l00280"></a>00280 }
<a name="l00281"></a>00281 <span class="comment"></span>
<a name="l00282"></a>00282 <span class="comment"> /// Constructs a read-only constant iterator that points to the first</span>
<a name="l00283"></a>00283 <span class="comment"> /// invalid slot in the last leaf of the B+ tree.</span>
<a name="l00284"></a><a class="code" href="a00006.html#a8fa9d5230ddb6f9306b2e941c1448ece">00284</a> <span class="comment"></span> <span class="keyword">inline</span> <a class="code" href="a00006.html#ac3b6e263ec2f54cab4e541b02e2156bf" title="STL-like iterator object for B+ tree items.">const_iterator</a> <a class="code" href="a00006.html#a3b3fdd20ed1c32051e6e8e9762789178" title="Constructs a read/data-write iterator that points to the first invalid slot in the last leaf of the B...">end</a>()<span class="keyword"> const</span>
<a name="l00285"></a>00285 <span class="keyword"> </span>{
<a name="l00286"></a>00286 <span class="keywordflow">return</span> <a class="code" href="a00006.html#aa78a74c628ee6ef25c5bffce7a9aacb2" title="The contained implementation object.">tree</a>.<a class="code" href="a00001.html#a8f1fbaf7eabefca66188e2bf6996573d" title="Constructs a read/data-write iterator that points to the first invalid slot in the last leaf of the B...">end</a>();
<a name="l00287"></a>00287 }
<a name="l00288"></a>00288 <span class="comment"></span>
<a name="l00289"></a>00289 <span class="comment"> /// Constructs a read/data-write reverse iterator that points to the first</span>
<a name="l00290"></a>00290 <span class="comment"> /// invalid slot in the last leaf of the B+ tree. Uses STL magic.</span>
<a name="l00291"></a><a class="code" href="a00006.html#ad5ff92256da155cf0a800c0be6d37f10">00291</a> <span class="comment"></span> <span class="keyword">inline</span> <a class="code" href="a00006.html#aa20cfd7ed6236bc3c51b20d5a77a5286" title="create mutable reverse iterator by using STL magic">reverse_iterator</a> <a class="code" href="a00006.html#ad5ff92256da155cf0a800c0be6d37f10" title="Constructs a read/data-write reverse iterator that points to the first invalid slot in the last leaf ...">rbegin</a>()
<a name="l00292"></a>00292 {
<a name="l00293"></a>00293 <span class="keywordflow">return</span> <a class="code" href="a00006.html#aa78a74c628ee6ef25c5bffce7a9aacb2" title="The contained implementation object.">tree</a>.<a class="code" href="a00001.html#a4e2f4ba4141820f4bc5782298c261aa5" title="Constructs a read/data-write reverse iterator that points to the first invalid slot in the last leaf ...">rbegin</a>();
<a name="l00294"></a>00294 }
<a name="l00295"></a>00295 <span class="comment"></span>
<a name="l00296"></a>00296 <span class="comment"> /// Constructs a read/data-write reverse iterator that points to the first</span>
<a name="l00297"></a>00297 <span class="comment"> /// slot in the first leaf of the B+ tree. Uses STL magic.</span>
<a name="l00298"></a><a class="code" href="a00006.html#accb388873e7a00b1779a27487e4c0200">00298</a> <span class="comment"></span> <span class="keyword">inline</span> <a class="code" href="a00006.html#aa20cfd7ed6236bc3c51b20d5a77a5286" title="create mutable reverse iterator by using STL magic">reverse_iterator</a> <a class="code" href="a00006.html#accb388873e7a00b1779a27487e4c0200" title="Constructs a read/data-write reverse iterator that points to the first slot in the first leaf of the ...">rend</a>()
<a name="l00299"></a>00299 {
<a name="l00300"></a>00300 <span class="keywordflow">return</span> <a class="code" href="a00006.html#aa78a74c628ee6ef25c5bffce7a9aacb2" title="The contained implementation object.">tree</a>.<a class="code" href="a00001.html#a625d6f5e37cfed631a403fe36fa818dc" title="Constructs a read/data-write reverse iterator that points to the first slot in the first leaf of the ...">rend</a>();
<a name="l00301"></a>00301 }
<a name="l00302"></a>00302 <span class="comment"></span>
<a name="l00303"></a>00303 <span class="comment"> /// Constructs a read-only reverse iterator that points to the first</span>
<a name="l00304"></a>00304 <span class="comment"> /// invalid slot in the last leaf of the B+ tree. Uses STL magic.</span>
<a name="l00305"></a><a class="code" href="a00006.html#aab7bf40d95f5e2e3a6f48ff132e5aa5c">00305</a> <span class="comment"></span> <span class="keyword">inline</span> <a class="code" href="a00006.html#aa137474f07b11232834fc838c96f89b4" title="create constant reverse iterator by using STL magic">const_reverse_iterator</a> <a class="code" href="a00006.html#ad5ff92256da155cf0a800c0be6d37f10" title="Constructs a read/data-write reverse iterator that points to the first invalid slot in the last leaf ...">rbegin</a>()<span class="keyword"> const</span>
<a name="l00306"></a>00306 <span class="keyword"> </span>{
<a name="l00307"></a>00307 <span class="keywordflow">return</span> <a class="code" href="a00006.html#aa78a74c628ee6ef25c5bffce7a9aacb2" title="The contained implementation object.">tree</a>.<a class="code" href="a00001.html#a4e2f4ba4141820f4bc5782298c261aa5" title="Constructs a read/data-write reverse iterator that points to the first invalid slot in the last leaf ...">rbegin</a>();
<a name="l00308"></a>00308 }
<a name="l00309"></a>00309 <span class="comment"></span>
<a name="l00310"></a>00310 <span class="comment"> /// Constructs a read-only reverse iterator that points to the first slot</span>
<a name="l00311"></a>00311 <span class="comment"> /// in the first leaf of the B+ tree. Uses STL magic.</span>
<a name="l00312"></a><a class="code" href="a00006.html#a01090ac817bc6525160dbee3b2943ad1">00312</a> <span class="comment"></span> <span class="keyword">inline</span> <a class="code" href="a00006.html#aa137474f07b11232834fc838c96f89b4" title="create constant reverse iterator by using STL magic">const_reverse_iterator</a> <a class="code" href="a00006.html#accb388873e7a00b1779a27487e4c0200" title="Constructs a read/data-write reverse iterator that points to the first slot in the first leaf of the ...">rend</a>()<span class="keyword"> const</span>
<a name="l00313"></a>00313 <span class="keyword"> </span>{
<a name="l00314"></a>00314 <span class="keywordflow">return</span> <a class="code" href="a00006.html#aa78a74c628ee6ef25c5bffce7a9aacb2" title="The contained implementation object.">tree</a>.<a class="code" href="a00001.html#a625d6f5e37cfed631a403fe36fa818dc" title="Constructs a read/data-write reverse iterator that points to the first slot in the first leaf of the ...">rend</a>();
<a name="l00315"></a>00315 }
<a name="l00316"></a>00316
<a name="l00317"></a>00317 <span class="keyword">public</span>:
<a name="l00318"></a>00318 <span class="comment">// *** Access Functions to the Item Count</span>
<a name="l00319"></a>00319 <span class="comment"></span>
<a name="l00320"></a>00320 <span class="comment"> /// Return the number of keys in the B+ tree</span>
<a name="l00321"></a><a class="code" href="a00006.html#a9be405a164ded347358ce38599d768bd">00321</a> <span class="comment"></span> <span class="keyword">inline</span> <a class="code" href="a00006.html#acb308af84d816e44d6fcaaf075b08a22" title="Size type used to count keys.">size_type</a> <a class="code" href="a00006.html#a9be405a164ded347358ce38599d768bd" title="Return the number of keys in the B+ tree.">size</a>()<span class="keyword"> const</span>
<a name="l00322"></a>00322 <span class="keyword"> </span>{
<a name="l00323"></a>00323 <span class="keywordflow">return</span> <a class="code" href="a00006.html#aa78a74c628ee6ef25c5bffce7a9aacb2" title="The contained implementation object.">tree</a>.<a class="code" href="a00001.html#a3942d7144bc93cf094b62f03e6113f4e" title="Return the number of key/data pairs in the B+ tree.">size</a>();
<a name="l00324"></a>00324 }
<a name="l00325"></a>00325 <span class="comment"></span>
<a name="l00326"></a>00326 <span class="comment"> /// Returns true if there is at least one key in the B+ tree</span>
<a name="l00327"></a><a class="code" href="a00006.html#a1943f3a2270fd9a13deb4d98855eb4bc">00327</a> <span class="comment"></span> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="a00006.html#a1943f3a2270fd9a13deb4d98855eb4bc" title="Returns true if there is at least one key in the B+ tree.">empty</a>()<span class="keyword"> const</span>
<a name="l00328"></a>00328 <span class="keyword"> </span>{
<a name="l00329"></a>00329 <span class="keywordflow">return</span> <a class="code" href="a00006.html#aa78a74c628ee6ef25c5bffce7a9aacb2" title="The contained implementation object.">tree</a>.<a class="code" href="a00001.html#ad7cf0c4833d2ea3fcd79df4c884bab40" title="Returns true if there is at least one key/data pair in the B+ tree.">empty</a>();
<a name="l00330"></a>00330 }
<a name="l00331"></a>00331 <span class="comment"></span>
<a name="l00332"></a>00332 <span class="comment"> /// Returns the largest possible size of the B+ Tree. This is just a</span>
<a name="l00333"></a>00333 <span class="comment"> /// function required by the STL standard, the B+ Tree can hold more items.</span>
<a name="l00334"></a><a class="code" href="a00006.html#a2b0012b20d4bc04d78d1297d78550d8a">00334</a> <span class="comment"></span> <span class="keyword">inline</span> <a class="code" href="a00006.html#acb308af84d816e44d6fcaaf075b08a22" title="Size type used to count keys.">size_type</a> <a class="code" href="a00006.html#a2b0012b20d4bc04d78d1297d78550d8a" title="Returns the largest possible size of the B+ Tree.">max_size</a>()<span class="keyword"> const</span>
<a name="l00335"></a>00335 <span class="keyword"> </span>{
<a name="l00336"></a>00336 <span class="keywordflow">return</span> <a class="code" href="a00006.html#aa78a74c628ee6ef25c5bffce7a9aacb2" title="The contained implementation object.">tree</a>.<a class="code" href="a00001.html#a3285e41cd6c4566e99d8c82803ad4d92" title="Returns the largest possible size of the B+ Tree.">max_size</a>();
<a name="l00337"></a>00337 }
<a name="l00338"></a>00338 <span class="comment"></span>
<a name="l00339"></a>00339 <span class="comment"> /// Return a const reference to the current statistics.</span>
<a name="l00340"></a><a class="code" href="a00006.html#a926c5bb8fbf409b1371c1ca211ba2bde">00340</a> <span class="comment"></span> <span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="a00006.html#a268704f56c398ed05b600262f8c1d558" title="Small structure containing statistics about the tree.">tree_stats</a>&amp; <a class="code" href="a00006.html#a926c5bb8fbf409b1371c1ca211ba2bde" title="Return a const reference to the current statistics.">get_stats</a>()<span class="keyword"> const</span>
<a name="l00341"></a>00341 <span class="keyword"> </span>{
<a name="l00342"></a>00342 <span class="keywordflow">return</span> <a class="code" href="a00006.html#aa78a74c628ee6ef25c5bffce7a9aacb2" title="The contained implementation object.">tree</a>.<a class="code" href="a00001.html#a81c7f4e56b3421976855daf40c6e20fc" title="Return a const reference to the current statistics.">get_stats</a>();
<a name="l00343"></a>00343 }
<a name="l00344"></a>00344
<a name="l00345"></a>00345 <span class="keyword">public</span>:
<a name="l00346"></a>00346 <span class="comment">// *** Standard Access Functions Querying the Tree by Descending to a Leaf</span>
<a name="l00347"></a>00347 <span class="comment"></span>
<a name="l00348"></a>00348 <span class="comment"> /// Non-STL function checking whether a key is in the B+ tree. The same as</span>
<a name="l00349"></a>00349 <span class="comment"> /// (find(k) != end()) or (count() != 0).</span>
<a name="l00350"></a><a class="code" href="a00006.html#a1438934e738862154bbcfa1314b485bb">00350</a> <span class="comment"></span> <span class="keywordtype">bool</span> <a class="code" href="a00006.html#a1438934e738862154bbcfa1314b485bb" title="Non-STL function checking whether a key is in the B+ tree.">exists</a>(<span class="keyword">const</span> <a class="code" href="a00006.html#adaf86bdcdf48a7d4ed87ae020436287e" title="First template parameter: The key type of the btree.">key_type</a> &amp;key)<span class="keyword"> const</span>
<a name="l00351"></a>00351 <span class="keyword"> </span>{
<a name="l00352"></a>00352 <span class="keywordflow">return</span> <a class="code" href="a00006.html#aa78a74c628ee6ef25c5bffce7a9aacb2" title="The contained implementation object.">tree</a>.<a class="code" href="a00001.html#a3c1b922d80faa7d5864237b4791a7961" title="Non-STL function checking whether a key is in the B+ tree.">exists</a>(key);
<a name="l00353"></a>00353 }
<a name="l00354"></a>00354 <span class="comment"></span>
<a name="l00355"></a>00355 <span class="comment"> /// Tries to locate a key in the B+ tree and returns an iterator to the</span>
<a name="l00356"></a>00356 <span class="comment"> /// key slot if found. If unsuccessful it returns end().</span>
<a name="l00357"></a><a class="code" href="a00006.html#a130a3b87e39b1d9ff8be6df80b942737">00357</a> <span class="comment"></span> <a class="code" href="a00006.html#a0d0c6764234271152a77643d5f160889" title="STL-like iterator object for B+ tree items.">iterator</a> <a class="code" href="a00006.html#a130a3b87e39b1d9ff8be6df80b942737" title="Tries to locate a key in the B+ tree and returns an iterator to the key slot if found.">find</a>(<span class="keyword">const</span> <a class="code" href="a00006.html#adaf86bdcdf48a7d4ed87ae020436287e" title="First template parameter: The key type of the btree.">key_type</a> &amp;key)
<a name="l00358"></a>00358 {
<a name="l00359"></a>00359 <span class="keywordflow">return</span> <a class="code" href="a00006.html#aa78a74c628ee6ef25c5bffce7a9aacb2" title="The contained implementation object.">tree</a>.<a class="code" href="a00001.html#a90bd85f703bb74d7ab7dc967bf8d712f" title="Tries to locate a key in the B+ tree and returns an iterator to the key/data slot if found...">find</a>(key);
<a name="l00360"></a>00360 }
<a name="l00361"></a>00361 <span class="comment"></span>
<a name="l00362"></a>00362 <span class="comment"> /// Tries to locate a key in the B+ tree and returns an constant iterator</span>
<a name="l00363"></a>00363 <span class="comment"> /// to the key slot if found. If unsuccessful it returns end().</span>
<a name="l00364"></a><a class="code" href="a00006.html#ac3bf82364b3392aa056b866a012ac0d8">00364</a> <span class="comment"></span> <a class="code" href="a00006.html#ac3b6e263ec2f54cab4e541b02e2156bf" title="STL-like iterator object for B+ tree items.">const_iterator</a> <a class="code" href="a00006.html#a130a3b87e39b1d9ff8be6df80b942737" title="Tries to locate a key in the B+ tree and returns an iterator to the key slot if found.">find</a>(<span class="keyword">const</span> <a class="code" href="a00006.html#adaf86bdcdf48a7d4ed87ae020436287e" title="First template parameter: The key type of the btree.">key_type</a> &amp;key)<span class="keyword"> const</span>
<a name="l00365"></a>00365 <span class="keyword"> </span>{
<a name="l00366"></a>00366 <span class="keywordflow">return</span> <a class="code" href="a00006.html#aa78a74c628ee6ef25c5bffce7a9aacb2" title="The contained implementation object.">tree</a>.<a class="code" href="a00001.html#a90bd85f703bb74d7ab7dc967bf8d712f" title="Tries to locate a key in the B+ tree and returns an iterator to the key/data slot if found...">find</a>(key);
<a name="l00367"></a>00367 }
<a name="l00368"></a>00368 <span class="comment"></span>
<a name="l00369"></a>00369 <span class="comment"> /// Tries to locate a key in the B+ tree and returns the number of</span>
<a name="l00370"></a>00370 <span class="comment"> /// identical key entries found.</span>
<a name="l00371"></a><a class="code" href="a00006.html#ab2ae64a7de25306d48798d502de46b6c">00371</a> <span class="comment"></span> <a class="code" href="a00006.html#acb308af84d816e44d6fcaaf075b08a22" title="Size type used to count keys.">size_type</a> <a class="code" href="a00006.html#ab2ae64a7de25306d48798d502de46b6c" title="Tries to locate a key in the B+ tree and returns the number of identical key entries found...">count</a>(<span class="keyword">const</span> <a class="code" href="a00006.html#adaf86bdcdf48a7d4ed87ae020436287e" title="First template parameter: The key type of the btree.">key_type</a> &amp;key)<span class="keyword"> const</span>
<a name="l00372"></a>00372 <span class="keyword"> </span>{
<a name="l00373"></a>00373 <span class="keywordflow">return</span> <a class="code" href="a00006.html#aa78a74c628ee6ef25c5bffce7a9aacb2" title="The contained implementation object.">tree</a>.<a class="code" href="a00001.html#a3882a2b0e2ea8eb43b4261e7f3eb32f2" title="Tries to locate a key in the B+ tree and returns the number of identical key entries found...">count</a>(key);
<a name="l00374"></a>00374 }
<a name="l00375"></a>00375 <span class="comment"></span>
<a name="l00376"></a>00376 <span class="comment"> /// Searches the B+ tree and returns an iterator to the first pair</span>
<a name="l00377"></a>00377 <span class="comment"> /// equal to or greater than key, or end() if all keys are smaller.</span>
<a name="l00378"></a><a class="code" href="a00006.html#acf1949d71f9c83184c98d084d66c56a4">00378</a> <span class="comment"></span> <a class="code" href="a00006.html#a0d0c6764234271152a77643d5f160889" title="STL-like iterator object for B+ tree items.">iterator</a> <a class="code" href="a00006.html#acf1949d71f9c83184c98d084d66c56a4" title="Searches the B+ tree and returns an iterator to the first pair equal to or greater than key...">lower_bound</a>(<span class="keyword">const</span> <a class="code" href="a00006.html#adaf86bdcdf48a7d4ed87ae020436287e" title="First template parameter: The key type of the btree.">key_type</a>&amp; key)
<a name="l00379"></a>00379 {
<a name="l00380"></a>00380 <span class="keywordflow">return</span> <a class="code" href="a00006.html#aa78a74c628ee6ef25c5bffce7a9aacb2" title="The contained implementation object.">tree</a>.<a class="code" href="a00001.html#aa0b7c53085ef7106f3d430d850b4959e" title="Searches the B+ tree and returns an iterator to the first pair equal to or greater than key...">lower_bound</a>(key);
<a name="l00381"></a>00381 }
<a name="l00382"></a>00382 <span class="comment"></span>
<a name="l00383"></a>00383 <span class="comment"> /// Searches the B+ tree and returns a constant iterator to the</span>
<a name="l00384"></a>00384 <span class="comment"> /// first pair equal to or greater than key, or end() if all keys</span>
<a name="l00385"></a>00385 <span class="comment"> /// are smaller.</span>
<a name="l00386"></a><a class="code" href="a00006.html#afb5c018e2dd2c9f53a148ddf0781921d">00386</a> <span class="comment"></span> <a class="code" href="a00006.html#ac3b6e263ec2f54cab4e541b02e2156bf" title="STL-like iterator object for B+ tree items.">const_iterator</a> <a class="code" href="a00006.html#acf1949d71f9c83184c98d084d66c56a4" title="Searches the B+ tree and returns an iterator to the first pair equal to or greater than key...">lower_bound</a>(<span class="keyword">const</span> <a class="code" href="a00006.html#adaf86bdcdf48a7d4ed87ae020436287e" title="First template parameter: The key type of the btree.">key_type</a>&amp; key)<span class="keyword"> const</span>
<a name="l00387"></a>00387 <span class="keyword"> </span>{
<a name="l00388"></a>00388 <span class="keywordflow">return</span> <a class="code" href="a00006.html#aa78a74c628ee6ef25c5bffce7a9aacb2" title="The contained implementation object.">tree</a>.<a class="code" href="a00001.html#aa0b7c53085ef7106f3d430d850b4959e" title="Searches the B+ tree and returns an iterator to the first pair equal to or greater than key...">lower_bound</a>(key);
<a name="l00389"></a>00389 }
<a name="l00390"></a>00390 <span class="comment"></span>
<a name="l00391"></a>00391 <span class="comment"> /// Searches the B+ tree and returns an iterator to the first pair</span>
<a name="l00392"></a>00392 <span class="comment"> /// greater than key, or end() if all keys are smaller or equal.</span>
<a name="l00393"></a><a class="code" href="a00006.html#a5e1197bbc27c927ebe4087541d601f20">00393</a> <span class="comment"></span> <a class="code" href="a00006.html#a0d0c6764234271152a77643d5f160889" title="STL-like iterator object for B+ tree items.">iterator</a> <a class="code" href="a00006.html#a5e1197bbc27c927ebe4087541d601f20" title="Searches the B+ tree and returns an iterator to the first pair greater than key, or end() if all keys...">upper_bound</a>(<span class="keyword">const</span> <a class="code" href="a00006.html#adaf86bdcdf48a7d4ed87ae020436287e" title="First template parameter: The key type of the btree.">key_type</a>&amp; key)
<a name="l00394"></a>00394 {
<a name="l00395"></a>00395 <span class="keywordflow">return</span> <a class="code" href="a00006.html#aa78a74c628ee6ef25c5bffce7a9aacb2" title="The contained implementation object.">tree</a>.<a class="code" href="a00001.html#a0404bb704466a149ea96613b7c5ef3e2" title="Searches the B+ tree and returns an iterator to the first pair greater than key, or end() if all keys...">upper_bound</a>(key);
<a name="l00396"></a>00396 }
<a name="l00397"></a>00397 <span class="comment"></span>
<a name="l00398"></a>00398 <span class="comment"> /// Searches the B+ tree and returns a constant iterator to the</span>
<a name="l00399"></a>00399 <span class="comment"> /// first pair greater than key, or end() if all keys are smaller</span>
<a name="l00400"></a>00400 <span class="comment"> /// or equal.</span>
<a name="l00401"></a><a class="code" href="a00006.html#a5833bec011824d4b54b716b685ae74ca">00401</a> <span class="comment"></span> <a class="code" href="a00006.html#ac3b6e263ec2f54cab4e541b02e2156bf" title="STL-like iterator object for B+ tree items.">const_iterator</a> <a class="code" href="a00006.html#a5e1197bbc27c927ebe4087541d601f20" title="Searches the B+ tree and returns an iterator to the first pair greater than key, or end() if all keys...">upper_bound</a>(<span class="keyword">const</span> <a class="code" href="a00006.html#adaf86bdcdf48a7d4ed87ae020436287e" title="First template parameter: The key type of the btree.">key_type</a>&amp; key)<span class="keyword"> const</span>
<a name="l00402"></a>00402 <span class="keyword"> </span>{
<a name="l00403"></a>00403 <span class="keywordflow">return</span> <a class="code" href="a00006.html#aa78a74c628ee6ef25c5bffce7a9aacb2" title="The contained implementation object.">tree</a>.<a class="code" href="a00001.html#a0404bb704466a149ea96613b7c5ef3e2" title="Searches the B+ tree and returns an iterator to the first pair greater than key, or end() if all keys...">upper_bound</a>(key);
<a name="l00404"></a>00404 }
<a name="l00405"></a>00405 <span class="comment"></span>
<a name="l00406"></a>00406 <span class="comment"> /// Searches the B+ tree and returns both lower_bound() and upper_bound().</span>
<a name="l00407"></a><a class="code" href="a00006.html#a405388c6589746b4a01af6ab8a4b4321">00407</a> <span class="comment"></span> <span class="keyword">inline</span> std::pair&lt;iterator, iterator&gt; <a class="code" href="a00006.html#a405388c6589746b4a01af6ab8a4b4321" title="Searches the B+ tree and returns both lower_bound() and upper_bound().">equal_range</a>(<span class="keyword">const</span> <a class="code" href="a00006.html#adaf86bdcdf48a7d4ed87ae020436287e" title="First template parameter: The key type of the btree.">key_type</a>&amp; key)
<a name="l00408"></a>00408 {
<a name="l00409"></a>00409 <span class="keywordflow">return</span> <a class="code" href="a00006.html#aa78a74c628ee6ef25c5bffce7a9aacb2" title="The contained implementation object.">tree</a>.<a class="code" href="a00001.html#ac73cf4621b0650fef2ea3ea1d2fd2f90" title="Searches the B+ tree and returns both lower_bound() and upper_bound().">equal_range</a>(key);
<a name="l00410"></a>00410 }
<a name="l00411"></a>00411 <span class="comment"></span>
<a name="l00412"></a>00412 <span class="comment"> /// Searches the B+ tree and returns both lower_bound() and upper_bound().</span>
<a name="l00413"></a><a class="code" href="a00006.html#aeffb8c7205996ac1a5ac40976f47a96f">00413</a> <span class="comment"></span> <span class="keyword">inline</span> std::pair&lt;const_iterator, const_iterator&gt; <a class="code" href="a00006.html#a405388c6589746b4a01af6ab8a4b4321" title="Searches the B+ tree and returns both lower_bound() and upper_bound().">equal_range</a>(<span class="keyword">const</span> <a class="code" href="a00006.html#adaf86bdcdf48a7d4ed87ae020436287e" title="First template parameter: The key type of the btree.">key_type</a>&amp; key)<span class="keyword"> const</span>
<a name="l00414"></a>00414 <span class="keyword"> </span>{
<a name="l00415"></a>00415 <span class="keywordflow">return</span> <a class="code" href="a00006.html#aa78a74c628ee6ef25c5bffce7a9aacb2" title="The contained implementation object.">tree</a>.<a class="code" href="a00001.html#ac73cf4621b0650fef2ea3ea1d2fd2f90" title="Searches the B+ tree and returns both lower_bound() and upper_bound().">equal_range</a>(key);
<a name="l00416"></a>00416 }
<a name="l00417"></a>00417
<a name="l00418"></a>00418 <span class="keyword">public</span>:
<a name="l00419"></a>00419 <span class="comment">// *** B+ Tree Object Comparison Functions</span>
<a name="l00420"></a>00420 <span class="comment"></span>
<a name="l00421"></a>00421 <span class="comment"> /// Equality relation of B+ trees of the same type. B+ trees of the same</span>
<a name="l00422"></a>00422 <span class="comment"> /// size and equal key (counts) are considered equal.</span>
<a name="l00423"></a><a class="code" href="a00006.html#a8151cc2608a7a0634d5a94e3824f8e34">00423</a> <span class="comment"></span> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="a00006.html#a8151cc2608a7a0634d5a94e3824f8e34" title="Equality relation of B+ trees of the same type.">operator==</a>(<span class="keyword">const</span> <span class="keyword">self</span> &amp;other)<span class="keyword"> const</span>
<a name="l00424"></a>00424 <span class="keyword"> </span>{
<a name="l00425"></a>00425 <span class="keywordflow">return</span> (<a class="code" href="a00006.html#aa78a74c628ee6ef25c5bffce7a9aacb2" title="The contained implementation object.">tree</a> == other.tree);
<a name="l00426"></a>00426 }
<a name="l00427"></a>00427 <span class="comment"></span>
<a name="l00428"></a>00428 <span class="comment"> /// Inequality relation. Based on operator==.</span>
<a name="l00429"></a><a class="code" href="a00006.html#ae9ad03cbc3be10a4a972b06ec9abedec">00429</a> <span class="comment"></span> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="a00006.html#ae9ad03cbc3be10a4a972b06ec9abedec" title="Inequality relation. Based on operator==.">operator!=</a>(<span class="keyword">const</span> <span class="keyword">self</span> &amp;other)<span class="keyword"> const</span>
<a name="l00430"></a>00430 <span class="keyword"> </span>{
<a name="l00431"></a>00431 <span class="keywordflow">return</span> (<a class="code" href="a00006.html#aa78a74c628ee6ef25c5bffce7a9aacb2" title="The contained implementation object.">tree</a> != other.tree);
<a name="l00432"></a>00432 }
<a name="l00433"></a>00433 <span class="comment"></span>
<a name="l00434"></a>00434 <span class="comment"> /// Total ordering relation of B+ trees of the same type. It uses</span>
<a name="l00435"></a>00435 <span class="comment"> /// std::lexicographical_compare() for the actual comparison of elements.</span>
<a name="l00436"></a><a class="code" href="a00006.html#a2dcdf9bb9c5e2eea56e9308388b07349">00436</a> <span class="comment"></span> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="a00006.html#a2dcdf9bb9c5e2eea56e9308388b07349" title="Total ordering relation of B+ trees of the same type.">operator&lt;</a>(<span class="keyword">const</span> <span class="keyword">self</span> &amp;other)<span class="keyword"> const</span>
<a name="l00437"></a>00437 <span class="keyword"> </span>{
<a name="l00438"></a>00438 <span class="keywordflow">return</span> (<a class="code" href="a00006.html#aa78a74c628ee6ef25c5bffce7a9aacb2" title="The contained implementation object.">tree</a> &lt; other.tree);
<a name="l00439"></a>00439 }
<a name="l00440"></a>00440 <span class="comment"></span>
<a name="l00441"></a>00441 <span class="comment"> /// Greater relation. Based on operator&lt;.</span>
<a name="l00442"></a><a class="code" href="a00006.html#a7c85cec4d55431ea5e057602ba8fe5a0">00442</a> <span class="comment"></span> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="a00006.html#a7c85cec4d55431ea5e057602ba8fe5a0" title="Greater relation. Based on operator&lt;.">operator&gt;</a>(<span class="keyword">const</span> <span class="keyword">self</span> &amp;other)<span class="keyword"> const</span>
<a name="l00443"></a>00443 <span class="keyword"> </span>{
<a name="l00444"></a>00444 <span class="keywordflow">return</span> (<a class="code" href="a00006.html#aa78a74c628ee6ef25c5bffce7a9aacb2" title="The contained implementation object.">tree</a> &gt; other.tree);
<a name="l00445"></a>00445 }
<a name="l00446"></a>00446 <span class="comment"></span>
<a name="l00447"></a>00447 <span class="comment"> /// Less-equal relation. Based on operator&lt;.</span>
<a name="l00448"></a><a class="code" href="a00006.html#a35de24d784f61ae794c1fa56fa9c6673">00448</a> <span class="comment"></span> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="a00006.html#a35de24d784f61ae794c1fa56fa9c6673" title="Less-equal relation. Based on operator&lt;.">operator&lt;=</a>(<span class="keyword">const</span> <span class="keyword">self</span> &amp;other)<span class="keyword"> const</span>
<a name="l00449"></a>00449 <span class="keyword"> </span>{
<a name="l00450"></a>00450 <span class="keywordflow">return</span> (<a class="code" href="a00006.html#aa78a74c628ee6ef25c5bffce7a9aacb2" title="The contained implementation object.">tree</a> &lt;= other.tree);
<a name="l00451"></a>00451 }
<a name="l00452"></a>00452 <span class="comment"></span>
<a name="l00453"></a>00453 <span class="comment"> /// Greater-equal relation. Based on operator&lt;.</span>
<a name="l00454"></a><a class="code" href="a00006.html#a603b031718fb9bb00d0edefc58d560c3">00454</a> <span class="comment"></span> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="a00006.html#a603b031718fb9bb00d0edefc58d560c3" title="Greater-equal relation. Based on operator&lt;.">operator&gt;=</a>(<span class="keyword">const</span> <span class="keyword">self</span> &amp;other)<span class="keyword"> const</span>
<a name="l00455"></a>00455 <span class="keyword"> </span>{
<a name="l00456"></a>00456 <span class="keywordflow">return</span> (<a class="code" href="a00006.html#aa78a74c628ee6ef25c5bffce7a9aacb2" title="The contained implementation object.">tree</a> &gt;= other.tree);
<a name="l00457"></a>00457 }
<a name="l00458"></a>00458
<a name="l00459"></a>00459 <span class="keyword">public</span>:<span class="comment"></span>
<a name="l00460"></a>00460 <span class="comment"> /// *** Fast Copy: Assign Operator and Copy Constructors</span>
<a name="l00461"></a>00461 <span class="comment"></span><span class="comment"></span>
<a name="l00462"></a>00462 <span class="comment"> /// Assignment operator. All the keys are copied</span>
<a name="l00463"></a><a class="code" href="a00006.html#a3e8081765077002a2cbc04e20506f03d">00463</a> <span class="comment"></span> <span class="keyword">inline</span> <span class="keyword">self</span>&amp; <a class="code" href="a00006.html#a3e8081765077002a2cbc04e20506f03d" title="*** Fast Copy: Assign Operator and Copy Constructors">operator= </a>(<span class="keyword">const</span> <span class="keyword">self</span> &amp;other)
<a name="l00464"></a>00464 {
<a name="l00465"></a>00465 <span class="keywordflow">if</span> (<span class="keyword">this</span> != &amp;other)
<a name="l00466"></a>00466 {
<a name="l00467"></a>00467 <a class="code" href="a00006.html#aa78a74c628ee6ef25c5bffce7a9aacb2" title="The contained implementation object.">tree</a> = other.tree;
<a name="l00468"></a>00468 }
<a name="l00469"></a>00469 <span class="keywordflow">return</span> *<span class="keyword">this</span>;
<a name="l00470"></a>00470 }
<a name="l00471"></a>00471 <span class="comment"></span>
<a name="l00472"></a>00472 <span class="comment"> /// Copy constructor. The newly initialized B+ tree object will contain a</span>
<a name="l00473"></a>00473 <span class="comment"> /// copy of all keys.</span>
<a name="l00474"></a><a class="code" href="a00006.html#a988a8fc330955bc3e74976865c841904">00474</a> <span class="comment"></span> <span class="keyword">inline</span> <a class="code" href="a00006.html#ae51979526a758ca48dff71269509d30d" title="Default constructor initializing an empty B+ tree with the standard key comparison function...">btree_multiset</a>(<span class="keyword">const</span> <span class="keyword">self</span> &amp;other)
<a name="l00475"></a>00475 : <a class="code" href="a00006.html#aa78a74c628ee6ef25c5bffce7a9aacb2" title="The contained implementation object.">tree</a>(other.<a class="code" href="a00006.html#aa78a74c628ee6ef25c5bffce7a9aacb2" title="The contained implementation object.">tree</a>)
<a name="l00476"></a>00476 {
<a name="l00477"></a>00477 }
<a name="l00478"></a>00478
<a name="l00479"></a>00479 <span class="keyword">public</span>:
<a name="l00480"></a>00480 <span class="comment">// *** Public Insertion Functions</span>
<a name="l00481"></a>00481 <span class="comment"></span>
<a name="l00482"></a>00482 <span class="comment"> /// Attempt to insert a key into the B+ tree. As this set allows</span>
<a name="l00483"></a>00483 <span class="comment"> /// duplicates, this function never fails.</span>
<a name="l00484"></a><a class="code" href="a00006.html#ad35b00f9ff7f148dbb5cfee7ac8102af">00484</a> <span class="comment"></span> <span class="keyword">inline</span> <a class="code" href="a00006.html#a0d0c6764234271152a77643d5f160889" title="STL-like iterator object for B+ tree items.">iterator</a> <a class="code" href="a00006.html#ad35b00f9ff7f148dbb5cfee7ac8102af" title="Attempt to insert a key into the B+ tree.">insert</a>(<span class="keyword">const</span> <a class="code" href="a00006.html#adaf86bdcdf48a7d4ed87ae020436287e" title="First template parameter: The key type of the btree.">key_type</a>&amp; x)
<a name="l00485"></a>00485 {
<a name="l00486"></a>00486 <span class="keywordflow">return</span> <a class="code" href="a00006.html#aa78a74c628ee6ef25c5bffce7a9aacb2" title="The contained implementation object.">tree</a>.<a class="code" href="a00001.html#a586dd230f8be24eaeebc75cc95196d78" title="Attempt to insert a key/data pair into the B+ tree.">insert2</a>(x, <a class="code" href="a00006.html#a4797d9899509ebbd391f6478f85fefd9" title="The empty data_type.">data_type</a>()).first;
<a name="l00487"></a>00487 }
<a name="l00488"></a>00488 <span class="comment"></span>
<a name="l00489"></a>00489 <span class="comment"> /// Attempt to insert a key into the B+ tree. The iterator hint is</span>
<a name="l00490"></a>00490 <span class="comment"> /// currently ignored by the B+ tree insertion routine.</span>
<a name="l00491"></a><a class="code" href="a00006.html#a0075140c2d21fe08b68f00e16630cff1">00491</a> <span class="comment"></span> <span class="keyword">inline</span> <a class="code" href="a00006.html#a0d0c6764234271152a77643d5f160889" title="STL-like iterator object for B+ tree items.">iterator</a> <a class="code" href="a00006.html#ad35b00f9ff7f148dbb5cfee7ac8102af" title="Attempt to insert a key into the B+ tree.">insert</a>(<a class="code" href="a00006.html#a0d0c6764234271152a77643d5f160889" title="STL-like iterator object for B+ tree items.">iterator</a> hint, <span class="keyword">const</span> <a class="code" href="a00006.html#adaf86bdcdf48a7d4ed87ae020436287e" title="First template parameter: The key type of the btree.">key_type</a> &amp;x)
<a name="l00492"></a>00492 {
<a name="l00493"></a>00493 <span class="keywordflow">return</span> <a class="code" href="a00006.html#aa78a74c628ee6ef25c5bffce7a9aacb2" title="The contained implementation object.">tree</a>.<a class="code" href="a00001.html#a586dd230f8be24eaeebc75cc95196d78" title="Attempt to insert a key/data pair into the B+ tree.">insert2</a>(hint, x, <a class="code" href="a00006.html#a4797d9899509ebbd391f6478f85fefd9" title="The empty data_type.">data_type</a>());
<a name="l00494"></a>00494 }
<a name="l00495"></a>00495 <span class="comment"></span>
<a name="l00496"></a>00496 <span class="comment"> /// Attempt to insert the range [first,last) of key_type into the B+</span>
<a name="l00497"></a>00497 <span class="comment"> /// tree. Each key is inserted individually.</span>
<a name="l00498"></a>00498 <span class="comment"></span> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> InputIterator&gt;
<a name="l00499"></a><a class="code" href="a00006.html#a75db73a6c739f8515ab508d3241feb88">00499</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00006.html#ad35b00f9ff7f148dbb5cfee7ac8102af" title="Attempt to insert a key into the B+ tree.">insert</a>(InputIterator first, InputIterator last)
<a name="l00500"></a>00500 {
<a name="l00501"></a>00501 InputIterator iter = first;
<a name="l00502"></a>00502 <span class="keywordflow">while</span>(iter != last)
<a name="l00503"></a>00503 {
<a name="l00504"></a>00504 <a class="code" href="a00006.html#ad35b00f9ff7f148dbb5cfee7ac8102af" title="Attempt to insert a key into the B+ tree.">insert</a>(*iter);
<a name="l00505"></a>00505 ++iter;
<a name="l00506"></a>00506 }
<a name="l00507"></a>00507 }
<a name="l00508"></a>00508 <span class="comment"></span>
<a name="l00509"></a>00509 <span class="comment"> /// Bulk load a sorted range [first,last). Loads items into leaves and</span>
<a name="l00510"></a>00510 <span class="comment"> /// constructs a B-tree above them. The tree must be empty when calling</span>
<a name="l00511"></a>00511 <span class="comment"> /// this function.</span>
<a name="l00512"></a>00512 <span class="comment"></span> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> Iterator&gt;
<a name="l00513"></a><a class="code" href="a00006.html#ac0ce2f8dad3a95fe6c276437abdacbc1">00513</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00006.html#ac0ce2f8dad3a95fe6c276437abdacbc1" title="Bulk load a sorted range [first,last).">bulk_load</a>(Iterator first, Iterator last)
<a name="l00514"></a>00514 {
<a name="l00515"></a>00515 <span class="keywordflow">return</span> <a class="code" href="a00006.html#aa78a74c628ee6ef25c5bffce7a9aacb2" title="The contained implementation object.">tree</a>.<a class="code" href="a00001.html#a053c808858d78e6f0a93041ab612d656" title="Bulk load a sorted range.">bulk_load</a>(first, last);
<a name="l00516"></a>00516 }
<a name="l00517"></a>00517
<a name="l00518"></a>00518 <span class="keyword">public</span>:
<a name="l00519"></a>00519 <span class="comment">// *** Public Erase Functions</span>
<a name="l00520"></a>00520 <span class="comment"></span>
<a name="l00521"></a>00521 <span class="comment"> /// Erases one (the first) entry of the given key.</span>
<a name="l00522"></a><a class="code" href="a00006.html#aa4e4cd44265e4c5fb8617ca3d17dd843">00522</a> <span class="comment"></span> <span class="keywordtype">bool</span> <a class="code" href="a00006.html#aa4e4cd44265e4c5fb8617ca3d17dd843" title="Erases one (the first) entry of the given key.">erase_one</a>(<span class="keyword">const</span> <a class="code" href="a00006.html#adaf86bdcdf48a7d4ed87ae020436287e" title="First template parameter: The key type of the btree.">key_type</a> &amp;key)
<a name="l00523"></a>00523 {
<a name="l00524"></a>00524 <span class="keywordflow">return</span> <a class="code" href="a00006.html#aa78a74c628ee6ef25c5bffce7a9aacb2" title="The contained implementation object.">tree</a>.<a class="code" href="a00001.html#a07ca3a19f1e20908f7cca3180420c817" title="Erases one (the first) of the key/data pairs associated with the given key.">erase_one</a>(key);
<a name="l00525"></a>00525 }
<a name="l00526"></a>00526 <span class="comment"></span>
<a name="l00527"></a>00527 <span class="comment"> /// Erases all the entries of the given key. This is implemented using</span>
<a name="l00528"></a>00528 <span class="comment"> /// erase_one() and thus not very efficient.</span>
<a name="l00529"></a><a class="code" href="a00006.html#afe2a42873c3a97234668e2feabc5191d">00529</a> <span class="comment"></span> <a class="code" href="a00006.html#acb308af84d816e44d6fcaaf075b08a22" title="Size type used to count keys.">size_type</a> <a class="code" href="a00006.html#afe2a42873c3a97234668e2feabc5191d" title="Erases all the entries of the given key.">erase</a>(<span class="keyword">const</span> <a class="code" href="a00006.html#adaf86bdcdf48a7d4ed87ae020436287e" title="First template parameter: The key type of the btree.">key_type</a> &amp;key)
<a name="l00530"></a>00530 {
<a name="l00531"></a>00531 <span class="keywordflow">return</span> <a class="code" href="a00006.html#aa78a74c628ee6ef25c5bffce7a9aacb2" title="The contained implementation object.">tree</a>.<a class="code" href="a00001.html#a8bced926ecf575a393e06ca7d35291f1" title="Erases all the key/data pairs associated with the given key.">erase</a>(key);
<a name="l00532"></a>00532 }
<a name="l00533"></a>00533 <span class="comment"></span>
<a name="l00534"></a>00534 <span class="comment"> /// Erase the key/data pair referenced by the iterator.</span>
<a name="l00535"></a><a class="code" href="a00006.html#ac174897bad297d88927e6abe4056a3b8">00535</a> <span class="comment"></span> <span class="keywordtype">void</span> <a class="code" href="a00006.html#afe2a42873c3a97234668e2feabc5191d" title="Erases all the entries of the given key.">erase</a>(<a class="code" href="a00006.html#a0d0c6764234271152a77643d5f160889" title="STL-like iterator object for B+ tree items.">iterator</a> iter)
<a name="l00536"></a>00536 {
<a name="l00537"></a>00537 <span class="keywordflow">return</span> <a class="code" href="a00006.html#aa78a74c628ee6ef25c5bffce7a9aacb2" title="The contained implementation object.">tree</a>.<a class="code" href="a00001.html#a8bced926ecf575a393e06ca7d35291f1" title="Erases all the key/data pairs associated with the given key.">erase</a>(iter);
<a name="l00538"></a>00538 }
<a name="l00539"></a>00539
<a name="l00540"></a>00540 <span class="preprocessor">#ifdef BTREE_TODO</span>
<a name="l00541"></a>00541 <span class="preprocessor"></span><span class="comment"> /// Erase all keys in the range [first,last). This function is currently</span>
<a name="l00542"></a>00542 <span class="comment"></span><span class="comment"> /// not implemented by the B+ Tree.</span>
<a name="l00543"></a><a class="code" href="a00006.html#aa5c867534e27a06c07baa2c17fbccfd1">00543</a> <span class="comment"></span> <span class="keywordtype">void</span> <a class="code" href="a00006.html#afe2a42873c3a97234668e2feabc5191d" title="Erases all the entries of the given key.">erase</a>(<a class="code" href="a00006.html#a0d0c6764234271152a77643d5f160889" title="STL-like iterator object for B+ tree items.">iterator</a> <span class="comment">/* first */</span>, <a class="code" href="a00006.html#a0d0c6764234271152a77643d5f160889" title="STL-like iterator object for B+ tree items.">iterator</a> <span class="comment">/* last */</span>)
<a name="l00544"></a>00544 {
<a name="l00545"></a>00545 abort();
<a name="l00546"></a>00546 }
<a name="l00547"></a>00547 <span class="preprocessor">#endif</span>
<a name="l00548"></a>00548 <span class="preprocessor"></span>
<a name="l00549"></a>00549 <span class="preprocessor">#ifdef BTREE_DEBUG</span>
<a name="l00550"></a>00550 <span class="preprocessor"></span><span class="keyword">public</span>:
<a name="l00551"></a>00551 <span class="comment">// *** Debug Printing</span>
<a name="l00552"></a>00552 <span class="comment"></span>
<a name="l00553"></a>00553 <span class="comment"> /// Print out the B+ tree structure with keys onto the given ostream. This function</span>
<a name="l00554"></a>00554 <span class="comment"> /// requires that the header is compiled with BTREE_DEBUG and that key_type</span>
<a name="l00555"></a>00555 <span class="comment"> /// is printable via std::ostream.</span>
<a name="l00556"></a><a class="code" href="a00006.html#a6aaf291909c709ea33419940352288b3">00556</a> <span class="comment"></span> <span class="keywordtype">void</span> <a class="code" href="a00006.html#a6aaf291909c709ea33419940352288b3" title="Print out the B+ tree structure with keys onto the given ostream.">print</a>(std::ostream &amp;os)<span class="keyword"> const</span>
<a name="l00557"></a>00557 <span class="keyword"> </span>{
<a name="l00558"></a>00558 <a class="code" href="a00006.html#aa78a74c628ee6ef25c5bffce7a9aacb2" title="The contained implementation object.">tree</a>.<a class="code" href="a00001.html#a29af931b81dc3446d1ffadab6fd5e017" title="Print out the B+ tree structure with keys onto the given ostream.">print</a>(os);
<a name="l00559"></a>00559 }
<a name="l00560"></a>00560 <span class="comment"></span>
<a name="l00561"></a>00561 <span class="comment"> /// Print out only the leaves via the double linked list.</span>
<a name="l00562"></a><a class="code" href="a00006.html#a8818ff27dd8b2275d4b6a68d728c6d77">00562</a> <span class="comment"></span> <span class="keywordtype">void</span> <a class="code" href="a00006.html#a8818ff27dd8b2275d4b6a68d728c6d77" title="Print out only the leaves via the double linked list.">print_leaves</a>(std::ostream &amp;os)<span class="keyword"> const</span>
<a name="l00563"></a>00563 <span class="keyword"> </span>{
<a name="l00564"></a>00564 <a class="code" href="a00006.html#aa78a74c628ee6ef25c5bffce7a9aacb2" title="The contained implementation object.">tree</a>.<a class="code" href="a00001.html#a2e9097d4266851d84d9e3813921155c6" title="Print out only the leaves via the double linked list.">print_leaves</a>(os);
<a name="l00565"></a>00565 }
<a name="l00566"></a>00566 <span class="preprocessor">#endif</span>
<a name="l00567"></a>00567 <span class="preprocessor"></span>
<a name="l00568"></a>00568 <span class="keyword">public</span>:
<a name="l00569"></a>00569 <span class="comment">// *** Verification of B+ Tree Invariants</span>
<a name="l00570"></a>00570 <span class="comment"></span>
<a name="l00571"></a>00571 <span class="comment"> /// Run a thorough verification of all B+ tree invariants. The program</span>
<a name="l00572"></a>00572 <span class="comment"> /// aborts via BTREE_ASSERT() if something is wrong.</span>
<a name="l00573"></a><a class="code" href="a00006.html#a862c504ed632b8591756c45273087e5a">00573</a> <span class="comment"></span> <span class="keywordtype">void</span> <a class="code" href="a00006.html#a862c504ed632b8591756c45273087e5a" title="Run a thorough verification of all B+ tree invariants.">verify</a>()<span class="keyword"> const</span>
<a name="l00574"></a>00574 <span class="keyword"> </span>{
<a name="l00575"></a>00575 <a class="code" href="a00006.html#aa78a74c628ee6ef25c5bffce7a9aacb2" title="The contained implementation object.">tree</a>.<a class="code" href="a00001.html#ad7008114b409fe53a5739a69f3b90e59" title="Run a thorough verification of all B+ tree invariants.">verify</a>();
<a name="l00576"></a>00576 }
<a name="l00577"></a>00577
<a name="l00578"></a>00578 <span class="keyword">public</span>:
<a name="l00579"></a>00579 <span class="comment"></span>
<a name="l00580"></a>00580 <span class="comment"> /// Dump the contents of the B+ tree out onto an ostream as a binary</span>
<a name="l00581"></a>00581 <span class="comment"> /// image. The image contains memory pointers which will be fixed when the</span>
<a name="l00582"></a>00582 <span class="comment"> /// image is restored. For this to work your key_type must be an integral</span>
<a name="l00583"></a>00583 <span class="comment"> /// type and contain no pointers or references.</span>
<a name="l00584"></a><a class="code" href="a00006.html#af443508ecb8fd77f32f01709f2f9d666">00584</a> <span class="comment"></span> <span class="keywordtype">void</span> <a class="code" href="a00006.html#af443508ecb8fd77f32f01709f2f9d666" title="Dump the contents of the B+ tree out onto an ostream as a binary image.">dump</a>(std::ostream &amp;os)<span class="keyword"> const</span>
<a name="l00585"></a>00585 <span class="keyword"> </span>{
<a name="l00586"></a>00586 <a class="code" href="a00006.html#aa78a74c628ee6ef25c5bffce7a9aacb2" title="The contained implementation object.">tree</a>.<a class="code" href="a00001.html#af26da2c6a1723bd3c98229b3670e2d28" title="Dump the contents of the B+ tree out onto an ostream as a binary image.">dump</a>(os);
<a name="l00587"></a>00587 }
<a name="l00588"></a>00588 <span class="comment"></span>
<a name="l00589"></a>00589 <span class="comment"> /// Restore a binary image of a dumped B+ tree from an istream. The B+ tree</span>
<a name="l00590"></a>00590 <span class="comment"> /// pointers are fixed using the dump order. For dump and restore to work</span>
<a name="l00591"></a>00591 <span class="comment"> /// your key_type must be an integral type and contain no pointers or</span>
<a name="l00592"></a>00592 <span class="comment"> /// references. Returns true if the restore was successful.</span>
<a name="l00593"></a><a class="code" href="a00006.html#a7f6dd7739f76cf5d1a31507ca3d80197">00593</a> <span class="comment"></span> <span class="keywordtype">bool</span> <a class="code" href="a00006.html#a7f6dd7739f76cf5d1a31507ca3d80197" title="Restore a binary image of a dumped B+ tree from an istream.">restore</a>(std::istream &amp;is)
<a name="l00594"></a>00594 {
<a name="l00595"></a>00595 <span class="keywordflow">return</span> <a class="code" href="a00006.html#aa78a74c628ee6ef25c5bffce7a9aacb2" title="The contained implementation object.">tree</a>.<a class="code" href="a00001.html#adf438d8a86c9784e277adfbb6ed5783d" title="Restore a binary image of a dumped B+ tree from an istream.">restore</a>(is);
<a name="l00596"></a>00596 }
<a name="l00597"></a>00597 };
<a name="l00598"></a>00598
<a name="l00599"></a>00599 } <span class="comment">// namespace stx</span>
<a name="l00600"></a>00600
<a name="l00601"></a>00601 <span class="preprocessor">#endif // _STX_BTREE_MULTISET_H_</span>
</pre></div></div><!-- contents -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Defines</a></div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<hr class="footer"/><address class="footer"><small>
Generated on Sun May 5 2013 23:38:43 for STX B+ Tree Template Classes by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.