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

📄 classpcontainer.html

📁 pwlib开发文档
💻 HTML
📖 第 1 页 / 共 2 页
字号:
      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Destroy the container contents. This function must be defined by the descendent class to do the actual destruction of the contents. It is automatically declared when the PDECLARE_CONTAINER()# macro is used.<p>For all descendent classes not immediately inheriting off the PContainer itself, the implementation of <a class="el" href="classPContainer.html#b1">DestroyContents()</a> should always call its ancestors function. This is especially relevent if many of the standard container classes, such as arrays, are descended from as memory leaks will occur.     </td>  </tr></table><a name="b5" doxytag="PContainer::Destruct"></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"> void PContainer::Destruct </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><code> [protected]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Internal function called from container destructors. This will conditionally call <a class="el" href="classPContainer.html#b1">DestroyContents()</a># to destroy the container contents.     </td>  </tr></table><a name="z69_0" doxytag="PContainer::GetSize"></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 PINDEX PContainer::GetSize </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><code> [virtual]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Get the current size of the container. This represents the number of things the container contains. For some types of containers this will always return 1.<p><dl compact><dt><b>Returns: </b></dt><dd>number of objects in container. </dl>    </td>  </tr></table><a name="z69_3" doxytag="PContainer::IsEmpty"></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 PContainer::IsEmpty </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><code> [virtual]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Determine if the container is empty. Determine if the container that this object references contains any elements.<p><dl compact><dt><b>Returns: </b></dt><dd>TRUE if <a class="el" href="classPContainer.html#z69_0">GetSize()</a># returns zero. </dl>    </td>  </tr></table><a name="z69_4" doxytag="PContainer::IsUnique"></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 PContainer::IsUnique </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>Determine if container is unique reference. Determine if this instance is the one and only reference to the container contents.<p><dl compact><dt><b>Returns: </b></dt><dd>TRUE if the reference count is one. </dl>    </td>  </tr></table><a name="z69_5" doxytag="PContainer::MakeUnique"></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 PContainer::MakeUnique </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><code> [virtual]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Make this instance to be the one and only reference to the container contents. This implicitly does a clone of the contents of the container to make a unique reference. If the instance was already unique then the function does nothing.<p><dl compact><dt><b>Returns: </b></dt><dd> TRUE if the instance was already unique. </dl>    </td>  </tr></table><a name="z67_2" doxytag="PContainer::operator="></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 PContainer &amp; PContainer::operator= </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">const PContainer &amp;&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp; <em>cont</em>          </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>Assign one container reference to another. Set the current container to reference the same thing as the container specified in the parameter.<p>Note that the old contents of the container is dereferenced and if it was unique, destroyed using the <a class="el" href="classPContainer.html#b1">DestroyContents()</a> function. <dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>cont</em>&nbsp;</td><td>Container to create a new reference from. </td></tr></table></dl>    </td>  </tr></table><a name="z69_2" doxytag="PContainer::SetMinSize"></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"> BOOL PContainer::SetMinSize </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>minSize</em>          </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>Set the minimum size of container. This function will set the size of the object to be at least the size specified. The <a class="el" href="classPContainer.html#z69_1">SetSize()</a># function is always called, either with the new value or the previous size, whichever is the larger. <dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>minSize</em>&nbsp;</td><td>Possible, new size for the container. </td></tr></table></dl>    </td>  </tr></table><a name="z69_1" doxytag="PContainer::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 PContainer::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> [pure virtual]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Set the new current size of the container. The exact behavious of this is determined by the descendent class. For instance an array class would reallocate memory to make space for the new number of elements.<p>Note for some types of containers this does not do anything as they inherently only contain one item. The function returns TRUE always and the new value is ignored.<p><dl compact><dt><b>Returns: </b></dt><dd> TRUE if the size was successfully changed. The value FALSE usually indicates failure due to insufficient memory. </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 container. </td></tr></table></dl><p>Implemented in <a class="el" href="classPAbstractArray.html#z23_0">PAbstractArray</a>, <a class="el" href="classPHashTable.html#z91_0">PHashTable</a>, <a class="el" href="classPAbstractList.html#z173_0">PAbstractList</a>, and <a class="el" href="classPAbstractSortedList.html#z181_0">PAbstractSortedList</a>.    </td>  </tr></table><hr><h2>Member Data Documentation</h2><a name="n0" doxytag="PContainer::reference"></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"> class <a class="el" href="classPContainer_1_1Reference.html">PContainer::Reference</a> *  PContainer::reference<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="contain_8h-source.html">contain.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 + -