⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 classphashtable.html

📁 pwlib开发文档
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>PHashTable class Reference</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.2.18 --><center><a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="namespaces.html">Namespace List</a> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; <a class="qindex" href="globals.html">File Members</a> &nbsp; </center><hr><h1>PHashTable Class Reference</h1><code>#include &lt;<a class="el" href="dict_8h-source.html">dict.h</a>&gt;</code><p><p>Inheritance diagram for PHashTable:<p><center><img src="classPHashTable.png" usemap="#PHashTable_map" border="0" alt=""></center><map name="PHashTable_map"><area href="classPCollection.html" alt="PCollection" shape="rect" coords="67,112,192,136"><area href="classPContainer.html" alt="PContainer" shape="rect" coords="67,56,192,80"><area href="classPObject.html" alt="PObject" shape="rect" coords="67,0,192,24"><area href="classPAbstractDictionary.html" alt="PAbstractDictionary" shape="rect" coords="0,224,125,248"><area href="classPAbstractSet.html" alt="PAbstractSet" shape="rect" coords="135,224,260,248"></map><a href="classPHashTable-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0><tr><td></td></tr><tr><td colspan=2><br><h2>Public Methods</h2></td></tr><tr><td colspan="2"><div class="groupHeader">Construction</div></td></tr><tr><td nowrap align=right valign=top>&nbsp;</td><td valign=bottom><a class="el" href="classPHashTable.html#z87_0">PHashTable</a> ()</td></tr><tr><td>&nbsp;</td><td><font size=-1><em>Create a new, empty, hash table.</em> <a href="#z87_0"></a><em></em></font><br><br></td></tr><tr><td colspan="2"><div class="groupHeader">Overrides from class PObject</div></td></tr><tr><td nowrap align=right valign=top>virtual <a class="el" href="classPObject.html#z199_0">Comparison</a>&nbsp;</td><td valign=bottom><a class="el" href="classPHashTable.html#z89_0">Compare</a> (const <a class="el" href="classPObject.html">PObject</a> &amp;obj) const</td></tr><tr><td colspan=2><br><h2>Protected Methods</h2></td></tr><tr><td colspan="2"><div class="groupHeader">Overrides from class PContainer</div></td></tr><tr><td nowrap align=right valign=top>virtual BOOL&nbsp;</td><td valign=bottom><a class="el" href="classPHashTable.html#z91_0">SetSize</a> (PINDEX newSize)</td></tr><tr><td colspan="2"><div class="groupHeader">New functions for class</div></td></tr><tr><td nowrap align=right valign=top>PINLINE BOOL&nbsp;</td><td valign=bottom><a class="el" href="classPHashTable.html#z93_0">AbstractContains</a> (const <a class="el" href="classPObject.html">PObject</a> &amp;key) const</td></tr><tr><td nowrap align=right valign=top>virtual const <a class="el" href="classPObject.html">PObject</a> &amp;&nbsp;</td><td valign=bottom><a class="el" href="classPHashTable.html#z93_1">AbstractGetKeyAt</a> (PINDEX index) const</td></tr><tr><td nowrap align=right valign=top>virtual <a class="el" href="classPObject.html">PObject</a> &amp;&nbsp;</td><td valign=bottom><a class="el" href="classPHashTable.html#z93_2">AbstractGetDataAt</a> (PINDEX index) const</td></tr><tr><td colspan=2><br><h2>Protected Attributes</h2></td></tr><tr><td nowrap align=right valign=top>Table *&nbsp;</td><td valign=bottom><a class="el" href="classPHashTable.html#n0">hashTable</a></td></tr><tr><td colspan=2><br><h2>Friends</h2></td></tr><tr><td nowrap align=right valign=top>class&nbsp;</td><td valign=bottom><a class="el" href="classPHashTable.html#l0">Table</a></td></tr></table><hr><a name="_details"></a><h2>Detailed Description</h2>The hash table class is the basis for implementing the PSet# and PDictionary# classes.<p>The hash table allows for very fast searches for an object based on a "hash function". This function yields an index into an array which is directly looked up to locate the object. When two key values have the same hash function value, then a linear search of a linked list is made to locate the object. Thus the efficiency of the hash table is highly dependent on the quality of the hash function for the data being used as keys. <p><hr><h2>Constructor &amp; Destructor Documentation</h2><a name="z87_0" doxytag="PHashTable::PHashTable"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> PHashTable::PHashTable </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp;          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Create a new, empty, hash table.<p>    </td>  </tr></table><hr><h2>Member Function Documentation</h2><a name="z93_0" doxytag="PHashTable::AbstractContains"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> PINLINE BOOL PHashTable::AbstractContains </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">const <a class="el" href="classPObject.html">PObject</a> &amp;&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp; <em>key</em>          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap> const<code> [protected]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Determine if the value of the object is contained in the hash table. The object values are compared, not the pointers. So the objects in the collection must correctly implement the PObject::Compare()# function. The hash table is used to locate the entry.<p><dl compact><dt><b>Returns: </b></dt><dd> TRUE if the object value is in the set. </dl><dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>key</em>&nbsp;</td><td>Key to look for in the set. </td></tr></table></dl>    </td>  </tr></table><a name="z93_2" doxytag="PHashTable::AbstractGetDataAt"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> virtual <a class="el" href="classPObject.html">PObject</a>&amp; PHashTable::AbstractGetDataAt </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">PINDEX&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp; <em>index</em>          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap> const<code> [protected, virtual]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Get the data in the hash table at the ordinal index position.<p>The ordinal position in the hash table is determined by the hash values of the keys and the order of insertion.<p>The last key/data pair is remembered by the class so that subseqent access is very fast.<p>This function is primarily used by the descendent template classes, or macro, with the appropriate type conversion.<p><dl compact><dt><b>Returns: </b></dt><dd> reference to key at the index position. </dl><dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>index</em>&nbsp;</td><td>Ordinal position in the hash table. </td></tr></table></dl>    </td>  </tr></table><a name="z93_1" doxytag="PHashTable::AbstractGetKeyAt"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> virtual const <a class="el" href="classPObject.html">PObject</a>&amp; PHashTable::AbstractGetKeyAt </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">PINDEX&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp; <em>index</em>          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap> const<code> [protected, virtual]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Get the key in the hash table at the ordinal index position.<p>The ordinal position in the hash table is determined by the hash values of the keys and the order of insertion.<p>The last key/data pair is remembered by the class so that subseqent access is very fast.<p>This function is primarily used by the descendent template classes, or macro, with the appropriate type conversion.<p><dl compact><dt><b>Returns: </b></dt><dd> reference to key at the index position. </dl><dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>index</em>&nbsp;</td><td>Ordinal position in the hash table. </td></tr></table></dl>    </td>  </tr></table><a name="z89_0" doxytag="PHashTable::Compare"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> virtual <a class="el" href="classPObject.html#z199_0">Comparison</a> PHashTable::Compare </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">const <a class="el" href="classPObject.html">PObject</a> &amp;&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp; <em>obj</em>          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap> const<code> [virtual]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Get the relative rank of the two hash tables. Actally ranking hash tables is really meaningless, so only equality is returned by the comparison. Equality is only achieved if the two instances reference the same hash table.<p><dl compact><dt><b>Returns: </b></dt><dd> comparison of the two objects, <a class="el" href="classPObject.html#z199_0s1">EqualTo</a># if the same reference and <a class="el" href="classPObject.html#z199_0s2">GreaterThan</a># if not. </dl><dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>obj</em>&nbsp;</td><td>Other PHashTable to compare against. </td></tr></table></dl><p>Reimplemented from <a class="el" href="classPObject.html#z199_1">PObject</a>.    </td>  </tr></table><a name="z91_0" doxytag="PHashTable::SetSize"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> virtual BOOL PHashTable::SetSize </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">PINDEX&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp; <em>newSize</em>          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap><code> [protected, virtual]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>This function is meaningless for hash table. The size of the collection is determined by the addition and removal of objects. The size cannot be set in any other way.<p><dl compact><dt><b>Returns: </b></dt><dd> Always TRUE. </dl><dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>newSize</em>&nbsp;</td><td>New size for the hash table, this is ignored. </td></tr></table></dl><p>Implements <a class="el" href="classPContainer.html#z69_1">PContainer</a>.    </td>  </tr></table><hr><h2>Friends And Related Function Documentation</h2><a name="l0" doxytag="PHashTable::Table"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> friend class Table<code> [friend]</code>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>    </td>  </tr></table><hr><h2>Member Data Documentation</h2><a name="n0" doxytag="PHashTable::hashTable"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> Table* PHashTable::hashTable<code> [protected]</code>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>    </td>  </tr></table><hr>The documentation for this class was generated from the following files:<ul><li><a class="el" href="dict_8h-source.html">dict.h</a><li><a class="el" href="contain_8inl.html">contain.inl</a></ul><hr><address style="align: right;"><small>Generated on Wed Sep 29 22:44:15 2004 for PWLib by<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border=0 width=110 height=53></a>1.2.18 </small></address></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -