Public Member Functions | Private Member Functions | Private Attributes

UT_MutexAcquirer Class Reference

#include <ut_mutex.h>

List of all members.

Public Member Functions

 UT_MutexAcquirer (UT_Mutex &inMutex)
 ~UT_MutexAcquirer ()

Private Member Functions

 UT_MutexAcquirer ()
 UT_MutexAcquirer (const UT_MutexAcquirer &other)
UT_MutexAcquireroperator= (const UT_MutexAcquirer &other)

Private Attributes


Detailed Description

Inline class whose job is just to acquire and un-aquire a mutex lock, thus releasing the programmer from manually having to remember to unlock a mutex before returning from a function, or even from within a block of code. Example:

void Clazz::method (int arg) { UT_MutexAcquirer acquirer (m_ClazzMutex); // do stuff that modifies class data // ... // just return, no need to release mutex. it's // done transparently by the acquirer }

Constructor & Destructor Documentation

UT_MutexAcquirer::UT_MutexAcquirer ( UT_Mutex inMutex  )  [inline]
UT_MutexAcquirer::~UT_MutexAcquirer (  )  [inline]
UT_MutexAcquirer::UT_MutexAcquirer (  )  [private]
UT_MutexAcquirer::UT_MutexAcquirer ( const UT_MutexAcquirer other  )  [private]

Member Function Documentation

UT_MutexAcquirer& UT_MutexAcquirer::operator= ( const UT_MutexAcquirer other  )  [private]

Member Data Documentation

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