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

📄 classpsafedictionarybase.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> TemplatePSafeDictionaryBase&lt; Coll, Key, Base &gt; 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>PSafeDictionaryBase&lt; Coll, Key, Base &gt; Class Template Reference</h1><code>#include &lt;<a class="el" href="safecoll_8h-source.html">safecoll.h</a>&gt;</code><p><p>Inheritance diagram for PSafeDictionaryBase&lt; Coll, Key, Base &gt;:<p><center><img src="classPSafeDictionaryBase.png" usemap="#PSafeDictionaryBase< Coll, Key, Base >_map" border="0" alt=""></center><map name="PSafeDictionaryBase< Coll, Key, Base >_map"><area href="classPSafeCollection.html" alt="PSafeCollection" shape="rect" coords="0,56,246,80"><area href="classPObject.html" alt="PObject" shape="rect" coords="0,0,246,24"></map><a href="classPSafeDictionaryBase-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="classPSafeDictionaryBase.html#z341_0">PSafeDictionaryBase</a> ()</td></tr><tr><td colspan="2"><div class="groupHeader">Operations</div></td></tr><tr><td nowrap align=right valign=top>virtual void&nbsp;</td><td valign=bottom><a class="el" href="classPSafeDictionaryBase.html#z343_0">SetAt</a> (const Key &amp;key, Base *obj)</td></tr><tr><td nowrap align=right valign=top>virtual BOOL&nbsp;</td><td valign=bottom><a class="el" href="classPSafeDictionaryBase.html#z343_1">RemoveAt</a> (const Key &amp;key)</td></tr><tr><td nowrap align=right valign=top>virtual BOOL&nbsp;</td><td valign=bottom><a class="el" href="classPSafeDictionaryBase.html#z343_2">Contains</a> (const Key &amp;key)</td></tr><tr><td nowrap align=right valign=top>virtual <a class="el" href="classPSafePtr.html">PSafePtr</a>&lt; Base &gt;&nbsp;</td><td valign=bottom><a class="el" href="classPSafeDictionaryBase.html#z343_3">GetAt</a> (PINDEX idx, <a class="el" href="safecoll_8h.html#a4">PSafetyMode</a> mode=PSafeReadWrite)</td></tr><tr><td nowrap align=right valign=top>virtual <a class="el" href="classPSafePtr.html">PSafePtr</a>&lt; Base &gt;&nbsp;</td><td valign=bottom><a class="el" href="classPSafeDictionaryBase.html#z343_4">FindWithLock</a> (const Key &amp;key, <a class="el" href="safecoll_8h.html#a4">PSafetyMode</a> mode=PSafeReadWrite)</td></tr></table><hr><a name="_details"></a><h2>Detailed Description</h2><h3>template&lt;class Coll, class Key, class Base&gt;<br> class PSafeDictionaryBase&lt; Coll, Key, Base &gt;</h3>This class defines a thread-safe dictionary of objects.<p>This is part of a set of classes to solve the general problem of a collection (eg a PList or PDictionary) of objects that needs to be a made thread safe. Any thread can add, read, write or remove an object with both the object and the database of objects itself kept thread safe.<p>See the <a class="el" href="classPSafeObject.html">PSafeObject</a> class for more details. Especially in regard to enumeration of collections. <p><hr><h2>Constructor &amp; Destructor Documentation</h2><a name="z341_0" doxytag="PSafeDictionaryBase::PSafeDictionaryBase"></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" colspan="4">template&lt;class Coll, class Key, class Base&gt; </td>        </tr>        <tr>          <td class="md" nowrap valign="top"> PSafeDictionaryBase&lt; Coll, Key, Base &gt;::PSafeDictionaryBase </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> [inline]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Create a safe dictionary wrapper around the real collection.     </td>  </tr></table><hr><h2>Member Function Documentation</h2><a name="z343_2" doxytag="PSafeDictionaryBase::Contains"></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" colspan="4">template&lt;class Coll, class Key, class Base&gt; </td>        </tr>        <tr>          <td class="md" nowrap valign="top"> virtual BOOL PSafeDictionaryBase&lt; Coll, Key, Base &gt;::Contains </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">const Key &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><code> [inline, virtual]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Determine of the dictionary contains an entry for the key.     </td>  </tr></table><a name="z343_4" doxytag="PSafeDictionaryBase::FindWithLock"></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" colspan="4">template&lt;class Coll, class Key, class Base&gt; </td>        </tr>        <tr>          <td class="md" nowrap valign="top"> virtual <a class="el" href="classPSafePtr.html">PSafePtr</a>&lt;Base&gt; PSafeDictionaryBase&lt; Coll, Key, Base &gt;::FindWithLock </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">const Key &amp;&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>key</em>, </td>        </tr>        <tr>          <td></td>          <td></td>          <td class="md" nowrap><a class="el" href="safecoll_8h.html#a4">PSafetyMode</a>&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>mode</em> = PSafeReadWrite</td>        </tr>        <tr>          <td></td>          <td class="md">)&nbsp;</td>          <td class="md" colspan="2"><code> [inline, virtual]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Find the instance in the collection of an object with the same value. The returned safe pointer will increment the reference count on the <a class="el" href="classPSafeObject.html">PSafeObject</a> and lock to the object in the mode specified. The lock will remain until the <a class="el" href="classPSafePtr.html">PSafePtr</a> goes out of scope.     </td>  </tr></table><a name="z343_3" doxytag="PSafeDictionaryBase::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" colspan="4">template&lt;class Coll, class Key, class Base&gt; </td>        </tr>        <tr>          <td class="md" nowrap valign="top"> virtual <a class="el" href="classPSafePtr.html">PSafePtr</a>&lt;Base&gt; PSafeDictionaryBase&lt; Coll, Key, Base &gt;::GetAt </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">PINDEX&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>idx</em>, </td>        </tr>        <tr>          <td></td>          <td></td>          <td class="md" nowrap><a class="el" href="safecoll_8h.html#a4">PSafetyMode</a>&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>mode</em> = PSafeReadWrite</td>        </tr>        <tr>          <td></td>          <td class="md">)&nbsp;</td>          <td class="md" colspan="2"><code> [inline, virtual]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Get the instance in the collection of the index. The returned safe pointer will increment the reference count on the <a class="el" href="classPSafeObject.html">PSafeObject</a> and lock to the object in the mode specified. The lock will remain until the <a class="el" href="classPSafePtr.html">PSafePtr</a> goes out of scope.     </td>  </tr></table><a name="z343_1" doxytag="PSafeDictionaryBase::RemoveAt"></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" colspan="4">template&lt;class Coll, class Key, class Base&gt; </td>        </tr>        <tr>          <td class="md" nowrap valign="top"> virtual BOOL PSafeDictionaryBase&lt; Coll, Key, Base &gt;::RemoveAt </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">const Key &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><code> [inline, virtual]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Remove an object to the collection. This function removes the object from the collection itself, but does not actually delete the object. It simply moves the object to a list of objects to be garbage collected at a later time.<p>As for Append() full mutual exclusion locking on the collection itself is maintained. <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 fund object to delete </td></tr></table></dl>    </td>  </tr></table><a name="z343_0" doxytag="PSafeDictionaryBase::SetAt"></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" colspan="4">template&lt;class Coll, class Key, class Base&gt; </td>        </tr>        <tr>          <td class="md" nowrap valign="top"> virtual void PSafeDictionaryBase&lt; Coll, Key, Base &gt;::SetAt </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">const Key &amp;&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>key</em>, </td>        </tr>        <tr>          <td></td>          <td></td>          <td class="md" nowrap>Base *&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>obj</em></td>        </tr>        <tr>          <td></td>          <td class="md">)&nbsp;</td>          <td class="md" colspan="2"><code> [inline, virtual]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Add an object to the collection. This uses the <a class="el" href="classPCollection.html#z75_0">PCollection::Append()</a> function to add the object to the collection, with full mutual exclusion locking on the collection.     </td>  </tr></table><hr>The documentation for this class was generated from the following file:<ul><li><a class="el" href="safecoll_8h-source.html">safecoll.h</a></ul><hr><address style="align: right;"><small>Generated on Wed Sep 29 22:44:18 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 + -