Logo Search packages:      
Sourcecode: pwlib version File versions  Download package

PSafeDictionaryBase< Coll, Key, Base > Class Template Reference

#include <safecoll.h>

Inheritance diagram for PSafeDictionaryBase< Coll, Key, Base >:

PSafeCollection PObject

List of all members.


Detailed Description

template<class Coll, class Key, class Base>
class PSafeDictionaryBase< Coll, Key, Base >

This class defines a thread-safe dictionary of objects.

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.

See the PSafeObject class for more details. Especially in regard to enumeration of collections.

Definition at line 960 of file safecoll.h.


Operations

void AllowDeleteObjects (BOOL yes=TRUE)
virtual void DeleteObject (PObject *object) const
virtual BOOL DeleteObjectsToBeRemoved ()
void DisallowDeleteObjects ()
const PMutexGetMutex () const
PINDEX GetSize () const
BOOL IsEmpty () const
virtual void RemoveAll (BOOL synchronous=FALSE)
virtual void SetAutoDeleteObjects ()
virtual BOOL SafeRemove (PSafeObject *obj)
virtual BOOL SafeRemoveAt (PINDEX idx)

Comparison functions

virtual Comparison Compare (const PObject &obj) const
virtual Comparison CompareObjectMemoryDirect (const PObject &obj) const
bool operator!= (const PObject &obj) const
bool operator< (const PObject &obj) const
bool operator<= (const PObject &obj) const
bool operator== (const PObject &obj) const
bool operator> (const PObject &obj) const
bool operator>= (const PObject &obj) const
enum  Comparison { LessThan = -1, EqualTo = 0, GreaterThan = 1 }

Run Time Type functions

virtual const char * GetClass (unsigned=0) const
virtual BOOL InternalIsDescendant (const char *clsName) const
BOOL IsClass (const char *cls) const
static const char * Class ()

I/O functions

virtual void PrintOn (ostream &strm) const
virtual void ReadFrom (istream &strm)
ostream & operator<< (ostream &strm, const PObject &obj)
istream & operator>> (istream &strm, PObject &obj)

Public Member Functions

Miscellaneous functions
virtual PObjectClone () const
virtual PINDEX HashFunction () const
Operations
virtual BOOL Contains (const Key &key)
virtual PSafePtr< Base > FindWithLock (const Key &key, PSafetyMode mode=PSafeReadWrite)
virtual PSafePtr< Base > GetAt (PINDEX idx, PSafetyMode mode=PSafeReadWrite)
virtual BOOL RemoveAt (const Key &key)
virtual void SetAt (const Key &key, Base *obj)
Construction
 PSafeDictionaryBase ()

Protected Member Functions

 PDECLARE_NOTIFIER (PTimer, PSafeCollection, DeleteObjectsTimeout)
void SafeRemoveObject (PSafeObject *obj)

Protected Attributes

PCollectioncollection
PMutex collectionMutex
BOOL deleteObjects
PTimer deleteObjectsTimer
PMutex removalMutex
PList< PSafeObjecttoBeRemoved

Private Member Functions

 PCLASSINFO (PSafeDictionaryBase, PSafeCollection)

Friends

class PSafePtrBase

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index