📄 classpabstractdictionary.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>PAbstractDictionary 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> <a class="qindex" href="namespaces.html">Namespace List</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center><hr><h1>PAbstractDictionary Class Reference</h1><code>#include <<a class="el" href="dict_8h-source.html">dict.h</a>></code><p><p>Inheritance diagram for PAbstractDictionary:<p><center><img src="classPAbstractDictionary.png" usemap="#PAbstractDictionary_map" border="0" alt=""></center><map name="PAbstractDictionary_map"><area href="classPHashTable.html" alt="PHashTable" shape="rect" coords="0,168,125,192"><area href="classPCollection.html" alt="PCollection" shape="rect" coords="0,112,125,136"><area href="classPContainer.html" alt="PContainer" shape="rect" coords="0,56,125,80"><area href="classPObject.html" alt="PObject" shape="rect" coords="0,0,125,24"></map><a href="classPAbstractDictionary-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>PINLINE </td><td valign=bottom><a class="el" href="classPAbstractDictionary.html#z99_0">PAbstractDictionary</a> ()</td></tr><tr><td colspan="2"><div class="groupHeader">Overrides from class PObject</div></td></tr><tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classPAbstractDictionary.html#z101_0">PrintOn</a> (ostream &strm) const</td></tr><tr><td colspan="2"><div class="groupHeader">Overrides from class PCollection</div></td></tr><tr><td nowrap align=right valign=top>virtual PINDEX </td><td valign=bottom><a class="el" href="classPAbstractDictionary.html#z103_0">Insert</a> (const <a class="el" href="classPObject.html">PObject</a> &key, <a class="el" href="classPObject.html">PObject</a> *obj)</td></tr><tr><td nowrap align=right valign=top>virtual PINDEX </td><td valign=bottom><a class="el" href="classPAbstractDictionary.html#z103_1">InsertAt</a> (PINDEX index, <a class="el" href="classPObject.html">PObject</a> *obj)</td></tr><tr><td nowrap align=right valign=top>virtual <a class="el" href="classPObject.html">PObject</a> * </td><td valign=bottom><a class="el" href="classPAbstractDictionary.html#z103_2">RemoveAt</a> (PINDEX index)</td></tr><tr><td nowrap align=right valign=top>virtual BOOL </td><td valign=bottom><a class="el" href="classPAbstractDictionary.html#z103_3">SetAt</a> (PINDEX index, <a class="el" href="classPObject.html">PObject</a> *val)</td></tr><tr><td nowrap align=right valign=top>virtual <a class="el" href="classPObject.html">PObject</a> * </td><td valign=bottom><a class="el" href="classPAbstractDictionary.html#z103_4">GetAt</a> (PINDEX index) const</td></tr><tr><td nowrap align=right valign=top>virtual PINDEX </td><td valign=bottom><a class="el" href="classPAbstractDictionary.html#z103_5">GetObjectsIndex</a> (const <a class="el" href="classPObject.html">PObject</a> *obj) const</td></tr><tr><td nowrap align=right valign=top>virtual PINDEX </td><td valign=bottom><a class="el" href="classPAbstractDictionary.html#z103_6">GetValuesIndex</a> (const <a class="el" href="classPObject.html">PObject</a> &obj) const</td></tr><tr><td colspan="2"><div class="groupHeader">New functions for class</div></td></tr><tr><td nowrap align=right valign=top>virtual BOOL </td><td valign=bottom><a class="el" href="classPAbstractDictionary.html#z105_0">SetDataAt</a> (PINDEX index, <a class="el" href="classPObject.html">PObject</a> *obj)</td></tr><tr><td nowrap align=right valign=top>virtual BOOL </td><td valign=bottom><a class="el" href="classPAbstractDictionary.html#z105_1">AbstractSetAt</a> (const <a class="el" href="classPObject.html">PObject</a> &key, <a class="el" href="classPObject.html">PObject</a> *obj)</td></tr><tr><td nowrap align=right valign=top>virtual <a class="el" href="classPObject.html">PObject</a> & </td><td valign=bottom><a class="el" href="classPAbstractDictionary.html#z105_2">GetRefAt</a> (const <a class="el" href="classPObject.html">PObject</a> &key) const</td></tr><tr><td nowrap align=right valign=top>virtual <a class="el" href="classPObject.html">PObject</a> * </td><td valign=bottom><a class="el" href="classPAbstractDictionary.html#z105_3">AbstractGetAt</a> (const <a class="el" href="classPObject.html">PObject</a> &key) const</td></tr><tr><td colspan=2><br><h2>Protected Methods</h2></td></tr><tr><td nowrap align=right valign=top>PINLINE </td><td valign=bottom><a class="el" href="classPAbstractDictionary.html#b0">PAbstractDictionary</a> (int dummy, const PAbstractDictionary *c)</td></tr></table><hr><a name="_details"></a><h2>Detailed Description</h2>An abstract dictionary container. <p><hr><h2>Constructor & Destructor Documentation</h2><a name="z99_0" doxytag="PAbstractDictionary::PAbstractDictionary"></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 PAbstractDictionary::PAbstractDictionary </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Create a new, empty, dictionary.<p>Note that by default, objects placed into the dictionary will be deleted when removed or when all references to the dictionary are destroyed. </td> </tr></table><a name="b0" doxytag="PAbstractDictionary::PAbstractDictionary"></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 PAbstractDictionary::PAbstractDictionary </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">int </td> <td class="mdname" nowrap> <em>dummy</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>const PAbstractDictionary * </td> <td class="mdname" nowrap> <em>c</em></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"><code> [protected]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p> </td> </tr></table><hr><h2>Member Function Documentation</h2><a name="z105_3" doxytag="PAbstractDictionary::AbstractGetAt"></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>* PAbstractDictionary::AbstractGetAt </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const <a class="el" href="classPObject.html">PObject</a> & </td> <td class="mdname1" valign="top" nowrap> <em>key</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap> const<code> [virtual]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Get the object at the specified key position. If the key was not in the collection then NULL is returned.<p><dl compact><dt><b>Returns: </b></dt><dd> pointer to object at the specified key. </dl><dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>key</em> </td><td>Key for position in dictionary to get object. </td></tr></table></dl> </td> </tr></table><a name="z105_1" doxytag="PAbstractDictionary::AbstractSetAt"></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 PAbstractDictionary::AbstractSetAt </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const <a class="el" href="classPObject.html">PObject</a> & </td> <td class="mdname" nowrap> <em>key</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap><a class="el" href="classPObject.html">PObject</a> * </td> <td class="mdname" nowrap> <em>obj</em></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"><code> [virtual]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Add a new object to the collection. If the objects value is already in the dictionary then the object is overrides the previous value. If the AllowDeleteObjects option is set then the old object is also deleted.<p>The object is placed in the an ordinal position dependent on the keys hash function. Subsequent searches use the has function to speed access to the data item.<p><dl compact><dt><b>Returns: </b></dt><dd> TRUE if the object was successfully added. </dl><dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>obj</em> </td><td>Key for position in dictionary to add object. New object to put into the dictionary. </td></tr></table></dl> </td> </tr></table><a name="z103_4" doxytag="PAbstractDictionary::GetAt"></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>* PAbstractDictionary::GetAt </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">PINDEX </td> <td class="mdname1" valign="top" nowrap> <em>index</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap> const<code> [virtual]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Get the object at the specified index position. The index is as is used in the GetKeyAt()# function. If the index was not in the collection then NULL is returned.<p><dl compact><dt><b>Returns: </b></dt><dd> pointer to object at the specified index. </dl><dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>index</em> </td><td>Index position in the collection of the object. </td></tr></table></dl><p>Implements <a class="el" href="classPCollection.html#z75_7">PCollection</a>. </td> </tr></table><a name="z103_5" doxytag="PAbstractDictionary::GetObjectsIndex"></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 PINDEX PAbstractDictionary::GetObjectsIndex </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const <a class="el" href="classPObject.html">PObject</a> * </td> <td class="mdname1" valign="top" nowrap> <em>obj</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap> const<code> [virtual]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Search the collection for the specific instance of the object. The object pointers are compared, not the values. The hash table is used to locate the entry.<p>Note that that will require value comparisons to be made to find the equivalent entry and then a final check is made with the pointers to see if they are the same instance.<p><dl compact><dt><b>Returns: </b></dt><dd> ordinal index position of the object, or P_MAX_INDEX. </dl><dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>obj</em> </td><td>Object to find. </td></tr></table></dl><p>Implements <a class="el" href="classPCollection.html#z75_8">PCollection</a>. </td> </tr></table><a name="z105_2" doxytag="PAbstractDictionary::GetRefAt"></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>& PAbstractDictionary::GetRefAt </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const <a class="el" href="classPObject.html">PObject</a> & </td> <td class="mdname1" valign="top" nowrap> <em>key</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap> const<code> [virtual]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Get the object at the specified key position. If the key was not in the collection then this function asserts.<p>This function is primarily for use by the operator[]# function is descendent template classes.<p><dl compact><dt><b>Returns: </b></dt><dd> reference to object at the specified key. </dl><dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>key</em> </td><td>Key for position in dictionary to get object. </td></tr></table></dl> </td> </tr></table>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -