Name

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.

The base class SynchronizedObject
Figure C-13. The base class SynchronizedObject

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).

Get Unit Test Frameworks now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.