📄 classpcollection.html
字号:
</tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Disallow the deletion of the objects contained in the collection. See the <a class="el" href="classPCollection.html#z75_10">AllowDeleteObjects()</a># function for more details. </td> </tr></table><a name="z75_7" doxytag="PCollection::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>* PCollection::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> [pure 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 ordinal position. If the index was greater than the size of 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>Implemented in <a class="el" href="classPAbstractSet.html#z97_5">PAbstractSet</a>, <a class="el" href="classPAbstractDictionary.html#z103_4">PAbstractDictionary</a>, <a class="el" href="classPAbstractList.html#z175_7">PAbstractList</a>, and <a class="el" href="classPAbstractSortedList.html#z183_7">PAbstractSortedList</a>. </td> </tr></table><a name="z75_8" doxytag="PCollection::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 PCollection::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> [pure 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 fastest search algorithm is employed depending on the collection type.<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 search for. </td></tr></table></dl><p>Implemented in <a class="el" href="classPAbstractSet.html#z97_7">PAbstractSet</a>, <a class="el" href="classPAbstractDictionary.html#z103_5">PAbstractDictionary</a>, <a class="el" href="classPAbstractList.html#z175_8">PAbstractList</a>, and <a class="el" href="classPAbstractSortedList.html#z183_8">PAbstractSortedList</a>. </td> </tr></table><a name="z75_9" doxytag="PCollection::GetValuesIndex"></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 PCollection::GetValuesIndex </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> [pure 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 specified value of the object. The object values are compared, not the pointers. So the objects in the collection must correctly implement the PObject::Compare()# function. The fastest search algorithm is employed depending on the collection type.<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 search for. </td></tr></table></dl><p>Implemented in <a class="el" href="classPAbstractSet.html#z97_8">PAbstractSet</a>, <a class="el" href="classPAbstractDictionary.html#z103_6">PAbstractDictionary</a>, <a class="el" href="classPAbstractList.html#z175_9">PAbstractList</a>, and <a class="el" href="classPAbstractSortedList.html#z183_9">PAbstractSortedList</a>. </td> </tr></table><a name="z75_1" doxytag="PCollection::Insert"></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 PCollection::Insert </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>before</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> [pure virtual]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Insert a new object immediately before the specified object. If the object to insert before is not in the collection then the equivalent of the <a class="el" href="classPCollection.html#z75_0">Append()</a># function is performed.<p>The exact semantics depends on the specific type of the collection. So the function may not place the object before the specified object at all. For example, in a PSortedList# the object is placed in the correct ordinal position in the list.<p>Note that the object values are compared for the search of the before# parameter, not the pointers. So the objects in the collection must correctly implement the PObject::Compare()# function.<p><dl compact><dt><b>Returns: </b></dt><dd>index of the newly inserted object. </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 value to insert before. New object to place into the collection. </td></tr></table></dl><p>Implemented in <a class="el" href="classPAbstractSet.html#z97_1">PAbstractSet</a>, <a class="el" href="classPAbstractDictionary.html#z103_0">PAbstractDictionary</a>, <a class="el" href="classPAbstractList.html#z175_1">PAbstractList</a>, and <a class="el" href="classPAbstractSortedList.html#z183_1">PAbstractSortedList</a>. </td> </tr></table><a name="z75_2" doxytag="PCollection::InsertAt"></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 PCollection::InsertAt </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">PINDEX </td> <td class="mdname" nowrap> <em>index</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> [pure virtual]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Insert a new object at the specified ordinal index. If the index is greater than the number of objects in the collection then the equivalent of the <a class="el" href="classPCollection.html#z75_0">Append()</a># function is performed.<p>The exact semantics depends on the specific type of the collection. So the function may not place the object at the specified index at all. For example, in a PSortedList# the object is placed in the correct ordinal position in the list.<p><dl compact><dt><b>Returns: </b></dt><dd>index of the newly inserted object. </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>Index position in collection to place the object. New object to place into the collection. </td></tr>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -