All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PSafeArray< Base > Class Template Reference

This class defines a thread-safe array of objects. More...

`#include <safecoll.h>`

Inheritance diagram for PSafeArray< Base >:

## Public Types

typedef PSafePtr< Base > | value_type
Public Types inherited from PObject
enum | Comparison { LessThan = -1, EqualTo = 0, GreaterThan = 1 }
| Result of the comparison operation performed by the `Compare()` function. More...

## Additional Inherited Members

Public Member Functions inherited from PSafeColl< PArray< Base >, Base >
| PSafeColl ()
| Create a safe list collection wrapper around the real collection. More...
| PSafeColl (const PSafeColl &other)
| Copy constructor for safe collection. More...
PSafeColl & | operator= (const PSafeColl &other)
| Assign one safe collection to another. More...
virtual PSafePtr< Base > | Append (Base *obj, PSafetyMode mode=PSafeReference)
| Add an object to the collection. More...
virtual PBoolean | Remove (Base *obj)
| Remove an object to the collection. More...
virtual PBoolean | RemoveAt (PINDEX idx)
| Remove an object to the collection. More...
virtual PSafePtr< Base > | GetAt (PINDEX idx, PSafetyMode mode=PSafeReadWrite)
| Get the instance in the collection of the index. More...
virtual PSafePtr< Base > | FindWithLock (const Base &value, PSafetyMode mode=PSafeReadWrite)
| Find the instance in the collection of an object with the same value. More...
Public Member Functions inherited from PSafeCollection
| PSafeCollection (PCollection *collection)
| Create a thread safe collection of objects. More...
| ~PSafeCollection ()
| Destroy the thread safe collection. More...
virtual void | RemoveAll (PBoolean synchronous=false)
| Remove all objects in collection. More...
void | AllowDeleteObjects (PBoolean yes=true)
| Disallow the automatic delete any objects that have been removed. More...
void | DisallowDeleteObjects ()
| Disallow the automatic delete any objects that have been removed. More...
virtual PBoolean | DeleteObjectsToBeRemoved ()
| Delete any objects that have been removed. More...
virtual void | DeleteObject (PObject *object) const
| Delete an objects that has been removed. More...
virtual void | SetAutoDeleteObjects ()
| Start a timer to automatically call DeleteObjectsToBeRemoved(). More...
PINDEX | GetSize () const
| Get the current size of the collection. More...
PBoolean | IsEmpty () const
| Determine if the collection is empty. More...
const PMutex & | GetMutex () const
| Get the mutex for the collection. More...
Public Member Functions inherited from PObject
virtual | ~PObject ()
virtual PObject * | Clone () const
| Create a copy of the class on the heap. More...
virtual PINDEX | HashFunction () const
| This function yields a hash value required by the `PDictionary` class. More...
virtual const char * | GetClass (unsigned ancestor=0) const
| Get the current dynamic type of the object instance. More...
PBoolean | IsClass (const char *cls) const
virtual PBoolean | InternalIsDescendant (const char *clsName) const
| Determine if the dynamic type of the current instance is a descendent of the specified class. More...
virtual Comparison | Compare (const PObject &obj) const
| Compare the two objects and return their relative rank. More...
virtual Comparison | CompareObjectMemoryDirect (const PObject &obj) const
| Determine the byte wise comparison of two objects. More...
bool | operator== (const PObject &obj) const
| Compare the two objects. More...
bool | operator!= (const PObject &obj) const
| Compare the two objects. More...
bool | operator< (const PObject &obj) const
| Compare the two objects. More...
bool | operator> (const PObject &obj) const
| Compare the two objects. More...
bool | operator<= (const PObject &obj) const
| Compare the two objects. More...
bool | operator>= (const PObject &obj) const
| Compare the two objects. More...
virtual void | PrintOn (ostream &strm) const
| Output the contents of the object to the stream. More...
virtual void | ReadFrom (istream &strm)
| Input the contents of the object from the stream. More...
Static Public Member Functions inherited from PObject
static const char * | Class ()
| Get the name of the class as a C string. More...
static Comparison | InternalCompareObjectMemoryDirect (const PObject *obj1, const PObject *obj2, PINDEX size)
| Internal function caled from CompareObjectMemoryDirect() More...
Protected Member Functions inherited from PSafeCollection
void | CopySafeCollection (PCollection *other)
void | CopySafeDictionary (PAbstractDictionary *other)
void | SafeRemoveObject (PSafeObject *obj)
| PDECLARE_NOTIFIER (PTimer, PSafeCollection, DeleteObjectsTimeout)
virtual PBoolean | SafeRemove (PSafeObject *obj)
| Remove an object to the collection. More...
virtual PBoolean | SafeRemoveAt (PINDEX idx)
| Remove an object to the collection. More...
Protected Member Functions inherited from PObject
| PObject ()
| Constructor for PObject, made protected so cannot ever create one on its own. More...
Protected Attributes inherited from PSafeCollection
PCollection * | collection
PMutex | collectionMutex
bool | deleteObjects
PList< PSafeObject > | toBeRemoved
PMutex | removalMutex
PTimer | deleteObjectsTimer

## Detailed Description

### template<class Base>
class PSafeArray< Base >

This class defines a thread-safe array of objects.

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

## Member Typedef Documentation

template<class Base >

typedef PSafePtr<Base> PSafeArray< Base >::value_type

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

- safecoll.h