📄 classpsafedictionarybase.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< Coll, Key, Base > 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>PSafeDictionaryBase< Coll, Key, Base > Class Template Reference</h1><code>#include <<a class="el" href="safecoll_8h-source.html">safecoll.h</a>></code><p><p>Inheritance diagram for PSafeDictionaryBase< Coll, Key, Base >:<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> </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 </td><td valign=bottom><a class="el" href="classPSafeDictionaryBase.html#z343_0">SetAt</a> (const Key &key, Base *obj)</td></tr><tr><td nowrap align=right valign=top>virtual BOOL </td><td valign=bottom><a class="el" href="classPSafeDictionaryBase.html#z343_1">RemoveAt</a> (const Key &key)</td></tr><tr><td nowrap align=right valign=top>virtual BOOL </td><td valign=bottom><a class="el" href="classPSafeDictionaryBase.html#z343_2">Contains</a> (const Key &key)</td></tr><tr><td nowrap align=right valign=top>virtual <a class="el" href="classPSafePtr.html">PSafePtr</a>< Base > </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>< Base > </td><td valign=bottom><a class="el" href="classPSafeDictionaryBase.html#z343_4">FindWithLock</a> (const Key &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<class Coll, class Key, class Base><br> class PSafeDictionaryBase< Coll, Key, Base ></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 & 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<class Coll, class Key, class Base> </td> </tr> <tr> <td class="md" nowrap valign="top"> PSafeDictionaryBase< Coll, Key, Base >::PSafeDictionaryBase </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap><code> [inline]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </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<class Coll, class Key, class Base> </td> </tr> <tr> <td class="md" nowrap valign="top"> virtual BOOL PSafeDictionaryBase< Coll, Key, Base >::Contains </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const Key & </td> <td class="mdname1" valign="top" nowrap> <em>key</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap><code> [inline, virtual]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </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<class Coll, class Key, class Base> </td> </tr> <tr> <td class="md" nowrap valign="top"> virtual <a class="el" href="classPSafePtr.html">PSafePtr</a><Base> PSafeDictionaryBase< Coll, Key, Base >::FindWithLock </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const Key & </td> <td class="mdname" nowrap> <em>key</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap><a class="el" href="safecoll_8h.html#a4">PSafetyMode</a> </td> <td class="mdname" nowrap> <em>mode</em> = PSafeReadWrite</td> </tr> <tr> <td></td> <td class="md">) </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> </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<class Coll, class Key, class Base> </td> </tr> <tr> <td class="md" nowrap valign="top"> virtual <a class="el" href="classPSafePtr.html">PSafePtr</a><Base> PSafeDictionaryBase< Coll, Key, Base >::GetAt </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">PINDEX </td> <td class="mdname" nowrap> <em>idx</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap><a class="el" href="safecoll_8h.html#a4">PSafetyMode</a> </td> <td class="mdname" nowrap> <em>mode</em> = PSafeReadWrite</td> </tr> <tr> <td></td> <td class="md">) </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> </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<class Coll, class Key, class Base> </td> </tr> <tr> <td class="md" nowrap valign="top"> virtual BOOL PSafeDictionaryBase< Coll, Key, Base >::RemoveAt </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const Key & </td> <td class="mdname1" valign="top" nowrap> <em>key</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap><code> [inline, virtual]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </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> </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<class Coll, class Key, class Base> </td> </tr> <tr> <td class="md" nowrap valign="top"> virtual void PSafeDictionaryBase< Coll, Key, Base >::SetAt </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const Key & </td> <td class="mdname" nowrap> <em>key</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>Base * </td> <td class="mdname" nowrap> <em>obj</em></td> </tr> <tr> <td></td> <td class="md">) </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> </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 + -