SynchronizedObject

   
SynchronizedObject

Description

The class SynchronizedObject (see Figure C-13) serves as the parent class for synchronized objects. Synchronized objects incorporate a mutex-based lock mechanism, allowing them to be used concurrently by multiple threads.

SynchronizedObject includes the nested classes SynchronizationObject , which is its mutex object, and ExclusiveZone , which locks a SynchronizationObject .

SynchronizedObject belongs to the namespace CppUnit . It is declared in SynchronizedObject.h and implemented in SynchronizedObject.cpp .

Figure C-13. The base class SynchronizedObject
figs/utf_ac13.gif

Declaration

 class SynchronizedObject 

Constructors/Destructors


SynchronizedObject(SynchronizationObject *syncObject = 0)

A constructor taking a SynchronizationObject (mutex.) If syncObject is null , a new SynchronizationObject is created.


virtual ~SynchronizedObject( )

A destructor.

Public Methods

None.

Protected/Private Methods


virtual void setSynchronizationObject(SynchronizationObject *syncObject)

Sets the SynchronizationObject .


SynchronizedObject(const SynchronizedObject &copy)

A copy constructor declared private to prevent its use.


void operator=(const SynchronizedObject &copy)

A copy operator declared private to prevent its use.

Attributes


SynchronizationObject *m_syncObject

A pointer to the SynchronizationObject for this SynchronizedObject ( protected ).



Unit Test Frameworks
Unit Test Frameworks
ISBN: 0596006896
EAN: 2147483647
Year: 2006
Pages: 146
Authors: Paul Hamill

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net