ResourceMutexHolder Class Reference

A class that allows sharing the same mutex among different objects. More...

Public Member Functions

 ResourceMutexHolder ()
 Constructor.
 
 ResourceMutexHolder (const ResourceMutexHolder &other) throw ()
 Copy constructor.
 
 ~ResourceMutexHolder () throw ()
 Destructor.
 
QMutex & operator* () const throw ()
 Overload of the dereference operator.
 
QMutex * operator-> () const throw ()
 Overload of the dereference operator (->)
 
ResourceMutexHolderoperator= (const ResourceMutexHolder &other) throw ()
 Copy operator.
 
bool operator== (const ResourceMutexHolder &other) const throw ()
 Comparison operator.
 

Detailed Description

A class that allows sharing the same mutex among different objects.

This class takes care of keeping the number of references to the mutex and of deleting it when no one references it anymore. The mutex is always recursive

Definition at line 84 of file resource.h.

Constructor & Destructor Documentation

Constructor.

Definition at line 27 of file resource.cpp.

ResourceMutexHolder ( const ResourceMutexHolder other) throw ()

Copy constructor.

Copies of ResourceMutexHolder share the same internal QMutex object

Parameters
otherthe object to copy

Definition at line 35 of file resource.cpp.

~ResourceMutexHolder ( ) throw ()

Destructor.

Definition at line 59 of file resource.cpp.

Member Function Documentation

QMutex& operator* ( ) const throw ()
inline

Overload of the dereference operator.

Returns
the instance of the the resource mutex

Definition at line 131 of file resource.h.

QMutex* operator-> ( ) const throw ()
inline

Overload of the dereference operator (->)

Returns
the pointer (the language then knows that that pointer should be dereferenced)

Definition at line 142 of file resource.h.

ResourceMutexHolder & operator= ( const ResourceMutexHolder other) throw ()

Copy operator.

Copies of ResourceMutexHolder share the same internal QMutex object

Parameters
otherthe object to copy

Definition at line 41 of file resource.cpp.

bool operator== ( const ResourceMutexHolder other) const throw ()
inline

Comparison operator.

Two instances of this class are equal if they refer to the same QMutex object

Parameters
otherthe object to compare with us
Returns
true if this instance is equal to other

Definition at line 121 of file resource.h.


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