67
56
<a href="#pub-static-methods">Static Public Member Functions</a> |
68
57
<a href="#pro-methods">Protected Member Functions</a> </div>
69
58
<div class="headertitle">
70
<div class="title">Glib::BalancedTree Class Reference</div> </div>
59
<div class="title">Glib::BalancedTree< K, V > Class Template Reference</div> </div>
72
61
<div class="contents">
73
<!-- doxytag: class="Glib::BalancedTree" -->
74
63
<p>Balanced Binary Trees — a sorted collection of key/value pairs optimized for searching and traversing in order. <a href="classGlib_1_1BalancedTree.html#details">More...</a></p>
76
65
<p><code>#include <glibmm/balancedtree.h></code></p>
78
67
<p><a href="classGlib_1_1BalancedTree-members.html">List of all members.</a></p>
79
68
<table class="memberdecls">
80
<tr><td colspan="2"><h2><a name="pub-types"></a>
69
<tr class="heading"><td colspan="2"><h2><a name="pub-types"></a>
81
70
Public Types</h2></td></tr>
82
<tr><td class="memItemLeft" align="right" valign="top">typedef <a class="elRef" doxygen="libsigc++-2.0.tag:http://library.gnome.org/devel/libsigc++/unstable/" href="http://library.gnome.org/devel/libsigc++/unstable/classsigc_1_1slot.html">sigc::slot</a>< bool, <br class="typebreak"/>
83
const K&, const V& > </td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1BalancedTree.html#a154ac5a5b5a715967c33e381010af4fb">TraverseFunc</a></td></tr>
84
<tr><td class="memItemLeft" align="right" valign="top">typedef <a class="elRef" doxygen="libsigc++-2.0.tag:http://library.gnome.org/devel/libsigc++/unstable/" href="http://library.gnome.org/devel/libsigc++/unstable/classsigc_1_1slot.html">sigc::slot</a>< int, const <br class="typebreak"/>
85
K&, const K& > </td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1BalancedTree.html#a3f0fca6b4f83d4e5660a5b216b47d44d">CompareFunc</a></td></tr>
86
<tr><td colspan="2"><h2><a name="pub-methods"></a>
71
<tr class="memitem:a4ff14046f2cef700ea37b5b9eb1e2e4e"><td class="memItemLeft" align="right" valign="top">typedef <a class="elRef" doxygen="libsigc++-2.0.tag:http://library.gnome.org/devel/libsigc++/unstable/" href="http://library.gnome.org/devel/libsigc++/unstable/classsigc_1_1slot.html">sigc::slot</a>< bool, <br class="typebreak"/>
72
const K&, const V& > </td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1BalancedTree.html#a4ff14046f2cef700ea37b5b9eb1e2e4e">TraverseFunc</a></td></tr>
73
<tr class="memitem:a9d637241cab431a674cadf806c0a83d4"><td class="memItemLeft" align="right" valign="top">typedef <a class="elRef" doxygen="libsigc++-2.0.tag:http://library.gnome.org/devel/libsigc++/unstable/" href="http://library.gnome.org/devel/libsigc++/unstable/classsigc_1_1slot.html">sigc::slot</a>< int, const <br class="typebreak"/>
74
K&, const K& > </td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1BalancedTree.html#a9d637241cab431a674cadf806c0a83d4">CompareFunc</a></td></tr>
75
</table><table class="memberdecls">
76
<tr class="heading"><td colspan="2"><h2><a name="pub-methods"></a>
87
77
Public Member Functions</h2></td></tr>
88
<tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1BalancedTree.html#a0dbc09ed0ee1d259bfb8eed6b322c119">~BalancedTree</a> ()</td></tr>
89
<tr><td class="memItemLeft" align="right" valign="top">GTree* </td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1BalancedTree.html#aed7a050230681a4f7e2295850c65db46">gobj</a> ()</td></tr>
90
<tr><td class="mdescLeft"> </td><td class="mdescRight">Provides access to the underlying C GObject. <a href="#aed7a050230681a4f7e2295850c65db46"></a><br/></td></tr>
91
<tr><td class="memItemLeft" align="right" valign="top">const GTree* </td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1BalancedTree.html#a12f1f81054f7a3707f9927052ad045ab">gobj</a> () const </td></tr>
92
<tr><td class="mdescLeft"> </td><td class="mdescRight">Provides access to the underlying C GObject. <a href="#a12f1f81054f7a3707f9927052ad045ab"></a><br/></td></tr>
93
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1BalancedTree.html#abdca6b386fa6d80f17b5ea071e72e5c3">reference</a> ()</td></tr>
94
<tr><td class="mdescLeft"> </td><td class="mdescRight">Increments the reference count of tree by one. <a href="#abdca6b386fa6d80f17b5ea071e72e5c3"></a><br/></td></tr>
95
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1BalancedTree.html#a5b605a8e0f1b148f565a62403e542a24">unreference</a> ()</td></tr>
96
<tr><td class="mdescLeft"> </td><td class="mdescRight">Decrements the reference count of tree by one. <a href="#a5b605a8e0f1b148f565a62403e542a24"></a><br/></td></tr>
97
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1BalancedTree.html#a5c25a47b95b95bf82382abfc9c2b938f">insert</a> (const K& key, const V&<a class="elRef" doxygen="libstdc++.tag:http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/" href="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/a01661.html#ga1c9e781d8d15a3814a601f471797c825">value</a>)</td></tr>
98
<tr><td class="mdescLeft"> </td><td class="mdescRight">Inserts a key/value pair into a <a class="el" href="classGlib_1_1BalancedTree.html" title="Balanced Binary Trees — a sorted collection of key/value pairs optimized for searching and traversing...">BalancedTree</a>. <a href="#a5c25a47b95b95bf82382abfc9c2b938f"></a><br/></td></tr>
99
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1BalancedTree.html#a8bcbb627536ca6259dae6fb2c310657a">remove</a> (const K& key)</td></tr>
100
<tr><td class="mdescLeft"> </td><td class="mdescRight">Removes a key/value pair from a <a class="el" href="classGlib_1_1BalancedTree.html" title="Balanced Binary Trees — a sorted collection of key/value pairs optimized for searching and traversing...">BalancedTree</a>. <a href="#a8bcbb627536ca6259dae6fb2c310657a"></a><br/></td></tr>
101
<tr><td class="memItemLeft" align="right" valign="top">V* </td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1BalancedTree.html#a2a3e2487e0da086402f9ac82a323b807">lookup</a> (const K& key)</td></tr>
102
<tr><td class="mdescLeft"> </td><td class="mdescRight">Gets the value corresponding to the given key. <a href="#a2a3e2487e0da086402f9ac82a323b807"></a><br/></td></tr>
103
<tr><td class="memItemLeft" align="right" valign="top">const V* </td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1BalancedTree.html#a24be930c7f257bce0022ff146c5eb68a">lookup</a> (const K& key) const </td></tr>
104
<tr><td class="memItemLeft" align="right" valign="top">gint </td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1BalancedTree.html#aedfba5c61a000954962cecbb1d93b7bf">height</a> () const </td></tr>
105
<tr><td class="mdescLeft"> </td><td class="mdescRight">Gets the height of a <a class="el" href="classGlib_1_1BalancedTree.html" title="Balanced Binary Trees — a sorted collection of key/value pairs optimized for searching and traversing...">BalancedTree</a>. <a href="#aedfba5c61a000954962cecbb1d93b7bf"></a><br/></td></tr>
106
<tr><td class="memItemLeft" align="right" valign="top">gint </td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1BalancedTree.html#a9f1d10536381051fffe35960cd6a29a6">nnodes</a> () const </td></tr>
107
<tr><td class="mdescLeft"> </td><td class="mdescRight">Gets the number of nodes in a <a class="el" href="classGlib_1_1BalancedTree.html" title="Balanced Binary Trees — a sorted collection of key/value pairs optimized for searching and traversing...">BalancedTree</a>. <a href="#a9f1d10536381051fffe35960cd6a29a6"></a><br/></td></tr>
108
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1BalancedTree.html#adb30dc8624d087a147aa5d232f0ffb5e">foreach</a> (const <a class="el" href="classGlib_1_1BalancedTree.html#a154ac5a5b5a715967c33e381010af4fb">TraverseFunc</a>& func) const </td></tr>
109
<tr><td class="mdescLeft"> </td><td class="mdescRight">Calls the given function for each of the key/value pairs in the <a class="el" href="classGlib_1_1BalancedTree.html" title="Balanced Binary Trees — a sorted collection of key/value pairs optimized for searching and traversing...">BalancedTree</a>. <a href="#adb30dc8624d087a147aa5d232f0ffb5e"></a><br/></td></tr>
110
<tr><td class="memItemLeft" align="right" valign="top">V* </td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1BalancedTree.html#a7dcc3d5ec0f3a55f8417158a665fbbdd">search</a> (const <a class="el" href="classGlib_1_1BalancedTree.html#a3f0fca6b4f83d4e5660a5b216b47d44d">CompareFunc</a>& search_func, const K& key)</td></tr>
111
<tr><td class="mdescLeft"> </td><td class="mdescRight">Searches a <a class="el" href="classGlib_1_1BalancedTree.html" title="Balanced Binary Trees — a sorted collection of key/value pairs optimized for searching and traversing...">BalancedTree</a> using <em>search_func</em>. <a href="#a7dcc3d5ec0f3a55f8417158a665fbbdd"></a><br/></td></tr>
112
<tr><td class="memItemLeft" align="right" valign="top">const V* </td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1BalancedTree.html#a529e85602ec10cf72a5ce36bc082806e">search</a> (const <a class="el" href="classGlib_1_1BalancedTree.html#a3f0fca6b4f83d4e5660a5b216b47d44d">CompareFunc</a>& search_func, const K& key) const </td></tr>
113
<tr><td class="mdescLeft"> </td><td class="mdescRight">Searches a <a class="el" href="classGlib_1_1BalancedTree.html" title="Balanced Binary Trees — a sorted collection of key/value pairs optimized for searching and traversing...">BalancedTree</a> using <em>search_func</em>. <a href="#a529e85602ec10cf72a5ce36bc082806e"></a><br/></td></tr>
114
<tr><td colspan="2"><h2><a name="pub-static-methods"></a>
78
<tr class="memitem:a6ad3ee2e4c7a396e059171800f703e13"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1BalancedTree.html#a6ad3ee2e4c7a396e059171800f703e13">~BalancedTree</a> ()</td></tr>
79
<tr class="memitem:a3992ca9669a73f98167e988ce0ff4415"><td class="memItemLeft" align="right" valign="top">GTree* </td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1BalancedTree.html#a3992ca9669a73f98167e988ce0ff4415">gobj</a> ()</td></tr>
80
<tr class="memdesc:a3992ca9669a73f98167e988ce0ff4415"><td class="mdescLeft"> </td><td class="mdescRight">Provides access to the underlying C GObject. <a href="#a3992ca9669a73f98167e988ce0ff4415"></a><br/></td></tr>
81
<tr class="memitem:aa95ee73b9302c6e53dce0e2b9a642b4c"><td class="memItemLeft" align="right" valign="top">const GTree* </td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1BalancedTree.html#aa95ee73b9302c6e53dce0e2b9a642b4c">gobj</a> () const </td></tr>
82
<tr class="memdesc:aa95ee73b9302c6e53dce0e2b9a642b4c"><td class="mdescLeft"> </td><td class="mdescRight">Provides access to the underlying C GObject. <a href="#aa95ee73b9302c6e53dce0e2b9a642b4c"></a><br/></td></tr>
83
<tr class="memitem:a80e50b78322d85f165ac2d6607ca9cb3"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1BalancedTree.html#a80e50b78322d85f165ac2d6607ca9cb3">reference</a> ()</td></tr>
84
<tr class="memdesc:a80e50b78322d85f165ac2d6607ca9cb3"><td class="mdescLeft"> </td><td class="mdescRight">Increments the reference count of tree by one. <a href="#a80e50b78322d85f165ac2d6607ca9cb3"></a><br/></td></tr>
85
<tr class="memitem:a6530fc006eec5d249a520be7e8bf4f20"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1BalancedTree.html#a6530fc006eec5d249a520be7e8bf4f20">unreference</a> ()</td></tr>
86
<tr class="memdesc:a6530fc006eec5d249a520be7e8bf4f20"><td class="mdescLeft"> </td><td class="mdescRight">Decrements the reference count of tree by one. <a href="#a6530fc006eec5d249a520be7e8bf4f20"></a><br/></td></tr>
87
<tr class="memitem:a1ff2e47b569956c2c8d19ba3f538346c"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1BalancedTree.html#a1ff2e47b569956c2c8d19ba3f538346c">insert</a> (const K& key, const V&<a class="elRef" doxygen="libstdc++.tag:http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/" href="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/a01661.html#ga1c9e781d8d15a3814a601f471797c825">value</a>)</td></tr>
88
<tr class="memdesc:a1ff2e47b569956c2c8d19ba3f538346c"><td class="mdescLeft"> </td><td class="mdescRight">Inserts a key/value pair into a <a class="el" href="classGlib_1_1BalancedTree.html" title="Balanced Binary Trees — a sorted collection of key/value pairs optimized for searching and traversing...">BalancedTree</a>. <a href="#a1ff2e47b569956c2c8d19ba3f538346c"></a><br/></td></tr>
89
<tr class="memitem:a751401d64137e241cacfec8e05ea5971"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1BalancedTree.html#a751401d64137e241cacfec8e05ea5971">remove</a> (const K& key)</td></tr>
90
<tr class="memdesc:a751401d64137e241cacfec8e05ea5971"><td class="mdescLeft"> </td><td class="mdescRight">Removes a key/value pair from a <a class="el" href="classGlib_1_1BalancedTree.html" title="Balanced Binary Trees — a sorted collection of key/value pairs optimized for searching and traversing...">BalancedTree</a>. <a href="#a751401d64137e241cacfec8e05ea5971"></a><br/></td></tr>
91
<tr class="memitem:a1004e229bf2fccbd79b15a7f567a51e0"><td class="memItemLeft" align="right" valign="top">V* </td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1BalancedTree.html#a1004e229bf2fccbd79b15a7f567a51e0">lookup</a> (const K& key)</td></tr>
92
<tr class="memdesc:a1004e229bf2fccbd79b15a7f567a51e0"><td class="mdescLeft"> </td><td class="mdescRight">Gets the value corresponding to the given key. <a href="#a1004e229bf2fccbd79b15a7f567a51e0"></a><br/></td></tr>
93
<tr class="memitem:acc3b86a40f9c6ce3f2870d2d51627cae"><td class="memItemLeft" align="right" valign="top">const V* </td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1BalancedTree.html#acc3b86a40f9c6ce3f2870d2d51627cae">lookup</a> (const K& key) const </td></tr>
94
<tr class="memitem:ab7f312cc9aa4a0cfc4d2b8b24b3d9749"><td class="memItemLeft" align="right" valign="top">gint </td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1BalancedTree.html#ab7f312cc9aa4a0cfc4d2b8b24b3d9749">height</a> () const </td></tr>
95
<tr class="memdesc:ab7f312cc9aa4a0cfc4d2b8b24b3d9749"><td class="mdescLeft"> </td><td class="mdescRight">Gets the height of a <a class="el" href="classGlib_1_1BalancedTree.html" title="Balanced Binary Trees — a sorted collection of key/value pairs optimized for searching and traversing...">BalancedTree</a>. <a href="#ab7f312cc9aa4a0cfc4d2b8b24b3d9749"></a><br/></td></tr>
96
<tr class="memitem:aa5965a94bd4afaa5da1dfb1c6406fef7"><td class="memItemLeft" align="right" valign="top">gint </td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1BalancedTree.html#aa5965a94bd4afaa5da1dfb1c6406fef7">nnodes</a> () const </td></tr>
97
<tr class="memdesc:aa5965a94bd4afaa5da1dfb1c6406fef7"><td class="mdescLeft"> </td><td class="mdescRight">Gets the number of nodes in a <a class="el" href="classGlib_1_1BalancedTree.html" title="Balanced Binary Trees — a sorted collection of key/value pairs optimized for searching and traversing...">BalancedTree</a>. <a href="#aa5965a94bd4afaa5da1dfb1c6406fef7"></a><br/></td></tr>
98
<tr class="memitem:aa1235b0242c3d7d87310adb6e370ec12"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1BalancedTree.html#aa1235b0242c3d7d87310adb6e370ec12">foreach</a> (const <a class="el" href="classGlib_1_1BalancedTree.html#a4ff14046f2cef700ea37b5b9eb1e2e4e">TraverseFunc</a>& func) const </td></tr>
99
<tr class="memdesc:aa1235b0242c3d7d87310adb6e370ec12"><td class="mdescLeft"> </td><td class="mdescRight">Calls the given function for each of the key/value pairs in the <a class="el" href="classGlib_1_1BalancedTree.html" title="Balanced Binary Trees — a sorted collection of key/value pairs optimized for searching and traversing...">BalancedTree</a>. <a href="#aa1235b0242c3d7d87310adb6e370ec12"></a><br/></td></tr>
100
<tr class="memitem:a55668fb48bb53d3099084db1088c9495"><td class="memItemLeft" align="right" valign="top">V* </td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1BalancedTree.html#a55668fb48bb53d3099084db1088c9495">search</a> (const <a class="el" href="classGlib_1_1BalancedTree.html#a9d637241cab431a674cadf806c0a83d4">CompareFunc</a>& search_func, const K& key)</td></tr>
101
<tr class="memdesc:a55668fb48bb53d3099084db1088c9495"><td class="mdescLeft"> </td><td class="mdescRight">Searches a <a class="el" href="classGlib_1_1BalancedTree.html" title="Balanced Binary Trees — a sorted collection of key/value pairs optimized for searching and traversing...">BalancedTree</a> using <em>search_func</em>. <a href="#a55668fb48bb53d3099084db1088c9495"></a><br/></td></tr>
102
<tr class="memitem:ae9339e46ced588dfc632ef35a6e97418"><td class="memItemLeft" align="right" valign="top">const V* </td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1BalancedTree.html#ae9339e46ced588dfc632ef35a6e97418">search</a> (const <a class="el" href="classGlib_1_1BalancedTree.html#a9d637241cab431a674cadf806c0a83d4">CompareFunc</a>& search_func, const K& key) const </td></tr>
103
<tr class="memdesc:ae9339e46ced588dfc632ef35a6e97418"><td class="mdescLeft"> </td><td class="mdescRight">Searches a <a class="el" href="classGlib_1_1BalancedTree.html" title="Balanced Binary Trees — a sorted collection of key/value pairs optimized for searching and traversing...">BalancedTree</a> using <em>search_func</em>. <a href="#ae9339e46ced588dfc632ef35a6e97418"></a><br/></td></tr>
104
</table><table class="memberdecls">
105
<tr class="heading"><td colspan="2"><h2><a name="pub-static-methods"></a>
115
106
Static Public Member Functions</h2></td></tr>
116
<tr><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classGlib_1_1RefPtr.html">Glib::RefPtr</a><br class="typebreak"/>
117
< <a class="el" href="classGlib_1_1BalancedTree.html">BalancedTree</a>< K, V > > </td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1BalancedTree.html#ad08bd37cbb7b494485655e1fcd0208c8">create</a> ()</td></tr>
118
<tr><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classGlib_1_1RefPtr.html">Glib::RefPtr</a><br class="typebreak"/>
119
< <a class="el" href="classGlib_1_1BalancedTree.html">BalancedTree</a>< K, V > > </td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1BalancedTree.html#a77e82a6d3a397c44c4c3bd70c5aa7c5d">create</a> (const <a class="el" href="classGlib_1_1BalancedTree.html#a3f0fca6b4f83d4e5660a5b216b47d44d">CompareFunc</a>& key_compare_slot)</td></tr>
120
<tr><td colspan="2"><h2><a name="pro-methods"></a>
107
<tr class="memitem:a346b8289fc878c1d9d3398e81800208e"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classGlib_1_1RefPtr.html">Glib::RefPtr</a><br class="typebreak"/>
108
< <a class="el" href="classGlib_1_1BalancedTree.html">BalancedTree</a>< K, V > > </td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1BalancedTree.html#a346b8289fc878c1d9d3398e81800208e">create</a> ()</td></tr>
109
<tr class="memitem:a225d6f1c845767474de9d024f9fa876a"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classGlib_1_1RefPtr.html">Glib::RefPtr</a><br class="typebreak"/>
110
< <a class="el" href="classGlib_1_1BalancedTree.html">BalancedTree</a>< K, V > > </td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1BalancedTree.html#a225d6f1c845767474de9d024f9fa876a">create</a> (const <a class="el" href="classGlib_1_1BalancedTree.html#a9d637241cab431a674cadf806c0a83d4">CompareFunc</a>& key_compare_slot)</td></tr>
111
</table><table class="memberdecls">
112
<tr class="heading"><td colspan="2"><h2><a name="pro-methods"></a>
121
113
Protected Member Functions</h2></td></tr>
122
<tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1BalancedTree.html#a586561d5c3c1f8e4abacaac08a3888d4">BalancedTree</a> ()</td></tr>
123
<tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1BalancedTree.html#aaa70385ac85ba16f43cdb98813f9b93e">BalancedTree</a> (const <a class="el" href="classGlib_1_1BalancedTree.html#a3f0fca6b4f83d4e5660a5b216b47d44d">CompareFunc</a>& key_compare_slot_)</td></tr>
114
<tr class="memitem:a26c7764fe28c41b2527be4111ef76a59"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1BalancedTree.html#a26c7764fe28c41b2527be4111ef76a59">BalancedTree</a> ()</td></tr>
115
<tr class="memitem:a8ded6a08615b93ef62b84418d5894499"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1BalancedTree.html#a8ded6a08615b93ef62b84418d5894499">BalancedTree</a> (const <a class="el" href="classGlib_1_1BalancedTree.html#a9d637241cab431a674cadf806c0a83d4">CompareFunc</a>& key_compare_slot_)</td></tr>
125
117
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
126
<div class="textblock"><p>Balanced Binary Trees — a sorted collection of key/value pairs optimized for searching and traversing in order. </p>
118
<div class="textblock"><h3>template<typename K, typename V><br/>
119
class Glib::BalancedTree< K, V ></h3>
121
<p>Balanced Binary Trees — a sorted collection of key/value pairs optimized for searching and traversing in order. </p>
127
122
<p>The <a class="el" href="classGlib_1_1BalancedTree.html" title="Balanced Binary Trees — a sorted collection of key/value pairs optimized for searching and traversing...">BalancedTree</a> structure and its associated functions provide a sorted collection of key/value pairs optimized for searching and traversing in order.</p>
128
<p>To insert a key/value pair into a <a class="el" href="classGlib_1_1BalancedTree.html" title="Balanced Binary Trees — a sorted collection of key/value pairs optimized for searching and traversing...">BalancedTree</a> use <a class="el" href="classGlib_1_1BalancedTree.html#a5c25a47b95b95bf82382abfc9c2b938f" title="Inserts a key/value pair into a BalancedTree.">insert()</a>.</p>
129
<p>To lookup the value corresponding to a given key, use <a class="el" href="classGlib_1_1BalancedTree.html#a2a3e2487e0da086402f9ac82a323b807" title="Gets the value corresponding to the given key.">lookup()</a>.</p>
130
<p>To find out the number of nodes in a <a class="el" href="classGlib_1_1BalancedTree.html" title="Balanced Binary Trees — a sorted collection of key/value pairs optimized for searching and traversing...">BalancedTree</a>, use <a class="el" href="classGlib_1_1BalancedTree.html#a9f1d10536381051fffe35960cd6a29a6" title="Gets the number of nodes in a BalancedTree.">nnodes()</a>. To get the height of a <a class="el" href="classGlib_1_1BalancedTree.html" title="Balanced Binary Trees — a sorted collection of key/value pairs optimized for searching and traversing...">BalancedTree</a>, use <a class="el" href="classGlib_1_1BalancedTree.html#aedfba5c61a000954962cecbb1d93b7bf" title="Gets the height of a BalancedTree.">height()</a>.</p>
131
<p>To traverse a <a class="el" href="classGlib_1_1BalancedTree.html" title="Balanced Binary Trees — a sorted collection of key/value pairs optimized for searching and traversing...">BalancedTree</a>, calling a function for each node visited in the traversal, use <a class="el" href="classGlib_1_1BalancedTree.html#adb30dc8624d087a147aa5d232f0ffb5e" title="Calls the given function for each of the key/value pairs in the BalancedTree.">foreach()</a>.</p>
132
<p>To remove a key/value pair use <a class="el" href="classGlib_1_1BalancedTree.html#a8bcbb627536ca6259dae6fb2c310657a" title="Removes a key/value pair from a BalancedTree.">remove()</a>.</p>
123
<p>To insert a key/value pair into a <a class="el" href="classGlib_1_1BalancedTree.html" title="Balanced Binary Trees — a sorted collection of key/value pairs optimized for searching and traversing...">BalancedTree</a> use <a class="el" href="classGlib_1_1BalancedTree.html#a1ff2e47b569956c2c8d19ba3f538346c" title="Inserts a key/value pair into a BalancedTree.">insert()</a>.</p>
124
<p>To lookup the value corresponding to a given key, use <a class="el" href="classGlib_1_1BalancedTree.html#a1004e229bf2fccbd79b15a7f567a51e0" title="Gets the value corresponding to the given key.">lookup()</a>.</p>
125
<p>To find out the number of nodes in a <a class="el" href="classGlib_1_1BalancedTree.html" title="Balanced Binary Trees — a sorted collection of key/value pairs optimized for searching and traversing...">BalancedTree</a>, use <a class="el" href="classGlib_1_1BalancedTree.html#aa5965a94bd4afaa5da1dfb1c6406fef7" title="Gets the number of nodes in a BalancedTree.">nnodes()</a>. To get the height of a <a class="el" href="classGlib_1_1BalancedTree.html" title="Balanced Binary Trees — a sorted collection of key/value pairs optimized for searching and traversing...">BalancedTree</a>, use <a class="el" href="classGlib_1_1BalancedTree.html#ab7f312cc9aa4a0cfc4d2b8b24b3d9749" title="Gets the height of a BalancedTree.">height()</a>.</p>
126
<p>To traverse a <a class="el" href="classGlib_1_1BalancedTree.html" title="Balanced Binary Trees — a sorted collection of key/value pairs optimized for searching and traversing...">BalancedTree</a>, calling a function for each node visited in the traversal, use <a class="el" href="classGlib_1_1BalancedTree.html#aa1235b0242c3d7d87310adb6e370ec12" title="Calls the given function for each of the key/value pairs in the BalancedTree.">foreach()</a>.</p>
127
<p>To remove a key/value pair use <a class="el" href="classGlib_1_1BalancedTree.html#a751401d64137e241cacfec8e05ea5971" title="Removes a key/value pair from a BalancedTree.">remove()</a>.</p>
133
128
<p>Any type to be used with this template must implement copy constructor. Compiler-generated implementations are OK, provided they do the right thing for the type. Both keys and values are stored in the balanced binary tree as copies, created by copy contructors.</p>
134
129
<p>Type of key to be used with this template must implement:</p>
137
132
<li>greater than operator</li>
139
134
</div><hr/><h2>Member Typedef Documentation</h2>
140
<a class="anchor" id="a3f0fca6b4f83d4e5660a5b216b47d44d"></a><!-- doxytag: member="Glib::BalancedTree::CompareFunc" ref="a3f0fca6b4f83d4e5660a5b216b47d44d" args="" -->
135
<a class="anchor" id="a9d637241cab431a674cadf806c0a83d4"></a>
141
136
<div class="memitem">
142
137
<div class="memproto">
138
<div class="memtemplate">
139
template <typename K , typename V > </div>
143
140
<table class="memname">
145
<td class="memname">typedef <a class="elRef" doxygen="libsigc++-2.0.tag:http://library.gnome.org/devel/libsigc++/unstable/" href="http://library.gnome.org/devel/libsigc++/unstable/classsigc_1_1slot.html">sigc::slot</a><int, const K&, const K&> <a class="el" href="classGlib_1_1BalancedTree.html#a3f0fca6b4f83d4e5660a5b216b47d44d">Glib::BalancedTree::CompareFunc</a></td>
142
<td class="memname">typedef <a class="elRef" doxygen="libsigc++-2.0.tag:http://library.gnome.org/devel/libsigc++/unstable/" href="http://library.gnome.org/devel/libsigc++/unstable/classsigc_1_1slot.html">sigc::slot</a><int, const K&, const K&> <a class="el" href="classGlib_1_1BalancedTree.html">Glib::BalancedTree</a>< K, V >::<a class="el" href="classGlib_1_1BalancedTree.html#a9d637241cab431a674cadf806c0a83d4">CompareFunc</a></td>
145
</div><div class="memdoc">
153
<a class="anchor" id="a154ac5a5b5a715967c33e381010af4fb"></a><!-- doxytag: member="Glib::BalancedTree::TraverseFunc" ref="a154ac5a5b5a715967c33e381010af4fb" args="" -->
149
<a class="anchor" id="a4ff14046f2cef700ea37b5b9eb1e2e4e"></a>
154
150
<div class="memitem">
155
151
<div class="memproto">
152
<div class="memtemplate">
153
template <typename K , typename V > </div>
156
154
<table class="memname">
158
<td class="memname">typedef <a class="elRef" doxygen="libsigc++-2.0.tag:http://library.gnome.org/devel/libsigc++/unstable/" href="http://library.gnome.org/devel/libsigc++/unstable/classsigc_1_1slot.html">sigc::slot</a><bool, const K&, const V&> <a class="el" href="classGlib_1_1BalancedTree.html#a154ac5a5b5a715967c33e381010af4fb">Glib::BalancedTree::TraverseFunc</a></td>
156
<td class="memname">typedef <a class="elRef" doxygen="libsigc++-2.0.tag:http://library.gnome.org/devel/libsigc++/unstable/" href="http://library.gnome.org/devel/libsigc++/unstable/classsigc_1_1slot.html">sigc::slot</a><bool, const K&, const V&> <a class="el" href="classGlib_1_1BalancedTree.html">Glib::BalancedTree</a>< K, V >::<a class="el" href="classGlib_1_1BalancedTree.html#a4ff14046f2cef700ea37b5b9eb1e2e4e">TraverseFunc</a></td>
159
</div><div class="memdoc">
166
163
<hr/><h2>Constructor & Destructor Documentation</h2>
167
<a class="anchor" id="a586561d5c3c1f8e4abacaac08a3888d4"></a><!-- doxytag: member="Glib::BalancedTree::BalancedTree" ref="a586561d5c3c1f8e4abacaac08a3888d4" args="()" -->
164
<a class="anchor" id="a26c7764fe28c41b2527be4111ef76a59"></a>
168
165
<div class="memitem">
169
166
<div class="memproto">
167
<div class="memtemplate">
168
template <typename K , typename V > </div>
169
<table class="mlabels">
171
<td class="mlabels-left">
170
172
<table class="memname">
172
<td class="memname">Glib::BalancedTree::BalancedTree </td>
174
<td class="memname"><a class="el" href="classGlib_1_1BalancedTree.html">Glib::BalancedTree</a>< K, V >::<a class="el" href="classGlib_1_1BalancedTree.html">BalancedTree</a> </td>
174
176
<td class="paramname"></td><td>)</td>
175
<td><code> [inline, protected]</code></td>
181
<td class="mlabels-right">
182
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">protected</span></span> </td>
185
</div><div class="memdoc">
183
<a class="anchor" id="aaa70385ac85ba16f43cdb98813f9b93e"></a><!-- doxytag: member="Glib::BalancedTree::BalancedTree" ref="aaa70385ac85ba16f43cdb98813f9b93e" args="(const CompareFunc &key_compare_slot_)" -->
189
<a class="anchor" id="a8ded6a08615b93ef62b84418d5894499"></a>
184
190
<div class="memitem">
185
191
<div class="memproto">
192
<div class="memtemplate">
193
template <typename K , typename V > </div>
194
<table class="mlabels">
196
<td class="mlabels-left">
186
197
<table class="memname">
188
<td class="memname">Glib::BalancedTree::BalancedTree </td>
199
<td class="memname"><a class="el" href="classGlib_1_1BalancedTree.html">Glib::BalancedTree</a>< K, V >::<a class="el" href="classGlib_1_1BalancedTree.html">BalancedTree</a> </td>
190
<td class="paramtype">const <a class="el" href="classGlib_1_1BalancedTree.html#a3f0fca6b4f83d4e5660a5b216b47d44d">CompareFunc</a>& </td>
201
<td class="paramtype">const <a class="el" href="classGlib_1_1BalancedTree.html#a9d637241cab431a674cadf806c0a83d4">CompareFunc</a>& </td>
191
202
<td class="paramname"><em>key_compare_slot_</em></td><td>)</td>
192
<td><code> [inline, protected]</code></td>
207
<td class="mlabels-right">
208
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">protected</span></span> </td>
211
</div><div class="memdoc">
200
<a class="anchor" id="a0dbc09ed0ee1d259bfb8eed6b322c119"></a><!-- doxytag: member="Glib::BalancedTree::~BalancedTree" ref="a0dbc09ed0ee1d259bfb8eed6b322c119" args="()" -->
215
<a class="anchor" id="a6ad3ee2e4c7a396e059171800f703e13"></a>
201
216
<div class="memitem">
202
217
<div class="memproto">
218
<div class="memtemplate">
219
template <typename K , typename V > </div>
220
<table class="mlabels">
222
<td class="mlabels-left">
203
223
<table class="memname">
205
<td class="memname">Glib::BalancedTree::~BalancedTree </td>
225
<td class="memname"><a class="el" href="classGlib_1_1BalancedTree.html">Glib::BalancedTree</a>< K, V >::~<a class="el" href="classGlib_1_1BalancedTree.html">BalancedTree</a> </td>
207
227
<td class="paramname"></td><td>)</td>
208
<td><code> [inline]</code></td>
232
<td class="mlabels-right">
233
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
236
</div><div class="memdoc">
216
240
<hr/><h2>Member Function Documentation</h2>
217
<a class="anchor" id="ad08bd37cbb7b494485655e1fcd0208c8"></a><!-- doxytag: member="Glib::BalancedTree::create" ref="ad08bd37cbb7b494485655e1fcd0208c8" args="()" -->
241
<a class="anchor" id="a346b8289fc878c1d9d3398e81800208e"></a>
218
242
<div class="memitem">
219
243
<div class="memproto">
244
<div class="memtemplate">
245
template <typename K , typename V > </div>
246
<table class="mlabels">
248
<td class="mlabels-left">
220
249
<table class="memname">
222
<td class="memname">static <a class="el" href="classGlib_1_1RefPtr.html">Glib::RefPtr</a>< <a class="el" href="classGlib_1_1BalancedTree.html">BalancedTree</a><K, V> > Glib::BalancedTree::create </td>
251
<td class="memname">static <a class="el" href="classGlib_1_1RefPtr.html">Glib::RefPtr</a>< <a class="el" href="classGlib_1_1BalancedTree.html">BalancedTree</a><K, V> > <a class="el" href="classGlib_1_1BalancedTree.html">Glib::BalancedTree</a>< K, V >::create </td>
224
253
<td class="paramname"></td><td>)</td>
225
<td><code> [inline, static]</code></td>
258
<td class="mlabels-right">
259
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td>
262
</div><div class="memdoc">
233
<a class="anchor" id="a77e82a6d3a397c44c4c3bd70c5aa7c5d"></a><!-- doxytag: member="Glib::BalancedTree::create" ref="a77e82a6d3a397c44c4c3bd70c5aa7c5d" args="(const CompareFunc &key_compare_slot)" -->
266
<a class="anchor" id="a225d6f1c845767474de9d024f9fa876a"></a>
234
267
<div class="memitem">
235
268
<div class="memproto">
269
<div class="memtemplate">
270
template <typename K , typename V > </div>
271
<table class="mlabels">
273
<td class="mlabels-left">
236
274
<table class="memname">
238
<td class="memname">static <a class="el" href="classGlib_1_1RefPtr.html">Glib::RefPtr</a>< <a class="el" href="classGlib_1_1BalancedTree.html">BalancedTree</a><K, V> > Glib::BalancedTree::create </td>
276
<td class="memname">static <a class="el" href="classGlib_1_1RefPtr.html">Glib::RefPtr</a>< <a class="el" href="classGlib_1_1BalancedTree.html">BalancedTree</a><K, V> > <a class="el" href="classGlib_1_1BalancedTree.html">Glib::BalancedTree</a>< K, V >::create </td>
240
<td class="paramtype">const <a class="el" href="classGlib_1_1BalancedTree.html#a3f0fca6b4f83d4e5660a5b216b47d44d">CompareFunc</a>& </td>
278
<td class="paramtype">const <a class="el" href="classGlib_1_1BalancedTree.html#a9d637241cab431a674cadf806c0a83d4">CompareFunc</a>& </td>
241
279
<td class="paramname"><em>key_compare_slot</em></td><td>)</td>
242
<td><code> [inline, static]</code></td>
284
<td class="mlabels-right">
285
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td>
288
</div><div class="memdoc">
250
<a class="anchor" id="adb30dc8624d087a147aa5d232f0ffb5e"></a><!-- doxytag: member="Glib::BalancedTree::foreach" ref="adb30dc8624d087a147aa5d232f0ffb5e" args="(const TraverseFunc &func) const " -->
292
<a class="anchor" id="aa1235b0242c3d7d87310adb6e370ec12"></a>
251
293
<div class="memitem">
252
294
<div class="memproto">
295
<div class="memtemplate">
296
template <typename K , typename V > </div>
297
<table class="mlabels">
299
<td class="mlabels-left">
253
300
<table class="memname">
255
<td class="memname">void Glib::BalancedTree::foreach </td>
302
<td class="memname">void <a class="el" href="classGlib_1_1BalancedTree.html">Glib::BalancedTree</a>< K, V >::foreach </td>
257
<td class="paramtype">const <a class="el" href="classGlib_1_1BalancedTree.html#a154ac5a5b5a715967c33e381010af4fb">TraverseFunc</a>& </td>
304
<td class="paramtype">const <a class="el" href="classGlib_1_1BalancedTree.html#a4ff14046f2cef700ea37b5b9eb1e2e4e">TraverseFunc</a>& </td>
258
305
<td class="paramname"><em>func</em></td><td>)</td>
259
<td> const<code> [inline]</code></td>
310
<td class="mlabels-right">
311
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
314
</div><div class="memdoc">
265
316
<p>Calls the given function for each of the key/value pairs in the <a class="el" href="classGlib_1_1BalancedTree.html" title="Balanced Binary Trees — a sorted collection of key/value pairs optimized for searching and traversing...">BalancedTree</a>. </p>
266
317
<p>The function is passed the key and value of each pair. The tree is traversed in sorted order.</p>
267
318
<p>The tree may not be modified while iterating over it (you can't add/remove items). To remove all items matching a predicate, you need to add each item to a list in your TraverseFunc as you walk over the tree, then walk the list and remove each item.</p>
268
<dl><dt><b>Parameters:</b></dt><dd>
319
<dl class="params"><dt>Parameters:</dt><dd>
269
320
<table class="params">
270
321
<tr><td class="paramname">func</td><td>The function to call for each node visited. If this function returns true, the traversal is stopped. </td></tr>
277
<a class="anchor" id="aed7a050230681a4f7e2295850c65db46"></a><!-- doxytag: member="Glib::BalancedTree::gobj" ref="aed7a050230681a4f7e2295850c65db46" args="()" -->
278
<div class="memitem">
279
<div class="memproto">
280
<table class="memname">
282
<td class="memname">GTree* Glib::BalancedTree::gobj </td>
284
<td class="paramname"></td><td>)</td>
285
<td><code> [inline]</code></td>
291
<p>Provides access to the underlying C GObject. </p>
295
<a class="anchor" id="a12f1f81054f7a3707f9927052ad045ab"></a><!-- doxytag: member="Glib::BalancedTree::gobj" ref="a12f1f81054f7a3707f9927052ad045ab" args="() const " -->
296
<div class="memitem">
297
<div class="memproto">
298
<table class="memname">
300
<td class="memname">const GTree* Glib::BalancedTree::gobj </td>
302
<td class="paramname"></td><td>)</td>
303
<td> const<code> [inline]</code></td>
309
<p>Provides access to the underlying C GObject. </p>
313
<a class="anchor" id="aedfba5c61a000954962cecbb1d93b7bf"></a><!-- doxytag: member="Glib::BalancedTree::height" ref="aedfba5c61a000954962cecbb1d93b7bf" args="() const " -->
314
<div class="memitem">
315
<div class="memproto">
316
<table class="memname">
318
<td class="memname">gint Glib::BalancedTree::height </td>
320
<td class="paramname"></td><td>)</td>
321
<td> const<code> [inline]</code></td>
328
<a class="anchor" id="a3992ca9669a73f98167e988ce0ff4415"></a>
329
<div class="memitem">
330
<div class="memproto">
331
<div class="memtemplate">
332
template <typename K , typename V > </div>
333
<table class="mlabels">
335
<td class="mlabels-left">
336
<table class="memname">
338
<td class="memname">GTree* <a class="el" href="classGlib_1_1BalancedTree.html">Glib::BalancedTree</a>< K, V >::gobj </td>
340
<td class="paramname"></td><td>)</td>
345
<td class="mlabels-right">
346
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
349
</div><div class="memdoc">
351
<p>Provides access to the underlying C GObject. </p>
355
<a class="anchor" id="aa95ee73b9302c6e53dce0e2b9a642b4c"></a>
356
<div class="memitem">
357
<div class="memproto">
358
<div class="memtemplate">
359
template <typename K , typename V > </div>
360
<table class="mlabels">
362
<td class="mlabels-left">
363
<table class="memname">
365
<td class="memname">const GTree* <a class="el" href="classGlib_1_1BalancedTree.html">Glib::BalancedTree</a>< K, V >::gobj </td>
367
<td class="paramname"></td><td>)</td>
372
<td class="mlabels-right">
373
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
376
</div><div class="memdoc">
378
<p>Provides access to the underlying C GObject. </p>
382
<a class="anchor" id="ab7f312cc9aa4a0cfc4d2b8b24b3d9749"></a>
383
<div class="memitem">
384
<div class="memproto">
385
<div class="memtemplate">
386
template <typename K , typename V > </div>
387
<table class="mlabels">
389
<td class="mlabels-left">
390
<table class="memname">
392
<td class="memname">gint <a class="el" href="classGlib_1_1BalancedTree.html">Glib::BalancedTree</a>< K, V >::height </td>
394
<td class="paramname"></td><td>)</td>
399
<td class="mlabels-right">
400
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
403
</div><div class="memdoc">
327
405
<p>Gets the height of a <a class="el" href="classGlib_1_1BalancedTree.html" title="Balanced Binary Trees — a sorted collection of key/value pairs optimized for searching and traversing...">BalancedTree</a>. </p>
328
406
<p>If the <a class="el" href="classGlib_1_1BalancedTree.html" title="Balanced Binary Trees — a sorted collection of key/value pairs optimized for searching and traversing...">BalancedTree</a> contains no nodes, the height is 0. If the <a class="el" href="classGlib_1_1BalancedTree.html" title="Balanced Binary Trees — a sorted collection of key/value pairs optimized for searching and traversing...">BalancedTree</a> contains only one root node the height is 1. If the root node has children the height is 2, etc.</p>
329
<dl class="return"><dt><b>Returns:</b></dt><dd>the height of the <a class="el" href="classGlib_1_1BalancedTree.html" title="Balanced Binary Trees — a sorted collection of key/value pairs optimized for searching and traversing...">BalancedTree</a>. </dd></dl>
407
<dl class="section return"><dt>Returns:</dt><dd>the height of the <a class="el" href="classGlib_1_1BalancedTree.html" title="Balanced Binary Trees — a sorted collection of key/value pairs optimized for searching and traversing...">BalancedTree</a>. </dd></dl>
333
<a class="anchor" id="a5c25a47b95b95bf82382abfc9c2b938f"></a><!-- doxytag: member="Glib::BalancedTree::insert" ref="a5c25a47b95b95bf82382abfc9c2b938f" args="(const K &key, const V &value)" -->
411
<a class="anchor" id="a1ff2e47b569956c2c8d19ba3f538346c"></a>
334
412
<div class="memitem">
335
413
<div class="memproto">
414
<div class="memtemplate">
415
template <typename K , typename V > </div>
416
<table class="mlabels">
418
<td class="mlabels-left">
336
419
<table class="memname">
338
<td class="memname">void Glib::BalancedTree::insert </td>
421
<td class="memname">void <a class="el" href="classGlib_1_1BalancedTree.html">Glib::BalancedTree</a>< K, V >::insert </td>
340
423
<td class="paramtype">const K & </td>
341
424
<td class="paramname"><em>key</em>, </td>
371
<a class="anchor" id="a2a3e2487e0da086402f9ac82a323b807"></a><!-- doxytag: member="Glib::BalancedTree::lookup" ref="a2a3e2487e0da086402f9ac82a323b807" args="(const K &key)" -->
458
<a class="anchor" id="a1004e229bf2fccbd79b15a7f567a51e0"></a>
372
459
<div class="memitem">
373
460
<div class="memproto">
461
<div class="memtemplate">
462
template <typename K , typename V > </div>
463
<table class="mlabels">
465
<td class="mlabels-left">
374
466
<table class="memname">
376
<td class="memname">V* Glib::BalancedTree::lookup </td>
468
<td class="memname">V* <a class="el" href="classGlib_1_1BalancedTree.html">Glib::BalancedTree</a>< K, V >::lookup </td>
378
470
<td class="paramtype">const K & </td>
379
471
<td class="paramname"><em>key</em></td><td>)</td>
380
<td><code> [inline]</code></td>
476
<td class="mlabels-right">
477
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
480
</div><div class="memdoc">
386
482
<p>Gets the value corresponding to the given key. </p>
387
483
<p>Since a <a class="el" href="classGlib_1_1BalancedTree.html" title="Balanced Binary Trees — a sorted collection of key/value pairs optimized for searching and traversing...">BalancedTree</a> is automatically balanced as key/value pairs are added, key lookup is very fast.</p>
388
<dl><dt><b>Parameters:</b></dt><dd>
484
<dl class="params"><dt>Parameters:</dt><dd>
389
485
<table class="params">
390
486
<tr><td class="paramname">key</td><td>The key to look up. </td></tr>
394
<dl class="return"><dt><b>Returns:</b></dt><dd>The value corresponding to the key, or 0 if the key was not found. </dd></dl>
490
<dl class="section return"><dt>Returns:</dt><dd>The value corresponding to the key, or 0 if the key was not found. </dd></dl>
398
<a class="anchor" id="a24be930c7f257bce0022ff146c5eb68a"></a><!-- doxytag: member="Glib::BalancedTree::lookup" ref="a24be930c7f257bce0022ff146c5eb68a" args="(const K &key) const " -->
494
<a class="anchor" id="acc3b86a40f9c6ce3f2870d2d51627cae"></a>
399
495
<div class="memitem">
400
496
<div class="memproto">
497
<div class="memtemplate">
498
template <typename K , typename V > </div>
499
<table class="mlabels">
501
<td class="mlabels-left">
401
502
<table class="memname">
403
<td class="memname">const V* Glib::BalancedTree::lookup </td>
504
<td class="memname">const V* <a class="el" href="classGlib_1_1BalancedTree.html">Glib::BalancedTree</a>< K, V >::lookup </td>
405
506
<td class="paramtype">const K & </td>
406
507
<td class="paramname"><em>key</em></td><td>)</td>
407
<td> const<code> [inline]</code></td>
512
<td class="mlabels-right">
513
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
516
</div><div class="memdoc">
415
<a class="anchor" id="a9f1d10536381051fffe35960cd6a29a6"></a><!-- doxytag: member="Glib::BalancedTree::nnodes" ref="a9f1d10536381051fffe35960cd6a29a6" args="() const " -->
520
<a class="anchor" id="aa5965a94bd4afaa5da1dfb1c6406fef7"></a>
416
521
<div class="memitem">
417
522
<div class="memproto">
523
<div class="memtemplate">
524
template <typename K , typename V > </div>
525
<table class="mlabels">
527
<td class="mlabels-left">
418
528
<table class="memname">
420
<td class="memname">gint Glib::BalancedTree::nnodes </td>
530
<td class="memname">gint <a class="el" href="classGlib_1_1BalancedTree.html">Glib::BalancedTree</a>< K, V >::nnodes </td>
422
532
<td class="paramname"></td><td>)</td>
423
<td> const<code> [inline]</code></td>
537
<td class="mlabels-right">
538
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
541
</div><div class="memdoc">
429
543
<p>Gets the number of nodes in a <a class="el" href="classGlib_1_1BalancedTree.html" title="Balanced Binary Trees — a sorted collection of key/value pairs optimized for searching and traversing...">BalancedTree</a>. </p>
430
<dl class="return"><dt><b>Returns:</b></dt><dd>the number of nodes in the <a class="el" href="classGlib_1_1BalancedTree.html" title="Balanced Binary Trees — a sorted collection of key/value pairs optimized for searching and traversing...">BalancedTree</a>. </dd></dl>
544
<dl class="section return"><dt>Returns:</dt><dd>the number of nodes in the <a class="el" href="classGlib_1_1BalancedTree.html" title="Balanced Binary Trees — a sorted collection of key/value pairs optimized for searching and traversing...">BalancedTree</a>. </dd></dl>
434
<a class="anchor" id="abdca6b386fa6d80f17b5ea071e72e5c3"></a><!-- doxytag: member="Glib::BalancedTree::reference" ref="abdca6b386fa6d80f17b5ea071e72e5c3" args="()" -->
548
<a class="anchor" id="a80e50b78322d85f165ac2d6607ca9cb3"></a>
435
549
<div class="memitem">
436
550
<div class="memproto">
551
<div class="memtemplate">
552
template <typename K , typename V > </div>
553
<table class="mlabels">
555
<td class="mlabels-left">
437
556
<table class="memname">
439
<td class="memname">void Glib::BalancedTree::reference </td>
558
<td class="memname">void <a class="el" href="classGlib_1_1BalancedTree.html">Glib::BalancedTree</a>< K, V >::<a class="elRef" doxygen="libstdc++.tag:http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/" href="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/a01683.html#gac3dcdf43512d32f125e8062c8d7db069">reference</a> </td>
441
560
<td class="paramname"></td><td>)</td>
442
<td><code> [inline]</code></td>
565
<td class="mlabels-right">
566
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
569
</div><div class="memdoc">
448
571
<p>Increments the reference count of tree by one. </p>
449
572
<p>It is safe to call this function from any thread. </p>
453
<a class="anchor" id="a8bcbb627536ca6259dae6fb2c310657a"></a><!-- doxytag: member="Glib::BalancedTree::remove" ref="a8bcbb627536ca6259dae6fb2c310657a" args="(const K &key)" -->
576
<a class="anchor" id="a751401d64137e241cacfec8e05ea5971"></a>
454
577
<div class="memitem">
455
578
<div class="memproto">
579
<div class="memtemplate">
580
template <typename K , typename V > </div>
581
<table class="mlabels">
583
<td class="mlabels-left">
456
584
<table class="memname">
458
<td class="memname">bool Glib::BalancedTree::remove </td>
586
<td class="memname">bool <a class="el" href="classGlib_1_1BalancedTree.html">Glib::BalancedTree</a>< K, V >::remove </td>
460
588
<td class="paramtype">const K & </td>
461
589
<td class="paramname"><em>key</em></td><td>)</td>
462
<td><code> [inline]</code></td>
594
<td class="mlabels-right">
595
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
598
</div><div class="memdoc">
468
600
<p>Removes a key/value pair from a <a class="el" href="classGlib_1_1BalancedTree.html" title="Balanced Binary Trees — a sorted collection of key/value pairs optimized for searching and traversing...">BalancedTree</a>. </p>
469
601
<p>If the key does not exist in the <a class="el" href="classGlib_1_1BalancedTree.html" title="Balanced Binary Trees — a sorted collection of key/value pairs optimized for searching and traversing...">BalancedTree</a>, the function does nothing.</p>
470
<dl><dt><b>Parameters:</b></dt><dd>
602
<dl class="params"><dt>Parameters:</dt><dd>
471
603
<table class="params">
472
604
<tr><td class="paramname">key</td><td>The key to remove. </td></tr>
476
<dl class="return"><dt><b>Returns:</b></dt><dd>true if the key was found (prior to 2.8, this function returned nothing) </dd></dl>
480
<a class="anchor" id="a7dcc3d5ec0f3a55f8417158a665fbbdd"></a><!-- doxytag: member="Glib::BalancedTree::search" ref="a7dcc3d5ec0f3a55f8417158a665fbbdd" args="(const CompareFunc &search_func, const K &key)" -->
481
<div class="memitem">
482
<div class="memproto">
483
<table class="memname">
485
<td class="memname">V* Glib::BalancedTree::search </td>
487
<td class="paramtype">const <a class="el" href="classGlib_1_1BalancedTree.html#a3f0fca6b4f83d4e5660a5b216b47d44d">CompareFunc</a>& </td>
488
<td class="paramname"><em>search_func</em>, </td>
491
<td class="paramkey"></td>
493
<td class="paramtype">const K & </td>
494
<td class="paramname"><em>key</em> </td>
499
<td></td><td><code> [inline]</code></td>
505
<p>Searches a <a class="el" href="classGlib_1_1BalancedTree.html" title="Balanced Binary Trees — a sorted collection of key/value pairs optimized for searching and traversing...">BalancedTree</a> using <em>search_func</em>. </p>
506
<p>The <em>search_func</em> is called with a reference to the key of a key/value pair in the tree. If <em>search_func</em> returns 0 for a key/value pair, then <a class="el" href="classGlib_1_1BalancedTree.html#a7dcc3d5ec0f3a55f8417158a665fbbdd" title="Searches a BalancedTree using search_func.">search()</a> will return the value of that pair. If <em>search_func</em> returns -1, searching will proceed among the key/value pairs that have a smaller key; if <em>search_func</em> returns 1, searching will proceed among the key/value pairs that have a larger key.</p>
507
<dl><dt><b>Parameters:</b></dt><dd>
508
<table class="params">
509
<tr><td class="paramname">search_func</td><td>A function used to search the <a class="el" href="classGlib_1_1BalancedTree.html" title="Balanced Binary Trees — a sorted collection of key/value pairs optimized for searching and traversing...">BalancedTree</a>. </td></tr>
513
<dl class="return"><dt><b>Returns:</b></dt><dd>the value corresponding to the found key, or NULL if the key was not found. </dd></dl>
517
<a class="anchor" id="a529e85602ec10cf72a5ce36bc082806e"></a><!-- doxytag: member="Glib::BalancedTree::search" ref="a529e85602ec10cf72a5ce36bc082806e" args="(const CompareFunc &search_func, const K &key) const " -->
518
<div class="memitem">
519
<div class="memproto">
520
<table class="memname">
522
<td class="memname">const V* Glib::BalancedTree::search </td>
524
<td class="paramtype">const <a class="el" href="classGlib_1_1BalancedTree.html#a3f0fca6b4f83d4e5660a5b216b47d44d">CompareFunc</a>& </td>
525
<td class="paramname"><em>search_func</em>, </td>
528
<td class="paramkey"></td>
530
<td class="paramtype">const K & </td>
531
<td class="paramname"><em>key</em> </td>
536
<td></td><td> const<code> [inline]</code></td>
542
<p>Searches a <a class="el" href="classGlib_1_1BalancedTree.html" title="Balanced Binary Trees — a sorted collection of key/value pairs optimized for searching and traversing...">BalancedTree</a> using <em>search_func</em>. </p>
543
<p>The <em>search_func</em> is called with a reference to the key of a key/value pair in the tree. If <em>search_func</em> returns 0 for a key/value pair, then <a class="el" href="classGlib_1_1BalancedTree.html#a7dcc3d5ec0f3a55f8417158a665fbbdd" title="Searches a BalancedTree using search_func.">search()</a> will return the value of that pair. If <em>search_func</em> returns -1, searching will proceed among the key/value pairs that have a smaller key; if <em>search_func</em> returns 1, searching will proceed among the key/value pairs that have a larger key.</p>
544
<dl><dt><b>Parameters:</b></dt><dd>
545
<table class="params">
546
<tr><td class="paramname">search_func</td><td>A function used to search the <a class="el" href="classGlib_1_1BalancedTree.html" title="Balanced Binary Trees — a sorted collection of key/value pairs optimized for searching and traversing...">BalancedTree</a>. </td></tr>
550
<dl class="return"><dt><b>Returns:</b></dt><dd>the value corresponding to the found key, or NULL if the key was not found. </dd></dl>
554
<a class="anchor" id="a5b605a8e0f1b148f565a62403e542a24"></a><!-- doxytag: member="Glib::BalancedTree::unreference" ref="a5b605a8e0f1b148f565a62403e542a24" args="()" -->
555
<div class="memitem">
556
<div class="memproto">
557
<table class="memname">
559
<td class="memname">void Glib::BalancedTree::unreference </td>
608
<dl class="section return"><dt>Returns:</dt><dd>true if the key was found (prior to 2.8, this function returned nothing) </dd></dl>
612
<a class="anchor" id="a55668fb48bb53d3099084db1088c9495"></a>
613
<div class="memitem">
614
<div class="memproto">
615
<div class="memtemplate">
616
template <typename K , typename V > </div>
617
<table class="mlabels">
619
<td class="mlabels-left">
620
<table class="memname">
622
<td class="memname">V* <a class="el" href="classGlib_1_1BalancedTree.html">Glib::BalancedTree</a>< K, V >::search </td>
624
<td class="paramtype">const <a class="el" href="classGlib_1_1BalancedTree.html#a9d637241cab431a674cadf806c0a83d4">CompareFunc</a>& </td>
625
<td class="paramname"><em>search_func</em>, </td>
628
<td class="paramkey"></td>
630
<td class="paramtype">const K & </td>
631
<td class="paramname"><em>key</em> </td>
640
<td class="mlabels-right">
641
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
644
</div><div class="memdoc">
646
<p>Searches a <a class="el" href="classGlib_1_1BalancedTree.html" title="Balanced Binary Trees — a sorted collection of key/value pairs optimized for searching and traversing...">BalancedTree</a> using <em>search_func</em>. </p>
647
<p>The <em>search_func</em> is called with a reference to the key of a key/value pair in the tree. If <em>search_func</em> returns 0 for a key/value pair, then <a class="el" href="classGlib_1_1BalancedTree.html#a55668fb48bb53d3099084db1088c9495" title="Searches a BalancedTree using search_func.">search()</a> will return the value of that pair. If <em>search_func</em> returns -1, searching will proceed among the key/value pairs that have a smaller key; if <em>search_func</em> returns 1, searching will proceed among the key/value pairs that have a larger key.</p>
648
<dl class="params"><dt>Parameters:</dt><dd>
649
<table class="params">
650
<tr><td class="paramname">search_func</td><td>A function used to search the <a class="el" href="classGlib_1_1BalancedTree.html" title="Balanced Binary Trees — a sorted collection of key/value pairs optimized for searching and traversing...">BalancedTree</a>. </td></tr>
654
<dl class="section return"><dt>Returns:</dt><dd>the value corresponding to the found key, or NULL if the key was not found. </dd></dl>
658
<a class="anchor" id="ae9339e46ced588dfc632ef35a6e97418"></a>
659
<div class="memitem">
660
<div class="memproto">
661
<div class="memtemplate">
662
template <typename K , typename V > </div>
663
<table class="mlabels">
665
<td class="mlabels-left">
666
<table class="memname">
668
<td class="memname">const V* <a class="el" href="classGlib_1_1BalancedTree.html">Glib::BalancedTree</a>< K, V >::search </td>
670
<td class="paramtype">const <a class="el" href="classGlib_1_1BalancedTree.html#a9d637241cab431a674cadf806c0a83d4">CompareFunc</a>& </td>
671
<td class="paramname"><em>search_func</em>, </td>
674
<td class="paramkey"></td>
676
<td class="paramtype">const K & </td>
677
<td class="paramname"><em>key</em> </td>
682
<td></td><td> const</td>
686
<td class="mlabels-right">
687
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
690
</div><div class="memdoc">
692
<p>Searches a <a class="el" href="classGlib_1_1BalancedTree.html" title="Balanced Binary Trees — a sorted collection of key/value pairs optimized for searching and traversing...">BalancedTree</a> using <em>search_func</em>. </p>
693
<p>The <em>search_func</em> is called with a reference to the key of a key/value pair in the tree. If <em>search_func</em> returns 0 for a key/value pair, then <a class="el" href="classGlib_1_1BalancedTree.html#a55668fb48bb53d3099084db1088c9495" title="Searches a BalancedTree using search_func.">search()</a> will return the value of that pair. If <em>search_func</em> returns -1, searching will proceed among the key/value pairs that have a smaller key; if <em>search_func</em> returns 1, searching will proceed among the key/value pairs that have a larger key.</p>
694
<dl class="params"><dt>Parameters:</dt><dd>
695
<table class="params">
696
<tr><td class="paramname">search_func</td><td>A function used to search the <a class="el" href="classGlib_1_1BalancedTree.html" title="Balanced Binary Trees — a sorted collection of key/value pairs optimized for searching and traversing...">BalancedTree</a>. </td></tr>
700
<dl class="section return"><dt>Returns:</dt><dd>the value corresponding to the found key, or NULL if the key was not found. </dd></dl>
704
<a class="anchor" id="a6530fc006eec5d249a520be7e8bf4f20"></a>
705
<div class="memitem">
706
<div class="memproto">
707
<div class="memtemplate">
708
template <typename K , typename V > </div>
709
<table class="mlabels">
711
<td class="mlabels-left">
712
<table class="memname">
714
<td class="memname">void <a class="el" href="classGlib_1_1BalancedTree.html">Glib::BalancedTree</a>< K, V >::unreference </td>
561
716
<td class="paramname"></td><td>)</td>
562
<td><code> [inline]</code></td>
721
<td class="mlabels-right">
722
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
725
</div><div class="memdoc">
568
727
<p>Decrements the reference count of tree by one. </p>
569
728
<p>If the reference count drops to 0, all keys and values will be destroyed and all memory allocated by tree will be released.</p>