📄 class____hash.html
字号:
</table></div><div class="memdoc"><p>Removes all elements from the hash table. <p>The bucket array's size is not changed </div></div><p><a class="anchor" name="f03db117c2785e68e0076f250b52f4ed"></a><!-- doxytag: member="__hash::SetBucketSize" ref="f03db117c2785e68e0076f250b52f4ed" args="(bucket_array_unit nNewSize)" --><div class="memitem"><div class="memproto"><div class="memtemplate">template<typename T> </div> <table class="memname"> <tr> <td class="memname">void <a class="el" href="class____hash.html">__hash</a>< T >::SetBucketSize </td> <td>(</td> <td class="paramtype"><a class="el" href="class____hash.html#89553b3d9132fb9c47ff04b1310800df">bucket_array_unit</a> </td> <td class="paramname"> <em>nNewSize</em> </td> <td> ) </td> <td width="100%"><code> [inline]</code></td> </tr> </table></div><div class="memdoc"><p>Sets the size of the bucket array. <p>You must only call this once, unless you call <a class="el" href="class____hash.html#a8885d121d5105769c4cfd3ee0ec89b7">Delete()</a> first. The bucket array cannot be resized once the size has been set. </div></div><p><a class="anchor" name="2b3496393272c8d576bb96761d122938"></a><!-- doxytag: member="__hash::GetBucketSize" ref="2b3496393272c8d576bb96761d122938" args="() const" --><div class="memitem"><div class="memproto"><div class="memtemplate">template<typename T> </div> <table class="memname"> <tr> <td class="memname"><a class="el" href="class____hash.html#89553b3d9132fb9c47ff04b1310800df">bucket_array_unit</a> <a class="el" href="class____hash.html">__hash</a>< T >::GetBucketSize </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td width="100%"> const<code> [inline]</code></td> </tr> </table></div><div class="memdoc"><p>Gets the size of the bucket array, as set in <a class="el" href="class____hash.html#f03db117c2785e68e0076f250b52f4ed">SetBucketSize()</a>. <p><dl class="return" compact><dt><b>Returns:</b></dt><dd>The size of the table. </dd></dl><dl class="note" compact><dt><b>Note:</b></dt><dd>This does not return the number of elements in the table </dd></dl></div></div><p><a class="anchor" name="75f8b134371749b1df974ad04c7b5909"></a><!-- doxytag: member="__hash::TakeArray" ref="75f8b134371749b1df974ad04c7b5909" args="(const std::vector< T > &array)" --><div class="memitem"><div class="memproto"><div class="memtemplate">template<typename T> </div> <table class="memname"> <tr> <td class="memname">void <a class="el" href="class____hash.html">__hash</a>< T >::TakeArray </td> <td>(</td> <td class="paramtype">const std::vector< T > & </td> <td class="paramname"> <em>array</em> </td> <td> ) </td> <td width="100%"></td> </tr> </table></div><div class="memdoc"><p>Takes an array and adds the elements to this hash table. <p>Any current elements in the hash are cleared. The bucket array does not change. </div></div><p><a class="anchor" name="b74784b9b36df3d2a5fc7e84edc302c1"></a><!-- doxytag: member="__hash::GetArray" ref="b74784b9b36df3d2a5fc7e84edc302c1" args="(std::vector< T > &array) const" --><div class="memitem"><div class="memproto"><div class="memtemplate">template<typename T> </div> <table class="memname"> <tr> <td class="memname"><a class="el" href="class____hash.html">__hash</a>< T >::<a class="el" href="class____hash.html#89553b3d9132fb9c47ff04b1310800df">bucket_array_unit</a> <a class="el" href="class____hash.html">__hash</a>< T >::GetArray </td> <td>(</td> <td class="paramtype">std::vector< T > & </td> <td class="paramname"> <em>array</em> </td> <td> ) </td> <td width="100%"> const</td> </tr> </table></div><div class="memdoc"><p>Gets an array of the table's contents. <p>Call this if you want the data to be an array. <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>array</em> </td><td>The array to add to. It will first be cleared </td></tr> </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>The size of the array. </dd></dl></div></div><p><a class="anchor" name="b6ea7e2b2078eed4efd6677038ea63cc"></a><!-- doxytag: member="__hash::GetBucketStats" ref="b6ea7e2b2078eed4efd6677038ea63cc" args="(std::vector< size_t > &array) const" --><div class="memitem"><div class="memproto"><div class="memtemplate">template<typename T> </div> <table class="memname"> <tr> <td class="memname"><a class="el" href="class____hash.html#89553b3d9132fb9c47ff04b1310800df">bucket_array_unit</a> <a class="el" href="class____hash.html">__hash</a>< T >::GetBucketStats </td> <td>(</td> <td class="paramtype">std::vector< size_t > & </td> <td class="paramname"> <em>array</em> </td> <td> ) </td> <td width="100%"> const<code> [inline]</code></td> </tr> </table></div><div class="memdoc"><p>Useful for getting the statistics for a table in debug mode. <p>Currently all it does it report how many T elements each element of the hash array has. Use this to test for colisions. <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>array</em> </td><td>An array of the number of T elements in each element of the hash array. The index for each element in this array correspond to that in the hash array. The data in each element of array is the number of T elements. </td></tr> </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>The size of array </dd></dl></div></div><p><a class="anchor" name="9d12bd08a34697e1486ccb92008445d4"></a><!-- doxytag: member="__hash::begin" ref="9d12bd08a34697e1486ccb92008445d4" args="()" --><div class="memitem"><div class="memproto"><div class="memtemplate">template<typename T> </div> <table class="memname"> <tr> <td class="memname"><a class="el" href="class____hash_1_1hasherator.html">hasherator</a> <a class="el" href="class____hash.html">__hash</a>< T >::begin </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td width="100%"><code> [inline]</code></td> </tr> </table></div><div class="memdoc"><p>Gets the first reference in the hash table. <p><dl class="return" compact><dt><b>Returns:</b></dt><dd>Iterator to the first member of the hash table </dd></dl></div></div><p><a class="anchor" name="e885e2c4334d8573e3ad4b1d7ca5c7ec"></a><!-- doxytag: member="__hash::begin" ref="e885e2c4334d8573e3ad4b1d7ca5c7ec" args="() const" --><div class="memitem"><div class="memproto"><div class="memtemplate">template<typename T> </div> <table class="memname"> <tr> <td class="memname"><a class="el" href="class____hash_1_1const__hasherator.html">const_hasherator</a> <a class="el" href="class____hash.html">__hash</a>< T >::begin </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td width="100%"> const<code> [inline]</code></td> </tr> </table></div><div class="memdoc"><p>Gets the first reference in the hash table. <p><dl class="return" compact><dt><b>Returns:</b></dt><dd>An iterator to the first member of a constant hash table. </dd></dl></div></div><p><a class="anchor" name="524189108dc1b2154194bfe7480ed25c"></a><!-- doxytag: member="__hash::GetHashReference" ref="524189108dc1b2154194bfe7480ed25c" args="(const T &ref) const HASHREFERENCEPOSTATTRIBUTES=0" --><div class="memitem"><div class="memproto"><div class="memtemplate">template<typename T> </div> <table class="memname"> <tr> <td class="memname">virtual <a class="el" href="class____hash.html#89553b3d9132fb9c47ff04b1310800df">bucket_array_unit</a> HASHREFERENCEPREATTRIBUTES <a class="el" href="class____hash.html">__hash</a>< T >::GetHashReference </td> <td>(</td> <td class="paramtype">const T & </td> <td class="paramname"> <em>ref</em> </td> <td> ) </td> <td width="100%"> const<code> [protected, pure virtual]</code></td> </tr> </table></div><div class="memdoc"><p>Gets the list in which the sought element is to be found. <p>This should call your hashing function. <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>ref</em> </td><td>An instance of T which has the member used to reference. </td></tr> </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>The index for m_buckets of the element that has the list. This reference should be >= 0 and < <a class="el" href="class____hash.html#2b3496393272c8d576bb96761d122938">GetBucketSize()</a>. </dd></dl><dl class="note" compact><dt><b>Note:</b></dt><dd><b>Do not neglect to include the HASHREFERENCEPREATTRIBUTES and HASHREFERENCEPOSTATTRIBUTES parts.</b> If you do, you probably won't get a compile or linker error, but your program will behave unpredictably. </dd></dl></div></div><p><hr>The documentation for this class was generated from the following file:<ul><li><a class="el" href="____hash_8h-source.html">__hash.h</a></ul><hr size="1"><address style="align: right;"><small>Generated on Fri Feb 1 13:27:18 2008 for ahash by <a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.0 </small></address></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -