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.
Declaration
class SynchronizedObject
Constructors/Destructors
-
SynchronizedObject(SynchronizationObject *syncObject = 0)
A constructor taking a
SynchronizationObject
(mutex.) IfsyncObject
isnull
, a newSynchronizationObject
is created.-
virtual ~SynchronizedObject( )
A destructor.
Public Methods
None.
Protected/Private Methods
-
virtual void setSynchronizationObject(SynchronizationObject *syncObject)
Sets the
SynchronizationObject
.-
SynchronizedObject(const SynchronizedObject ©)
A copy constructor declared
private
to prevent its use.-
void operator=(const SynchronizedObject ©)
A copy operator declared
private
to prevent its use.
Attributes
-
SynchronizationObject *m_syncObject
A pointer to the
SynchronizationObject
for thisSynchronizedObject
(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.