Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > d5e74628f0e673bb8680aebce32b2c04 > files > 17793

itk-doc-3.12.0-1mdv2010.0.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta name="robots" content="noindex">
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>ITK: itk_hashtable.h Source File</title>
<link href="DoxygenStyle.css" rel="stylesheet" type="text/css">
</head><body bgcolor="#ffffff">


<!--  Section customized for INSIGHT : Tue Jul 17 01:02:45 2001 -->
<center>
<a href="index.html" class="qindex">Main Page</a>&nbsp;&nbsp; 
<a href="modules.html" class="qindex">Groups</a>&nbsp;&nbsp;
<a href="namespaces.html" class="qindex">Namespace List</a>&nbsp;&nbsp;
<a href="hierarchy.html" class="qindex">Class Hierarchy</a>&nbsp;&nbsp;
<a href="classes.html" class="qindex">Alphabetical List</a>&nbsp;&nbsp;
<a href="annotated.html" class="qindex">Compound List</a>&nbsp;&nbsp; 
<a href="files.html" class="qindex">File
List</a>&nbsp;&nbsp; 
<a href="namespacemembers.html" class="qindex">Namespace Members</a>&nbsp;&nbsp; 
<a href="functions.html" class="qindex">Compound Members</a>&nbsp;&nbsp; 
<a href="globals.html" class="qindex">File Members</a>&nbsp;&nbsp;
<a href="pages.html" class="qindex">Concepts</a></center>


<!-- Generated by Doxygen 1.5.9 -->
  <div class="navpath"><a class="el" href="dir_02e23d841c198393a6e961e9a0678fff.html">Code</a>&nbsp;&raquo&nbsp;<a class="el" href="dir_ea7fc529ede9a38b0438cf13831ae873.html">Common</a>
  </div>
<div class="contents">
<h1>itk_hashtable.h</h1><a href="itk__hashtable_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*=========================================================================</span>
<a name="l00002"></a>00002 <span class="comment"></span>
<a name="l00003"></a>00003 <span class="comment">  Program:   Insight Segmentation &amp; Registration Toolkit</span>
<a name="l00004"></a>00004 <span class="comment">  Module:    $RCSfile: itk_hashtable.h,v $</span>
<a name="l00005"></a>00005 <span class="comment">  Language:  C++</span>
<a name="l00006"></a>00006 <span class="comment">  Date:      $Date: 2009-02-06 20:53:15 $</span>
<a name="l00007"></a>00007 <span class="comment">  Version:   $Revision: 1.31 $</span>
<a name="l00008"></a>00008 <span class="comment"></span>
<a name="l00009"></a>00009 <span class="comment">  Copyright (c) Insight Software Consortium. All rights reserved.</span>
<a name="l00010"></a>00010 <span class="comment">  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.</span>
<a name="l00011"></a>00011 <span class="comment"></span>
<a name="l00012"></a>00012 <span class="comment">     This software is distributed WITHOUT ANY WARRANTY; without even</span>
<a name="l00013"></a>00013 <span class="comment">     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR</span>
<a name="l00014"></a>00014 <span class="comment">     PURPOSE.  See the above copyright notices for more information.</span>
<a name="l00015"></a>00015 <span class="comment"></span>
<a name="l00016"></a>00016 <span class="comment">=========================================================================*/</span>
<a name="l00068"></a>00068 <span class="preprocessor">#ifndef __itk_hashtable_h</span>
<a name="l00069"></a>00069 <span class="preprocessor"></span><span class="preprocessor">#define __itk_hashtable_h</span>
<a name="l00070"></a>00070 <span class="preprocessor"></span>
<a name="l00071"></a>00071 <span class="preprocessor">#if defined(_MSC_VER)</span>
<a name="l00072"></a>00072 <span class="preprocessor"></span><span class="comment">// unreachable code</span>
<a name="l00073"></a>00073 <span class="preprocessor">#pragma warning ( disable : 4702 )</span>
<a name="l00074"></a>00074 <span class="preprocessor"></span><span class="comment">// assignment operator could not be generated</span>
<a name="l00075"></a>00075 <span class="preprocessor">#pragma warning ( disable : 4512 )</span>
<a name="l00076"></a>00076 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00077"></a>00077 <span class="preprocessor"></span>
<a name="l00078"></a>00078 <span class="preprocessor">#if (defined(__GNUC__) &amp;&amp; (((__GNUC__==3) &amp;&amp; (__GNUC_MINOR__&gt;=1) || (__GNUC__&gt;3) ) || ( (__GNUC__==4) &amp;&amp; defined(__INTEL_COMPILER) ) )) || (defined(__IBMCPP__) &amp;&amp; __IBMCPP__ &gt;= 600)</span>
<a name="l00079"></a>00079 <span class="preprocessor"></span><span class="comment">// Use this hashtable that is already define for GNU_C versions &gt;= 3.1, IBMCPP &gt;=600, or Intel compilers with GCCv4</span>
<a name="l00080"></a>00080 
<a name="l00081"></a>00081 <span class="preprocessor">#else</span>
<a name="l00082"></a>00082 <span class="preprocessor"></span>
<a name="l00085"></a>00085 <span class="preprocessor">#include "<a class="code" href="itkMacro_8h.html">itkMacro.h</a>"</span>
<a name="l00086"></a>00086 <span class="preprocessor">#include &lt;iostream&gt;</span>
<a name="l00087"></a>00087 <span class="preprocessor">#include "<a class="code" href="itk__alloc_8h.html">itk_alloc.h</a>"</span>
<a name="l00088"></a>00088 <span class="preprocessor">#include &lt;vector&gt;</span>
<a name="l00089"></a>00089 <span class="preprocessor">#include &lt;utility&gt;</span>
<a name="l00090"></a>00090 <span class="preprocessor">#include &lt;memory&gt;</span>
<a name="l00091"></a>00091 <span class="preprocessor">#include "vcl_compiler.h"</span>
<a name="l00092"></a>00092 <span class="preprocessor">#include &lt;functional&gt;</span>
<a name="l00093"></a>00093 <span class="preprocessor">#include &lt;algorithm&gt;</span>
<a name="l00094"></a>00094 <span class="preprocessor">#include &lt;iterator&gt;</span>
<a name="l00095"></a>00095 
<a name="l00096"></a>00096 
<a name="l00097"></a>00097 <span class="keyword">namespace </span>itk
<a name="l00098"></a>00098 {
<a name="l00099"></a><a class="code" href="structitk_1_1hash.html">00099</a> <span class="keyword">template</span> &lt;<span class="keyword">class</span> Key&gt; <span class="keyword">struct </span><a class="code" href="structitk_1_1hash.html">hash</a> { };
<a name="l00100"></a>00100 
<a name="l00101"></a><a class="code" href="namespaceitk.html#5c50c0121529fb0e45d6c39eaabb9708">00101</a> <span class="keyword">inline</span> <span class="keywordtype">size_t</span> <a class="code" href="namespaceitk.html#5c50c0121529fb0e45d6c39eaabb9708">hash_string</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* s)
<a name="l00102"></a>00102 {
<a name="l00103"></a>00103   <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> h = 0;
<a name="l00104"></a>00104   <span class="keywordflow">for</span> (; *s; ++s)
<a name="l00105"></a>00105     {
<a name="l00106"></a>00106     h = 5*h + *s;
<a name="l00107"></a>00107     }
<a name="l00108"></a>00108   <span class="keywordflow">return</span> size_t(h);
<a name="l00109"></a>00109 }
<a name="l00110"></a>00110 
<a name="l00111"></a>00111 <span class="keyword">template</span>&lt;&gt;
<a name="l00112"></a><a class="code" href="structitk_1_1hash_3_01char_01_5_01_4.html">00112</a> <span class="keyword">struct </span><a class="code" href="structitk_1_1hash.html">hash</a>&lt;char*&gt;
<a name="l00113"></a>00113 {
<a name="l00114"></a><a class="code" href="structitk_1_1hash_3_01char_01_5_01_4.html#0a08f7cec9bcdc704c3e47a64a1c713a">00114</a>   <span class="keywordtype">size_t</span> <a class="code" href="structitk_1_1hash_3_01char_01_5_01_4.html#0a08f7cec9bcdc704c3e47a64a1c713a">operator()</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* s)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="namespaceitk.html#5c50c0121529fb0e45d6c39eaabb9708">hash_string</a>(s); }
<a name="l00115"></a>00115 };
<a name="l00116"></a>00116 
<a name="l00117"></a>00117 <span class="keyword">template</span>&lt;&gt;
<a name="l00118"></a><a class="code" href="structitk_1_1hash_3_01const_01char_01_5_01_4.html">00118</a> <span class="keyword">struct </span><a class="code" href="structitk_1_1hash.html">hash</a>&lt;const char*&gt;
<a name="l00119"></a>00119 {
<a name="l00120"></a><a class="code" href="structitk_1_1hash_3_01const_01char_01_5_01_4.html#3aebf8d5c116192cc103bfb5a2c6d5ea">00120</a>   <span class="keywordtype">size_t</span> <a class="code" href="structitk_1_1hash_3_01const_01char_01_5_01_4.html#3aebf8d5c116192cc103bfb5a2c6d5ea">operator()</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* s)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="namespaceitk.html#5c50c0121529fb0e45d6c39eaabb9708">hash_string</a>(s); }
<a name="l00121"></a>00121 };
<a name="l00122"></a>00122 
<a name="l00123"></a>00123 <span class="keyword">template</span>&lt;&gt;
<a name="l00124"></a><a class="code" href="structitk_1_1hash_3_01char_01_4.html">00124</a> <span class="keyword">struct </span><a class="code" href="structitk_1_1hash.html">hash</a>&lt;char&gt;
<a name="l00125"></a>00125 {
<a name="l00126"></a><a class="code" href="structitk_1_1hash_3_01char_01_4.html#4d93886f338bc0f4a9c651701bedd1c9">00126</a>   <span class="keywordtype">size_t</span> <a class="code" href="structitk_1_1hash_3_01char_01_4.html#4d93886f338bc0f4a9c651701bedd1c9">operator()</a>(<span class="keywordtype">char</span> x)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> x; }
<a name="l00127"></a>00127 };
<a name="l00128"></a>00128 
<a name="l00129"></a>00129 <span class="keyword">template</span>&lt;&gt;
<a name="l00130"></a><a class="code" href="structitk_1_1hash_3_01unsigned_01char_01_4.html">00130</a> <span class="keyword">struct </span><a class="code" href="structitk_1_1hash.html">hash</a>&lt;unsigned char&gt;
<a name="l00131"></a>00131 {
<a name="l00132"></a><a class="code" href="structitk_1_1hash_3_01unsigned_01char_01_4.html#2a2ab34c0d91deb652780d0a74e5a099">00132</a>   <span class="keywordtype">size_t</span> <a class="code" href="structitk_1_1hash_3_01unsigned_01char_01_4.html#2a2ab34c0d91deb652780d0a74e5a099">operator()</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> x)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> x; }
<a name="l00133"></a>00133 };
<a name="l00134"></a>00134 
<a name="l00135"></a>00135 <span class="keyword">template</span>&lt;&gt;
<a name="l00136"></a><a class="code" href="structitk_1_1hash_3_01signed_01char_01_4.html">00136</a> <span class="keyword">struct </span><a class="code" href="structitk_1_1hash.html">hash</a>&lt;signed char&gt;
<a name="l00137"></a>00137 {
<a name="l00138"></a><a class="code" href="structitk_1_1hash_3_01signed_01char_01_4.html#ba8d7202e223feedb0057e38d7193571">00138</a>   <span class="keywordtype">size_t</span> <a class="code" href="structitk_1_1hash_3_01signed_01char_01_4.html#ba8d7202e223feedb0057e38d7193571">operator()</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> x)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> x; }
<a name="l00139"></a>00139 };
<a name="l00140"></a>00140 
<a name="l00141"></a>00141 <span class="keyword">template</span>&lt;&gt;
<a name="l00142"></a><a class="code" href="structitk_1_1hash_3_01short_01_4.html">00142</a> <span class="keyword">struct </span><a class="code" href="structitk_1_1hash.html">hash</a>&lt;short&gt;
<a name="l00143"></a>00143 {
<a name="l00144"></a><a class="code" href="structitk_1_1hash_3_01short_01_4.html#6038b81686556f30e75114f829da7946">00144</a>   <span class="keywordtype">size_t</span> <a class="code" href="structitk_1_1hash_3_01short_01_4.html#6038b81686556f30e75114f829da7946">operator()</a>(<span class="keywordtype">short</span> x)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> x; }
<a name="l00145"></a>00145 };
<a name="l00146"></a>00146 
<a name="l00147"></a>00147 <span class="keyword">template</span>&lt;&gt;
<a name="l00148"></a><a class="code" href="structitk_1_1hash_3_01unsigned_01short_01_4.html">00148</a> <span class="keyword">struct </span><a class="code" href="structitk_1_1hash.html">hash</a>&lt;unsigned short&gt;
<a name="l00149"></a>00149 {
<a name="l00150"></a><a class="code" href="structitk_1_1hash_3_01unsigned_01short_01_4.html#b8bf8418b2c2bf88dd888fe2e66e5937">00150</a>   <span class="keywordtype">size_t</span> <a class="code" href="structitk_1_1hash_3_01unsigned_01short_01_4.html#b8bf8418b2c2bf88dd888fe2e66e5937">operator()</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> x)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> x; }
<a name="l00151"></a>00151 };
<a name="l00152"></a>00152 
<a name="l00153"></a>00153 <span class="keyword">template</span>&lt;&gt;
<a name="l00154"></a><a class="code" href="structitk_1_1hash_3_01int_01_4.html">00154</a> <span class="keyword">struct </span><a class="code" href="structitk_1_1hash.html">hash</a>&lt;int&gt;
<a name="l00155"></a>00155 {
<a name="l00156"></a><a class="code" href="structitk_1_1hash_3_01int_01_4.html#aaf195612560f97f95cffe4e8e3e9cfd">00156</a>   <span class="keywordtype">size_t</span> <a class="code" href="structitk_1_1hash_3_01int_01_4.html#aaf195612560f97f95cffe4e8e3e9cfd">operator()</a>(<span class="keywordtype">int</span> x)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> x; }
<a name="l00157"></a>00157 };
<a name="l00158"></a>00158 
<a name="l00159"></a>00159 <span class="keyword">template</span>&lt;&gt;
<a name="l00160"></a><a class="code" href="structitk_1_1hash_3_01unsigned_01int_01_4.html">00160</a> <span class="keyword">struct </span><a class="code" href="structitk_1_1hash.html">hash</a>&lt;unsigned int&gt;
<a name="l00161"></a>00161 {
<a name="l00162"></a><a class="code" href="structitk_1_1hash_3_01unsigned_01int_01_4.html#5565ca3d8dded5d53c1aead1948d94aa">00162</a>   <span class="keywordtype">size_t</span> <a class="code" href="structitk_1_1hash_3_01unsigned_01int_01_4.html#5565ca3d8dded5d53c1aead1948d94aa">operator()</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> x)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> x; }
<a name="l00163"></a>00163 };
<a name="l00164"></a>00164 
<a name="l00165"></a>00165 <span class="keyword">template</span>&lt;&gt;
<a name="l00166"></a><a class="code" href="structitk_1_1hash_3_01long_01_4.html">00166</a> <span class="keyword">struct </span><a class="code" href="structitk_1_1hash.html">hash</a>&lt;long&gt;
<a name="l00167"></a>00167 {
<a name="l00168"></a><a class="code" href="structitk_1_1hash_3_01long_01_4.html#b67b41705db50ac9afcb22deecf6728c">00168</a>   <span class="keywordtype">size_t</span> <a class="code" href="structitk_1_1hash_3_01long_01_4.html#b67b41705db50ac9afcb22deecf6728c">operator()</a>(<span class="keywordtype">long</span> x)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> x; }
<a name="l00169"></a>00169 };
<a name="l00170"></a>00170 
<a name="l00171"></a>00171 <span class="keyword">template</span>&lt;&gt;
<a name="l00172"></a><a class="code" href="structitk_1_1hash_3_01unsigned_01long_01_4.html">00172</a> <span class="keyword">struct </span><a class="code" href="structitk_1_1hash.html">hash</a>&lt;unsigned long&gt;
<a name="l00173"></a>00173 {
<a name="l00174"></a><a class="code" href="structitk_1_1hash_3_01unsigned_01long_01_4.html#8c911c443b42459185dc7feb38e1690e">00174</a>   <span class="keywordtype">size_t</span> <a class="code" href="structitk_1_1hash_3_01unsigned_01long_01_4.html#8c911c443b42459185dc7feb38e1690e">operator()</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> x)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> x; }
<a name="l00175"></a>00175 };
<a name="l00176"></a>00176 
<a name="l00177"></a>00177 <span class="keyword">template</span> &lt;<span class="keyword">class</span> Value&gt;
<a name="l00178"></a><a class="code" href="structitk_1_1hashtable__node.html">00178</a> <span class="keyword">struct </span><a class="code" href="structitk_1_1hashtable__node.html">hashtable_node</a>
<a name="l00179"></a>00179 {
<a name="l00180"></a><a class="code" href="structitk_1_1hashtable__node.html#6e333fae1f3f8c3cc450b2dc558a334b">00180</a>   <span class="keyword">typedef</span> <a class="code" href="structitk_1_1hashtable__node.html">hashtable_node&lt;Value&gt;</a> <span class="keyword">self</span>;
<a name="l00181"></a><a class="code" href="structitk_1_1hashtable__node.html#7483e6d4641f35dc50abd79bbe9c0f74">00181</a>   <span class="keyword">self</span>* <a class="code" href="structitk_1_1hashtable__node.html#7483e6d4641f35dc50abd79bbe9c0f74">next</a>;
<a name="l00182"></a><a class="code" href="structitk_1_1hashtable__node.html#e3770520494e2a6426c1204a2bd4e1bc">00182</a>   Value <a class="code" href="structitk_1_1hashtable__node.html#e3770520494e2a6426c1204a2bd4e1bc">val</a>;
<a name="l00183"></a>00183 };
<a name="l00184"></a>00184 
<a name="l00185"></a>00185 <span class="keyword">template</span> &lt;<span class="keyword">class</span> Value, <span class="keyword">class</span> Key, <span class="keyword">class</span> HashFcn, <span class="keyword">class</span> ExtractKey, <span class="keyword">class</span> EqualKey ,  VCL_DFL_TYPE_PARAM_STLDECL(Alloc,std::allocator&lt;<span class="keywordtype">char</span>&gt;)&gt;
<a name="l00186"></a>00186 <span class="keyword">class </span><a class="code" href="classitk_1_1hashtable.html">hashtable</a>;
<a name="l00187"></a>00187 
<a name="l00188"></a>00188 <span class="keyword">template</span> &lt;<span class="keyword">class</span> Value, <span class="keyword">class</span> Key, <span class="keyword">class</span> HashFcn, <span class="keyword">class</span> ExtractKey, <span class="keyword">class</span> EqualKey, <span class="keyword">class</span> Alloc&gt;
<a name="l00189"></a>00189 <span class="keyword">struct </span><a class="code" href="structitk_1_1hashtable__iterator.html">hashtable_iterator</a>;
<a name="l00190"></a>00190 
<a name="l00191"></a>00191 <span class="keyword">template</span> &lt;<span class="keyword">class</span> Value, <span class="keyword">class</span> Key, <span class="keyword">class</span> HashFcn, <span class="keyword">class</span> ExtractKey, <span class="keyword">class</span> EqualKey, <span class="keyword">class</span> Alloc&gt;
<a name="l00192"></a>00192 <span class="keyword">struct </span><a class="code" href="structitk_1_1hashtable__const__iterator.html">hashtable_const_iterator</a>;
<a name="l00193"></a>00193 
<a name="l00194"></a>00194 <span class="keyword">template</span> &lt;<span class="keyword">class</span> Value, <span class="keyword">class</span> Key, <span class="keyword">class</span> HashFcn, <span class="keyword">class</span> ExtractKey, <span class="keyword">class</span> EqualKey, <span class="keyword">class</span> Alloc&gt;
<a name="l00195"></a><a class="code" href="structitk_1_1hashtable__iterator.html">00195</a> <span class="keyword">struct </span><a class="code" href="structitk_1_1hashtable__iterator.html">hashtable_iterator</a>
<a name="l00196"></a>00196 {
<a name="l00197"></a><a class="code" href="structitk_1_1hashtable__iterator.html#7fd35e2ea36a03e9510c377a24f29944">00197</a>   <span class="keyword">typedef</span> <a class="code" href="classitk_1_1hashtable.html">hashtable&lt;Value, Key, HashFcn, ExtractKey, EqualKey, Alloc&gt;</a> <a class="code" href="classitk_1_1hashtable.html">hash_table</a>;
<a name="l00198"></a>00198   <span class="keyword">typedef</span> <a class="code" href="structitk_1_1hashtable__iterator.html">hashtable_iterator</a>&lt;Value, Key, HashFcn,
<a name="l00199"></a><a class="code" href="structitk_1_1hashtable__iterator.html#cda827799bf583412c54d08f7e0c32be">00199</a>                                ExtractKey, EqualKey, Alloc&gt;           <a class="code" href="structitk_1_1hashtable__iterator.html">iterator</a>;
<a name="l00200"></a>00200   <span class="keyword">typedef</span> <a class="code" href="structitk_1_1hashtable__const__iterator.html">hashtable_const_iterator</a>&lt;Value, Key, HashFcn,
<a name="l00201"></a>00201                                      ExtractKey, EqualKey, Alloc&gt;
<a name="l00202"></a><a class="code" href="structitk_1_1hashtable__iterator.html#4a3f58aaf456b8899379e1e2f7f55a96">00202</a>                                                                       <a class="code" href="structitk_1_1hashtable__const__iterator.html">const_iterator</a>;
<a name="l00203"></a><a class="code" href="structitk_1_1hashtable__iterator.html#b21b155ead06ab79a80ce2e144b74680">00203</a>   <span class="keyword">typedef</span> <a class="code" href="structitk_1_1hashtable__node.html">hashtable_node&lt;Value&gt;</a>                                       <a class="code" href="structitk_1_1hashtable__node.html">node</a>;
<a name="l00204"></a><a class="code" href="structitk_1_1hashtable__iterator.html#43332464775c2fdc6a84ed7b77f20664">00204</a>   <span class="keyword">typedef</span> <span class="keywordtype">size_t</span>                                                      <a class="code" href="structitk_1_1hashtable__iterator.html#43332464775c2fdc6a84ed7b77f20664">size_type</a>;
<a name="l00205"></a><a class="code" href="structitk_1_1hashtable__iterator.html#3f1364c50c5472317ce62f4d18853074">00205</a>   <span class="keyword">typedef</span> Value&amp;                                                      <a class="code" href="structitk_1_1hashtable__iterator.html#3f1364c50c5472317ce62f4d18853074">reference</a>;
<a name="l00206"></a><a class="code" href="structitk_1_1hashtable__iterator.html#e80e4a5114c621a5c731e2d375507f70">00206</a>   <span class="keyword">typedef</span> Value*                                                      <a class="code" href="structitk_1_1hashtable__iterator.html#e80e4a5114c621a5c731e2d375507f70">pointer</a>;
<a name="l00207"></a><a class="code" href="structitk_1_1hashtable__iterator.html#aa0b74affa7b1aa39b3f3dcd673b3877">00207</a>   <span class="keyword">typedef</span> <span class="keyword">const</span> Value&amp;                                                <a class="code" href="structitk_1_1hashtable__iterator.html#aa0b74affa7b1aa39b3f3dcd673b3877">const_reference</a>;
<a name="l00208"></a>00208 
<a name="l00209"></a><a class="code" href="structitk_1_1hashtable__iterator.html#6a8af3f1e0971c467461b6195c43d659">00209</a>   <a class="code" href="structitk_1_1hashtable__node.html">node</a>*       <a class="code" href="structitk_1_1hashtable__iterator.html#6a8af3f1e0971c467461b6195c43d659">cur</a>;
<a name="l00210"></a><a class="code" href="structitk_1_1hashtable__iterator.html#55ee062e60bc13294bf8326a18b683a0">00210</a>   <a class="code" href="classitk_1_1hashtable.html">hash_table</a>* <a class="code" href="structitk_1_1hashtable__iterator.html#55ee062e60bc13294bf8326a18b683a0">ht</a>;
<a name="l00211"></a>00211 
<a name="l00212"></a><a class="code" href="structitk_1_1hashtable__iterator.html#dab861063fbabd1c8c11367334607073">00212</a>   <a class="code" href="structitk_1_1hashtable__iterator.html#dab861063fbabd1c8c11367334607073">hashtable_iterator</a>(<a class="code" href="structitk_1_1hashtable__node.html">node</a>* n, <a class="code" href="classitk_1_1hashtable.html">hash_table</a>* tab) : <a class="code" href="structitk_1_1hashtable__iterator.html#6a8af3f1e0971c467461b6195c43d659">cur</a>(n), <a class="code" href="structitk_1_1hashtable__iterator.html#55ee062e60bc13294bf8326a18b683a0">ht</a>(tab) {}
<a name="l00213"></a><a class="code" href="structitk_1_1hashtable__iterator.html#9c6f5cead1a4f578207a5c1c57f89e57">00213</a>   <a class="code" href="structitk_1_1hashtable__iterator.html#9c6f5cead1a4f578207a5c1c57f89e57">hashtable_iterator</a>() {}
<a name="l00214"></a><a class="code" href="structitk_1_1hashtable__iterator.html#87b27f1621e133b5d6b222ec6b077dda">00214</a>   <a class="code" href="structitk_1_1hashtable__iterator.html#3f1364c50c5472317ce62f4d18853074">reference</a> <a class="code" href="structitk_1_1hashtable__iterator.html#87b27f1621e133b5d6b222ec6b077dda">operator*</a>()<span class="keyword"> const</span>
<a name="l00215"></a>00215 <span class="keyword">    </span>{
<a name="l00216"></a>00216     <span class="keywordflow">return</span> <a class="code" href="structitk_1_1hashtable__iterator.html#6a8af3f1e0971c467461b6195c43d659">cur</a>-&gt;<a class="code" href="structitk_1_1hashtable__node.html#e3770520494e2a6426c1204a2bd4e1bc">val</a>;
<a name="l00217"></a>00217     }
<a name="l00218"></a><a class="code" href="structitk_1_1hashtable__iterator.html#5a03d6014c2ac625e00b2e109397d9ef">00218</a>   <a class="code" href="structitk_1_1hashtable__iterator.html#e80e4a5114c621a5c731e2d375507f70">pointer</a> <a class="code" href="structitk_1_1hashtable__iterator.html#5a03d6014c2ac625e00b2e109397d9ef">operator-&gt;</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> &amp;(<a class="code" href="structitk_1_1hashtable__iterator.html#87b27f1621e133b5d6b222ec6b077dda">operator*</a>()); }
<a name="l00219"></a>00219 
<a name="l00220"></a>00220   IUEi_STL_INLINE <a class="code" href="structitk_1_1hashtable__iterator.html#cda827799bf583412c54d08f7e0c32be">iterator</a>&amp; <a class="code" href="structitk_1_1hashtable__iterator.html#a1247240b238e7e623bef828dc82ac89">operator++</a>();
<a name="l00221"></a>00221   IUEi_STL_INLINE <a class="code" href="structitk_1_1hashtable__iterator.html#cda827799bf583412c54d08f7e0c32be">iterator</a> <a class="code" href="structitk_1_1hashtable__iterator.html#a1247240b238e7e623bef828dc82ac89">operator++</a>(<span class="keywordtype">int</span>);
<a name="l00222"></a><a class="code" href="structitk_1_1hashtable__iterator.html#42e0d14b8518dcd4dbb20050ad1c67d8">00222</a>   <span class="keywordtype">bool</span> <a class="code" href="structitk_1_1hashtable__iterator.html#42e0d14b8518dcd4dbb20050ad1c67d8">operator==</a>(<span class="keyword">const</span> <a class="code" href="structitk_1_1hashtable__iterator.html">iterator</a>&amp; it)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="structitk_1_1hashtable__iterator.html#6a8af3f1e0971c467461b6195c43d659">cur</a> == it.<a class="code" href="structitk_1_1hashtable__iterator.html#6a8af3f1e0971c467461b6195c43d659">cur</a>; }
<a name="l00223"></a><a class="code" href="structitk_1_1hashtable__iterator.html#b31d3d7ddfcac786acb925e7e8fd4c77">00223</a>   <span class="keywordtype">bool</span> <a class="code" href="structitk_1_1hashtable__iterator.html#b31d3d7ddfcac786acb925e7e8fd4c77">operator!=</a>(<span class="keyword">const</span> <a class="code" href="structitk_1_1hashtable__iterator.html">iterator</a>&amp; it)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="structitk_1_1hashtable__iterator.html#6a8af3f1e0971c467461b6195c43d659">cur</a> != it.<a class="code" href="structitk_1_1hashtable__iterator.html#6a8af3f1e0971c467461b6195c43d659">cur</a>; }
<a name="l00224"></a>00224 };
<a name="l00225"></a>00225 
<a name="l00226"></a>00226 
<a name="l00227"></a>00227 <span class="keyword">template</span> &lt;<span class="keyword">class</span> Value, <span class="keyword">class</span> Key, <span class="keyword">class</span> HashFcn, <span class="keyword">class</span> ExtractKey, <span class="keyword">class</span> EqualKey, <span class="keyword">class</span> Alloc&gt;
<a name="l00228"></a><a class="code" href="structitk_1_1hashtable__const__iterator.html">00228</a> <span class="keyword">struct </span><a class="code" href="structitk_1_1hashtable__const__iterator.html">hashtable_const_iterator</a>
<a name="l00229"></a>00229 {
<a name="l00230"></a>00230   <span class="keyword">typedef</span> <a class="code" href="classitk_1_1hashtable.html">hashtable&lt;Value, Key, HashFcn, ExtractKey, EqualKey, Alloc&gt;</a>
<a name="l00231"></a><a class="code" href="structitk_1_1hashtable__const__iterator.html#d49c9b6738943a3d4469ab8b23a4d4bc">00231</a>           <a class="code" href="classitk_1_1hashtable.html">hash_table</a>;
<a name="l00232"></a>00232   <span class="keyword">typedef</span> <a class="code" href="structitk_1_1hashtable__iterator.html">hashtable_iterator</a>&lt;Value, Key, HashFcn,
<a name="l00233"></a><a class="code" href="structitk_1_1hashtable__const__iterator.html#49378bf88e9ec50949e89b2ae4067644">00233</a>      ExtractKey, EqualKey, Alloc&gt; <a class="code" href="structitk_1_1hashtable__iterator.html">iterator</a>;
<a name="l00234"></a>00234   <span class="keyword">typedef</span> <a class="code" href="structitk_1_1hashtable__const__iterator.html">hashtable_const_iterator</a>&lt;Value, Key, HashFcn,
<a name="l00235"></a><a class="code" href="structitk_1_1hashtable__const__iterator.html#934a34e035d76ddd8bfdf809a9fd1eb0">00235</a>      ExtractKey, EqualKey, Alloc&gt; <a class="code" href="structitk_1_1hashtable__const__iterator.html">const_iterator</a>;
<a name="l00236"></a><a class="code" href="structitk_1_1hashtable__const__iterator.html#e7bd78973754fdbc6ccdcf7b0a99e21d">00236</a>   <span class="keyword">typedef</span> <a class="code" href="structitk_1_1hashtable__node.html">hashtable_node&lt;Value&gt;</a> <a class="code" href="structitk_1_1hashtable__node.html">node</a>;
<a name="l00237"></a><a class="code" href="structitk_1_1hashtable__const__iterator.html#8c3f287129d05c5384f97a8aab8e20f3">00237</a>   <span class="keyword">typedef</span> <span class="keywordtype">size_t</span> <a class="code" href="structitk_1_1hashtable__const__iterator.html#8c3f287129d05c5384f97a8aab8e20f3">size_type</a>;
<a name="l00238"></a><a class="code" href="structitk_1_1hashtable__const__iterator.html#0882e5ea64ae45579294f5dbb8b714b2">00238</a>   <span class="keyword">typedef</span> Value&amp; <a class="code" href="structitk_1_1hashtable__const__iterator.html#0882e5ea64ae45579294f5dbb8b714b2">reference</a>;
<a name="l00239"></a><a class="code" href="structitk_1_1hashtable__const__iterator.html#65bb88326e2e49d1b17559738557cacc">00239</a>   <span class="keyword">typedef</span> <span class="keyword">const</span> Value&amp; <a class="code" href="structitk_1_1hashtable__const__iterator.html#65bb88326e2e49d1b17559738557cacc">const_reference</a>;
<a name="l00240"></a><a class="code" href="structitk_1_1hashtable__const__iterator.html#0f9fac2cb75349289e1aa359eeaae3d9">00240</a>   <span class="keyword">typedef</span> <span class="keyword">const</span> Value* <a class="code" href="structitk_1_1hashtable__const__iterator.html#0f9fac2cb75349289e1aa359eeaae3d9">pointer</a>;
<a name="l00241"></a>00241 
<a name="l00242"></a><a class="code" href="structitk_1_1hashtable__const__iterator.html#f429aa3dffb4c6d65392da4a5ec1ff99">00242</a>   <span class="keyword">const</span> <a class="code" href="structitk_1_1hashtable__node.html">node</a>* <a class="code" href="structitk_1_1hashtable__const__iterator.html#f429aa3dffb4c6d65392da4a5ec1ff99">cur</a>;
<a name="l00243"></a><a class="code" href="structitk_1_1hashtable__const__iterator.html#01555fe635013fd1a6a61c493a6116f5">00243</a>   <span class="keyword">const</span> <a class="code" href="classitk_1_1hashtable.html">hash_table</a>* <a class="code" href="structitk_1_1hashtable__const__iterator.html#01555fe635013fd1a6a61c493a6116f5">ht</a>;
<a name="l00244"></a>00244 
<a name="l00245"></a><a class="code" href="structitk_1_1hashtable__const__iterator.html#844e138b432441b3926b38653fb9343b">00245</a>   <a class="code" href="structitk_1_1hashtable__const__iterator.html#844e138b432441b3926b38653fb9343b">hashtable_const_iterator</a>(<span class="keyword">const</span> <a class="code" href="structitk_1_1hashtable__node.html">node</a>* n, <span class="keyword">const</span> <a class="code" href="classitk_1_1hashtable.html">hash_table</a>* tab) : <a class="code" href="structitk_1_1hashtable__const__iterator.html#f429aa3dffb4c6d65392da4a5ec1ff99">cur</a>(n), <a class="code" href="structitk_1_1hashtable__const__iterator.html#01555fe635013fd1a6a61c493a6116f5">ht</a>(tab) {}
<a name="l00246"></a><a class="code" href="structitk_1_1hashtable__const__iterator.html#52a281a588409c633dd1d4d580b64413">00246</a>   <a class="code" href="structitk_1_1hashtable__const__iterator.html#52a281a588409c633dd1d4d580b64413">hashtable_const_iterator</a>() {}
<a name="l00247"></a><a class="code" href="structitk_1_1hashtable__const__iterator.html#f1f8f621fa648f42ac4ce25725ffabc9">00247</a>   <a class="code" href="structitk_1_1hashtable__const__iterator.html#f1f8f621fa648f42ac4ce25725ffabc9">hashtable_const_iterator</a>(<span class="keyword">const</span> <a class="code" href="structitk_1_1hashtable__iterator.html">iterator</a>&amp; it) : <a class="code" href="structitk_1_1hashtable__const__iterator.html#f429aa3dffb4c6d65392da4a5ec1ff99">cur</a>(it.<a class="code" href="structitk_1_1hashtable__const__iterator.html#f429aa3dffb4c6d65392da4a5ec1ff99">cur</a>), <a class="code" href="structitk_1_1hashtable__const__iterator.html#01555fe635013fd1a6a61c493a6116f5">ht</a>(it.<a class="code" href="structitk_1_1hashtable__const__iterator.html#01555fe635013fd1a6a61c493a6116f5">ht</a>) {}
<a name="l00248"></a>00248 
<a name="l00249"></a><a class="code" href="structitk_1_1hashtable__const__iterator.html#05c5f69d27db4bda254f995fdabe40ea">00249</a>   <a class="code" href="structitk_1_1hashtable__const__iterator.html#65bb88326e2e49d1b17559738557cacc">const_reference</a> <a class="code" href="structitk_1_1hashtable__const__iterator.html#05c5f69d27db4bda254f995fdabe40ea">operator*</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="structitk_1_1hashtable__const__iterator.html#f429aa3dffb4c6d65392da4a5ec1ff99">cur</a>-&gt;<a class="code" href="structitk_1_1hashtable__node.html#e3770520494e2a6426c1204a2bd4e1bc">val</a>; }
<a name="l00250"></a><a class="code" href="structitk_1_1hashtable__const__iterator.html#f5eb89c1d4e7d5f1352b20daabc1c706">00250</a>   <a class="code" href="structitk_1_1hashtable__const__iterator.html#0f9fac2cb75349289e1aa359eeaae3d9">pointer</a> <a class="code" href="structitk_1_1hashtable__const__iterator.html#f5eb89c1d4e7d5f1352b20daabc1c706">operator-&gt;</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> &amp;(<a class="code" href="structitk_1_1hashtable__const__iterator.html#05c5f69d27db4bda254f995fdabe40ea">operator*</a>()); }
<a name="l00251"></a>00251   IUEi_STL_INLINE <a class="code" href="structitk_1_1hashtable__const__iterator.html#934a34e035d76ddd8bfdf809a9fd1eb0">const_iterator</a>&amp; <a class="code" href="structitk_1_1hashtable__const__iterator.html#29d5a2c376befb4d12f5e46792e5ba34">operator++</a>();
<a name="l00252"></a>00252   IUEi_STL_INLINE <a class="code" href="structitk_1_1hashtable__const__iterator.html#934a34e035d76ddd8bfdf809a9fd1eb0">const_iterator</a> <a class="code" href="structitk_1_1hashtable__const__iterator.html#29d5a2c376befb4d12f5e46792e5ba34">operator++</a>(<span class="keywordtype">int</span>);
<a name="l00253"></a><a class="code" href="structitk_1_1hashtable__const__iterator.html#a1013107f3a224aaa88cbbf0e8d6eefc">00253</a>   <span class="keywordtype">bool</span> <a class="code" href="structitk_1_1hashtable__const__iterator.html#a1013107f3a224aaa88cbbf0e8d6eefc">operator==</a>(<span class="keyword">const</span> <a class="code" href="structitk_1_1hashtable__const__iterator.html">const_iterator</a>&amp; it)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="structitk_1_1hashtable__const__iterator.html#f429aa3dffb4c6d65392da4a5ec1ff99">cur</a> == it.<a class="code" href="structitk_1_1hashtable__const__iterator.html#f429aa3dffb4c6d65392da4a5ec1ff99">cur</a>; }
<a name="l00254"></a><a class="code" href="structitk_1_1hashtable__const__iterator.html#6702acd939b80033e94e0e3deb262770">00254</a>   <span class="keywordtype">bool</span> <a class="code" href="structitk_1_1hashtable__const__iterator.html#6702acd939b80033e94e0e3deb262770">operator!=</a>(<span class="keyword">const</span> <a class="code" href="structitk_1_1hashtable__const__iterator.html">const_iterator</a>&amp; it)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="structitk_1_1hashtable__const__iterator.html#f429aa3dffb4c6d65392da4a5ec1ff99">cur</a> != it.<a class="code" href="structitk_1_1hashtable__const__iterator.html#f429aa3dffb4c6d65392da4a5ec1ff99">cur</a>; }
<a name="l00255"></a>00255 };
<a name="l00256"></a>00256 
<a name="l00257"></a>00257 <span class="comment">// Note: assumes long is at least 32 bits.</span>
<a name="l00258"></a>00258 <span class="comment">// fbp: try to avoid intances in every module</span>
<a name="l00259"></a><a class="code" href="namespaceitk.html#c877691e707540fcdc9791c2df0946ee057a251c5684717870e0a7bc4a5eaa36">00259</a> <span class="keyword">enum</span> { <a class="code" href="namespaceitk.html#c877691e707540fcdc9791c2df0946ee057a251c5684717870e0a7bc4a5eaa36">num_primes</a> = 28 };
<a name="l00260"></a>00260 
<a name="l00261"></a>00261 <span class="preprocessor">#if ( __STL_STATIC_TEMPLATE_DATA &gt; 0 ) &amp;&amp; ! defined (WIN32)</span>
<a name="l00262"></a>00262 <span class="preprocessor"></span><span class="preprocessor">#  define prime_list prime&lt;false&gt;::list_</span>
<a name="l00263"></a>00263 <span class="preprocessor"></span><span class="keyword">template</span> &lt;<span class="keywordtype">bool</span> dummy&gt;
<a name="l00264"></a>00264 <span class="keyword">struct </span>prime {
<a name="l00265"></a>00265 <span class="keyword">public</span>:
<a name="l00266"></a>00266   <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> list_[];
<a name="l00267"></a>00267 };
<a name="l00268"></a>00268 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> prime_list_dummy[<a class="code" href="namespaceitk.html#c877691e707540fcdc9791c2df0946ee057a251c5684717870e0a7bc4a5eaa36">num_primes</a>] =
<a name="l00269"></a>00269 <span class="preprocessor">#  else</span>
<a name="l00270"></a>00270 <span class="preprocessor"></span><span class="preprocessor">#  if ( __STL_WEAK_ATTRIBUTE &gt; 0 )</span>
<a name="l00271"></a>00271 <span class="preprocessor"></span>  <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <a class="code" href="namespaceitk.html#22fcbb1c45c3cbaa6dac69786fead438">prime_list</a>[<a class="code" href="namespaceitk.html#c877691e707540fcdc9791c2df0946ee057a251c5684717870e0a7bc4a5eaa36">num_primes</a>] __attribute__((weak)) =
<a name="l00272"></a>00272 <span class="preprocessor">#  else</span>
<a name="l00273"></a>00273 <span class="preprocessor"></span>  <span class="comment">// give up</span>
<a name="l00274"></a><a class="code" href="namespaceitk.html#22fcbb1c45c3cbaa6dac69786fead438">00274</a>   <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <a class="code" href="namespaceitk.html#22fcbb1c45c3cbaa6dac69786fead438">prime_list</a>[<a class="code" href="namespaceitk.html#c877691e707540fcdc9791c2df0946ee057a251c5684717870e0a7bc4a5eaa36">num_primes</a>] =
<a name="l00275"></a>00275 <span class="preprocessor">#  endif </span><span class="comment">/* __STL_WEAK_ATTRIBUTE */</span>
<a name="l00276"></a>00276 <span class="preprocessor">#endif </span><span class="comment">/* __STL_STATIC_TEMPLATE_DATA */</span>
<a name="l00277"></a>00277 {
<a name="l00278"></a>00278   53,         97,         193,       389,       769,
<a name="l00279"></a>00279   1543,       3079,       6151,      12289,     24593,
<a name="l00280"></a>00280   49157,      98317,      196613,    393241,    786433,
<a name="l00281"></a>00281   1572869,    3145739,    6291469,   12582917,  25165843,
<a name="l00282"></a>00282   50331653,   100663319,  201326611, 402653189, 805306457,
<a name="l00283"></a>00283   1610612741, 3221225473U, 4294967291U
<a name="l00284"></a>00284 };
<a name="l00285"></a>00285 
<a name="l00286"></a><a class="code" href="namespaceitk.html#c180ca658f913bb6596772a32bbc177c">00286</a> <span class="keyword">inline</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <a class="code" href="namespaceitk.html#c180ca658f913bb6596772a32bbc177c">next_prime</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> n)
<a name="l00287"></a>00287 {
<a name="l00288"></a>00288   <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>* first = <a class="code" href="namespaceitk.html#22fcbb1c45c3cbaa6dac69786fead438">prime_list</a>;
<a name="l00289"></a>00289   <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>* last = <a class="code" href="namespaceitk.html#22fcbb1c45c3cbaa6dac69786fead438">prime_list</a>;
<a name="l00290"></a>00290   last += <a class="code" href="namespaceitk.html#c877691e707540fcdc9791c2df0946ee057a251c5684717870e0a7bc4a5eaa36">num_primes</a>;
<a name="l00291"></a>00291   <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>* pos = std::lower_bound(first, last, n);
<a name="l00292"></a>00292   <span class="keywordflow">return</span> pos == last ? *(last - 1) : *pos;
<a name="l00293"></a>00293 }
<a name="l00294"></a>00294 
<a name="l00295"></a>00295 <span class="keyword">template</span> &lt;<span class="keyword">class</span> Value, <span class="keyword">class</span> Alloc&gt;
<a name="l00296"></a><a class="code" href="classitk_1_1hashtable__base.html">00296</a> <span class="keyword">class </span><a class="code" href="classitk_1_1hashtable__base.html">hashtable_base</a>
<a name="l00297"></a>00297 {
<a name="l00298"></a>00298 <span class="keyword">private</span>:
<a name="l00299"></a>00299   <span class="keyword">typedef</span> Value value_type;
<a name="l00300"></a>00300   <span class="keyword">typedef</span> <span class="keywordtype">size_t</span> size_type;
<a name="l00301"></a>00301   <span class="keyword">typedef</span> <a class="code" href="structitk_1_1hashtable__node.html">hashtable_node&lt;Value&gt;</a> <a class="code" href="structitk_1_1hashtable__node.html">node</a>;
<a name="l00302"></a>00302   <span class="keyword">typedef</span> <a class="code" href="classitk__simple__alloc.html">itk_simple_alloc&lt;node, Alloc&gt;</a> <a class="code" href="classitk__simple__alloc.html">node_allocator</a>;
<a name="l00303"></a>00303 <span class="keyword">public</span>: <span class="comment">// These are public to get around restriction on protected access</span>
<a name="l00304"></a><a class="code" href="classitk_1_1hashtable__base.html#aee14b1961f628f107cc202bfd06b2c8">00304</a>   <span class="keyword">typedef</span> std::vector&lt;VCL_SUNPRO_ALLOCATOR_HACK(node*) &gt; <a class="code" href="classitk_1_1hashtable__base.html#aee14b1961f628f107cc202bfd06b2c8">buckets_type</a>;
<a name="l00305"></a><a class="code" href="classitk_1_1hashtable__base.html#bd17986486bda165e7fe60eb79cba12a">00305</a>   <a class="code" href="classitk_1_1hashtable__base.html#aee14b1961f628f107cc202bfd06b2c8">buckets_type</a> <a class="code" href="classitk_1_1hashtable__base.html#bd17986486bda165e7fe60eb79cba12a">buckets</a>; <span class="comment">// awf killed optional allocator</span>
<a name="l00306"></a><a class="code" href="classitk_1_1hashtable__base.html#61c5192d841cc653832445b61e4ef8bf">00306</a>   size_type <a class="code" href="classitk_1_1hashtable__base.html#61c5192d841cc653832445b61e4ef8bf">num_elements</a>;
<a name="l00307"></a>00307 <span class="keyword">protected</span>:
<a name="l00308"></a>00308   IUEi_STL_INLINE <span class="keywordtype">void</span> <a class="code" href="classitk_1_1hashtable__base.html#f2c42aa904b06fe2c128ddf0b73701ca">clear</a>();
<a name="l00309"></a>00309 
<a name="l00310"></a><a class="code" href="classitk_1_1hashtable__base.html#1b4e12a8c83b4ac5cce22bc331f210d9">00310</a>   <a class="code" href="structitk_1_1hashtable__node.html">node</a>* <a class="code" href="classitk_1_1hashtable__base.html#1b4e12a8c83b4ac5cce22bc331f210d9">new_node</a>(<span class="keyword">const</span> value_type&amp; obj)
<a name="l00311"></a>00311     {
<a name="l00312"></a>00312     <a class="code" href="structitk_1_1hashtable__node.html">node</a>* n = <a class="code" href="classitk__simple__alloc.html#d4a54ed5545e6d01b38438f2355d444d">node_allocator::allocate</a>();
<a name="l00313"></a>00313     <span class="keywordflow">try</span>
<a name="l00314"></a>00314       {
<a name="l00315"></a>00315       <span class="keyword">new</span> (&amp;(n-&gt;<a class="code" href="structitk_1_1hashtable__node.html#e3770520494e2a6426c1204a2bd4e1bc">val</a>)) value_type(obj);
<a name="l00316"></a>00316       }
<a name="l00317"></a>00317     <span class="keywordflow">catch</span> (...)
<a name="l00318"></a>00318       {
<a name="l00319"></a>00319       <a class="code" href="classitk__simple__alloc.html#a9aaacb5e247e0453d4bc940d18f6ab5">node_allocator::deallocate</a>(n);
<a name="l00320"></a>00320       <span class="keywordflow">throw</span> <span class="stringliteral">""</span>;
<a name="l00321"></a>00321       }
<a name="l00322"></a>00322     n-&gt;<a class="code" href="structitk_1_1hashtable__node.html#7483e6d4641f35dc50abd79bbe9c0f74">next</a> = 0;
<a name="l00323"></a>00323     <span class="keywordflow">return</span> n;
<a name="l00324"></a>00324     }
<a name="l00325"></a>00325 
<a name="l00326"></a><a class="code" href="classitk_1_1hashtable__base.html#abce8d61a3042df7e067837f0d7315e3">00326</a>   <span class="keywordtype">void</span> <a class="code" href="classitk_1_1hashtable__base.html#abce8d61a3042df7e067837f0d7315e3">delete_node</a>(<a class="code" href="structitk_1_1hashtable__node.html">node</a>* n)
<a name="l00327"></a>00327     {
<a name="l00328"></a>00328 <span class="preprocessor">#define vcli_destroy(T, p)    ((T*)p)-&gt;~T()</span>
<a name="l00329"></a>00329 <span class="preprocessor"></span>    <a class="code" href="itk__hashtable_8h.html#411356b664322285043d080cbb4d272e">vcli_destroy</a>(Value, &amp;(n-&gt;<a class="code" href="structitk_1_1hashtable__node.html#e3770520494e2a6426c1204a2bd4e1bc">val</a>));
<a name="l00330"></a>00330 <span class="preprocessor">#undef vcli_destroy</span>
<a name="l00331"></a>00331 <span class="preprocessor"></span>    <a class="code" href="classitk__simple__alloc.html#a9aaacb5e247e0453d4bc940d18f6ab5">node_allocator::deallocate</a>(n);
<a name="l00332"></a>00332     }
<a name="l00333"></a>00333 
<a name="l00334"></a>00334     IUEi_STL_INLINE <span class="keywordtype">void</span> <a class="code" href="classitk_1_1hashtable__base.html#370b34942d193c9931deeafbfdd3d647">copy_from</a>(<span class="keyword">const</span> <a class="code" href="classitk_1_1hashtable__base.html">hashtable_base&lt;Value,Alloc&gt;</a>&amp; ht);
<a name="l00335"></a>00335 
<a name="l00336"></a>00336 <span class="keyword">public</span>: <span class="comment">// These are public to get around restriction on protected access</span>
<a name="l00337"></a><a class="code" href="classitk_1_1hashtable__base.html#7b98c85fe09ec1f6ce0775060bdfca94">00337</a>     <a class="code" href="classitk_1_1hashtable__base.html#7b98c85fe09ec1f6ce0775060bdfca94">hashtable_base</a>() : <a class="code" href="classitk_1_1hashtable__base.html#61c5192d841cc653832445b61e4ef8bf">num_elements</a>(0) { }
<a name="l00338"></a>00338 <span class="comment">//    hashtable_base(size_type n) : num_elements(0) {}</span>
<a name="l00339"></a><a class="code" href="classitk_1_1hashtable__base.html#b851a6bcd825ddc7e02abf6933771963">00339</a>     <a class="code" href="classitk_1_1hashtable__base.html#b851a6bcd825ddc7e02abf6933771963">~hashtable_base</a>() { <a class="code" href="classitk_1_1hashtable__base.html#f2c42aa904b06fe2c128ddf0b73701ca">clear</a>(); }
<a name="l00340"></a>00340 };
<a name="l00341"></a>00341 
<a name="l00342"></a>00342 
<a name="l00343"></a>00343 <span class="comment">// forward declarations</span>
<a name="l00344"></a>00344 <span class="keyword">template</span> &lt;<span class="keyword">class</span> Value, <span class="keyword">class</span> Key, <span class="keyword">class</span> HashFcn, <span class="keyword">class</span> ExtractKey, <span class="keyword">class</span> EqualKey, <span class="keyword">class</span> Alloc&gt; <span class="keyword">class </span>hashtable;
<a name="l00345"></a>00345 <span class="keyword">template</span> &lt;<span class="keyword">class</span> Value, <span class="keyword">class</span> Key, <span class="keyword">class</span> HashFcn, <span class="keyword">class</span> ExtractKey, <span class="keyword">class</span> EqualKey, <span class="keyword">class</span> Alloc&gt;
<a name="l00346"></a>00346   <span class="keywordtype">bool</span> <a class="code" href="namespaceitk.html#e1c1b02c301187419478f5126c789a01">operator== </a>(hashtable&lt;Value,Key,HashFcn,ExtractKey,EqualKey,Alloc&gt;<span class="keyword">const</span>&amp;,hashtable&lt;Value,Key,HashFcn,ExtractKey,EqualKey,Alloc&gt;<span class="keyword">const</span>&amp;);
<a name="l00347"></a>00347 
<a name="l00348"></a>00348 <span class="keyword">template</span> &lt;<span class="keyword">class</span> Value, <span class="keyword">class</span> Key, <span class="keyword">class</span> HashFcn, <span class="keyword">class</span> ExtractKey, <span class="keyword">class</span> EqualKey, <span class="keyword">class</span> Alloc&gt;
<a name="l00349"></a><a class="code" href="classitk_1_1hashtable.html">00349</a> <span class="keyword">class </span><a class="code" href="classitk_1_1hashtable.html">hashtable</a> : <span class="keyword">protected</span> <a class="code" href="classitk_1_1hashtable__base.html">hashtable_base</a>&lt;Value, Alloc&gt;
<a name="l00350"></a>00350 {
<a name="l00351"></a>00351   <span class="keyword">typedef</span> <a class="code" href="classitk_1_1hashtable__base.html">hashtable_base&lt;Value, Alloc&gt;</a> <a class="code" href="classitk_1_1hashtable__base.html">super</a>;
<a name="l00352"></a>00352   <span class="keyword">typedef</span> <a class="code" href="classitk_1_1hashtable.html">hashtable&lt;Value, Key, HashFcn, ExtractKey, EqualKey, Alloc&gt;</a> <span class="keyword">self</span>;
<a name="l00353"></a>00353 <span class="keyword">public</span>:
<a name="l00354"></a><a class="code" href="classitk_1_1hashtable.html#ce7f39999dfd0460fafc792cc0fcf31b">00354</a>   <span class="keyword">typedef</span> Key <a class="code" href="classitk_1_1hashtable.html#ce7f39999dfd0460fafc792cc0fcf31b">key_type</a>;
<a name="l00355"></a><a class="code" href="classitk_1_1hashtable.html#9b4944269bde048047a0379fb26b1f26">00355</a>   <span class="keyword">typedef</span> Value <a class="code" href="classitk_1_1hashtable.html#9b4944269bde048047a0379fb26b1f26">value_type</a>;
<a name="l00356"></a><a class="code" href="classitk_1_1hashtable.html#9573613f935976ffd4446f4fa6037d34">00356</a>   <span class="keyword">typedef</span> HashFcn <a class="code" href="classitk_1_1hashtable.html#9573613f935976ffd4446f4fa6037d34">hasher</a>;
<a name="l00357"></a><a class="code" href="classitk_1_1hashtable.html#7d43a00a83b7a980ef685ec55aabeccc">00357</a>   <span class="keyword">typedef</span> EqualKey <a class="code" href="classitk_1_1hashtable.html#7d43a00a83b7a980ef685ec55aabeccc">key_equal</a>;
<a name="l00358"></a>00358 
<a name="l00359"></a><a class="code" href="classitk_1_1hashtable.html#24390ecc706db752bc17b789feded607">00359</a>   <span class="keyword">typedef</span> <span class="keywordtype">size_t</span>            <a class="code" href="classitk_1_1hashtable.html#24390ecc706db752bc17b789feded607">size_type</a>;
<a name="l00360"></a><a class="code" href="classitk_1_1hashtable.html#4823f0a7e1138fe9afc54b858ee8f9b9">00360</a>   <span class="keyword">typedef</span> ptrdiff_t         <a class="code" href="classitk_1_1hashtable.html#4823f0a7e1138fe9afc54b858ee8f9b9">difference_type</a>;
<a name="l00361"></a><a class="code" href="classitk_1_1hashtable.html#76ff0ab4d4b969a1ebcdb4807684e18a">00361</a>   <span class="keyword">typedef</span> <a class="code" href="classitk_1_1hashtable.html#9b4944269bde048047a0379fb26b1f26">value_type</a>*       <a class="code" href="classitk_1_1hashtable.html#76ff0ab4d4b969a1ebcdb4807684e18a">pointer</a>;
<a name="l00362"></a><a class="code" href="classitk_1_1hashtable.html#77fe29fafb247e4d756f5e749e55ba31">00362</a>   <span class="keyword">typedef</span> <span class="keyword">const</span> <a class="code" href="classitk_1_1hashtable.html#9b4944269bde048047a0379fb26b1f26">value_type</a>* <a class="code" href="classitk_1_1hashtable.html#77fe29fafb247e4d756f5e749e55ba31">const_pointer</a>;
<a name="l00363"></a><a class="code" href="classitk_1_1hashtable.html#e40ca427619fedc8dfeeeab75071accd">00363</a>   <span class="keyword">typedef</span> <a class="code" href="classitk_1_1hashtable.html#9b4944269bde048047a0379fb26b1f26">value_type</a>&amp;       <a class="code" href="classitk_1_1hashtable.html#e40ca427619fedc8dfeeeab75071accd">reference</a>;
<a name="l00364"></a><a class="code" href="classitk_1_1hashtable.html#79422138a06bd1c6687779e27e236ece">00364</a>   <span class="keyword">typedef</span> <span class="keyword">const</span> <a class="code" href="classitk_1_1hashtable.html#9b4944269bde048047a0379fb26b1f26">value_type</a>&amp; <a class="code" href="classitk_1_1hashtable.html#79422138a06bd1c6687779e27e236ece">const_reference</a>;
<a name="l00365"></a>00365 
<a name="l00366"></a><a class="code" href="classitk_1_1hashtable.html#1d2c56a89e24be3b4b03bfd6f04793e2">00366</a>   <a class="code" href="classitk_1_1hashtable.html#9573613f935976ffd4446f4fa6037d34">hasher</a> <a class="code" href="classitk_1_1hashtable.html#1d2c56a89e24be3b4b03bfd6f04793e2">hash_funct</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> hashfun; }
<a name="l00367"></a><a class="code" href="classitk_1_1hashtable.html#3ac1ff41a505f4fc4bd2927bcb7e0ef4">00367</a>   <a class="code" href="classitk_1_1hashtable.html#7d43a00a83b7a980ef685ec55aabeccc">key_equal</a> <a class="code" href="classitk_1_1hashtable.html#3ac1ff41a505f4fc4bd2927bcb7e0ef4">key_eq</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> equals; }
<a name="l00368"></a>00368 
<a name="l00369"></a>00369 <span class="keyword">private</span>:
<a name="l00370"></a>00370   <a class="code" href="classitk_1_1hashtable.html#9573613f935976ffd4446f4fa6037d34">hasher</a> hashfun;
<a name="l00371"></a>00371   <a class="code" href="classitk_1_1hashtable.html#7d43a00a83b7a980ef685ec55aabeccc">key_equal</a> equals;
<a name="l00372"></a>00372   ExtractKey get_key;
<a name="l00373"></a>00373 
<a name="l00374"></a>00374   <span class="keyword">typedef</span> <a class="code" href="structitk_1_1hashtable__node.html">hashtable_node&lt;Value&gt;</a> node;
<a name="l00375"></a>00375   <span class="keyword">typedef</span> <a class="code" href="classitk__simple__alloc.html">itk_simple_alloc&lt;node, Alloc&gt;</a> node_allocator;
<a name="l00376"></a>00376 
<a name="l00377"></a>00377 <span class="keyword">public</span>:
<a name="l00378"></a><a class="code" href="classitk_1_1hashtable.html#8805a45b0131beb02f2dc918da33b033">00378</a>   <span class="keyword">typedef</span> <a class="code" href="structitk_1_1hashtable__iterator.html">hashtable_iterator&lt;Value, Key, HashFcn, ExtractKey, EqualKey, Alloc&gt;</a> <a class="code" href="structitk_1_1hashtable__iterator.html">iterator</a>;
<a name="l00379"></a><a class="code" href="classitk_1_1hashtable.html#e0d20552c5d9760ac0fde6df53347b67">00379</a>   <span class="keyword">typedef</span> <a class="code" href="structitk_1_1hashtable__const__iterator.html">hashtable_const_iterator&lt;Value, Key, HashFcn, ExtractKey, EqualKey,Alloc&gt;</a> <a class="code" href="structitk_1_1hashtable__const__iterator.html">const_iterator</a>;
<a name="l00380"></a><a class="code" href="classitk_1_1hashtable.html#4608cf3f1e3fefe384960dcda69d4f65">00380</a>   <span class="keyword">friend</span> <span class="keyword">struct</span>
<a name="l00381"></a><a class="code" href="classitk_1_1hashtable.html#96598bffa5e5857ef71eba1d87c93d5c">00381</a>   <a class="code" href="structitk_1_1hashtable__iterator.html">hashtable_iterator&lt;Value, Key, HashFcn, ExtractKey, EqualKey, Alloc&gt;</a>;
<a name="l00382"></a>00382   <span class="keyword">friend</span> <span class="keyword">struct</span>
<a name="l00383"></a>00383   <a class="code" href="structitk_1_1hashtable__const__iterator.html">hashtable_const_iterator&lt;Value, Key, HashFcn, ExtractKey, EqualKey, Alloc&gt;</a>;
<a name="l00384"></a><a class="code" href="classitk_1_1hashtable.html#b351ac1860c589bc9c65e8ecf10f2be3">00384</a> 
<a name="l00385"></a>00385 <span class="keyword">public</span>:
<a name="l00386"></a>00386   <a class="code" href="classitk_1_1hashtable.html#b351ac1860c589bc9c65e8ecf10f2be3">hashtable</a>(<a class="code" href="classitk_1_1hashtable.html#24390ecc706db752bc17b789feded607">size_type</a> n,
<a name="l00387"></a>00387             <span class="keyword">const</span> HashFcn&amp;    hf,
<a name="l00388"></a>00388             <span class="keyword">const</span> EqualKey&amp;   eql,
<a name="l00389"></a>00389             <span class="keyword">const</span> ExtractKey&amp; ext)
<a name="l00390"></a>00390     : hashfun(hf), equals(eql), get_key(ext)
<a name="l00391"></a>00391     {
<a name="l00392"></a>00392     initialize_buckets(n);
<a name="l00393"></a><a class="code" href="classitk_1_1hashtable.html#8a50f6eba2fef4c1c4a8ad21ef71ad29">00393</a>     }
<a name="l00394"></a>00394 
<a name="l00395"></a>00395   <a class="code" href="classitk_1_1hashtable.html#b351ac1860c589bc9c65e8ecf10f2be3">hashtable</a>(<a class="code" href="classitk_1_1hashtable.html#24390ecc706db752bc17b789feded607">size_type</a> n,
<a name="l00396"></a>00396             <span class="keyword">const</span> HashFcn&amp;    hf,
<a name="l00397"></a>00397             <span class="keyword">const</span> EqualKey&amp;   eql)
<a name="l00398"></a>00398       : hashfun(hf), equals(eql), get_key(ExtractKey())
<a name="l00399"></a>00399     {
<a name="l00400"></a>00400     initialize_buckets(n);
<a name="l00401"></a><a class="code" href="classitk_1_1hashtable.html#a85c143747c601596b6797412d8b7309">00401</a>     }
<a name="l00402"></a>00402 
<a name="l00403"></a>00403   <a class="code" href="classitk_1_1hashtable.html#b351ac1860c589bc9c65e8ecf10f2be3">hashtable</a>(<span class="keyword">const</span> <span class="keyword">self</span>&amp; ht)
<a name="l00404"></a>00404     : hashfun(ht.hashfun), equals(ht.equals), get_key(ht.get_key)
<a name="l00405"></a>00405     {
<a name="l00406"></a>00406     <a class="code" href="classitk_1_1hashtable__base.html#370b34942d193c9931deeafbfdd3d647">copy_from</a>(ht);
<a name="l00407"></a><a class="code" href="classitk_1_1hashtable.html#7685e6e03c6d5b33d2c0ab84d10c02c5">00407</a>     }
<a name="l00408"></a>00408 
<a name="l00409"></a>00409   <span class="keyword">self</span>&amp; <a class="code" href="classitk_1_1hashtable.html#7685e6e03c6d5b33d2c0ab84d10c02c5">operator= </a>(<span class="keyword">const</span> <span class="keyword">self</span>&amp; ht)
<a name="l00410"></a>00410     {
<a name="l00411"></a>00411     <span class="keywordflow">if</span> (&amp;ht != <span class="keyword">this</span>)
<a name="l00412"></a>00412       {
<a name="l00413"></a>00413       hashfun = ht.hashfun;
<a name="l00414"></a>00414       equals = ht.equals;
<a name="l00415"></a>00415       get_key = ht.get_key;
<a name="l00416"></a>00416       <a class="code" href="classitk_1_1hashtable.html#8277af2e2c3a55380bb0e6fee17942ca">clear</a>();
<a name="l00417"></a>00417       this-&gt;<a class="code" href="classitk_1_1hashtable__base.html#bd17986486bda165e7fe60eb79cba12a">buckets</a>.clear();
<a name="l00418"></a>00418       <a class="code" href="classitk_1_1hashtable__base.html#370b34942d193c9931deeafbfdd3d647">copy_from</a>(ht);
<a name="l00419"></a>00419       }
<a name="l00420"></a>00420     <span class="keywordflow">return</span> *<span class="keyword">this</span>;
<a name="l00421"></a><a class="code" href="classitk_1_1hashtable.html#d521a694aa0924019fa5e47a9a7bbfb3">00421</a>     }
<a name="l00422"></a>00422 
<a name="l00423"></a><a class="code" href="classitk_1_1hashtable.html#1099e731a42e664826073e0af53072d3">00423</a>   <a class="code" href="classitk_1_1hashtable.html#d521a694aa0924019fa5e47a9a7bbfb3">~hashtable</a>() {}
<a name="l00424"></a><a class="code" href="classitk_1_1hashtable.html#1eb088b174e2efd1935c67fafb94d8c1">00424</a> 
<a name="l00425"></a><a class="code" href="classitk_1_1hashtable.html#b5ee85ee90fb247a287b91ff93c8a5d0">00425</a>   <a class="code" href="classitk_1_1hashtable.html#24390ecc706db752bc17b789feded607">size_type</a> <a class="code" href="classitk_1_1hashtable.html#1099e731a42e664826073e0af53072d3">size</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> this-&gt;<a class="code" href="classitk_1_1hashtable__base.html#61c5192d841cc653832445b61e4ef8bf">num_elements</a>; }
<a name="l00426"></a>00426   <a class="code" href="classitk_1_1hashtable.html#24390ecc706db752bc17b789feded607">size_type</a> <a class="code" href="classitk_1_1hashtable.html#1eb088b174e2efd1935c67fafb94d8c1">max_size</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classitk_1_1hashtable.html#24390ecc706db752bc17b789feded607">size_type</a>(-1); }
<a name="l00427"></a><a class="code" href="classitk_1_1hashtable.html#78e86996d21870444c69be2f971f0e52">00427</a>   <span class="keywordtype">bool</span> <a class="code" href="classitk_1_1hashtable.html#b5ee85ee90fb247a287b91ff93c8a5d0">empty</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classitk_1_1hashtable.html#1099e731a42e664826073e0af53072d3">size</a>() == 0; }
<a name="l00428"></a>00428 
<a name="l00429"></a>00429   <span class="keywordtype">void</span> <a class="code" href="classitk_1_1hashtable.html#78e86996d21870444c69be2f971f0e52">swap</a>(<span class="keyword">self</span>&amp; ht)
<a name="l00430"></a>00430     {
<a name="l00431"></a>00431     <a class="code" href="classitk_1_1hashtable.html#78e86996d21870444c69be2f971f0e52">std::swap</a>(hashfun, ht.hashfun);
<a name="l00432"></a>00432     <a class="code" href="classitk_1_1hashtable.html#78e86996d21870444c69be2f971f0e52">std::swap</a>(equals, ht.equals);
<a name="l00433"></a>00433     <a class="code" href="classitk_1_1hashtable.html#78e86996d21870444c69be2f971f0e52">std::swap</a>(get_key, ht.get_key);
<a name="l00434"></a>00434     this-&gt;<a class="code" href="classitk_1_1hashtable__base.html#bd17986486bda165e7fe60eb79cba12a">buckets</a>.swap(ht.buckets);
<a name="l00435"></a>00435     <a class="code" href="classitk_1_1hashtable.html#78e86996d21870444c69be2f971f0e52">std::swap</a>(this-&gt;<a class="code" href="classitk_1_1hashtable__base.html#61c5192d841cc653832445b61e4ef8bf">num_elements</a>, ht.num_elements);
<a name="l00436"></a><a class="code" href="classitk_1_1hashtable.html#58bf22f83b683a429d29c639ba648fb0">00436</a>     }
<a name="l00437"></a>00437 
<a name="l00438"></a>00438   <a class="code" href="classitk_1_1hashtable.html#8805a45b0131beb02f2dc918da33b033">iterator</a> <a class="code" href="classitk_1_1hashtable.html#58bf22f83b683a429d29c639ba648fb0">begin</a>()
<a name="l00439"></a>00439     {
<a name="l00440"></a>00440     <span class="keywordflow">for</span> (<a class="code" href="classitk_1_1hashtable.html#24390ecc706db752bc17b789feded607">size_type</a> n = 0; n &lt; this-&gt;<a class="code" href="classitk_1_1hashtable__base.html#bd17986486bda165e7fe60eb79cba12a">buckets</a>.size(); ++n)
<a name="l00441"></a>00441       {
<a name="l00442"></a>00442       <span class="keywordflow">if</span> (this-&gt;<a class="code" href="classitk_1_1hashtable__base.html#bd17986486bda165e7fe60eb79cba12a">buckets</a>[n])
<a name="l00443"></a>00443         {
<a name="l00444"></a>00444         <span class="keywordflow">return</span> <a class="code" href="classitk_1_1hashtable.html#8805a45b0131beb02f2dc918da33b033">iterator</a>(this-&gt;<a class="code" href="classitk_1_1hashtable__base.html#bd17986486bda165e7fe60eb79cba12a">buckets</a>[n], <span class="keyword">this</span>);
<a name="l00445"></a>00445         }
<a name="l00446"></a>00446       }
<a name="l00447"></a>00447     <span class="keywordflow">return</span> <a class="code" href="classitk_1_1hashtable.html#b94a445bec49543c2357c33e99436677">end</a>();
<a name="l00448"></a><a class="code" href="classitk_1_1hashtable.html#b94a445bec49543c2357c33e99436677">00448</a>     }
<a name="l00449"></a>00449 
<a name="l00450"></a><a class="code" href="classitk_1_1hashtable.html#4d1e34f0161445d04f0525c07cf4d413">00450</a>   <a class="code" href="structitk_1_1hashtable__iterator.html">iterator</a> <a class="code" href="classitk_1_1hashtable.html#b94a445bec49543c2357c33e99436677">end</a>() { <span class="keywordflow">return</span> <a class="code" href="classitk_1_1hashtable.html#8805a45b0131beb02f2dc918da33b033">iterator</a>((<a class="code" href="structitk_1_1hashtable__node.html">node</a>*)0, <span class="keyword">this</span>); }
<a name="l00451"></a>00451 
<a name="l00452"></a>00452   <a class="code" href="classitk_1_1hashtable.html#e0d20552c5d9760ac0fde6df53347b67">const_iterator</a> <a class="code" href="classitk_1_1hashtable.html#58bf22f83b683a429d29c639ba648fb0">begin</a>()<span class="keyword"> const</span>
<a name="l00453"></a>00453 <span class="keyword">    </span>{
<a name="l00454"></a>00454     <span class="keywordflow">for</span> (<a class="code" href="classitk_1_1hashtable.html#24390ecc706db752bc17b789feded607">size_type</a> n = 0; n &lt; this-&gt;<a class="code" href="classitk_1_1hashtable__base.html#bd17986486bda165e7fe60eb79cba12a">buckets</a>.size(); ++n)
<a name="l00455"></a>00455       {
<a name="l00456"></a>00456       <span class="keywordflow">if</span> (this-&gt;<a class="code" href="classitk_1_1hashtable__base.html#bd17986486bda165e7fe60eb79cba12a">buckets</a>[n])
<a name="l00457"></a>00457         {
<a name="l00458"></a>00458         <span class="keywordflow">return</span> <a class="code" href="classitk_1_1hashtable.html#e0d20552c5d9760ac0fde6df53347b67">const_iterator</a>(this-&gt;<a class="code" href="classitk_1_1hashtable__base.html#bd17986486bda165e7fe60eb79cba12a">buckets</a>[n], <span class="keyword">this</span>);
<a name="l00459"></a>00459         }
<a name="l00460"></a>00460       }
<a name="l00461"></a>00461     <span class="keywordflow">return</span> <a class="code" href="classitk_1_1hashtable.html#b94a445bec49543c2357c33e99436677">end</a>();
<a name="l00462"></a><a class="code" href="classitk_1_1hashtable.html#4996a9cc32d9ed23fd039b6c2fcef5ee">00462</a>     }
<a name="l00463"></a>00463 
<a name="l00464"></a>00464   <a class="code" href="classitk_1_1hashtable.html#e0d20552c5d9760ac0fde6df53347b67">const_iterator</a> <a class="code" href="classitk_1_1hashtable.html#b94a445bec49543c2357c33e99436677">end</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classitk_1_1hashtable.html#e0d20552c5d9760ac0fde6df53347b67">const_iterator</a>((node*)0, <span class="keyword">this</span>); }
<a name="l00465"></a>00465 
<a name="l00466"></a>00466   <span class="keyword">friend</span> <span class="keywordtype">bool</span> operator==ITK_FRIEND_TEMPLATE_FUNCTION_ARGUMENT(<span class="keyword">self</span>)(<span class="keyword">const</span> <span class="keyword">self</span>&amp;,<span class="keyword">const</span> <span class="keyword">self</span>&amp;);
<a name="l00467"></a>00467 
<a name="l00468"></a><a class="code" href="classitk_1_1hashtable.html#05913daab175ec271753c0134762c7c7">00468</a> <span class="keyword">public</span>:
<a name="l00469"></a>00469 
<a name="l00470"></a><a class="code" href="classitk_1_1hashtable.html#573ec83655435defacce1c4c39637e18">00470</a>   <a class="code" href="classitk_1_1hashtable.html#24390ecc706db752bc17b789feded607">size_type</a> <a class="code" href="classitk_1_1hashtable.html#05913daab175ec271753c0134762c7c7">bucket_count</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> this-&gt;<a class="code" href="classitk_1_1hashtable__base.html#bd17986486bda165e7fe60eb79cba12a">buckets</a>.size(); }
<a name="l00471"></a>00471 
<a name="l00472"></a>00472   <a class="code" href="classitk_1_1hashtable.html#24390ecc706db752bc17b789feded607">size_type</a> <a class="code" href="classitk_1_1hashtable.html#573ec83655435defacce1c4c39637e18">max_bucket_count</a>()<span class="keyword"> const</span>
<a name="l00473"></a><a class="code" href="classitk_1_1hashtable.html#57b0c1ab29503a23eb0d38cc4447e67b">00473</a> <span class="keyword">    </span>{ <span class="keywordflow">return</span> <a class="code" href="namespaceitk.html#22fcbb1c45c3cbaa6dac69786fead438">prime_list</a>[<a class="code" href="namespaceitk.html#c877691e707540fcdc9791c2df0946ee057a251c5684717870e0a7bc4a5eaa36">num_primes</a> - 1]; }
<a name="l00474"></a>00474 
<a name="l00475"></a>00475   <a class="code" href="classitk_1_1hashtable.html#24390ecc706db752bc17b789feded607">size_type</a> <a class="code" href="classitk_1_1hashtable.html#57b0c1ab29503a23eb0d38cc4447e67b">elems_in_bucket</a>(<a class="code" href="classitk_1_1hashtable.html#24390ecc706db752bc17b789feded607">size_type</a> bucket)<span class="keyword"> const</span>
<a name="l00476"></a>00476 <span class="keyword">    </span>{
<a name="l00477"></a>00477     <a class="code" href="classitk_1_1hashtable.html#24390ecc706db752bc17b789feded607">size_type</a> result = 0;
<a name="l00478"></a>00478     <span class="keywordflow">for</span> (node* cur = this-&gt;<a class="code" href="classitk_1_1hashtable__base.html#bd17986486bda165e7fe60eb79cba12a">buckets</a>[bucket]; cur; cur = cur-&gt;next)
<a name="l00479"></a>00479       {
<a name="l00480"></a>00480       result += 1;
<a name="l00481"></a>00481       }
<a name="l00482"></a>00482     <span class="keywordflow">return</span> result;
<a name="l00483"></a><a class="code" href="classitk_1_1hashtable.html#240c395abae08460fe16e99426d1a699">00483</a>     }
<a name="l00484"></a>00484 
<a name="l00485"></a>00485   std::pair&lt;iterator, bool&gt; <a class="code" href="classitk_1_1hashtable.html#240c395abae08460fe16e99426d1a699">insert_unique</a>(<span class="keyword">const</span> <a class="code" href="classitk_1_1hashtable.html#9b4944269bde048047a0379fb26b1f26">value_type</a>&amp; obj)
<a name="l00486"></a>00486     {
<a name="l00487"></a>00487     <a class="code" href="classitk_1_1hashtable.html#f40249391498b87b6ee4765a034d3ebe">resize</a>(this-&gt;<a class="code" href="classitk_1_1hashtable__base.html#61c5192d841cc653832445b61e4ef8bf">num_elements</a> + 1);
<a name="l00488"></a>00488     <span class="keywordflow">return</span> <a class="code" href="classitk_1_1hashtable.html#88ecf906d4eb91a5c95f02d89e1a8865">insert_unique_noresize</a>(obj);
<a name="l00489"></a><a class="code" href="classitk_1_1hashtable.html#d72fdc55cb8a88a73e4afad5a24a1fe8">00489</a>     }
<a name="l00490"></a>00490 
<a name="l00491"></a>00491   <a class="code" href="classitk_1_1hashtable.html#8805a45b0131beb02f2dc918da33b033">iterator</a> <a class="code" href="classitk_1_1hashtable.html#d72fdc55cb8a88a73e4afad5a24a1fe8">insert_equal</a>(<span class="keyword">const</span> <a class="code" href="classitk_1_1hashtable.html#9b4944269bde048047a0379fb26b1f26">value_type</a>&amp; obj)
<a name="l00492"></a>00492     {
<a name="l00493"></a>00493     <a class="code" href="classitk_1_1hashtable.html#f40249391498b87b6ee4765a034d3ebe">resize</a>(this-&gt;<a class="code" href="classitk_1_1hashtable__base.html#61c5192d841cc653832445b61e4ef8bf">num_elements</a> + 1);
<a name="l00494"></a>00494     <span class="keywordflow">return</span> <a class="code" href="classitk_1_1hashtable.html#5507dd5bd99ca558794ed3babcbacafb">insert_equal_noresize</a>(obj);
<a name="l00495"></a>00495     }
<a name="l00496"></a>00496 
<a name="l00497"></a>00497   IUEi_STL_INLINE std::pair&lt;iterator, bool&gt; <a class="code" href="classitk_1_1hashtable.html#88ecf906d4eb91a5c95f02d89e1a8865">insert_unique_noresize</a>(<span class="keyword">const</span> <a class="code" href="classitk_1_1hashtable.html#9b4944269bde048047a0379fb26b1f26">value_type</a>&amp; obj);
<a name="l00498"></a><a class="code" href="classitk_1_1hashtable.html#f3323cccb05040b885515a57814d19d3">00498</a>   IUEi_STL_INLINE <a class="code" href="structitk_1_1hashtable__iterator.html">iterator</a> <a class="code" href="classitk_1_1hashtable.html#5507dd5bd99ca558794ed3babcbacafb">insert_equal_noresize</a>(<span class="keyword">const</span> <a class="code" href="classitk_1_1hashtable.html#9b4944269bde048047a0379fb26b1f26">value_type</a>&amp; obj);
<a name="l00499"></a>00499 
<a name="l00500"></a>00500   <span class="keywordtype">void</span> <a class="code" href="classitk_1_1hashtable.html#240c395abae08460fe16e99426d1a699">insert_unique</a>(<span class="keyword">const</span> <a class="code" href="classitk_1_1hashtable.html#9b4944269bde048047a0379fb26b1f26">value_type</a>* f, <span class="keyword">const</span> <a class="code" href="classitk_1_1hashtable.html#9b4944269bde048047a0379fb26b1f26">value_type</a>* l)
<a name="l00501"></a>00501     {
<a name="l00502"></a>00502     <a class="code" href="classitk_1_1hashtable.html#24390ecc706db752bc17b789feded607">size_type</a> n = l - f;
<a name="l00503"></a>00503     <a class="code" href="classitk_1_1hashtable.html#f40249391498b87b6ee4765a034d3ebe">resize</a>(this-&gt;<a class="code" href="classitk_1_1hashtable__base.html#61c5192d841cc653832445b61e4ef8bf">num_elements</a> + n);
<a name="l00504"></a>00504     <span class="keywordflow">for</span> (; n &gt; 0; --n)
<a name="l00505"></a>00505       {
<a name="l00506"></a>00506       <a class="code" href="classitk_1_1hashtable.html#88ecf906d4eb91a5c95f02d89e1a8865">insert_unique_noresize</a>(*f++);
<a name="l00507"></a>00507       }
<a name="l00508"></a><a class="code" href="classitk_1_1hashtable.html#a6d77c7f99680a9eb96298de9005894a">00508</a>     }
<a name="l00509"></a>00509 
<a name="l00510"></a>00510   <span class="keywordtype">void</span> <a class="code" href="classitk_1_1hashtable.html#d72fdc55cb8a88a73e4afad5a24a1fe8">insert_equal</a>(<span class="keyword">const</span> <a class="code" href="classitk_1_1hashtable.html#9b4944269bde048047a0379fb26b1f26">value_type</a>* f, <span class="keyword">const</span> <a class="code" href="classitk_1_1hashtable.html#9b4944269bde048047a0379fb26b1f26">value_type</a>* l)
<a name="l00511"></a>00511     {
<a name="l00512"></a>00512     <a class="code" href="classitk_1_1hashtable.html#24390ecc706db752bc17b789feded607">size_type</a> n = l - f;
<a name="l00513"></a>00513     <a class="code" href="classitk_1_1hashtable.html#f40249391498b87b6ee4765a034d3ebe">resize</a>(this-&gt;<a class="code" href="classitk_1_1hashtable__base.html#61c5192d841cc653832445b61e4ef8bf">num_elements</a> + n);
<a name="l00514"></a>00514     <span class="keywordflow">for</span> (; n &gt; 0; --n)
<a name="l00515"></a>00515       {
<a name="l00516"></a>00516       <a class="code" href="classitk_1_1hashtable.html#5507dd5bd99ca558794ed3babcbacafb">insert_equal_noresize</a>(*f++);
<a name="l00517"></a>00517       }
<a name="l00518"></a><a class="code" href="classitk_1_1hashtable.html#66cf3973f08911e7814f00b02f5b667a">00518</a>     }
<a name="l00519"></a>00519 
<a name="l00520"></a>00520   <span class="keywordtype">void</span> <a class="code" href="classitk_1_1hashtable.html#240c395abae08460fe16e99426d1a699">insert_unique</a>(<a class="code" href="classitk_1_1hashtable.html#e0d20552c5d9760ac0fde6df53347b67">const_iterator</a> f, <a class="code" href="classitk_1_1hashtable.html#e0d20552c5d9760ac0fde6df53347b67">const_iterator</a> l)
<a name="l00521"></a>00521     {
<a name="l00522"></a>00522     <a class="code" href="classitk_1_1hashtable.html#24390ecc706db752bc17b789feded607">size_type</a> n = 0;
<a name="l00523"></a>00523     std::distance(f, l, n);
<a name="l00524"></a>00524     <a class="code" href="classitk_1_1hashtable.html#f40249391498b87b6ee4765a034d3ebe">resize</a>(this-&gt;<a class="code" href="classitk_1_1hashtable__base.html#61c5192d841cc653832445b61e4ef8bf">num_elements</a> + n);
<a name="l00525"></a>00525     <span class="keywordflow">for</span> (; n &gt; 0; --n)
<a name="l00526"></a>00526       {
<a name="l00527"></a>00527       <a class="code" href="classitk_1_1hashtable.html#88ecf906d4eb91a5c95f02d89e1a8865">insert_unique_noresize</a>(*f++);
<a name="l00528"></a>00528       }
<a name="l00529"></a><a class="code" href="classitk_1_1hashtable.html#035b7f87f219ab644c6ddff2a697b272">00529</a>     }
<a name="l00530"></a>00530 
<a name="l00531"></a>00531   <span class="keywordtype">void</span> <a class="code" href="classitk_1_1hashtable.html#d72fdc55cb8a88a73e4afad5a24a1fe8">insert_equal</a>(<a class="code" href="classitk_1_1hashtable.html#e0d20552c5d9760ac0fde6df53347b67">const_iterator</a> f, <a class="code" href="classitk_1_1hashtable.html#e0d20552c5d9760ac0fde6df53347b67">const_iterator</a> l)
<a name="l00532"></a>00532     {
<a name="l00533"></a>00533     <a class="code" href="classitk_1_1hashtable.html#24390ecc706db752bc17b789feded607">size_type</a> n = 0;
<a name="l00534"></a>00534     std::distance(f, l, n);
<a name="l00535"></a>00535     <a class="code" href="classitk_1_1hashtable.html#f40249391498b87b6ee4765a034d3ebe">resize</a>(this-&gt;<a class="code" href="classitk_1_1hashtable__base.html#61c5192d841cc653832445b61e4ef8bf">num_elements</a> + n);
<a name="l00536"></a>00536     <span class="keywordflow">for</span> (; n &gt; 0; --n)
<a name="l00537"></a>00537       {
<a name="l00538"></a>00538       <a class="code" href="classitk_1_1hashtable.html#5507dd5bd99ca558794ed3babcbacafb">insert_equal_noresize</a>(*f++);
<a name="l00539"></a>00539       }
<a name="l00540"></a>00540     }
<a name="l00541"></a>00541 
<a name="l00542"></a><a class="code" href="classitk_1_1hashtable.html#de9a7a756cb3ab27dd7d9797b9a3958c">00542</a>   IUEi_STL_INLINE <a class="code" href="classitk_1_1hashtable.html#e40ca427619fedc8dfeeeab75071accd">reference</a> <a class="code" href="classitk_1_1hashtable.html#f19c5165f2f2e4a8374463749edec489">find_or_insert</a>(<span class="keyword">const</span> <a class="code" href="classitk_1_1hashtable.html#9b4944269bde048047a0379fb26b1f26">value_type</a>&amp; obj);
<a name="l00543"></a>00543 
<a name="l00544"></a>00544   <a class="code" href="structitk_1_1hashtable__iterator.html">iterator</a> <a class="code" href="classitk_1_1hashtable.html#de9a7a756cb3ab27dd7d9797b9a3958c">find</a>(<span class="keyword">const</span> <a class="code" href="classitk_1_1hashtable.html#ce7f39999dfd0460fafc792cc0fcf31b">key_type</a>&amp; key)
<a name="l00545"></a>00545     {
<a name="l00546"></a>00546     <a class="code" href="classitk_1_1hashtable.html#24390ecc706db752bc17b789feded607">size_type</a> n = bkt_num_key(key);
<a name="l00547"></a>00547     <a class="code" href="structitk_1_1hashtable__node.html">node</a>* first;
<a name="l00548"></a>00548     <span class="keywordflow">for</span> ( first = this-&gt;<a class="code" href="classitk_1_1hashtable__base.html#bd17986486bda165e7fe60eb79cba12a">buckets</a>[n];
<a name="l00549"></a>00549           first &amp;&amp; !equals(get_key(first-&gt;<a class="code" href="structitk_1_1hashtable__node.html#e3770520494e2a6426c1204a2bd4e1bc">val</a>), key);
<a name="l00550"></a>00550           first = first-&gt;<a class="code" href="structitk_1_1hashtable__node.html#7483e6d4641f35dc50abd79bbe9c0f74">next</a>)
<a name="l00551"></a>00551       {}
<a name="l00552"></a>00552     <span class="keywordflow">return</span> <a class="code" href="classitk_1_1hashtable.html#8805a45b0131beb02f2dc918da33b033">iterator</a>(first, <span class="keyword">this</span>);
<a name="l00553"></a><a class="code" href="classitk_1_1hashtable.html#1573e91e47e4253ebdb393c9699b5522">00553</a>     }
<a name="l00554"></a>00554 
<a name="l00555"></a>00555   <a class="code" href="classitk_1_1hashtable.html#e0d20552c5d9760ac0fde6df53347b67">const_iterator</a> <a class="code" href="classitk_1_1hashtable.html#de9a7a756cb3ab27dd7d9797b9a3958c">find</a>(<span class="keyword">const</span> <a class="code" href="classitk_1_1hashtable.html#ce7f39999dfd0460fafc792cc0fcf31b">key_type</a>&amp; key)<span class="keyword"> const</span>
<a name="l00556"></a>00556 <span class="keyword">    </span>{
<a name="l00557"></a>00557     <a class="code" href="classitk_1_1hashtable.html#24390ecc706db752bc17b789feded607">size_type</a> n = bkt_num_key(key);
<a name="l00558"></a>00558     <span class="keyword">const</span> node* first;
<a name="l00559"></a>00559     <span class="keywordflow">for</span> ( first = this-&gt;<a class="code" href="classitk_1_1hashtable__base.html#bd17986486bda165e7fe60eb79cba12a">buckets</a>[n];
<a name="l00560"></a>00560           first &amp;&amp; !equals(get_key(first-&gt;val), key);
<a name="l00561"></a>00561           first = first-&gt;next)
<a name="l00562"></a>00562       {}
<a name="l00563"></a>00563     <span class="keywordflow">return</span> <a class="code" href="classitk_1_1hashtable.html#e0d20552c5d9760ac0fde6df53347b67">const_iterator</a>(first, <span class="keyword">this</span>);
<a name="l00564"></a><a class="code" href="classitk_1_1hashtable.html#bfce65fbba7b7aa67653925aebe2dac4">00564</a>     }
<a name="l00565"></a>00565 
<a name="l00566"></a>00566   <a class="code" href="classitk_1_1hashtable.html#24390ecc706db752bc17b789feded607">size_type</a> <a class="code" href="classitk_1_1hashtable.html#bfce65fbba7b7aa67653925aebe2dac4">count</a>(<span class="keyword">const</span> <a class="code" href="classitk_1_1hashtable.html#ce7f39999dfd0460fafc792cc0fcf31b">key_type</a>&amp; key)<span class="keyword"> const</span>
<a name="l00567"></a>00567 <span class="keyword">    </span>{
<a name="l00568"></a>00568     <span class="keyword">const</span> <a class="code" href="classitk_1_1hashtable.html#24390ecc706db752bc17b789feded607">size_type</a> n = bkt_num_key(key);
<a name="l00569"></a>00569     <a class="code" href="classitk_1_1hashtable.html#24390ecc706db752bc17b789feded607">size_type</a> result = 0;
<a name="l00570"></a>00570 
<a name="l00571"></a>00571     <span class="keywordflow">for</span> (<span class="keyword">const</span> node* cur = this-&gt;<a class="code" href="classitk_1_1hashtable__base.html#bd17986486bda165e7fe60eb79cba12a">buckets</a>[n]; cur; cur = cur-&gt;next)
<a name="l00572"></a>00572       {
<a name="l00573"></a>00573       <span class="keywordflow">if</span> (equals(get_key(cur-&gt;val), key))
<a name="l00574"></a>00574         {
<a name="l00575"></a>00575         ++result;
<a name="l00576"></a>00576         }
<a name="l00577"></a>00577       }
<a name="l00578"></a>00578     <span class="keywordflow">return</span> result;
<a name="l00579"></a>00579     }
<a name="l00580"></a>00580 
<a name="l00581"></a>00581   IUEi_STL_INLINE std::pair&lt;iterator, iterator&gt; <a class="code" href="classitk_1_1hashtable.html#9ab88d24837423d2913890c7e0d0596c">equal_range</a>(<span class="keyword">const</span> <a class="code" href="classitk_1_1hashtable.html#ce7f39999dfd0460fafc792cc0fcf31b">key_type</a>&amp; key);
<a name="l00582"></a>00582   IUEi_STL_INLINE std::pair&lt;const_iterator, const_iterator&gt; <a class="code" href="classitk_1_1hashtable.html#9ab88d24837423d2913890c7e0d0596c">equal_range</a>(<span class="keyword">const</span> <a class="code" href="classitk_1_1hashtable.html#ce7f39999dfd0460fafc792cc0fcf31b">key_type</a>&amp; key) <span class="keyword">const</span>;
<a name="l00583"></a>00583 
<a name="l00584"></a>00584   IUEi_STL_INLINE <a class="code" href="classitk_1_1hashtable.html#24390ecc706db752bc17b789feded607">size_type</a> <a class="code" href="classitk_1_1hashtable.html#2877156f7bd16ed9490819eeb78314eb">erase</a>(<span class="keyword">const</span> <a class="code" href="classitk_1_1hashtable.html#ce7f39999dfd0460fafc792cc0fcf31b">key_type</a>&amp; key);
<a name="l00585"></a>00585   IUEi_STL_INLINE <span class="keywordtype">void</span> <a class="code" href="classitk_1_1hashtable.html#2877156f7bd16ed9490819eeb78314eb">erase</a>(<span class="keyword">const</span> <a class="code" href="classitk_1_1hashtable.html#8805a45b0131beb02f2dc918da33b033">iterator</a>&amp; it);
<a name="l00586"></a>00586   IUEi_STL_INLINE <span class="keywordtype">void</span> <a class="code" href="classitk_1_1hashtable.html#2877156f7bd16ed9490819eeb78314eb">erase</a>(<a class="code" href="classitk_1_1hashtable.html#8805a45b0131beb02f2dc918da33b033">iterator</a> first, <a class="code" href="classitk_1_1hashtable.html#8805a45b0131beb02f2dc918da33b033">iterator</a> last);
<a name="l00587"></a>00587 
<a name="l00588"></a>00588   IUEi_STL_INLINE <span class="keywordtype">void</span> <a class="code" href="classitk_1_1hashtable.html#2877156f7bd16ed9490819eeb78314eb">erase</a>(<span class="keyword">const</span> <a class="code" href="classitk_1_1hashtable.html#e0d20552c5d9760ac0fde6df53347b67">const_iterator</a>&amp; it);
<a name="l00589"></a>00589   IUEi_STL_INLINE <span class="keywordtype">void</span> <a class="code" href="classitk_1_1hashtable.html#2877156f7bd16ed9490819eeb78314eb">erase</a>(<a class="code" href="classitk_1_1hashtable.html#e0d20552c5d9760ac0fde6df53347b67">const_iterator</a> first, <a class="code" href="classitk_1_1hashtable.html#e0d20552c5d9760ac0fde6df53347b67">const_iterator</a> last);
<a name="l00590"></a><a class="code" href="classitk_1_1hashtable.html#8277af2e2c3a55380bb0e6fee17942ca">00590</a> 
<a name="l00591"></a>00591   IUEi_STL_INLINE <span class="keywordtype">void</span> <a class="code" href="classitk_1_1hashtable.html#f40249391498b87b6ee4765a034d3ebe">resize</a>(<a class="code" href="classitk_1_1hashtable.html#24390ecc706db752bc17b789feded607">size_type</a> num_elements_hint);
<a name="l00592"></a>00592   <span class="keywordtype">void</span> <a class="code" href="classitk_1_1hashtable.html#8277af2e2c3a55380bb0e6fee17942ca">clear</a>() { <a class="code" href="classitk_1_1hashtable__base.html#f2c42aa904b06fe2c128ddf0b73701ca">super::clear</a>(); }
<a name="l00593"></a>00593 <span class="keyword">private</span>:
<a name="l00594"></a>00594   <a class="code" href="classitk_1_1hashtable.html#24390ecc706db752bc17b789feded607">size_type</a> next_size(<a class="code" href="classitk_1_1hashtable.html#24390ecc706db752bc17b789feded607">size_type</a> n)<span class="keyword"> const</span>
<a name="l00595"></a>00595 <span class="keyword">    </span>{
<a name="l00596"></a>00596     <span class="keywordflow">return</span> <span class="keyword">static_cast&lt;</span><a class="code" href="classitk_1_1hashtable.html#24390ecc706db752bc17b789feded607">size_type</a><span class="keyword">&gt;</span>(
<a name="l00597"></a>00597       <a class="code" href="namespaceitk.html#c180ca658f913bb6596772a32bbc177c">next_prime</a>( static_cast&lt;unsigned long&gt;(n) ) );
<a name="l00598"></a>00598     }
<a name="l00599"></a>00599 
<a name="l00600"></a>00600   <span class="keywordtype">void</span> initialize_buckets(<a class="code" href="classitk_1_1hashtable.html#24390ecc706db752bc17b789feded607">size_type</a> n)
<a name="l00601"></a>00601     {
<a name="l00602"></a>00602     <span class="keyword">const</span> <a class="code" href="classitk_1_1hashtable.html#24390ecc706db752bc17b789feded607">size_type</a> n_buckets = next_size(n);
<a name="l00603"></a>00603     this-&gt;<a class="code" href="classitk_1_1hashtable__base.html#bd17986486bda165e7fe60eb79cba12a">buckets</a>.reserve(n_buckets);
<a name="l00604"></a>00604     this-&gt;<a class="code" href="classitk_1_1hashtable__base.html#bd17986486bda165e7fe60eb79cba12a">buckets</a>.insert(this-&gt;<a class="code" href="classitk_1_1hashtable__base.html#bd17986486bda165e7fe60eb79cba12a">buckets</a>.end(), n_buckets, (node*) 0);
<a name="l00605"></a>00605     this-&gt;<a class="code" href="classitk_1_1hashtable__base.html#61c5192d841cc653832445b61e4ef8bf">num_elements</a> = 0;
<a name="l00606"></a>00606     }
<a name="l00607"></a>00607   <a class="code" href="classitk_1_1hashtable.html#24390ecc706db752bc17b789feded607">size_type</a> bkt_num_key(<span class="keyword">const</span> <a class="code" href="classitk_1_1hashtable.html#ce7f39999dfd0460fafc792cc0fcf31b">key_type</a>&amp; key)<span class="keyword"> const</span>
<a name="l00608"></a>00608 <span class="keyword">    </span>{
<a name="l00609"></a>00609     <span class="keywordflow">return</span> bkt_num_key(key, this-&gt;<a class="code" href="classitk_1_1hashtable__base.html#bd17986486bda165e7fe60eb79cba12a">buckets</a>.size());
<a name="l00610"></a>00610     }
<a name="l00611"></a>00611 
<a name="l00612"></a>00612   <a class="code" href="classitk_1_1hashtable.html#24390ecc706db752bc17b789feded607">size_type</a> bkt_num(<span class="keyword">const</span> <a class="code" href="classitk_1_1hashtable.html#9b4944269bde048047a0379fb26b1f26">value_type</a>&amp; obj)<span class="keyword"> const</span>
<a name="l00613"></a>00613 <span class="keyword">    </span>{
<a name="l00614"></a>00614     <span class="keywordflow">return</span> bkt_num_key(get_key(obj));
<a name="l00615"></a>00615     }
<a name="l00616"></a>00616 
<a name="l00617"></a>00617   <a class="code" href="classitk_1_1hashtable.html#24390ecc706db752bc17b789feded607">size_type</a> bkt_num_key(<span class="keyword">const</span> <a class="code" href="classitk_1_1hashtable.html#ce7f39999dfd0460fafc792cc0fcf31b">key_type</a>&amp; key, <span class="keywordtype">size_t</span> n)<span class="keyword"> const</span>
<a name="l00618"></a>00618 <span class="keyword">    </span>{
<a name="l00619"></a>00619     <span class="keywordflow">return</span> hashfun(key) % n;
<a name="l00620"></a>00620     }
<a name="l00621"></a>00621 
<a name="l00622"></a>00622   <a class="code" href="classitk_1_1hashtable.html#24390ecc706db752bc17b789feded607">size_type</a> bkt_num(<span class="keyword">const</span> <a class="code" href="classitk_1_1hashtable.html#9b4944269bde048047a0379fb26b1f26">value_type</a>&amp; obj, <span class="keywordtype">size_t</span> n)<span class="keyword"> const</span>
<a name="l00623"></a>00623 <span class="keyword">    </span>{
<a name="l00624"></a>00624     <span class="keywordflow">return</span> bkt_num_key(get_key(obj), n);
<a name="l00625"></a>00625     }
<a name="l00626"></a>00626   IUEi_STL_INLINE <span class="keywordtype">void</span> erase_bucket(<span class="keyword">const</span> <a class="code" href="classitk_1_1hashtable.html#24390ecc706db752bc17b789feded607">size_type</a> n, node* first, node* last);
<a name="l00627"></a>00627   IUEi_STL_INLINE <span class="keywordtype">void</span> erase_bucket(<span class="keyword">const</span> <a class="code" href="classitk_1_1hashtable.html#24390ecc706db752bc17b789feded607">size_type</a> n, node* last);
<a name="l00628"></a>00628 };
<a name="l00629"></a>00629 
<a name="l00630"></a>00630 <span class="comment">// fbp: these defines are for outline methods definitions.</span>
<a name="l00631"></a>00631 <span class="comment">// needed to definitions to be portable. Should not be used in method bodies.</span>
<a name="l00632"></a>00632 
<a name="l00633"></a>00633 <span class="preprocessor"># if defined ( __STL_NESTED_TYPE_PARAM_BUG )</span>
<a name="l00634"></a>00634 <span class="preprocessor"></span><span class="preprocessor">#  define __difference_type__ ptrdiff_t</span>
<a name="l00635"></a>00635 <span class="preprocessor"></span><span class="preprocessor">#  define __size_type__       size_t</span>
<a name="l00636"></a>00636 <span class="preprocessor"></span><span class="preprocessor">#  define __value_type__      Value</span>
<a name="l00637"></a>00637 <span class="preprocessor"></span><span class="preprocessor">#  define __key_type__        Key</span>
<a name="l00638"></a>00638 <span class="preprocessor"></span><span class="preprocessor">#  define __node__            hashtable_node&lt;Value&gt;</span>
<a name="l00639"></a>00639 <span class="preprocessor"></span><span class="preprocessor">#  define __reference__       Value&amp;</span>
<a name="l00640"></a>00640 <span class="preprocessor"></span><span class="preprocessor"># else</span>
<a name="l00641"></a><a class="code" href="itk__hashtable_8h.html#8e857f1622ea6f7b528acd63a6db2301">00641</a> <span class="preprocessor"></span><span class="preprocessor">#  define __difference_type__  typename hashtable&lt;Value, Key, HashFcn, ExtractKey, EqualKey, Alloc&gt;::difference_type</span>
<a name="l00642"></a><a class="code" href="itk__hashtable_8h.html#1f27e0ccf16bfb7affce9908d6f05425">00642</a> <span class="preprocessor"></span><span class="preprocessor">#  define __size_type__        typename hashtable&lt;Value, Key, HashFcn, ExtractKey, EqualKey, Alloc&gt;::size_type</span>
<a name="l00643"></a><a class="code" href="itk__hashtable_8h.html#6552f918961cf84f869db6fd5c8e18a5">00643</a> <span class="preprocessor"></span><span class="preprocessor">#  define __value_type__       typename hashtable&lt;Value, Key, HashFcn, ExtractKey, EqualKey, Alloc&gt;::value_type</span>
<a name="l00644"></a><a class="code" href="itk__hashtable_8h.html#2c24296691a35bcce469277d24506e07">00644</a> <span class="preprocessor"></span><span class="preprocessor">#  define __key_type__         typename hashtable&lt;Value, Key, HashFcn, ExtractKey, EqualKey, Alloc&gt;::key_type</span>
<a name="l00645"></a><a class="code" href="itk__hashtable_8h.html#4eca751a0a7f67660d09430afa3d05a1">00645</a> <span class="preprocessor"></span><span class="preprocessor">#  define __node__             typename hashtable&lt;Value, Key, HashFcn, ExtractKey, EqualKey, Alloc&gt;::node</span>
<a name="l00646"></a><a class="code" href="itk__hashtable_8h.html#ad03b7623209afa243bd26a70ec77e9e">00646</a> <span class="preprocessor"></span><span class="preprocessor">#  define __reference__        typename hashtable&lt;Value, Key, HashFcn, ExtractKey, EqualKey, Alloc&gt;::reference</span>
<a name="l00647"></a>00647 <span class="preprocessor"></span><span class="preprocessor"># endif</span>
<a name="l00648"></a>00648 <span class="preprocessor"></span>
<a name="l00649"></a>00649 <span class="keyword">template</span> &lt;<span class="keyword">class</span> Value, <span class="keyword">class</span> Key, <span class="keyword">class</span> HashFcn, <span class="keyword">class</span> ExtractKey, <span class="keyword">class</span> EqualKey, <span class="keyword">class</span> Alloc&gt;
<a name="l00650"></a>00650 <span class="keyword">inline</span> hashtable_iterator&lt;Value, Key, HashFcn, ExtractKey, EqualKey, Alloc&gt;&amp;
<a name="l00651"></a><a class="code" href="structitk_1_1hashtable__iterator.html#a1247240b238e7e623bef828dc82ac89">00651</a> <a class="code" href="structitk_1_1hashtable__iterator.html#a1247240b238e7e623bef828dc82ac89">hashtable_iterator&lt;Value, Key, HashFcn, ExtractKey, EqualKey, Alloc&gt;::operator++</a>()
<a name="l00652"></a>00652 {
<a name="l00653"></a>00653   <span class="keyword">const</span> <a class="code" href="structitk_1_1hashtable__node.html">node</a>* old = <a class="code" href="structitk_1_1hashtable__iterator.html#6a8af3f1e0971c467461b6195c43d659">cur</a>;
<a name="l00654"></a>00654   <a class="code" href="structitk_1_1hashtable__iterator.html#6a8af3f1e0971c467461b6195c43d659">cur</a> = <a class="code" href="structitk_1_1hashtable__iterator.html#6a8af3f1e0971c467461b6195c43d659">cur</a>-&gt;<a class="code" href="structitk_1_1hashtable__node.html#7483e6d4641f35dc50abd79bbe9c0f74">next</a>;
<a name="l00655"></a>00655   <span class="keywordflow">if</span> (!<a class="code" href="structitk_1_1hashtable__iterator.html#6a8af3f1e0971c467461b6195c43d659">cur</a>)
<a name="l00656"></a>00656     {
<a name="l00657"></a>00657     <a class="code" href="structitk_1_1hashtable__iterator.html#43332464775c2fdc6a84ed7b77f20664">size_type</a> bucket = <a class="code" href="structitk_1_1hashtable__iterator.html#55ee062e60bc13294bf8326a18b683a0">ht</a>-&gt;bkt_num(old-&gt;<a class="code" href="structitk_1_1hashtable__node.html#e3770520494e2a6426c1204a2bd4e1bc">val</a>);
<a name="l00658"></a>00658     <span class="keywordflow">while</span> (!<a class="code" href="structitk_1_1hashtable__iterator.html#6a8af3f1e0971c467461b6195c43d659">cur</a> &amp;&amp; ++bucket &lt; ht-&gt;buckets.size())
<a name="l00659"></a>00659       {
<a name="l00660"></a>00660       <a class="code" href="structitk_1_1hashtable__iterator.html#6a8af3f1e0971c467461b6195c43d659">cur</a> = <a class="code" href="structitk_1_1hashtable__iterator.html#55ee062e60bc13294bf8326a18b683a0">ht</a>-&gt;<a class="code" href="classitk_1_1hashtable__base.html#bd17986486bda165e7fe60eb79cba12a">buckets</a>[bucket];
<a name="l00661"></a>00661       }
<a name="l00662"></a>00662     }
<a name="l00663"></a>00663   <span class="keywordflow">return</span> *<span class="keyword">this</span>;
<a name="l00664"></a>00664 }
<a name="l00665"></a>00665 
<a name="l00666"></a>00666 <span class="keyword">template</span> &lt;<span class="keyword">class</span> Value, <span class="keyword">class</span> Key, <span class="keyword">class</span> HashFcn, <span class="keyword">class</span> ExtractKey, <span class="keyword">class</span> EqualKey, <span class="keyword">class</span> Alloc&gt;
<a name="l00667"></a>00667 <span class="keyword">inline</span> <a class="code" href="structitk_1_1hashtable__iterator.html">hashtable_iterator&lt;Value, Key, HashFcn, ExtractKey, EqualKey, Alloc&gt;</a>
<a name="l00668"></a><a class="code" href="structitk_1_1hashtable__iterator.html#b854b106fb672f053346b4b3ca0e52bd">00668</a> <a class="code" href="structitk_1_1hashtable__iterator.html#a1247240b238e7e623bef828dc82ac89">hashtable_iterator&lt;Value, Key, HashFcn, ExtractKey, EqualKey, Alloc&gt;::operator++</a>(<span class="keywordtype">int</span>)
<a name="l00669"></a>00669 {
<a name="l00670"></a>00670   <a class="code" href="structitk_1_1hashtable__iterator.html">iterator</a> tmp = *<span class="keyword">this</span>;
<a name="l00671"></a>00671   ++*<span class="keyword">this</span>;
<a name="l00672"></a>00672   <span class="keywordflow">return</span> tmp;
<a name="l00673"></a>00673 }
<a name="l00674"></a>00674 
<a name="l00675"></a>00675 <span class="keyword">template</span> &lt;<span class="keyword">class</span> Value, <span class="keyword">class</span> Key, <span class="keyword">class</span> HashFcn, <span class="keyword">class</span> ExtractKey, <span class="keyword">class</span> EqualKey, <span class="keyword">class</span> Alloc&gt;
<a name="l00676"></a>00676 <span class="keyword">inline</span> <a class="code" href="structitk_1_1hashtable__const__iterator.html">hashtable_const_iterator&lt;Value, Key, HashFcn, ExtractKey, EqualKey, Alloc&gt;</a>&amp;
<a name="l00677"></a><a class="code" href="structitk_1_1hashtable__const__iterator.html#29d5a2c376befb4d12f5e46792e5ba34">00677</a> <a class="code" href="structitk_1_1hashtable__const__iterator.html#29d5a2c376befb4d12f5e46792e5ba34">hashtable_const_iterator&lt;Value, Key, HashFcn, ExtractKey, EqualKey, Alloc&gt;::operator++</a>()
<a name="l00678"></a>00678 {
<a name="l00679"></a>00679   <span class="keyword">const</span> <a class="code" href="structitk_1_1hashtable__node.html">node</a>* old = <a class="code" href="structitk_1_1hashtable__const__iterator.html#f429aa3dffb4c6d65392da4a5ec1ff99">cur</a>;
<a name="l00680"></a>00680   <a class="code" href="structitk_1_1hashtable__const__iterator.html#f429aa3dffb4c6d65392da4a5ec1ff99">cur</a> = <a class="code" href="structitk_1_1hashtable__const__iterator.html#f429aa3dffb4c6d65392da4a5ec1ff99">cur</a>-&gt;<a class="code" href="structitk_1_1hashtable__node.html#7483e6d4641f35dc50abd79bbe9c0f74">next</a>;
<a name="l00681"></a>00681   <span class="keywordflow">if</span> (!<a class="code" href="structitk_1_1hashtable__const__iterator.html#f429aa3dffb4c6d65392da4a5ec1ff99">cur</a>)
<a name="l00682"></a>00682     {
<a name="l00683"></a>00683     <a class="code" href="structitk_1_1hashtable__const__iterator.html#8c3f287129d05c5384f97a8aab8e20f3">size_type</a> bucket = <a class="code" href="structitk_1_1hashtable__const__iterator.html#01555fe635013fd1a6a61c493a6116f5">ht</a>-&gt;bkt_num(old-&gt;<a class="code" href="structitk_1_1hashtable__node.html#e3770520494e2a6426c1204a2bd4e1bc">val</a>);
<a name="l00684"></a>00684     <span class="keywordflow">while</span> (!<a class="code" href="structitk_1_1hashtable__const__iterator.html#f429aa3dffb4c6d65392da4a5ec1ff99">cur</a> &amp;&amp; ++bucket &lt; ht-&gt;buckets.size())
<a name="l00685"></a>00685       {
<a name="l00686"></a>00686       <a class="code" href="structitk_1_1hashtable__const__iterator.html#f429aa3dffb4c6d65392da4a5ec1ff99">cur</a> = <a class="code" href="structitk_1_1hashtable__const__iterator.html#01555fe635013fd1a6a61c493a6116f5">ht</a>-&gt;<a class="code" href="classitk_1_1hashtable__base.html#bd17986486bda165e7fe60eb79cba12a">buckets</a>[bucket];
<a name="l00687"></a>00687       }
<a name="l00688"></a>00688     }
<a name="l00689"></a>00689   <span class="keywordflow">return</span> *<span class="keyword">this</span>;
<a name="l00690"></a>00690 }
<a name="l00691"></a>00691 
<a name="l00692"></a>00692 <span class="keyword">template</span> &lt;<span class="keyword">class</span> Value, <span class="keyword">class</span> Key, <span class="keyword">class</span> HashFcn, <span class="keyword">class</span> ExtractKey, <span class="keyword">class</span> EqualKey, <span class="keyword">class</span> Alloc&gt;
<a name="l00693"></a>00693 <span class="keyword">inline</span> <a class="code" href="structitk_1_1hashtable__const__iterator.html">hashtable_const_iterator&lt;Value, Key, HashFcn, ExtractKey, EqualKey, Alloc&gt;</a>
<a name="l00694"></a><a class="code" href="structitk_1_1hashtable__const__iterator.html#821a960a0c2ce6aa5397e6faefdfb3fb">00694</a> <a class="code" href="structitk_1_1hashtable__const__iterator.html#29d5a2c376befb4d12f5e46792e5ba34">hashtable_const_iterator&lt;Value, Key, HashFcn, ExtractKey, EqualKey, Alloc&gt;::operator++</a>(<span class="keywordtype">int</span>)
<a name="l00695"></a>00695 {
<a name="l00696"></a>00696   <a class="code" href="structitk_1_1hashtable__const__iterator.html">const_iterator</a> tmp = *<span class="keyword">this</span>;
<a name="l00697"></a>00697   ++*<span class="keyword">this</span>;
<a name="l00698"></a>00698   <span class="keywordflow">return</span> tmp;
<a name="l00699"></a>00699 }
<a name="l00700"></a>00700 
<a name="l00701"></a>00701 <span class="keyword">template</span> &lt;<span class="keyword">class</span> Value, <span class="keyword">class</span> Key, <span class="keyword">class</span> HashFcn, <span class="keyword">class</span> ExtractKey, <span class="keyword">class</span> EqualKey, <span class="keyword">class</span> Alloc&gt;
<a name="l00702"></a>00702 <span class="keyword">inline</span> std::forward_iterator_tag
<a name="l00703"></a><a class="code" href="namespaceitk.html#702df34265f04c634443286b857a809a">00703</a> <a class="code" href="namespaceitk.html#702df34265f04c634443286b857a809a">iterator_category</a> (<span class="keyword">const</span> <a class="code" href="structitk_1_1hashtable__iterator.html">hashtable_iterator&lt;Value, Key, HashFcn, ExtractKey, EqualKey, Alloc&gt;</a>&amp;)
<a name="l00704"></a>00704 {
<a name="l00705"></a>00705   <span class="keywordflow">return</span> std::forward_iterator_tag();
<a name="l00706"></a>00706 }
<a name="l00707"></a>00707 
<a name="l00708"></a>00708 <span class="keyword">template</span> &lt;<span class="keyword">class</span> Value, <span class="keyword">class</span> Key, <span class="keyword">class</span> HashFcn, <span class="keyword">class</span> ExtractKey, <span class="keyword">class</span> EqualKey, <span class="keyword">class</span> Alloc&gt;
<a name="l00709"></a>00709 <span class="keyword">inline</span> Value*
<a name="l00710"></a><a class="code" href="namespaceitk.html#87ac35b82c3f0b7231a21eda576557d1">00710</a> <a class="code" href="namespaceitk.html#87ac35b82c3f0b7231a21eda576557d1">value_type</a>(<span class="keyword">const</span> <a class="code" href="structitk_1_1hashtable__iterator.html">hashtable_iterator&lt;Value, Key, HashFcn, ExtractKey, EqualKey, Alloc&gt;</a>&amp;)
<a name="l00711"></a>00711 {
<a name="l00712"></a>00712   <span class="keywordflow">return</span> (Value*) 0;
<a name="l00713"></a>00713 }
<a name="l00714"></a>00714 
<a name="l00715"></a>00715 <span class="keyword">template</span> &lt;<span class="keyword">class</span> Value, <span class="keyword">class</span> Key, <span class="keyword">class</span> HashFcn, <span class="keyword">class</span> ExtractKey, <span class="keyword">class</span> EqualKey, <span class="keyword">class</span> Alloc&gt;
<a name="l00716"></a>00716 <span class="keyword">inline</span> ptrdiff_t*
<a name="l00717"></a><a class="code" href="namespaceitk.html#ceb05b5fe857ad2be50e8462c8167540">00717</a> <a class="code" href="namespaceitk.html#ceb05b5fe857ad2be50e8462c8167540">distance_type</a>(<span class="keyword">const</span> <a class="code" href="structitk_1_1hashtable__iterator.html">hashtable_iterator&lt;Value, Key, HashFcn, ExtractKey, EqualKey, Alloc&gt;</a>&amp;)
<a name="l00718"></a>00718 {
<a name="l00719"></a>00719   <span class="keywordflow">return</span> (ptrdiff_t*) 0;
<a name="l00720"></a>00720 }
<a name="l00721"></a>00721 
<a name="l00722"></a>00722 <span class="keyword">template</span> &lt;<span class="keyword">class</span> Value, <span class="keyword">class</span> Key, <span class="keyword">class</span> HashFcn, <span class="keyword">class</span> ExtractKey, <span class="keyword">class</span> EqualKey, <span class="keyword">class</span> Alloc&gt;
<a name="l00723"></a>00723 <span class="keyword">inline</span> std::forward_iterator_tag
<a name="l00724"></a><a class="code" href="namespaceitk.html#39c31791a7ceaebc4bb66e1db62b9f4b">00724</a> <a class="code" href="namespaceitk.html#702df34265f04c634443286b857a809a">iterator_category</a> (<span class="keyword">const</span> <a class="code" href="structitk_1_1hashtable__const__iterator.html">hashtable_const_iterator&lt;Value, Key, HashFcn, ExtractKey, EqualKey, Alloc&gt;</a>&amp;)
<a name="l00725"></a>00725 {
<a name="l00726"></a>00726   <span class="keywordflow">return</span> std::forward_iterator_tag();
<a name="l00727"></a>00727 }
<a name="l00728"></a>00728 
<a name="l00729"></a>00729 <span class="keyword">template</span> &lt;<span class="keyword">class</span> Value, <span class="keyword">class</span> Key, <span class="keyword">class</span> HashFcn, <span class="keyword">class</span> ExtractKey, <span class="keyword">class</span> EqualKey, <span class="keyword">class</span> Alloc&gt;
<a name="l00730"></a>00730 <span class="keyword">inline</span> Value*
<a name="l00731"></a><a class="code" href="namespaceitk.html#e5240a9246f8bb6a4d07b05bb51de129">00731</a> <a class="code" href="namespaceitk.html#87ac35b82c3f0b7231a21eda576557d1">value_type</a>(<span class="keyword">const</span> <a class="code" href="structitk_1_1hashtable__const__iterator.html">hashtable_const_iterator&lt;Value, Key, HashFcn, ExtractKey, EqualKey, Alloc&gt;</a>&amp;)
<a name="l00732"></a>00732 {
<a name="l00733"></a>00733   <span class="keywordflow">return</span> (Value*) 0;
<a name="l00734"></a>00734 }
<a name="l00735"></a>00735 
<a name="l00736"></a>00736 <span class="keyword">template</span> &lt;<span class="keyword">class</span> Value, <span class="keyword">class</span> Key, <span class="keyword">class</span> HashFcn, <span class="keyword">class</span> ExtractKey, <span class="keyword">class</span> EqualKey, <span class="keyword">class</span> Alloc&gt;
<a name="l00737"></a>00737 <span class="keyword">inline</span> ptrdiff_t*
<a name="l00738"></a><a class="code" href="namespaceitk.html#fd47813d865a370610f83aadb498c844">00738</a> <a class="code" href="namespaceitk.html#ceb05b5fe857ad2be50e8462c8167540">distance_type</a>(<span class="keyword">const</span> <a class="code" href="structitk_1_1hashtable__const__iterator.html">hashtable_const_iterator&lt;Value, Key, HashFcn, ExtractKey, EqualKey, Alloc&gt;</a>&amp;)
<a name="l00739"></a>00739 {
<a name="l00740"></a>00740   <span class="keywordflow">return</span> (ptrdiff_t*) 0;
<a name="l00741"></a>00741 }
<a name="l00742"></a>00742 
<a name="l00745"></a>00745 <span class="keyword">template</span> &lt;<span class="keyword">class</span> Value, <span class="keyword">class</span> Key, <span class="keyword">class</span> HashFcn, <span class="keyword">class</span> ExtractKey, <span class="keyword">class</span> EqualKey, <span class="keyword">class</span> Alloc&gt;
<a name="l00746"></a><a class="code" href="namespaceitk.html#9b73b59d7ccfd96b77dfd8e56e036a5b">00746</a> <span class="keywordtype">bool</span> <a class="code" href="namespaceitk.html#e1c1b02c301187419478f5126c789a01">operator==</a>(<span class="keyword">const</span> <a class="code" href="classitk_1_1hashtable.html">hashtable&lt;Value, Key, HashFcn, ExtractKey, EqualKey, Alloc&gt;</a>&amp; ht1,
<a name="l00747"></a>00747                 <span class="keyword">const</span> <a class="code" href="classitk_1_1hashtable.html">hashtable&lt;Value, Key, HashFcn, ExtractKey, EqualKey, Alloc&gt;</a>&amp; ht2)
<a name="l00748"></a>00748 {
<a name="l00749"></a>00749   <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="structitk_1_1hashtable__node.html">hashtable&lt;Value, Key, HashFcn, ExtractKey, EqualKey, Alloc&gt;::node</a> node;
<a name="l00750"></a>00750   <span class="keywordflow">if</span> (ht1.<a class="code" href="classitk_1_1hashtable__base.html#bd17986486bda165e7fe60eb79cba12a">buckets</a>.size() != ht2.<a class="code" href="classitk_1_1hashtable__base.html#bd17986486bda165e7fe60eb79cba12a">buckets</a>.size())
<a name="l00751"></a>00751     {
<a name="l00752"></a>00752     <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00753"></a>00753     }
<a name="l00754"></a>00754   <span class="keywordflow">for</span> (<span class="keywordtype">int</span> n = 0; n &lt; ht1.<a class="code" href="classitk_1_1hashtable__base.html#bd17986486bda165e7fe60eb79cba12a">buckets</a>.size(); ++n)
<a name="l00755"></a>00755     {
<a name="l00756"></a>00756     node* cur1 = ht1.<a class="code" href="classitk_1_1hashtable__base.html#bd17986486bda165e7fe60eb79cba12a">buckets</a>[n];
<a name="l00757"></a>00757     node* cur2 = ht2.<a class="code" href="classitk_1_1hashtable__base.html#bd17986486bda165e7fe60eb79cba12a">buckets</a>[n];
<a name="l00758"></a>00758     <span class="keywordflow">for</span> (; cur1 &amp;&amp; cur2 &amp;&amp; cur1-&gt;val == cur2-&gt;val;
<a name="l00759"></a>00759           cur1 = cur1-&gt;next, cur2 = cur2-&gt;next)
<a name="l00760"></a>00760       {}
<a name="l00761"></a>00761     <span class="keywordflow">if</span> (cur1 || cur2)
<a name="l00762"></a>00762       {
<a name="l00763"></a>00763       <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00764"></a>00764       }
<a name="l00765"></a>00765     }
<a name="l00766"></a>00766   <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00767"></a>00767 }
<a name="l00769"></a>00769 
<a name="l00770"></a>00770 <span class="keyword">template</span> &lt;<span class="keyword">class</span> Value, <span class="keyword">class</span> Key, <span class="keyword">class</span> HashFcn, <span class="keyword">class</span> ExtractKey, <span class="keyword">class</span> EqualKey, <span class="keyword">class</span> Alloc&gt;
<a name="l00771"></a>00771 std::pair&lt;hashtable_iterator&lt;Value, Key, HashFcn, ExtractKey, EqualKey, Alloc&gt;, <span class="keywordtype">bool</span>&gt;
<a name="l00772"></a>00772 <a class="code" href="classitk_1_1hashtable.html#88ecf906d4eb91a5c95f02d89e1a8865">hashtable&lt;Value, Key, HashFcn, ExtractKey, EqualKey, Alloc&gt;::insert_unique_noresize</a>(<span class="keyword">const</span> <a class="code" href="itk__hashtable_8h.html#6552f918961cf84f869db6fd5c8e18a5">__value_type__</a>&amp; obj)
<a name="l00773"></a>00773 {
<a name="l00774"></a>00774   <span class="keyword">const</span> size_type n = bkt_num(obj);
<a name="l00775"></a>00775   node* first = this-&gt;buckets[n];
<a name="l00776"></a>00776 
<a name="l00777"></a>00777   <span class="keywordflow">for</span> (node* cur = first; cur; cur = cur-&gt;next)
<a name="l00778"></a>00778     <span class="keywordflow">if</span> (equals(get_key(cur-&gt;val), get_key(obj)))
<a name="l00779"></a>00779       <span class="keywordflow">return</span> std::pair&lt;iterator, bool&gt;(iterator(cur, <span class="keyword">this</span>), <span class="keyword">false</span>);
<a name="l00780"></a>00780 
<a name="l00781"></a>00781   node* tmp = new_node(obj);
<a name="l00782"></a>00782   tmp-&gt;next = first;
<a name="l00783"></a>00783   this-&gt;buckets[n] = tmp;
<a name="l00784"></a>00784   ++this-&gt;num_elements;
<a name="l00785"></a>00785   <span class="keywordflow">return</span> std::pair&lt;iterator, bool&gt;(iterator(tmp, <span class="keyword">this</span>), <span class="keyword">true</span>);
<a name="l00786"></a>00786 }
<a name="l00787"></a>00787 
<a name="l00788"></a>00788 <span class="keyword">template</span> &lt;<span class="keyword">class</span> Value, <span class="keyword">class</span> Key, <span class="keyword">class</span> HashFcn, <span class="keyword">class</span> ExtractKey, <span class="keyword">class</span> EqualKey, <span class="keyword">class</span> Alloc&gt;
<a name="l00789"></a>00789 hashtable_iterator&lt;Value, Key, HashFcn, ExtractKey, EqualKey, Alloc&gt;
<a name="l00790"></a>00790 hashtable&lt;Value, Key, HashFcn, ExtractKey, EqualKey, Alloc&gt;::insert_equal_noresize(<span class="keyword">const</span> <a class="code" href="itk__hashtable_8h.html#6552f918961cf84f869db6fd5c8e18a5">__value_type__</a>&amp; obj)
<a name="l00791"></a>00791 {
<a name="l00792"></a>00792   <span class="keyword">const</span> size_type n = bkt_num(obj);
<a name="l00793"></a>00793   node* first = this-&gt;buckets[n];
<a name="l00794"></a>00794 
<a name="l00795"></a>00795   <span class="keywordflow">for</span> (node* cur = first; cur; cur = cur-&gt;next)
<a name="l00796"></a>00796     {
<a name="l00797"></a>00797     <span class="keywordflow">if</span> (equals(get_key(cur-&gt;val), get_key(obj)))
<a name="l00798"></a>00798       {
<a name="l00799"></a>00799       node* tmp = new_node(obj);
<a name="l00800"></a>00800       tmp-&gt;next = cur-&gt;next;
<a name="l00801"></a>00801       cur-&gt;next = tmp;
<a name="l00802"></a>00802       ++this-&gt;num_elements;
<a name="l00803"></a>00803       <span class="keywordflow">return</span> iterator(tmp, <span class="keyword">this</span>);
<a name="l00804"></a>00804       }
<a name="l00805"></a>00805     }
<a name="l00806"></a>00806   node* tmp = new_node(obj);
<a name="l00807"></a>00807   tmp-&gt;next = first;
<a name="l00808"></a>00808   this-&gt;buckets[n] = tmp;
<a name="l00809"></a>00809   ++this-&gt;num_elements;
<a name="l00810"></a>00810   <span class="keywordflow">return</span> iterator(tmp, <span class="keyword">this</span>);
<a name="l00811"></a>00811 }
<a name="l00812"></a>00812 
<a name="l00813"></a>00813 <span class="keyword">template</span> &lt;<span class="keyword">class</span> Value, <span class="keyword">class</span> Key, <span class="keyword">class</span> HashFcn, <span class="keyword">class</span> ExtractKey, <span class="keyword">class</span> EqualKey, <span class="keyword">class</span> Alloc&gt;
<a name="l00814"></a>00814 <a class="code" href="itk__hashtable_8h.html#ad03b7623209afa243bd26a70ec77e9e">__reference__</a>
<a name="l00815"></a>00815 hashtable&lt;Value, Key, HashFcn, ExtractKey, EqualKey, Alloc&gt;::find_or_insert(<span class="keyword">const</span> <a class="code" href="itk__hashtable_8h.html#6552f918961cf84f869db6fd5c8e18a5">__value_type__</a>&amp; obj)
<a name="l00816"></a>00816 {
<a name="l00817"></a>00817   resize(this-&gt;num_elements + 1);
<a name="l00818"></a>00818 
<a name="l00819"></a>00819   size_type n = bkt_num(obj);
<a name="l00820"></a>00820   node* first = this-&gt;buckets[n];
<a name="l00821"></a>00821 
<a name="l00822"></a>00822   <span class="keywordflow">for</span> (node* cur = first; cur; cur = cur-&gt;next)
<a name="l00823"></a>00823     <span class="keywordflow">if</span> (equals(get_key(cur-&gt;val), get_key(obj)))
<a name="l00824"></a>00824       <span class="keywordflow">return</span> cur-&gt;val;
<a name="l00825"></a>00825 
<a name="l00826"></a>00826   node* tmp = new_node(obj);
<a name="l00827"></a>00827   tmp-&gt;next = first;
<a name="l00828"></a>00828   this-&gt;buckets[n] = tmp;
<a name="l00829"></a>00829   ++this-&gt;num_elements;
<a name="l00830"></a>00830   <span class="keywordflow">return</span> tmp-&gt;val;
<a name="l00831"></a>00831 }
<a name="l00832"></a>00832 
<a name="l00833"></a>00833 <span class="keyword">template</span> &lt;<span class="keyword">class</span> Value, <span class="keyword">class</span> Key, <span class="keyword">class</span> HashFcn, <span class="keyword">class</span> ExtractKey, <span class="keyword">class</span> EqualKey, <span class="keyword">class</span> Alloc&gt;
<a name="l00834"></a>00834 std::pair&lt;hashtable_iterator&lt;Value, Key, HashFcn, ExtractKey, EqualKey, Alloc&gt;,
<a name="l00835"></a>00835      hashtable_iterator&lt;Value, Key, HashFcn, ExtractKey, EqualKey, Alloc&gt; &gt;
<a name="l00836"></a>00836 hashtable&lt;Value, Key, HashFcn, ExtractKey, EqualKey, Alloc&gt;::equal_range(<span class="keyword">const</span> <a class="code" href="itk__hashtable_8h.html#2c24296691a35bcce469277d24506e07">__key_type__</a>&amp; key)
<a name="l00837"></a>00837 {
<a name="l00838"></a>00838   <span class="keyword">typedef</span> std::pair&lt;iterator, iterator&gt; pii;
<a name="l00839"></a>00839   <span class="keyword">const</span> size_type n = bkt_num_key(key);
<a name="l00840"></a>00840 
<a name="l00841"></a>00841   <span class="keywordflow">for</span> (node* first = this-&gt;buckets[n]; first; first = first-&gt;next)
<a name="l00842"></a>00842     {
<a name="l00843"></a>00843     <span class="keywordflow">if</span> (equals(get_key(first-&gt;val), key))
<a name="l00844"></a>00844       {
<a name="l00845"></a>00845       <span class="keywordflow">for</span> (node* cur = first-&gt;next; cur; cur = cur-&gt;next)
<a name="l00846"></a>00846         {
<a name="l00847"></a>00847         <span class="keywordflow">if</span> (!equals(get_key(cur-&gt;val), key))
<a name="l00848"></a>00848           <span class="keywordflow">return</span> pii(iterator(first, <span class="keyword">this</span>), iterator(cur, <span class="keyword">this</span>));
<a name="l00849"></a>00849         }
<a name="l00850"></a>00850       <span class="keywordflow">for</span> (size_type m = n + 1; m &lt; this-&gt;buckets.size(); ++m)
<a name="l00851"></a>00851         {
<a name="l00852"></a>00852         <span class="keywordflow">if</span> (this-&gt;buckets[m])
<a name="l00853"></a>00853           {
<a name="l00854"></a>00854           <span class="keywordflow">return</span> pii(iterator(first, <span class="keyword">this</span>),
<a name="l00855"></a>00855                      iterator(this-&gt;buckets[m], <span class="keyword">this</span>));
<a name="l00856"></a>00856           }
<a name="l00857"></a>00857         }
<a name="l00858"></a>00858       <span class="keywordflow">return</span> pii(iterator(first, <span class="keyword">this</span>), end());
<a name="l00859"></a>00859       }
<a name="l00860"></a>00860     }
<a name="l00861"></a>00861   <span class="keywordflow">return</span> pii(end(), end());
<a name="l00862"></a>00862 }
<a name="l00863"></a>00863 
<a name="l00864"></a>00864 <span class="keyword">template</span> &lt;<span class="keyword">class</span> Value, <span class="keyword">class</span> Key, <span class="keyword">class</span> HashFcn, <span class="keyword">class</span> ExtractKey, <span class="keyword">class</span> EqualKey, <span class="keyword">class</span> Alloc&gt;
<a name="l00865"></a>00865 std::pair&lt;hashtable_const_iterator&lt;Value, Key, HashFcn, ExtractKey, EqualKey, Alloc&gt;,
<a name="l00866"></a>00866      hashtable_const_iterator&lt;Value, Key, HashFcn, ExtractKey, EqualKey, Alloc&gt; &gt;
<a name="l00867"></a>00867 hashtable&lt;Value, Key, HashFcn, ExtractKey, EqualKey, Alloc&gt;::equal_range(<span class="keyword">const</span> <a class="code" href="itk__hashtable_8h.html#2c24296691a35bcce469277d24506e07">__key_type__</a>&amp; key)<span class="keyword"> const</span>
<a name="l00868"></a>00868 <span class="keyword"></span>{
<a name="l00869"></a>00869   <span class="keyword">typedef</span> std::pair&lt;const_iterator, const_iterator&gt; pii;
<a name="l00870"></a>00870   <span class="keyword">const</span> size_type n = bkt_num_key(key);
<a name="l00871"></a>00871 
<a name="l00872"></a>00872   <span class="keywordflow">for</span> (<span class="keyword">const</span> node* first = this-&gt;buckets[n]; first; first = first-&gt;next)
<a name="l00873"></a>00873     {
<a name="l00874"></a>00874     <span class="keywordflow">if</span> (equals(get_key(first-&gt;val), key))
<a name="l00875"></a>00875       {
<a name="l00876"></a>00876       <span class="keywordflow">for</span> (<span class="keyword">const</span> node* cur = first-&gt;next; cur; cur = cur-&gt;next)
<a name="l00877"></a>00877         {
<a name="l00878"></a>00878         <span class="keywordflow">if</span> (!equals(get_key(cur-&gt;val), key))
<a name="l00879"></a>00879           {
<a name="l00880"></a>00880           <span class="keywordflow">return</span> pii(const_iterator(first, <span class="keyword">this</span>),
<a name="l00881"></a>00881                      const_iterator(cur, <span class="keyword">this</span>));
<a name="l00882"></a>00882           }
<a name="l00883"></a>00883         }
<a name="l00884"></a>00884       <span class="keywordflow">for</span> (size_type m = n + 1; m &lt; this-&gt;buckets.size(); ++m)
<a name="l00885"></a>00885         {
<a name="l00886"></a>00886         <span class="keywordflow">if</span> (this-&gt;buckets[m])
<a name="l00887"></a>00887           {
<a name="l00888"></a>00888           <span class="keywordflow">return</span> pii(const_iterator(first, <span class="keyword">this</span>),
<a name="l00889"></a>00889                      const_iterator(this-&gt;buckets[m], <span class="keyword">this</span>));
<a name="l00890"></a>00890           }
<a name="l00891"></a>00891         }
<a name="l00892"></a>00892       <span class="keywordflow">return</span> pii(const_iterator(first, <span class="keyword">this</span>), end());
<a name="l00893"></a>00893       }
<a name="l00894"></a>00894     }
<a name="l00895"></a>00895   <span class="keywordflow">return</span> pii(end(), end());
<a name="l00896"></a>00896 }
<a name="l00897"></a>00897 
<a name="l00898"></a>00898 <span class="keyword">template</span> &lt;<span class="keyword">class</span> Value, <span class="keyword">class</span> Key, <span class="keyword">class</span> HashFcn, <span class="keyword">class</span> ExtractKey, <span class="keyword">class</span> EqualKey, <span class="keyword">class</span> Alloc&gt;
<a name="l00899"></a>00899 <a class="code" href="itk__hashtable_8h.html#1f27e0ccf16bfb7affce9908d6f05425">__size_type__</a>
<a name="l00900"></a>00900 hashtable&lt;Value, Key, HashFcn, ExtractKey, EqualKey, Alloc&gt;::erase(<span class="keyword">const</span> <a class="code" href="itk__hashtable_8h.html#2c24296691a35bcce469277d24506e07">__key_type__</a>&amp; key)
<a name="l00901"></a>00901 {
<a name="l00902"></a>00902   <span class="keyword">const</span> size_type n = bkt_num_key(key);
<a name="l00903"></a>00903   node* first = this-&gt;buckets[n];
<a name="l00904"></a>00904   size_type erased = 0;
<a name="l00905"></a>00905 
<a name="l00906"></a>00906   <span class="keywordflow">if</span> (first)
<a name="l00907"></a>00907     {
<a name="l00908"></a>00908     node* cur = first;
<a name="l00909"></a>00909     node* next = cur-&gt;next;
<a name="l00910"></a>00910     <span class="keywordflow">while</span> (next)
<a name="l00911"></a>00911       {
<a name="l00912"></a>00912       <span class="keywordflow">if</span> (equals(get_key(next-&gt;val), key))
<a name="l00913"></a>00913         {
<a name="l00914"></a>00914         cur-&gt;next = next-&gt;next;
<a name="l00915"></a>00915         delete_node(next);
<a name="l00916"></a>00916         next = cur-&gt;next;
<a name="l00917"></a>00917         ++erased;
<a name="l00918"></a>00918         }
<a name="l00919"></a>00919       <span class="keywordflow">else</span>
<a name="l00920"></a>00920         {
<a name="l00921"></a>00921         cur = next;
<a name="l00922"></a>00922         next = cur-&gt;next;
<a name="l00923"></a>00923         }
<a name="l00924"></a>00924       }
<a name="l00925"></a>00925     <span class="keywordflow">if</span> (equals(get_key(first-&gt;val), key))
<a name="l00926"></a>00926       {
<a name="l00927"></a>00927       this-&gt;buckets[n] = first-&gt;next;
<a name="l00928"></a>00928       delete_node(first);
<a name="l00929"></a>00929       ++erased;
<a name="l00930"></a>00930       }
<a name="l00931"></a>00931     }
<a name="l00932"></a>00932   this-&gt;num_elements -= erased;
<a name="l00933"></a>00933   <span class="keywordflow">return</span> erased;
<a name="l00934"></a>00934 }
<a name="l00935"></a>00935 
<a name="l00936"></a>00936 <span class="keyword">template</span> &lt;<span class="keyword">class</span> Value, <span class="keyword">class</span> Key, <span class="keyword">class</span> HashFcn, <span class="keyword">class</span> ExtractKey, <span class="keyword">class</span> EqualKey, <span class="keyword">class</span> Alloc&gt;
<a name="l00937"></a>00937 <span class="keywordtype">void</span>
<a name="l00938"></a>00938 hashtable&lt;Value, Key, HashFcn, ExtractKey, EqualKey, Alloc&gt;::erase(<span class="keyword">const</span> hashtable_iterator&lt;Value, Key, HashFcn, ExtractKey, EqualKey, Alloc&gt;&amp; it)
<a name="l00939"></a>00939 {
<a name="l00940"></a>00940   node* <span class="keyword">const</span> p = it.cur;
<a name="l00941"></a>00941   <span class="keywordflow">if</span> (p)
<a name="l00942"></a>00942     {
<a name="l00943"></a>00943     <span class="keyword">const</span> size_type n = bkt_num(p-&gt;val);
<a name="l00944"></a>00944     node* cur = this-&gt;buckets[n];
<a name="l00945"></a>00945 
<a name="l00946"></a>00946     <span class="keywordflow">if</span> (cur == p)
<a name="l00947"></a>00947       {
<a name="l00948"></a>00948       this-&gt;buckets[n] = cur-&gt;next;
<a name="l00949"></a>00949       delete_node(cur);
<a name="l00950"></a>00950       --this-&gt;num_elements;
<a name="l00951"></a>00951       }
<a name="l00952"></a>00952     <span class="keywordflow">else</span>
<a name="l00953"></a>00953       {
<a name="l00954"></a>00954       node* next = cur-&gt;next;
<a name="l00955"></a>00955       <span class="keywordflow">while</span> (next)
<a name="l00956"></a>00956         {
<a name="l00957"></a>00957         <span class="keywordflow">if</span> (next == p)
<a name="l00958"></a>00958           {
<a name="l00959"></a>00959           cur-&gt;next = next-&gt;next;
<a name="l00960"></a>00960           delete_node(next);
<a name="l00961"></a>00961           --this-&gt;num_elements;
<a name="l00962"></a>00962           <span class="keywordflow">break</span>;
<a name="l00963"></a>00963           }
<a name="l00964"></a>00964         <span class="keywordflow">else</span>
<a name="l00965"></a>00965           {
<a name="l00966"></a>00966           cur = next;
<a name="l00967"></a>00967           next = cur-&gt;next;
<a name="l00968"></a>00968           }
<a name="l00969"></a>00969         }
<a name="l00970"></a>00970       }
<a name="l00971"></a>00971     }
<a name="l00972"></a>00972 }
<a name="l00973"></a>00973 
<a name="l00974"></a>00974 <span class="keyword">template</span> &lt;<span class="keyword">class</span> Value, <span class="keyword">class</span> Key, <span class="keyword">class</span> HashFcn, <span class="keyword">class</span> ExtractKey, <span class="keyword">class</span> EqualKey, <span class="keyword">class</span> Alloc&gt;
<a name="l00975"></a>00975 <span class="keywordtype">void</span>
<a name="l00976"></a>00976 hashtable&lt;Value, Key, HashFcn, ExtractKey, EqualKey, Alloc&gt;::erase(hashtable_iterator&lt;Value, Key, HashFcn, ExtractKey, EqualKey, Alloc&gt; first,
<a name="l00977"></a>00977                                         hashtable_iterator&lt;Value, Key, HashFcn, ExtractKey, EqualKey, Alloc&gt; last)
<a name="l00978"></a>00978 {
<a name="l00979"></a>00979   size_type f_bucket = first.cur ? bkt_num(first.cur-&gt;val) : this-&gt;buckets.size();
<a name="l00980"></a>00980   size_type l_bucket = last.cur ? bkt_num(last.cur-&gt;val) : this-&gt;buckets.size();
<a name="l00981"></a>00981   <span class="keywordflow">if</span> (first.cur == last.cur)
<a name="l00982"></a>00982     <span class="keywordflow">return</span>;
<a name="l00983"></a>00983   <span class="keywordflow">else</span> <span class="keywordflow">if</span> (f_bucket == l_bucket)
<a name="l00984"></a>00984     erase_bucket(f_bucket, first.cur, last.cur);
<a name="l00985"></a>00985   <span class="keywordflow">else</span>
<a name="l00986"></a>00986     {
<a name="l00987"></a>00987     erase_bucket(f_bucket, first.cur, 0);
<a name="l00988"></a>00988     <span class="keywordflow">for</span> (size_type n = f_bucket + 1; n &lt; l_bucket; ++n)
<a name="l00989"></a>00989       erase_bucket(n, 0);
<a name="l00990"></a>00990     <span class="keywordflow">if</span> (l_bucket != this-&gt;buckets.size())
<a name="l00991"></a>00991       erase_bucket(l_bucket, last.cur);
<a name="l00992"></a>00992     }
<a name="l00993"></a>00993 }
<a name="l00994"></a>00994 
<a name="l00995"></a>00995 <span class="keyword">template</span> &lt;<span class="keyword">class</span> Value, <span class="keyword">class</span> Key, <span class="keyword">class</span> HashFcn, <span class="keyword">class</span> ExtractKey, <span class="keyword">class</span> EqualKey, <span class="keyword">class</span> Alloc&gt;
<a name="l00996"></a>00996 <span class="keyword">inline</span> <span class="keywordtype">void</span>
<a name="l00997"></a>00997 hashtable&lt;Value, Key, HashFcn, ExtractKey, EqualKey, Alloc&gt;::erase(hashtable_const_iterator&lt;Value, Key, HashFcn, ExtractKey, EqualKey, Alloc&gt; first,
<a name="l00998"></a>00998                                         hashtable_const_iterator&lt;Value, Key, HashFcn, ExtractKey, EqualKey, Alloc&gt; last)
<a name="l00999"></a>00999 {
<a name="l01000"></a>01000   erase(iterator(const_cast&lt;node*&gt;(first.cur),
<a name="l01001"></a>01001                  const_cast&lt;self*&gt;(first.ht)),
<a name="l01002"></a>01002         iterator(const_cast&lt;node*&gt;(last.cur),
<a name="l01003"></a>01003                  const_cast&lt;self*&gt;(last.ht)));
<a name="l01004"></a>01004 }
<a name="l01005"></a>01005 
<a name="l01006"></a>01006 <span class="keyword">template</span> &lt;<span class="keyword">class</span> Value, <span class="keyword">class</span> Key, <span class="keyword">class</span> HashFcn, <span class="keyword">class</span> ExtractKey, <span class="keyword">class</span> EqualKey, <span class="keyword">class</span> Alloc&gt;
<a name="l01007"></a>01007 <span class="keyword">inline</span> <span class="keywordtype">void</span>
<a name="l01008"></a>01008 hashtable&lt;Value, Key, HashFcn, ExtractKey, EqualKey, Alloc&gt;::erase(<span class="keyword">const</span> hashtable_const_iterator&lt;Value, Key, HashFcn, ExtractKey, EqualKey, Alloc&gt;&amp; it)
<a name="l01009"></a>01009 {
<a name="l01010"></a>01010   erase(iterator(const_cast&lt;node*&gt;(it.cur),
<a name="l01011"></a>01011                  const_cast&lt;self*&gt;(it.ht)));
<a name="l01012"></a>01012 }
<a name="l01013"></a>01013 
<a name="l01014"></a>01014 <span class="keyword">template</span> &lt;<span class="keyword">class</span> Value, <span class="keyword">class</span> Key, <span class="keyword">class</span> HashFcn, <span class="keyword">class</span> ExtractKey, <span class="keyword">class</span> EqualKey, <span class="keyword">class</span> Alloc&gt;
<a name="l01015"></a>01015 <span class="keywordtype">void</span>
<a name="l01016"></a>01016 hashtable&lt;Value, Key, HashFcn, ExtractKey, EqualKey, Alloc&gt;::resize(<a class="code" href="itk__hashtable_8h.html#1f27e0ccf16bfb7affce9908d6f05425">__size_type__</a> num_elements_hint)
<a name="l01017"></a>01017 {
<a name="l01018"></a>01018   <span class="keyword">const</span> size_type old_n = this-&gt;buckets.size();
<a name="l01019"></a>01019   <span class="keywordflow">if</span> (num_elements_hint &gt; old_n)
<a name="l01020"></a>01020     {
<a name="l01021"></a>01021     <span class="keyword">const</span> size_type n = next_size(num_elements_hint);
<a name="l01022"></a>01022     <span class="keywordflow">if</span> (n &gt; old_n)
<a name="l01023"></a>01023       {
<a name="l01024"></a>01024       <span class="keyword">typename</span> hashtable&lt;Value, Key, HashFcn, ExtractKey, EqualKey, Alloc&gt;::buckets_type tmp(n, (node*)0);
<a name="l01025"></a>01025       <span class="keywordflow">for</span> (size_type bucket = 0; bucket &lt; old_n; ++bucket)
<a name="l01026"></a>01026         {
<a name="l01027"></a>01027         node* first = this-&gt;buckets[bucket];
<a name="l01028"></a>01028         <span class="keywordflow">while</span> (first)
<a name="l01029"></a>01029           {
<a name="l01030"></a>01030           size_type new_bucket = bkt_num(first-&gt;val, n);
<a name="l01031"></a>01031           this-&gt;buckets[bucket] = first-&gt;next;
<a name="l01032"></a>01032           first-&gt;next = tmp[new_bucket];
<a name="l01033"></a>01033           tmp[new_bucket] = first;
<a name="l01034"></a>01034           first = this-&gt;buckets[bucket];
<a name="l01035"></a>01035           }
<a name="l01036"></a>01036         }
<a name="l01037"></a>01037       this-&gt;buckets.clear();
<a name="l01038"></a>01038       this-&gt;buckets.swap(tmp);
<a name="l01039"></a>01039       }
<a name="l01040"></a>01040     }
<a name="l01041"></a>01041 }
<a name="l01042"></a>01042 
<a name="l01043"></a>01043 
<a name="l01044"></a>01044 <span class="keyword">template</span> &lt;<span class="keyword">class</span> Value, <span class="keyword">class</span> Key, <span class="keyword">class</span> HashFcn, <span class="keyword">class</span> ExtractKey, <span class="keyword">class</span> EqualKey, <span class="keyword">class</span> Alloc&gt;
<a name="l01045"></a>01045 <span class="keywordtype">void</span>
<a name="l01046"></a>01046 hashtable&lt;Value, Key, HashFcn, ExtractKey, EqualKey, Alloc&gt;::erase_bucket(<span class="keyword">const</span> <span class="keywordtype">size_t</span> n,
<a name="l01047"></a>01047                                              hashtable_node&lt;Value&gt;* first,
<a name="l01048"></a>01048                                              hashtable_node&lt;Value&gt;* last)
<a name="l01049"></a>01049 {
<a name="l01050"></a>01050   node* cur = this-&gt;buckets[n];
<a name="l01051"></a>01051   <span class="keywordflow">if</span> (cur == first)
<a name="l01052"></a>01052     erase_bucket(n, last);
<a name="l01053"></a>01053   <span class="keywordflow">else</span>
<a name="l01054"></a>01054     {
<a name="l01055"></a>01055     node* next;
<a name="l01056"></a>01056     <span class="keywordflow">for</span> (next = cur-&gt;next; next != first; cur = next, next = cur-&gt;next);
<a name="l01057"></a>01057     <span class="keywordflow">while</span> (next)
<a name="l01058"></a>01058       {
<a name="l01059"></a>01059       cur-&gt;next = next-&gt;next;
<a name="l01060"></a>01060       delete_node(next);
<a name="l01061"></a>01061       next = cur-&gt;next;
<a name="l01062"></a>01062       --this-&gt;num_elements;
<a name="l01063"></a>01063       }
<a name="l01064"></a>01064     }
<a name="l01065"></a>01065 }
<a name="l01066"></a>01066 
<a name="l01067"></a>01067 <span class="keyword">template</span> &lt;<span class="keyword">class</span> Value, <span class="keyword">class</span> Key, <span class="keyword">class</span> HashFcn, <span class="keyword">class</span> ExtractKey, <span class="keyword">class</span> EqualKey, <span class="keyword">class</span> Alloc&gt;
<a name="l01068"></a>01068 <span class="keywordtype">void</span>
<a name="l01069"></a>01069 hashtable&lt;Value, Key, HashFcn, ExtractKey, EqualKey, Alloc&gt;::erase_bucket(<span class="keyword">const</span> <span class="keywordtype">size_t</span> n,
<a name="l01070"></a>01070                                                             hashtable_node&lt;Value&gt;* last)
<a name="l01071"></a>01071 {
<a name="l01072"></a>01072   node* cur = this-&gt;buckets[n];
<a name="l01073"></a>01073   <span class="keywordflow">while</span> (cur != last)
<a name="l01074"></a>01074     {
<a name="l01075"></a>01075     node* next = cur-&gt;next;
<a name="l01076"></a>01076     delete_node(cur);
<a name="l01077"></a>01077     cur = next;
<a name="l01078"></a>01078     this-&gt;buckets[n] = cur;
<a name="l01079"></a>01079     --this-&gt;num_elements;
<a name="l01080"></a>01080     }
<a name="l01081"></a>01081 }
<a name="l01082"></a>01082 
<a name="l01083"></a>01083 <span class="keyword">template</span> &lt;<span class="keyword">class</span> Value, <span class="keyword">class</span> Alloc&gt;
<a name="l01084"></a><a class="code" href="classitk_1_1hashtable__base.html#f2c42aa904b06fe2c128ddf0b73701ca">01084</a> <span class="keywordtype">void</span> <a class="code" href="classitk_1_1hashtable__base.html">hashtable_base&lt;Value, Alloc&gt;::clear</a>()
<a name="l01085"></a>01085 {
<a name="l01086"></a>01086   <span class="keywordflow">for</span> (size_type i = 0; i &lt; <a class="code" href="classitk_1_1hashtable__base.html#bd17986486bda165e7fe60eb79cba12a">buckets</a>.size(); ++i)
<a name="l01087"></a>01087     {
<a name="l01088"></a>01088     <a class="code" href="structitk_1_1hashtable__node.html">node</a>* cur = <a class="code" href="classitk_1_1hashtable__base.html#bd17986486bda165e7fe60eb79cba12a">buckets</a>[i];
<a name="l01089"></a>01089     <span class="keywordflow">while</span> (cur != 0)
<a name="l01090"></a>01090       {
<a name="l01091"></a>01091       <a class="code" href="structitk_1_1hashtable__node.html">node</a>* next = cur-&gt;<a class="code" href="structitk_1_1hashtable__node.html#7483e6d4641f35dc50abd79bbe9c0f74">next</a>;
<a name="l01092"></a>01092       <a class="code" href="classitk_1_1hashtable__base.html#abce8d61a3042df7e067837f0d7315e3">delete_node</a>(cur);
<a name="l01093"></a>01093       cur = next;
<a name="l01094"></a>01094       }
<a name="l01095"></a>01095     <a class="code" href="classitk_1_1hashtable__base.html#bd17986486bda165e7fe60eb79cba12a">buckets</a>[i] = 0;
<a name="l01096"></a>01096     }
<a name="l01097"></a>01097   <a class="code" href="classitk_1_1hashtable__base.html#61c5192d841cc653832445b61e4ef8bf">num_elements</a> = 0;
<a name="l01098"></a>01098 }
<a name="l01099"></a>01099 
<a name="l01100"></a>01100 
<a name="l01101"></a>01101 <span class="keyword">template</span> &lt;<span class="keyword">class</span> Value, <span class="keyword">class</span> Alloc&gt;
<a name="l01102"></a><a class="code" href="classitk_1_1hashtable__base.html#370b34942d193c9931deeafbfdd3d647">01102</a> <span class="keywordtype">void</span> <a class="code" href="classitk_1_1hashtable__base.html#370b34942d193c9931deeafbfdd3d647">hashtable_base&lt;Value, Alloc&gt;::copy_from</a>(<span class="keyword">const</span> <a class="code" href="classitk_1_1hashtable__base.html">hashtable_base&lt;Value, Alloc&gt;</a>&amp; ht)
<a name="l01103"></a>01103 {
<a name="l01104"></a>01104   buckets.reserve(ht.<a class="code" href="classitk_1_1hashtable__base.html#bd17986486bda165e7fe60eb79cba12a">buckets</a>.size());
<a name="l01105"></a>01105   buckets.insert(buckets.end(), ht.<a class="code" href="classitk_1_1hashtable__base.html#bd17986486bda165e7fe60eb79cba12a">buckets</a>.size(), (<a class="code" href="structitk_1_1hashtable__node.html">node</a>*) 0);
<a name="l01106"></a>01106   <span class="keywordflow">for</span> (size_type i = 0; i &lt; ht.<a class="code" href="classitk_1_1hashtable__base.html#bd17986486bda165e7fe60eb79cba12a">buckets</a>.size(); ++i)
<a name="l01107"></a>01107     {
<a name="l01108"></a>01108     <span class="keyword">const</span> <a class="code" href="structitk_1_1hashtable__node.html">node</a>* cur = ht.<a class="code" href="classitk_1_1hashtable__base.html#bd17986486bda165e7fe60eb79cba12a">buckets</a>[i];
<a name="l01109"></a>01109     <span class="keywordflow">if</span> (cur)
<a name="l01110"></a>01110       {
<a name="l01111"></a>01111       <a class="code" href="structitk_1_1hashtable__node.html">node</a>* copy = new_node(cur-&gt;<a class="code" href="structitk_1_1hashtable__node.html#e3770520494e2a6426c1204a2bd4e1bc">val</a>);
<a name="l01112"></a>01112       buckets[i] = copy;
<a name="l01113"></a>01113       ++num_elements;
<a name="l01114"></a>01114 
<a name="l01115"></a>01115       <span class="keywordflow">for</span> (<a class="code" href="structitk_1_1hashtable__node.html">node</a>* next = cur-&gt;<a class="code" href="structitk_1_1hashtable__node.html#7483e6d4641f35dc50abd79bbe9c0f74">next</a>; next; cur = next, next = cur-&gt;<a class="code" href="structitk_1_1hashtable__node.html#7483e6d4641f35dc50abd79bbe9c0f74">next</a>)
<a name="l01116"></a>01116         {
<a name="l01117"></a>01117         copy-&gt;<a class="code" href="structitk_1_1hashtable__node.html#7483e6d4641f35dc50abd79bbe9c0f74">next</a> = new_node(next-&gt;val);
<a name="l01118"></a>01118         ++num_elements;
<a name="l01119"></a>01119         copy = copy-&gt;<a class="code" href="structitk_1_1hashtable__node.html#7483e6d4641f35dc50abd79bbe9c0f74">next</a>;
<a name="l01120"></a>01120         }
<a name="l01121"></a>01121       }
<a name="l01122"></a>01122     }
<a name="l01123"></a>01123 }
<a name="l01124"></a>01124 
<a name="l01125"></a>01125 }<span class="comment">// end namespace itk</span>
<a name="l01126"></a>01126 
<a name="l01127"></a>01127 
<a name="l01128"></a>01128 <span class="preprocessor"># undef __difference_type__</span>
<a name="l01129"></a>01129 <span class="preprocessor"></span><span class="preprocessor"># undef __size_type__</span>
<a name="l01130"></a>01130 <span class="preprocessor"></span><span class="preprocessor"># undef __value_type__</span>
<a name="l01131"></a>01131 <span class="preprocessor"></span><span class="preprocessor"># undef __key_type__</span>
<a name="l01132"></a>01132 <span class="preprocessor"></span><span class="preprocessor"># undef __node__</span>
<a name="l01133"></a>01133 <span class="preprocessor"></span>
<a name="l01134"></a>01134 <span class="comment">// the following is added for itk compatability:</span>
<a name="l01135"></a>01135 
<a name="l01136"></a>01136 <span class="comment">// --</span>
<a name="l01137"></a>01137 
<a name="l01138"></a>01138 <span class="comment">// A few compatability fixes.  Placed here for automatic include in</span>
<a name="l01139"></a>01139 <span class="comment">// both the hash_set and the hash_map sources.</span>
<a name="l01140"></a>01140 <span class="preprocessor"># if defined(VCL_SUNPRO_CC) || defined (_MSC_VER) || defined(__BORLANDC__) || ((defined(__ICC)||defined(__ECC)) &amp;&amp; defined(linux))</span>
<a name="l01141"></a>01141 <span class="preprocessor"></span><span class="keyword">namespace </span>std
<a name="l01142"></a>01142 {
<a name="l01143"></a>01143 <span class="keyword">template</span> &lt;<span class="keyword">class</span> T&gt;
<a name="l01144"></a>01144 <span class="keyword">struct </span>identity : <span class="keyword">public</span> std::unary_function&lt;T, T&gt; {
<a name="l01145"></a>01145 <span class="keyword">public</span>:
<a name="l01146"></a>01146   <span class="keyword">const</span> T&amp; operator()(<span class="keyword">const</span> T&amp; x)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> x; }
<a name="l01147"></a>01147 };
<a name="l01148"></a>01148 }
<a name="l01149"></a>01149 
<a name="l01150"></a>01150 <span class="keyword">template</span> &lt;<span class="keyword">class</span> _Pair&gt;
<a name="l01151"></a>01151 <span class="keyword">struct </span>itk_Select1st : <span class="keyword">public</span> std::unary_function&lt;_Pair, typename _Pair::first_type&gt; {
<a name="l01152"></a>01152   <span class="keyword">typename</span> _Pair::first_type <span class="keyword">const</span> &amp; operator()(_Pair <span class="keyword">const</span> &amp; __x)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> __x.first; }
<a name="l01153"></a>01153 };
<a name="l01154"></a>01154 
<a name="l01155"></a>01155 <span class="keyword">template</span> &lt;<span class="keyword">class</span> _Pair&gt;
<a name="l01156"></a>01156 <span class="keyword">struct </span>itk_Select2nd : <span class="keyword">public</span> std::unary_function&lt;_Pair, typename _Pair::second_type&gt; {
<a name="l01157"></a>01157   <span class="keyword">typename</span> _Pair::second_type <span class="keyword">const</span> &amp; operator()(_Pair <span class="keyword">const</span> &amp; __x)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> __x.second; }
<a name="l01158"></a>01158 };
<a name="l01159"></a>01159 
<a name="l01160"></a>01160 <span class="comment">// Add select* to std.</span>
<a name="l01161"></a>01161 <span class="keyword">namespace </span>std {
<a name="l01162"></a>01162 <span class="keyword">template</span> &lt;<span class="keyword">class</span> _Pair&gt;
<a name="l01163"></a>01163 <span class="keyword">struct </span>select1st : <span class="keyword">public</span> itk_Select1st&lt;_Pair&gt; {};
<a name="l01164"></a>01164 <span class="keyword">template</span> &lt;<span class="keyword">class</span> _Pair&gt; <span class="keyword">struct </span>select2nd : <span class="keyword">public</span> itk_Select2nd&lt;_Pair&gt; {};
<a name="l01165"></a>01165 }
<a name="l01166"></a>01166 
<a name="l01167"></a>01167 <span class="preprocessor">#endif</span>
<a name="l01168"></a>01168 <span class="preprocessor"></span>
<a name="l01169"></a>01169 <span class="preprocessor">#endif</span>
<a name="l01170"></a>01170 <span class="preprocessor"></span>
<a name="l01171"></a>01171 <span class="preprocessor">#endif // itk_emulation_hashtable_h</span>
<a name="l01172"></a>01172 <span class="preprocessor"></span>
</pre></div></div>
<hr><address><small>
Generated at Thu May 7 22:04:10 2009 for ITK  by <a href="http://www.stack.nl/~dimitri/doxygen/index.html"> <img 
src="http://www.stack.nl/~dimitri/doxygen/doxygen.png" alt="doxygen"
align="middle" border=0 width=110 height=53>
</a> 1.5.9 written by <a href="mailto:dimitri@stack.nl">Dimitri van Heesch</a>,
 &copy;&nbsp;1997-2000</small></address>
</body>
</html>