Permalink
Fetching contributors…
Cannot retrieve contributors at this time
710 lines (692 sloc) 97.1 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_set.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_set.h</div> </div>
</div><!--header-->
<div class="contents">
<a href="a00034.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_set.h</span>
<a name="l00002"></a>00002 <span class="comment"> * Contains the specialized B+ tree template class btree_set</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_SET_H_</span>
<a name="l00035"></a>00035 <span class="preprocessor"></span><span class="preprocessor">#define _STX_BTREE_SET_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 set container.</span>
<a name="l00042"></a>00042 <span class="comment"> *</span>
<a name="l00043"></a>00043 <span class="comment"> * Implements the STL set using a B+ tree. It can be used as a drop-in</span>
<a name="l00044"></a>00044 <span class="comment"> * replacement for std::set. Not all asymptotic time requirements are met in</span>
<a name="l00045"></a>00045 <span class="comment"> * theory. The class has a traits class defining B+ tree properties like slots</span>
<a name="l00046"></a>00046 <span class="comment"> * and self-verification. Furthermore an allocator can be specified for tree</span>
<a name="l00047"></a>00047 <span class="comment"> * nodes.</span>
<a name="l00048"></a>00048 <span class="comment"> *</span>
<a name="l00049"></a>00049 <span class="comment"> * It is somewhat inefficient to implement a set using a B+ tree, a plain B</span>
<a name="l00050"></a>00050 <span class="comment"> * tree would hold fewer copies of the keys.</span>
<a name="l00051"></a>00051 <span class="comment"> *</span>
<a name="l00052"></a>00052 <span class="comment"> * The set class is derived from the base implementation class btree by</span>
<a name="l00053"></a>00053 <span class="comment"> * specifying an empty struct as data_type. All function are adapted to provide</span>
<a name="l00054"></a>00054 <span class="comment"> * the inner class with placeholder objects. Most tricky to get right were the</span>
<a name="l00055"></a>00055 <span class="comment"> * return type&#39;s of iterators which as value_type should be the same as</span>
<a name="l00056"></a>00056 <span class="comment"> * key_type, and not a pair of key and dummy-struct. This is taken case of</span>
<a name="l00057"></a>00057 <span class="comment"> * using some template magic in the btree class.</span>
<a name="l00058"></a>00058 <span class="comment"> */</span>
<a name="l00059"></a>00059 <span class="keyword">template</span> &lt;<span class="keyword">typename</span> _Key,
<a name="l00060"></a>00060 <span class="keyword">typename</span> _Compare = std::less&lt;_Key&gt;,
<a name="l00061"></a>00061 <span class="keyword">typename</span> _Traits = btree_default_set_traits&lt;_Key&gt;,
<a name="l00062"></a>00062 <span class="keyword">typename</span> _Alloc = std::allocator&lt;_Key&gt; &gt;
<a name="l00063"></a><a class="code" href="a00009.html">00063</a> <span class="keyword">class </span><a class="code" href="a00009.html" title="Specialized B+ tree template class implementing STL&#39;s set container.">btree_set</a>
<a name="l00064"></a>00064 {
<a name="l00065"></a>00065 <span class="keyword">public</span>:
<a name="l00066"></a>00066 <span class="comment">// *** Template Parameter Types</span>
<a name="l00067"></a>00067 <span class="comment"></span>
<a name="l00068"></a>00068 <span class="comment"> /// First template parameter: The key type of the B+ tree. This is stored</span>
<a name="l00069"></a>00069 <span class="comment"> /// in inner nodes and leaves</span>
<a name="l00070"></a><a class="code" href="a00009.html#a30048df0132910557b9fc6eef098c260">00070</a> <span class="comment"></span> <span class="keyword">typedef</span> _Key <a class="code" href="a00009.html#a30048df0132910557b9fc6eef098c260" title="First template parameter: The key type of the B+ tree.">key_type</a>;
<a name="l00071"></a>00071 <span class="comment"></span>
<a name="l00072"></a>00072 <span class="comment"> /// Second template parameter: Key comparison function object</span>
<a name="l00073"></a><a class="code" href="a00009.html#af50de559aebda323728e4fa2452bee5f">00073</a> <span class="comment"></span> <span class="keyword">typedef</span> _Compare <a class="code" href="a00009.html#af50de559aebda323728e4fa2452bee5f" title="Second template parameter: Key comparison function object.">key_compare</a>;
<a name="l00074"></a>00074 <span class="comment"></span>
<a name="l00075"></a>00075 <span class="comment"> /// Third template parameter: Traits object used to define more parameters</span>
<a name="l00076"></a>00076 <span class="comment"> /// of the B+ tree</span>
<a name="l00077"></a><a class="code" href="a00009.html#ae4153912a1f97b51f7bbad71b3129008">00077</a> <span class="comment"></span> <span class="keyword">typedef</span> _Traits <a class="code" href="a00009.html#ae4153912a1f97b51f7bbad71b3129008" title="Third template parameter: Traits object used to define more parameters of the B+ tree.">traits</a>;
<a name="l00078"></a>00078 <span class="comment"></span>
<a name="l00079"></a>00079 <span class="comment"> /// Fourth template parameter: STL allocator</span>
<a name="l00080"></a><a class="code" href="a00009.html#add9d9415d959dd6280c4c9388463890b">00080</a> <span class="comment"></span> <span class="keyword">typedef</span> _Alloc <a class="code" href="a00009.html#add9d9415d959dd6280c4c9388463890b" title="Fourth template parameter: STL allocator.">allocator_type</a>;
<a name="l00081"></a>00081 <span class="comment"></span>
<a name="l00082"></a>00082 <span class="comment"> /// The macro BTREE_FRIENDS can be used by outside class to access the B+</span>
<a name="l00083"></a>00083 <span class="comment"> /// tree internals. This was added for wxBTreeDemo to be able to draw the</span>
<a name="l00084"></a>00084 <span class="comment"> /// tree.</span>
<a name="l00085"></a>00085 <span class="comment"></span> <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="l00086"></a>00086
<a name="l00087"></a>00087 <span class="keyword">private</span>:
<a name="l00088"></a>00088 <span class="comment">// *** The data_type</span>
<a name="l00089"></a>00089 <span class="comment"></span>
<a name="l00090"></a>00090 <span class="comment"> /// \internal The empty struct used as a placeholder for the data_type</span>
<a name="l00091"></a><a class="code" href="a00013.html">00091</a> <span class="comment"></span> <span class="keyword">struct </span><a class="code" href="a00013.html" title="The macro BTREE_FRIENDS can be used by outside class to access the B+ tree internals.">empty_struct</a>
<a name="l00092"></a>00092 {
<a name="l00093"></a>00093 };
<a name="l00094"></a>00094
<a name="l00095"></a>00095 <span class="keyword">public</span>:
<a name="l00096"></a>00096 <span class="comment">// *** Constructed Types</span>
<a name="l00097"></a>00097 <span class="comment"></span>
<a name="l00098"></a>00098 <span class="comment"> /// The empty data_type</span>
<a name="l00099"></a><a class="code" href="a00009.html#a00bbef593d8ccf4068c327a83ec63284">00099</a> <span class="comment"></span> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="a00013.html" title="The macro BTREE_FRIENDS can be used by outside class to access the B+ tree internals.">empty_struct</a> <a class="code" href="a00013.html" title="The macro BTREE_FRIENDS can be used by outside class to access the B+ tree internals.">data_type</a>;
<a name="l00100"></a>00100 <span class="comment"></span>
<a name="l00101"></a>00101 <span class="comment"> /// Construct the set value_type: the key_type.</span>
<a name="l00102"></a><a class="code" href="a00009.html#a2d6c5e2aa366dfea07ab1232d0d96515">00102</a> <span class="comment"></span> <span class="keyword">typedef</span> <a class="code" href="a00009.html#a30048df0132910557b9fc6eef098c260" title="First template parameter: The key type of the B+ tree.">key_type</a> <a class="code" href="a00009.html#a2d6c5e2aa366dfea07ab1232d0d96515" title="Construct the set value_type: the key_type.">value_type</a>;
<a name="l00103"></a>00103 <span class="comment"></span>
<a name="l00104"></a>00104 <span class="comment"> /// Typedef of our own type</span>
<a name="l00105"></a><a class="code" href="a00009.html#aadf0dbca723b094c06361719ea3f9aae">00105</a> <span class="comment"></span> <span class="keyword">typedef</span> <a class="code" href="a00009.html" title="Specialized B+ tree template class implementing STL&#39;s set container.">btree_set&lt;key_type, key_compare, traits, allocator_type&gt;</a> <span class="keyword">self</span>;
<a name="l00106"></a>00106 <span class="comment"></span>
<a name="l00107"></a>00107 <span class="comment"> /// Implementation type of the btree_base</span>
<a name="l00108"></a>00108 <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="a00009.html#a30048df0132910557b9fc6eef098c260" title="First template parameter: The key type of the B+ tree.">key_type</a>, <a class="code" href="a00009.html#a00bbef593d8ccf4068c327a83ec63284" title="The empty data_type.">data_type</a>, <a class="code" href="a00009.html#a2d6c5e2aa366dfea07ab1232d0d96515" title="Construct the set value_type: the key_type.">value_type</a>, <a class="code" href="a00009.html#af50de559aebda323728e4fa2452bee5f" title="Second template parameter: Key comparison function object.">key_compare</a>,
<a name="l00109"></a><a class="code" href="a00009.html#a446013f241dac77c0b36dd6f410b9026">00109</a> <a class="code" href="a00009.html#ae4153912a1f97b51f7bbad71b3129008" title="Third template parameter: Traits object used to define more parameters of the B+ tree.">traits</a>, <span class="keyword">false</span>, <a class="code" href="a00009.html#add9d9415d959dd6280c4c9388463890b" title="Fourth template parameter: STL allocator.">allocator_type</a>, <span class="keyword">true</span>&gt; <a class="code" href="a00009.html#a446013f241dac77c0b36dd6f410b9026" title="Implementation type of the btree_base.">btree_impl</a>;
<a name="l00110"></a>00110 <span class="comment"></span>
<a name="l00111"></a>00111 <span class="comment"> /// Function class comparing two value_type keys.</span>
<a name="l00112"></a><a class="code" href="a00009.html#a9fc9960504727883e021ed064f831a9b">00112</a> <span class="comment"></span> <span class="keyword">typedef</span> <span class="keyword">typename</span> btree_impl::value_compare <a class="code" href="a00009.html#a9fc9960504727883e021ed064f831a9b" title="Function class comparing two value_type keys.">value_compare</a>;
<a name="l00113"></a>00113 <span class="comment"></span>
<a name="l00114"></a>00114 <span class="comment"> /// Size type used to count keys</span>
<a name="l00115"></a><a class="code" href="a00009.html#ab2cb644afc7271107dcceb53e9a86f45">00115</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="a00009.html#ab2cb644afc7271107dcceb53e9a86f45" title="Size type used to count keys.">size_type</a>;
<a name="l00116"></a>00116 <span class="comment"></span>
<a name="l00117"></a>00117 <span class="comment"> /// Small structure containing statistics about the tree</span>
<a name="l00118"></a><a class="code" href="a00009.html#acb76d4594a31ed8906a25d08f5830f5e">00118</a> <span class="comment"></span> <span class="keyword">typedef</span> <span class="keyword">typename</span> btree_impl::tree_stats <a class="code" href="a00009.html#acb76d4594a31ed8906a25d08f5830f5e" title="Small structure containing statistics about the tree.">tree_stats</a>;
<a name="l00119"></a>00119
<a name="l00120"></a>00120 <span class="keyword">public</span>:
<a name="l00121"></a>00121 <span class="comment">// *** Static Constant Options and Values of the B+ Tree</span>
<a name="l00122"></a>00122 <span class="comment"></span>
<a name="l00123"></a>00123 <span class="comment"> /// Base B+ tree parameter: The number of key slots in each leaf</span>
<a name="l00124"></a><a class="code" href="a00009.html#af20d59df4181356a7731674deeeafa0d">00124</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="a00009.html#af20d59df4181356a7731674deeeafa0d" title="Base B+ tree parameter: The number of key 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="l00125"></a>00125 <span class="comment"></span>
<a name="l00126"></a>00126 <span class="comment"> /// Base B+ tree parameter: The number of key slots in each inner node,</span>
<a name="l00127"></a>00127 <span class="comment"> /// this can differ from slots in each leaf.</span>
<a name="l00128"></a><a class="code" href="a00009.html#aa48cfb5c8f935ff286ca7a12e97886db">00128</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="a00009.html#aa48cfb5c8f935ff286ca7a12e97886db" 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="l00129"></a>00129 <span class="comment"></span>
<a name="l00130"></a>00130 <span class="comment"> /// Computed B+ tree parameter: The minimum number of key slots used in a</span>
<a name="l00131"></a>00131 <span class="comment"> /// leaf. If fewer slots are used, the leaf will be merged or slots shifted</span>
<a name="l00132"></a>00132 <span class="comment"> /// from it&#39;s siblings.</span>
<a name="l00133"></a><a class="code" href="a00009.html#a16ff8b6fdbbffcbdb50de080d4631015">00133</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="a00009.html#a16ff8b6fdbbffcbdb50de080d4631015" 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="l00134"></a>00134 <span class="comment"></span>
<a name="l00135"></a>00135 <span class="comment"> /// Computed B+ tree parameter: The minimum number of key slots used</span>
<a name="l00136"></a>00136 <span class="comment"> /// in an inner node. If fewer slots are used, the inner node will be</span>
<a name="l00137"></a>00137 <span class="comment"> /// merged or slots shifted from it&#39;s siblings.</span>
<a name="l00138"></a><a class="code" href="a00009.html#a133181518b3bfeec73537984581cc8ef">00138</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="a00009.html#a133181518b3bfeec73537984581cc8ef" 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="l00139"></a>00139 <span class="comment"></span>
<a name="l00140"></a>00140 <span class="comment"> /// Debug parameter: Enables expensive and thorough checking of the B+ tree</span>
<a name="l00141"></a>00141 <span class="comment"> /// invariants after each insert/erase operation.</span>
<a name="l00142"></a><a class="code" href="a00009.html#aeef1f92bbdd38ed63f588a56db598077">00142</a> <span class="comment"></span> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">bool</span> <a class="code" href="a00009.html#aeef1f92bbdd38ed63f588a56db598077" 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="l00143"></a>00143 <span class="comment"></span>
<a name="l00144"></a>00144 <span class="comment"> /// Debug parameter: Prints out lots of debug information about how the</span>
<a name="l00145"></a>00145 <span class="comment"> /// algorithms change the tree. Requires the header file to be compiled</span>
<a name="l00146"></a>00146 <span class="comment"> /// with BTREE_DEBUG and the key type must be std::ostream printable.</span>
<a name="l00147"></a><a class="code" href="a00009.html#ab3568dade6579ccf9a3f50df18eabb01">00147</a> <span class="comment"></span> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">bool</span> <a class="code" href="a00009.html#ab3568dade6579ccf9a3f50df18eabb01" 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="l00148"></a>00148 <span class="comment"></span>
<a name="l00149"></a>00149 <span class="comment"> /// Operational parameter: Allow duplicate keys in the btree.</span>
<a name="l00150"></a><a class="code" href="a00009.html#a76a14434ee750af9999bea4e2b657b36">00150</a> <span class="comment"></span> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">bool</span> <a class="code" href="a00009.html#a76a14434ee750af9999bea4e2b657b36" 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="l00151"></a>00151
<a name="l00152"></a>00152 <span class="keyword">public</span>:
<a name="l00153"></a>00153 <span class="comment">// *** Iterators and Reverse Iterators</span>
<a name="l00154"></a>00154 <span class="comment"></span>
<a name="l00155"></a>00155 <span class="comment"> /// STL-like iterator object for B+ tree items. The iterator points to a</span>
<a name="l00156"></a>00156 <span class="comment"> /// specific slot number in a leaf.</span>
<a name="l00157"></a><a class="code" href="a00009.html#a7d77049f9bbaaf25ba9edc0635c4627f">00157</a> <span class="comment"></span> <span class="keyword">typedef</span> <span class="keyword">typename</span> btree_impl::iterator <a class="code" href="a00009.html#a7d77049f9bbaaf25ba9edc0635c4627f" title="STL-like iterator object for B+ tree items.">iterator</a>;
<a name="l00158"></a>00158 <span class="comment"></span>
<a name="l00159"></a>00159 <span class="comment"> /// STL-like iterator object for B+ tree items. The iterator points to a</span>
<a name="l00160"></a>00160 <span class="comment"> /// specific slot number in a leaf.</span>
<a name="l00161"></a><a class="code" href="a00009.html#aa5d3d9c7b1218e5680f653fd8f9d8996">00161</a> <span class="comment"></span> <span class="keyword">typedef</span> <span class="keyword">typename</span> btree_impl::const_iterator <a class="code" href="a00009.html#aa5d3d9c7b1218e5680f653fd8f9d8996" title="STL-like iterator object for B+ tree items.">const_iterator</a>;
<a name="l00162"></a>00162 <span class="comment"></span>
<a name="l00163"></a>00163 <span class="comment"> /// create mutable reverse iterator by using STL magic</span>
<a name="l00164"></a><a class="code" href="a00009.html#afb9918dafdccf1eaffa6b6ddc8de0938">00164</a> <span class="comment"></span> <span class="keyword">typedef</span> <span class="keyword">typename</span> btree_impl::reverse_iterator <a class="code" href="a00009.html#afb9918dafdccf1eaffa6b6ddc8de0938" title="create mutable reverse iterator by using STL magic">reverse_iterator</a>;
<a name="l00165"></a>00165 <span class="comment"></span>
<a name="l00166"></a>00166 <span class="comment"> /// create constant reverse iterator by using STL magic</span>
<a name="l00167"></a><a class="code" href="a00009.html#a989d5052f0f73009ad08544bef214038">00167</a> <span class="comment"></span> <span class="keyword">typedef</span> <span class="keyword">typename</span> btree_impl::const_reverse_iterator <a class="code" href="a00009.html#a989d5052f0f73009ad08544bef214038" title="create constant reverse iterator by using STL magic">const_reverse_iterator</a>;
<a name="l00168"></a>00168
<a name="l00169"></a>00169 <span class="keyword">private</span>:
<a name="l00170"></a>00170 <span class="comment">// *** Tree Implementation Object</span>
<a name="l00171"></a>00171 <span class="comment"></span>
<a name="l00172"></a>00172 <span class="comment"> /// The contained implementation object</span>
<a name="l00173"></a><a class="code" href="a00009.html#a352435bb00a9126a4c72b565553d13b7">00173</a> <span class="comment"></span> <a class="code" href="a00001.html">btree_impl</a> <a class="code" href="a00009.html#a352435bb00a9126a4c72b565553d13b7" title="The contained implementation object.">tree</a>;
<a name="l00174"></a>00174
<a name="l00175"></a>00175 <span class="keyword">public</span>:
<a name="l00176"></a>00176 <span class="comment">// *** Constructors and Destructor</span>
<a name="l00177"></a>00177 <span class="comment"></span>
<a name="l00178"></a>00178 <span class="comment"> /// Default constructor initializing an empty B+ tree with the standard key</span>
<a name="l00179"></a>00179 <span class="comment"> /// comparison function</span>
<a name="l00180"></a><a class="code" href="a00009.html#a45a3f6e426f588acd351b258413e2797">00180</a> <span class="comment"></span> <span class="keyword">explicit</span> <span class="keyword">inline</span> <a class="code" href="a00009.html#a45a3f6e426f588acd351b258413e2797" title="Default constructor initializing an empty B+ tree with the standard key comparison function...">btree_set</a>(<span class="keyword">const</span> <a class="code" href="a00009.html#add9d9415d959dd6280c4c9388463890b" title="Fourth template parameter: STL allocator.">allocator_type</a> &amp;alloc = <a class="code" href="a00009.html#add9d9415d959dd6280c4c9388463890b" title="Fourth template parameter: STL allocator.">allocator_type</a>())
<a name="l00181"></a>00181 : <a class="code" href="a00009.html#a352435bb00a9126a4c72b565553d13b7" title="The contained implementation object.">tree</a>(alloc)
<a name="l00182"></a>00182 {
<a name="l00183"></a>00183 }
<a name="l00184"></a>00184 <span class="comment"></span>
<a name="l00185"></a>00185 <span class="comment"> /// Constructor initializing an empty B+ tree with a special key</span>
<a name="l00186"></a>00186 <span class="comment"> /// comparison object</span>
<a name="l00187"></a><a class="code" href="a00009.html#a9b12b35835ef7a7bf7414fed7b572119">00187</a> <span class="comment"></span> <span class="keyword">explicit</span> <span class="keyword">inline</span> <a class="code" href="a00009.html#a45a3f6e426f588acd351b258413e2797" title="Default constructor initializing an empty B+ tree with the standard key comparison function...">btree_set</a>(<span class="keyword">const</span> <a class="code" href="a00009.html#af50de559aebda323728e4fa2452bee5f" title="Second template parameter: Key comparison function object.">key_compare</a> &amp;kcf,
<a name="l00188"></a>00188 <span class="keyword">const</span> <a class="code" href="a00009.html#add9d9415d959dd6280c4c9388463890b" title="Fourth template parameter: STL allocator.">allocator_type</a> &amp;alloc = <a class="code" href="a00009.html#add9d9415d959dd6280c4c9388463890b" title="Fourth template parameter: STL allocator.">allocator_type</a>())
<a name="l00189"></a>00189 : <a class="code" href="a00009.html#a352435bb00a9126a4c72b565553d13b7" title="The contained implementation object.">tree</a>(kcf, alloc)
<a name="l00190"></a>00190 {
<a name="l00191"></a>00191 }
<a name="l00192"></a>00192 <span class="comment"></span>
<a name="l00193"></a>00193 <span class="comment"> /// Constructor initializing a B+ tree with the range [first,last)</span>
<a name="l00194"></a>00194 <span class="comment"></span> <span class="keyword">template</span> &lt;<span class="keyword">class</span> InputIterator&gt;
<a name="l00195"></a><a class="code" href="a00009.html#a158e2ba5a007dcd647928ceb942cdf48">00195</a> <span class="keyword">inline</span> <a class="code" href="a00009.html#a45a3f6e426f588acd351b258413e2797" title="Default constructor initializing an empty B+ tree with the standard key comparison function...">btree_set</a>(InputIterator first, InputIterator last,
<a name="l00196"></a>00196 <span class="keyword">const</span> <a class="code" href="a00009.html#add9d9415d959dd6280c4c9388463890b" title="Fourth template parameter: STL allocator.">allocator_type</a> &amp;alloc = <a class="code" href="a00009.html#add9d9415d959dd6280c4c9388463890b" title="Fourth template parameter: STL allocator.">allocator_type</a>())
<a name="l00197"></a>00197 : <a class="code" href="a00009.html#a352435bb00a9126a4c72b565553d13b7" title="The contained implementation object.">tree</a>(alloc)
<a name="l00198"></a>00198 {
<a name="l00199"></a>00199 <a class="code" href="a00009.html#aea42997e9d00ecaabe5e868196c5e8f0" title="Attempt to insert a key into the B+ tree.">insert</a>(first, last);
<a name="l00200"></a>00200 }
<a name="l00201"></a>00201 <span class="comment"></span>
<a name="l00202"></a>00202 <span class="comment"> /// Constructor initializing a B+ tree with the range [first,last) and a</span>
<a name="l00203"></a>00203 <span class="comment"> /// special key comparison object</span>
<a name="l00204"></a>00204 <span class="comment"></span> <span class="keyword">template</span> &lt;<span class="keyword">class</span> InputIterator&gt;
<a name="l00205"></a><a class="code" href="a00009.html#ac949bdeb75eeff239de30007029a7dc4">00205</a> <span class="keyword">inline</span> <a class="code" href="a00009.html#a45a3f6e426f588acd351b258413e2797" title="Default constructor initializing an empty B+ tree with the standard key comparison function...">btree_set</a>(InputIterator first, InputIterator last, <span class="keyword">const</span> <a class="code" href="a00009.html#af50de559aebda323728e4fa2452bee5f" title="Second template parameter: Key comparison function object.">key_compare</a> &amp;kcf,
<a name="l00206"></a>00206 <span class="keyword">const</span> <a class="code" href="a00009.html#add9d9415d959dd6280c4c9388463890b" title="Fourth template parameter: STL allocator.">allocator_type</a> &amp;alloc = <a class="code" href="a00009.html#add9d9415d959dd6280c4c9388463890b" title="Fourth template parameter: STL allocator.">allocator_type</a>())
<a name="l00207"></a>00207 : <a class="code" href="a00009.html#a352435bb00a9126a4c72b565553d13b7" title="The contained implementation object.">tree</a>(kcf, alloc)
<a name="l00208"></a>00208 {
<a name="l00209"></a>00209 <a class="code" href="a00009.html#aea42997e9d00ecaabe5e868196c5e8f0" title="Attempt to insert a key into the B+ tree.">insert</a>(first, last);
<a name="l00210"></a>00210 }
<a name="l00211"></a>00211 <span class="comment"></span>
<a name="l00212"></a>00212 <span class="comment"> /// Frees up all used B+ tree memory pages</span>
<a name="l00213"></a><a class="code" href="a00009.html#a252d6d1027b0d78a1bec9f63fc68cd82">00213</a> <span class="comment"></span> <span class="keyword">inline</span> <a class="code" href="a00009.html#a252d6d1027b0d78a1bec9f63fc68cd82" title="Frees up all used B+ tree memory pages.">~btree_set</a>()
<a name="l00214"></a>00214 {
<a name="l00215"></a>00215 }
<a name="l00216"></a>00216 <span class="comment"></span>
<a name="l00217"></a>00217 <span class="comment"> /// Fast swapping of two identical B+ tree objects.</span>
<a name="l00218"></a><a class="code" href="a00009.html#a24321f7bdae8ffc461e48d6331cf25e3">00218</a> <span class="comment"></span> <span class="keywordtype">void</span> <a class="code" href="a00009.html#a24321f7bdae8ffc461e48d6331cf25e3" title="Fast swapping of two identical B+ tree objects.">swap</a>(<span class="keyword">self</span>&amp; from)
<a name="l00219"></a>00219 {
<a name="l00220"></a>00220 <a class="code" href="a00009.html#a24321f7bdae8ffc461e48d6331cf25e3" title="Fast swapping of two identical B+ tree objects.">std::swap</a>(<a class="code" href="a00009.html#a352435bb00a9126a4c72b565553d13b7" title="The contained implementation object.">tree</a>, from.tree);
<a name="l00221"></a>00221 }
<a name="l00222"></a>00222
<a name="l00223"></a>00223 <span class="keyword">public</span>:
<a name="l00224"></a>00224 <span class="comment">// *** Key and Value Comparison Function Objects</span>
<a name="l00225"></a>00225 <span class="comment"></span>
<a name="l00226"></a>00226 <span class="comment"> /// Constant access to the key comparison object sorting the B+ tree</span>
<a name="l00227"></a><a class="code" href="a00009.html#abd0d44790a5ec381c5137b0dea712894">00227</a> <span class="comment"></span> <span class="keyword">inline</span> <a class="code" href="a00009.html#af50de559aebda323728e4fa2452bee5f" title="Second template parameter: Key comparison function object.">key_compare</a> <a class="code" href="a00009.html#abd0d44790a5ec381c5137b0dea712894" title="Constant access to the key comparison object sorting the B+ tree.">key_comp</a>()<span class="keyword"> const</span>
<a name="l00228"></a>00228 <span class="keyword"> </span>{
<a name="l00229"></a>00229 <span class="keywordflow">return</span> <a class="code" href="a00009.html#a352435bb00a9126a4c72b565553d13b7" 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="l00230"></a>00230 }
<a name="l00231"></a>00231 <span class="comment"></span>
<a name="l00232"></a>00232 <span class="comment"> /// Constant access to a constructed value_type comparison object. required</span>
<a name="l00233"></a>00233 <span class="comment"> /// by the STL</span>
<a name="l00234"></a><a class="code" href="a00009.html#a2e31a7e133791f60117cfa2e0a323819">00234</a> <span class="comment"></span> <span class="keyword">inline</span> <a class="code" href="a00009.html#a9fc9960504727883e021ed064f831a9b" title="Function class comparing two value_type keys.">value_compare</a> <a class="code" href="a00009.html#a2e31a7e133791f60117cfa2e0a323819" title="Constant access to a constructed value_type comparison object.">value_comp</a>()<span class="keyword"> const</span>
<a name="l00235"></a>00235 <span class="keyword"> </span>{
<a name="l00236"></a>00236 <span class="keywordflow">return</span> <a class="code" href="a00009.html#a352435bb00a9126a4c72b565553d13b7" 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="l00237"></a>00237 }
<a name="l00238"></a>00238
<a name="l00239"></a>00239 <span class="keyword">public</span>:
<a name="l00240"></a>00240 <span class="comment">// *** Allocators</span>
<a name="l00241"></a>00241 <span class="comment"></span>
<a name="l00242"></a>00242 <span class="comment"> /// Return the base node allocator provided during construction.</span>
<a name="l00243"></a><a class="code" href="a00009.html#a603ef9ef20b9f7ad05401d5d6eca2ece">00243</a> <span class="comment"></span> <a class="code" href="a00009.html#add9d9415d959dd6280c4c9388463890b" title="Fourth template parameter: STL allocator.">allocator_type</a> <a class="code" href="a00009.html#a603ef9ef20b9f7ad05401d5d6eca2ece" title="Return the base node allocator provided during construction.">get_allocator</a>()<span class="keyword"> const</span>
<a name="l00244"></a>00244 <span class="keyword"> </span>{
<a name="l00245"></a>00245 <span class="keywordflow">return</span> <a class="code" href="a00009.html#a352435bb00a9126a4c72b565553d13b7" 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="l00246"></a>00246 }
<a name="l00247"></a>00247
<a name="l00248"></a>00248 <span class="keyword">public</span>:
<a name="l00249"></a>00249 <span class="comment">// *** Fast Destruction of the B+ Tree</span>
<a name="l00250"></a>00250 <span class="comment"></span>
<a name="l00251"></a>00251 <span class="comment"> /// Frees all keys and all nodes of the tree</span>
<a name="l00252"></a><a class="code" href="a00009.html#a52fe59cdd4576d9cc9266e42bca323b2">00252</a> <span class="comment"></span> <span class="keywordtype">void</span> <a class="code" href="a00009.html#a52fe59cdd4576d9cc9266e42bca323b2" title="Frees all keys and all nodes of the tree.">clear</a>()
<a name="l00253"></a>00253 {
<a name="l00254"></a>00254 <a class="code" href="a00009.html#a352435bb00a9126a4c72b565553d13b7" 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="l00255"></a>00255 }
<a name="l00256"></a>00256
<a name="l00257"></a>00257 <span class="keyword">public</span>:
<a name="l00258"></a>00258 <span class="comment">// *** STL Iterator Construction Functions</span>
<a name="l00259"></a>00259 <span class="comment"></span>
<a name="l00260"></a>00260 <span class="comment"> /// Constructs a read/data-write iterator that points to the first slot in</span>
<a name="l00261"></a>00261 <span class="comment"> /// the first leaf of the B+ tree.</span>
<a name="l00262"></a><a class="code" href="a00009.html#a9521b86ca0d5142a12ae32523c1afb71">00262</a> <span class="comment"></span> <span class="keyword">inline</span> <a class="code" href="a00009.html#a7d77049f9bbaaf25ba9edc0635c4627f" title="STL-like iterator object for B+ tree items.">iterator</a> <a class="code" href="a00009.html#a9521b86ca0d5142a12ae32523c1afb71" 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="l00263"></a>00263 {
<a name="l00264"></a>00264 <span class="keywordflow">return</span> <a class="code" href="a00009.html#a352435bb00a9126a4c72b565553d13b7" 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="l00265"></a>00265 }
<a name="l00266"></a>00266 <span class="comment"></span>
<a name="l00267"></a>00267 <span class="comment"> /// Constructs a read/data-write iterator that points to the first invalid</span>
<a name="l00268"></a>00268 <span class="comment"> /// slot in the last leaf of the B+ tree.</span>
<a name="l00269"></a><a class="code" href="a00009.html#a8048755a5927b42cce11c19fa8953d93">00269</a> <span class="comment"></span> <span class="keyword">inline</span> <a class="code" href="a00009.html#a7d77049f9bbaaf25ba9edc0635c4627f" title="STL-like iterator object for B+ tree items.">iterator</a> <a class="code" href="a00009.html#a8048755a5927b42cce11c19fa8953d93" 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="l00270"></a>00270 {
<a name="l00271"></a>00271 <span class="keywordflow">return</span> <a class="code" href="a00009.html#a352435bb00a9126a4c72b565553d13b7" 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="l00272"></a>00272 }
<a name="l00273"></a>00273 <span class="comment"></span>
<a name="l00274"></a>00274 <span class="comment"> /// Constructs a read-only constant iterator that points to the first slot</span>
<a name="l00275"></a>00275 <span class="comment"> /// in the first leaf of the B+ tree.</span>
<a name="l00276"></a><a class="code" href="a00009.html#ad79866f391eff27bb4da840c31f1b4cd">00276</a> <span class="comment"></span> <span class="keyword">inline</span> <a class="code" href="a00009.html#aa5d3d9c7b1218e5680f653fd8f9d8996" title="STL-like iterator object for B+ tree items.">const_iterator</a> <a class="code" href="a00009.html#a9521b86ca0d5142a12ae32523c1afb71" 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="l00277"></a>00277 <span class="keyword"> </span>{
<a name="l00278"></a>00278 <span class="keywordflow">return</span> <a class="code" href="a00009.html#a352435bb00a9126a4c72b565553d13b7" 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="l00279"></a>00279 }
<a name="l00280"></a>00280 <span class="comment"></span>
<a name="l00281"></a>00281 <span class="comment"> /// Constructs a read-only constant iterator that points to the first</span>
<a name="l00282"></a>00282 <span class="comment"> /// invalid slot in the last leaf of the B+ tree.</span>
<a name="l00283"></a><a class="code" href="a00009.html#a0e5c8c7a9deff3d2fe75f180d01b911e">00283</a> <span class="comment"></span> <span class="keyword">inline</span> <a class="code" href="a00009.html#aa5d3d9c7b1218e5680f653fd8f9d8996" title="STL-like iterator object for B+ tree items.">const_iterator</a> <a class="code" href="a00009.html#a8048755a5927b42cce11c19fa8953d93" 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="l00284"></a>00284 <span class="keyword"> </span>{
<a name="l00285"></a>00285 <span class="keywordflow">return</span> <a class="code" href="a00009.html#a352435bb00a9126a4c72b565553d13b7" 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="l00286"></a>00286 }
<a name="l00287"></a>00287 <span class="comment"></span>
<a name="l00288"></a>00288 <span class="comment"> /// Constructs a read/data-write reverse iterator that points to the first</span>
<a name="l00289"></a>00289 <span class="comment"> /// invalid slot in the last leaf of the B+ tree. Uses STL magic.</span>
<a name="l00290"></a><a class="code" href="a00009.html#a4f427468ae77255b8f6dfd99f09df632">00290</a> <span class="comment"></span> <span class="keyword">inline</span> <a class="code" href="a00009.html#afb9918dafdccf1eaffa6b6ddc8de0938" title="create mutable reverse iterator by using STL magic">reverse_iterator</a> <a class="code" href="a00009.html#a4f427468ae77255b8f6dfd99f09df632" title="Constructs a read/data-write reverse iterator that points to the first invalid slot in the last leaf ...">rbegin</a>()
<a name="l00291"></a>00291 {
<a name="l00292"></a>00292 <span class="keywordflow">return</span> <a class="code" href="a00009.html#a352435bb00a9126a4c72b565553d13b7" 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="l00293"></a>00293 }
<a name="l00294"></a>00294 <span class="comment"></span>
<a name="l00295"></a>00295 <span class="comment"> /// Constructs a read/data-write reverse iterator that points to the first</span>
<a name="l00296"></a>00296 <span class="comment"> /// slot in the first leaf of the B+ tree. Uses STL magic.</span>
<a name="l00297"></a><a class="code" href="a00009.html#a9e1eb2e0b1c92cee93524a002456fbaf">00297</a> <span class="comment"></span> <span class="keyword">inline</span> <a class="code" href="a00009.html#afb9918dafdccf1eaffa6b6ddc8de0938" title="create mutable reverse iterator by using STL magic">reverse_iterator</a> <a class="code" href="a00009.html#a9e1eb2e0b1c92cee93524a002456fbaf" title="Constructs a read/data-write reverse iterator that points to the first slot in the first leaf of the ...">rend</a>()
<a name="l00298"></a>00298 {
<a name="l00299"></a>00299 <span class="keywordflow">return</span> <a class="code" href="a00009.html#a352435bb00a9126a4c72b565553d13b7" 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="l00300"></a>00300 }
<a name="l00301"></a>00301 <span class="comment"></span>
<a name="l00302"></a>00302 <span class="comment"> /// Constructs a read-only reverse iterator that points to the first</span>
<a name="l00303"></a>00303 <span class="comment"> /// invalid slot in the last leaf of the B+ tree. Uses STL magic.</span>
<a name="l00304"></a><a class="code" href="a00009.html#af6fcf44e17e2c3416228f3f016c46d18">00304</a> <span class="comment"></span> <span class="keyword">inline</span> <a class="code" href="a00009.html#a989d5052f0f73009ad08544bef214038" title="create constant reverse iterator by using STL magic">const_reverse_iterator</a> <a class="code" href="a00009.html#a4f427468ae77255b8f6dfd99f09df632" 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="l00305"></a>00305 <span class="keyword"> </span>{
<a name="l00306"></a>00306 <span class="keywordflow">return</span> <a class="code" href="a00009.html#a352435bb00a9126a4c72b565553d13b7" 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="l00307"></a>00307 }
<a name="l00308"></a>00308 <span class="comment"></span>
<a name="l00309"></a>00309 <span class="comment"> /// Constructs a read-only reverse iterator that points to the first slot</span>
<a name="l00310"></a>00310 <span class="comment"> /// in the first leaf of the B+ tree. Uses STL magic.</span>
<a name="l00311"></a><a class="code" href="a00009.html#a054c601b6f1f281868d8426a61e7020d">00311</a> <span class="comment"></span> <span class="keyword">inline</span> <a class="code" href="a00009.html#a989d5052f0f73009ad08544bef214038" title="create constant reverse iterator by using STL magic">const_reverse_iterator</a> <a class="code" href="a00009.html#a9e1eb2e0b1c92cee93524a002456fbaf" 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="l00312"></a>00312 <span class="keyword"> </span>{
<a name="l00313"></a>00313 <span class="keywordflow">return</span> <a class="code" href="a00009.html#a352435bb00a9126a4c72b565553d13b7" 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="l00314"></a>00314 }
<a name="l00315"></a>00315
<a name="l00316"></a>00316 <span class="keyword">public</span>:
<a name="l00317"></a>00317 <span class="comment">// *** Access Functions to the Item Count</span>
<a name="l00318"></a>00318 <span class="comment"></span>
<a name="l00319"></a>00319 <span class="comment"> /// Return the number of keys in the B+ tree</span>
<a name="l00320"></a><a class="code" href="a00009.html#ad00b79874786c1f20cae2b7e765b9e7a">00320</a> <span class="comment"></span> <span class="keyword">inline</span> <a class="code" href="a00009.html#ab2cb644afc7271107dcceb53e9a86f45" title="Size type used to count keys.">size_type</a> <a class="code" href="a00009.html#ad00b79874786c1f20cae2b7e765b9e7a" title="Return the number of keys in the B+ tree.">size</a>()<span class="keyword"> const</span>
<a name="l00321"></a>00321 <span class="keyword"> </span>{
<a name="l00322"></a>00322 <span class="keywordflow">return</span> <a class="code" href="a00009.html#a352435bb00a9126a4c72b565553d13b7" 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="l00323"></a>00323 }
<a name="l00324"></a>00324 <span class="comment"></span>
<a name="l00325"></a>00325 <span class="comment"> /// Returns true if there is at least one key in the B+ tree</span>
<a name="l00326"></a><a class="code" href="a00009.html#a763bf123995cf352f7a08bc43fe0597d">00326</a> <span class="comment"></span> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="a00009.html#a763bf123995cf352f7a08bc43fe0597d" title="Returns true if there is at least one key in the B+ tree.">empty</a>()<span class="keyword"> const</span>
<a name="l00327"></a>00327 <span class="keyword"> </span>{
<a name="l00328"></a>00328 <span class="keywordflow">return</span> <a class="code" href="a00009.html#a352435bb00a9126a4c72b565553d13b7" 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="l00329"></a>00329 }
<a name="l00330"></a>00330 <span class="comment"></span>
<a name="l00331"></a>00331 <span class="comment"> /// Returns the largest possible size of the B+ Tree. This is just a</span>
<a name="l00332"></a>00332 <span class="comment"> /// function required by the STL standard, the B+ Tree can hold more items.</span>
<a name="l00333"></a><a class="code" href="a00009.html#ae3338e9685da6924c7be74906b3cf68b">00333</a> <span class="comment"></span> <span class="keyword">inline</span> <a class="code" href="a00009.html#ab2cb644afc7271107dcceb53e9a86f45" title="Size type used to count keys.">size_type</a> <a class="code" href="a00009.html#ae3338e9685da6924c7be74906b3cf68b" title="Returns the largest possible size of the B+ Tree.">max_size</a>()<span class="keyword"> const</span>
<a name="l00334"></a>00334 <span class="keyword"> </span>{
<a name="l00335"></a>00335 <span class="keywordflow">return</span> <a class="code" href="a00009.html#a352435bb00a9126a4c72b565553d13b7" 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="l00336"></a>00336 }
<a name="l00337"></a>00337 <span class="comment"></span>
<a name="l00338"></a>00338 <span class="comment"> /// Return a const reference to the current statistics.</span>
<a name="l00339"></a><a class="code" href="a00009.html#ae085f7427a2cb614b5a44c0b545fb86b">00339</a> <span class="comment"></span> <span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="a00009.html#acb76d4594a31ed8906a25d08f5830f5e" title="Small structure containing statistics about the tree.">tree_stats</a>&amp; <a class="code" href="a00009.html#ae085f7427a2cb614b5a44c0b545fb86b" title="Return a const reference to the current statistics.">get_stats</a>()<span class="keyword"> const</span>
<a name="l00340"></a>00340 <span class="keyword"> </span>{
<a name="l00341"></a>00341 <span class="keywordflow">return</span> <a class="code" href="a00009.html#a352435bb00a9126a4c72b565553d13b7" 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="l00342"></a>00342 }
<a name="l00343"></a>00343
<a name="l00344"></a>00344 <span class="keyword">public</span>:
<a name="l00345"></a>00345 <span class="comment">// *** Standard Access Functions Querying the Tree by Descending to a Leaf</span>
<a name="l00346"></a>00346 <span class="comment"></span>
<a name="l00347"></a>00347 <span class="comment"> /// Non-STL function checking whether a key is in the B+ tree. The same as</span>
<a name="l00348"></a>00348 <span class="comment"> /// (find(k) != end()) or (count() != 0).</span>
<a name="l00349"></a><a class="code" href="a00009.html#ac76905f0dc9369d4bb460f6e24bf7363">00349</a> <span class="comment"></span> <span class="keywordtype">bool</span> <a class="code" href="a00009.html#ac76905f0dc9369d4bb460f6e24bf7363" title="Non-STL function checking whether a key is in the B+ tree.">exists</a>(<span class="keyword">const</span> <a class="code" href="a00009.html#a30048df0132910557b9fc6eef098c260" title="First template parameter: The key type of the B+ tree.">key_type</a> &amp;key)<span class="keyword"> const</span>
<a name="l00350"></a>00350 <span class="keyword"> </span>{
<a name="l00351"></a>00351 <span class="keywordflow">return</span> <a class="code" href="a00009.html#a352435bb00a9126a4c72b565553d13b7" 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="l00352"></a>00352 }
<a name="l00353"></a>00353 <span class="comment"></span>
<a name="l00354"></a>00354 <span class="comment"> /// Tries to locate a key in the B+ tree and returns an iterator to the</span>
<a name="l00355"></a>00355 <span class="comment"> /// key slot if found. If unsuccessful it returns end().</span>
<a name="l00356"></a><a class="code" href="a00009.html#a7ed6ed0ae9f3993cedca7b7d8755be85">00356</a> <span class="comment"></span> <a class="code" href="a00009.html#a7d77049f9bbaaf25ba9edc0635c4627f" title="STL-like iterator object for B+ tree items.">iterator</a> <a class="code" href="a00009.html#a7ed6ed0ae9f3993cedca7b7d8755be85" 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="a00009.html#a30048df0132910557b9fc6eef098c260" title="First template parameter: The key type of the B+ tree.">key_type</a> &amp;key)
<a name="l00357"></a>00357 {
<a name="l00358"></a>00358 <span class="keywordflow">return</span> <a class="code" href="a00009.html#a352435bb00a9126a4c72b565553d13b7" 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="l00359"></a>00359 }
<a name="l00360"></a>00360 <span class="comment"></span>
<a name="l00361"></a>00361 <span class="comment"> /// Tries to locate a key in the B+ tree and returns an constant iterator</span>
<a name="l00362"></a>00362 <span class="comment"> /// to the key slot if found. If unsuccessful it returns end().</span>
<a name="l00363"></a><a class="code" href="a00009.html#a4f4474b05a7a87b0ce0e9a451b25741d">00363</a> <span class="comment"></span> <a class="code" href="a00009.html#aa5d3d9c7b1218e5680f653fd8f9d8996" title="STL-like iterator object for B+ tree items.">const_iterator</a> <a class="code" href="a00009.html#a7ed6ed0ae9f3993cedca7b7d8755be85" 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="a00009.html#a30048df0132910557b9fc6eef098c260" title="First template parameter: The key type of the B+ tree.">key_type</a> &amp;key)<span class="keyword"> const</span>
<a name="l00364"></a>00364 <span class="keyword"> </span>{
<a name="l00365"></a>00365 <span class="keywordflow">return</span> <a class="code" href="a00009.html#a352435bb00a9126a4c72b565553d13b7" 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="l00366"></a>00366 }
<a name="l00367"></a>00367 <span class="comment"></span>
<a name="l00368"></a>00368 <span class="comment"> /// Tries to locate a key in the B+ tree and returns the number of</span>
<a name="l00369"></a>00369 <span class="comment"> /// identical key entries found. As this is a unique set, count() returns</span>
<a name="l00370"></a>00370 <span class="comment"> /// either 0 or 1.</span>
<a name="l00371"></a><a class="code" href="a00009.html#a1dbbf865a4ad5a740419de17946b4a4c">00371</a> <span class="comment"></span> <a class="code" href="a00009.html#ab2cb644afc7271107dcceb53e9a86f45" title="Size type used to count keys.">size_type</a> <a class="code" href="a00009.html#a1dbbf865a4ad5a740419de17946b4a4c" 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="a00009.html#a30048df0132910557b9fc6eef098c260" title="First template parameter: The key type of the B+ tree.">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="a00009.html#a352435bb00a9126a4c72b565553d13b7" 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="a00009.html#ab9bce6f24080308ab099b2ea41adbba7">00378</a> <span class="comment"></span> <a class="code" href="a00009.html#a7d77049f9bbaaf25ba9edc0635c4627f" title="STL-like iterator object for B+ tree items.">iterator</a> <a class="code" href="a00009.html#ab9bce6f24080308ab099b2ea41adbba7" 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="a00009.html#a30048df0132910557b9fc6eef098c260" title="First template parameter: The key type of the B+ tree.">key_type</a>&amp; key)
<a name="l00379"></a>00379 {
<a name="l00380"></a>00380 <span class="keywordflow">return</span> <a class="code" href="a00009.html#a352435bb00a9126a4c72b565553d13b7" 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="a00009.html#a555d7bf9ca80b37707ed8a2f2427bd10">00386</a> <span class="comment"></span> <a class="code" href="a00009.html#aa5d3d9c7b1218e5680f653fd8f9d8996" title="STL-like iterator object for B+ tree items.">const_iterator</a> <a class="code" href="a00009.html#ab9bce6f24080308ab099b2ea41adbba7" 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="a00009.html#a30048df0132910557b9fc6eef098c260" title="First template parameter: The key type of the B+ tree.">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="a00009.html#a352435bb00a9126a4c72b565553d13b7" 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="a00009.html#ab135d588af2fbdf1631a722b9014c524">00393</a> <span class="comment"></span> <a class="code" href="a00009.html#a7d77049f9bbaaf25ba9edc0635c4627f" title="STL-like iterator object for B+ tree items.">iterator</a> <a class="code" href="a00009.html#ab135d588af2fbdf1631a722b9014c524" 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="a00009.html#a30048df0132910557b9fc6eef098c260" title="First template parameter: The key type of the B+ tree.">key_type</a>&amp; key)
<a name="l00394"></a>00394 {
<a name="l00395"></a>00395 <span class="keywordflow">return</span> <a class="code" href="a00009.html#a352435bb00a9126a4c72b565553d13b7" 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="a00009.html#a8cccc9b19e58b5c37f3f40ffd8ae3978">00401</a> <span class="comment"></span> <a class="code" href="a00009.html#aa5d3d9c7b1218e5680f653fd8f9d8996" title="STL-like iterator object for B+ tree items.">const_iterator</a> <a class="code" href="a00009.html#ab135d588af2fbdf1631a722b9014c524" 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="a00009.html#a30048df0132910557b9fc6eef098c260" title="First template parameter: The key type of the B+ tree.">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="a00009.html#a352435bb00a9126a4c72b565553d13b7" 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="a00009.html#af023de2dd94f574e312e8e9f5515bd8c">00407</a> <span class="comment"></span> <span class="keyword">inline</span> std::pair&lt;iterator, iterator&gt; <a class="code" href="a00009.html#af023de2dd94f574e312e8e9f5515bd8c" 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="a00009.html#a30048df0132910557b9fc6eef098c260" title="First template parameter: The key type of the B+ tree.">key_type</a>&amp; key)
<a name="l00408"></a>00408 {
<a name="l00409"></a>00409 <span class="keywordflow">return</span> <a class="code" href="a00009.html#a352435bb00a9126a4c72b565553d13b7" 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="a00009.html#ac9dc81052691280fb5fd0b091c08ea0a">00413</a> <span class="comment"></span> <span class="keyword">inline</span> std::pair&lt;const_iterator, const_iterator&gt; <a class="code" href="a00009.html#af023de2dd94f574e312e8e9f5515bd8c" 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="a00009.html#a30048df0132910557b9fc6eef098c260" title="First template parameter: The key type of the B+ tree.">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="a00009.html#a352435bb00a9126a4c72b565553d13b7" 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 elements are considered equal.</span>
<a name="l00423"></a><a class="code" href="a00009.html#a7151704256c80cf7bc413b48bea52b75">00423</a> <span class="comment"></span> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="a00009.html#a7151704256c80cf7bc413b48bea52b75" 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="a00009.html#a352435bb00a9126a4c72b565553d13b7" 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="a00009.html#a164d435a3f3c3ba2a00a4f4c8f1a91b2">00429</a> <span class="comment"></span> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="a00009.html#a164d435a3f3c3ba2a00a4f4c8f1a91b2" 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="a00009.html#a352435bb00a9126a4c72b565553d13b7" 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="a00009.html#a9e637bfa9b10589da6af42ac17048976">00436</a> <span class="comment"></span> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="a00009.html#a9e637bfa9b10589da6af42ac17048976" 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="a00009.html#a352435bb00a9126a4c72b565553d13b7" 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="a00009.html#a201df2577f43d59328a442f38bbb6e30">00442</a> <span class="comment"></span> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="a00009.html#a201df2577f43d59328a442f38bbb6e30" 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="a00009.html#a352435bb00a9126a4c72b565553d13b7" 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="a00009.html#a9ce20587b88f126796b6e3784680f66e">00448</a> <span class="comment"></span> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="a00009.html#a9ce20587b88f126796b6e3784680f66e" 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="a00009.html#a352435bb00a9126a4c72b565553d13b7" 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="a00009.html#afefedc35ea11d982c716860a921f2a24">00454</a> <span class="comment"></span> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="a00009.html#afefedc35ea11d982c716860a921f2a24" 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="a00009.html#a352435bb00a9126a4c72b565553d13b7" 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="a00009.html#a36ba21d19bf0aa1bc6b2ffb8e4ea8cfc">00463</a> <span class="comment"></span> <span class="keyword">inline</span> <span class="keyword">self</span>&amp; <a class="code" href="a00009.html#a36ba21d19bf0aa1bc6b2ffb8e4ea8cfc" 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="a00009.html#a352435bb00a9126a4c72b565553d13b7" 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="a00009.html#af37409eb0e66f7d3e80b8ad29470118b">00474</a> <span class="comment"></span> <span class="keyword">inline</span> <a class="code" href="a00009.html#a45a3f6e426f588acd351b258413e2797" title="Default constructor initializing an empty B+ tree with the standard key comparison function...">btree_set</a>(<span class="keyword">const</span> <span class="keyword">self</span> &amp;other)
<a name="l00475"></a>00475 : <a class="code" href="a00009.html#a352435bb00a9126a4c72b565553d13b7" title="The contained implementation object.">tree</a>(other.<a class="code" href="a00009.html#a352435bb00a9126a4c72b565553d13b7" 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. The insert will fail if it is</span>
<a name="l00483"></a>00483 <span class="comment"> /// already present.</span>
<a name="l00484"></a><a class="code" href="a00009.html#aea42997e9d00ecaabe5e868196c5e8f0">00484</a> <span class="comment"></span> <span class="keyword">inline</span> std::pair&lt;iterator, bool&gt; <a class="code" href="a00009.html#aea42997e9d00ecaabe5e868196c5e8f0" title="Attempt to insert a key into the B+ tree.">insert</a>(<span class="keyword">const</span> <a class="code" href="a00009.html#a30048df0132910557b9fc6eef098c260" title="First template parameter: The key type of the B+ tree.">key_type</a>&amp; x)
<a name="l00485"></a>00485 {
<a name="l00486"></a>00486 <span class="keywordflow">return</span> <a class="code" href="a00009.html#a352435bb00a9126a4c72b565553d13b7" 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="a00009.html#a00bbef593d8ccf4068c327a83ec63284" title="The empty data_type.">data_type</a>());
<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="a00009.html#a9f6d35bf91f3c3c8721a73ce7ebba710">00491</a> <span class="comment"></span> <span class="keyword">inline</span> <a class="code" href="a00009.html#a7d77049f9bbaaf25ba9edc0635c4627f" title="STL-like iterator object for B+ tree items.">iterator</a> <a class="code" href="a00009.html#aea42997e9d00ecaabe5e868196c5e8f0" title="Attempt to insert a key into the B+ tree.">insert</a>(<a class="code" href="a00009.html#a7d77049f9bbaaf25ba9edc0635c4627f" title="STL-like iterator object for B+ tree items.">iterator</a> hint, <span class="keyword">const</span> <a class="code" href="a00009.html#a30048df0132910557b9fc6eef098c260" title="First template parameter: The key type of the B+ tree.">key_type</a> &amp;x)
<a name="l00492"></a>00492 {
<a name="l00493"></a>00493 <span class="keywordflow">return</span> <a class="code" href="a00009.html#a352435bb00a9126a4c72b565553d13b7" 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="a00009.html#a00bbef593d8ccf4068c327a83ec63284" 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 iterators dereferencing to</span>
<a name="l00497"></a>00497 <span class="comment"> /// key_type into the B+ tree. Each key/data pair 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="a00009.html#a4e7317f32d2855d50b2dd18df22c2f96">00499</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00009.html#aea42997e9d00ecaabe5e868196c5e8f0" 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="a00009.html#aea42997e9d00ecaabe5e868196c5e8f0" 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="a00009.html#a51c3a4976f4bd78315a3c25ab2da5c33">00513</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00009.html#a51c3a4976f4bd78315a3c25ab2da5c33" 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="a00009.html#a352435bb00a9126a4c72b565553d13b7" 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 the key from the set. As this is a unique set, there is no</span>
<a name="l00522"></a>00522 <span class="comment"> /// difference to erase().</span>
<a name="l00523"></a><a class="code" href="a00009.html#a0cf2d6744a938d3249f58263f68f4802">00523</a> <span class="comment"></span> <span class="keywordtype">bool</span> <a class="code" href="a00009.html#a0cf2d6744a938d3249f58263f68f4802" title="Erases the key from the set.">erase_one</a>(<span class="keyword">const</span> <a class="code" href="a00009.html#a30048df0132910557b9fc6eef098c260" title="First template parameter: The key type of the B+ tree.">key_type</a> &amp;key)
<a name="l00524"></a>00524 {
<a name="l00525"></a>00525 <span class="keywordflow">return</span> <a class="code" href="a00009.html#a352435bb00a9126a4c72b565553d13b7" 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="l00526"></a>00526 }
<a name="l00527"></a>00527 <span class="comment"></span>
<a name="l00528"></a>00528 <span class="comment"> /// Erases all the key/data pairs associated with the given key.</span>
<a name="l00529"></a><a class="code" href="a00009.html#a0b4f57f1b268095b0c33c5623280c4e4">00529</a> <span class="comment"></span> <a class="code" href="a00009.html#ab2cb644afc7271107dcceb53e9a86f45" title="Size type used to count keys.">size_type</a> <a class="code" href="a00009.html#a0b4f57f1b268095b0c33c5623280c4e4" title="Erases all the key/data pairs associated with the given key.">erase</a>(<span class="keyword">const</span> <a class="code" href="a00009.html#a30048df0132910557b9fc6eef098c260" title="First template parameter: The key type of the B+ tree.">key_type</a> &amp;key)
<a name="l00530"></a>00530 {
<a name="l00531"></a>00531 <span class="keywordflow">return</span> <a class="code" href="a00009.html#a352435bb00a9126a4c72b565553d13b7" 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="a00009.html#aea8d759b037157313042df5b6cad4b5b">00535</a> <span class="comment"></span> <span class="keywordtype">void</span> <a class="code" href="a00009.html#a0b4f57f1b268095b0c33c5623280c4e4" title="Erases all the key/data pairs associated with the given key.">erase</a>(<a class="code" href="a00009.html#a7d77049f9bbaaf25ba9edc0635c4627f" 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="a00009.html#a352435bb00a9126a4c72b565553d13b7" 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="a00009.html#ad0bf46d5da971b9abef66a69bab86b33">00543</a> <span class="comment"></span> <span class="keywordtype">void</span> <a class="code" href="a00009.html#a0b4f57f1b268095b0c33c5623280c4e4" title="Erases all the key/data pairs associated with the given key.">erase</a>(<a class="code" href="a00009.html#a7d77049f9bbaaf25ba9edc0635c4627f" title="STL-like iterator object for B+ tree items.">iterator</a> <span class="comment">/* first */</span>, <a class="code" href="a00009.html#a7d77049f9bbaaf25ba9edc0635c4627f" 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="a00009.html#ab52f7877dc24a1ada22eb093346926ad">00556</a> <span class="comment"></span> <span class="keywordtype">void</span> <a class="code" href="a00009.html#ab52f7877dc24a1ada22eb093346926ad" 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="a00009.html#a352435bb00a9126a4c72b565553d13b7" 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="a00009.html#ab4f43a518a8294478c0a635e6cb822f4">00562</a> <span class="comment"></span> <span class="keywordtype">void</span> <a class="code" href="a00009.html#ab4f43a518a8294478c0a635e6cb822f4" 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="a00009.html#a352435bb00a9126a4c72b565553d13b7" 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
<a name="l00567"></a>00567 <span class="preprocessor">#endif</span>
<a name="l00568"></a>00568 <span class="preprocessor"></span>
<a name="l00569"></a>00569 <span class="keyword">public</span>:
<a name="l00570"></a>00570 <span class="comment">// *** Verification of B+ Tree Invariants</span>
<a name="l00571"></a>00571 <span class="comment"></span>
<a name="l00572"></a>00572 <span class="comment"> /// Run a thorough verification of all B+ tree invariants. The program</span>
<a name="l00573"></a>00573 <span class="comment"> /// aborts via BTREE_ASSERT() if something is wrong.</span>
<a name="l00574"></a><a class="code" href="a00009.html#af88455baba68554522a181ad2a8dc8fc">00574</a> <span class="comment"></span> <span class="keywordtype">void</span> <a class="code" href="a00009.html#af88455baba68554522a181ad2a8dc8fc" title="Run a thorough verification of all B+ tree invariants.">verify</a>()<span class="keyword"> const</span>
<a name="l00575"></a>00575 <span class="keyword"> </span>{
<a name="l00576"></a>00576 <a class="code" href="a00009.html#a352435bb00a9126a4c72b565553d13b7" 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="l00577"></a>00577 }
<a name="l00578"></a>00578
<a name="l00579"></a>00579 <span class="keyword">public</span>:
<a name="l00580"></a>00580 <span class="comment"></span>
<a name="l00581"></a>00581 <span class="comment"> /// Dump the contents of the B+ tree out onto an ostream as a binary</span>
<a name="l00582"></a>00582 <span class="comment"> /// image. The image contains memory pointers which will be fixed when the</span>
<a name="l00583"></a>00583 <span class="comment"> /// image is restored. For this to work your key_type must be an integral</span>
<a name="l00584"></a>00584 <span class="comment"> /// type and contain no pointers or references.</span>
<a name="l00585"></a><a class="code" href="a00009.html#ab482ba64445f71f2c088f0c5ee981ea5">00585</a> <span class="comment"></span> <span class="keywordtype">void</span> <a class="code" href="a00009.html#ab482ba64445f71f2c088f0c5ee981ea5" 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="l00586"></a>00586 <span class="keyword"> </span>{
<a name="l00587"></a>00587 <a class="code" href="a00009.html#a352435bb00a9126a4c72b565553d13b7" 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="l00588"></a>00588 }
<a name="l00589"></a>00589 <span class="comment"></span>
<a name="l00590"></a>00590 <span class="comment"> /// Restore a binary image of a dumped B+ tree from an istream. The B+ tree</span>
<a name="l00591"></a>00591 <span class="comment"> /// pointers are fixed using the dump order. For dump and restore to work</span>
<a name="l00592"></a>00592 <span class="comment"> /// your key_type must be an integral type and contain no pointers or</span>
<a name="l00593"></a>00593 <span class="comment"> /// references. Returns true if the restore was successful.</span>
<a name="l00594"></a><a class="code" href="a00009.html#a2f73e4b0a1d3ed2f6e73ef33dea0ac46">00594</a> <span class="comment"></span> <span class="keywordtype">bool</span> <a class="code" href="a00009.html#a2f73e4b0a1d3ed2f6e73ef33dea0ac46" title="Restore a binary image of a dumped B+ tree from an istream.">restore</a>(std::istream &amp;is)
<a name="l00595"></a>00595 {
<a name="l00596"></a>00596 <span class="keywordflow">return</span> <a class="code" href="a00009.html#a352435bb00a9126a4c72b565553d13b7" 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="l00597"></a>00597 }
<a name="l00598"></a>00598 };
<a name="l00599"></a>00599
<a name="l00600"></a>00600 } <span class="comment">// namespace stx</span>
<a name="l00601"></a>00601
<a name="l00602"></a>00602 <span class="preprocessor">#endif // _STX_BTREE_SET_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>