ulxr::Mutex::TryLocker Class Reference

Helper class to request and release a mutex by pure presence. More...

#include <ulxr_mutex.h>

Collaboration diagram for ulxr::Mutex::TryLocker:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TryLocker (Mutex &mtx)
 Create object and request mutex.
 ~TryLocker () throw ()
 Destroys object and releases mutex.
bool isLocked ()
 Checks if the mutex has been succesfully requested.

Private Attributes

Mutex * mutex
bool locked

Detailed Description

Helper class to request and release a mutex by pure presence.

Definition at line 75 of file ulxr_mutex.h.


Constructor & Destructor Documentation

ulxr::Mutex::TryLocker::TryLocker ( Mutex &  mtx  ) 

Create object and request mutex.

Parameters:
mtx mutex to request.

Definition at line 149 of file ulxr_mutex.cpp.

References locked, mutex, and ulxr::Mutex::tryLock().

ulxr::Mutex::TryLocker::~TryLocker (  )  throw ()

Destroys object and releases mutex.

Definition at line 156 of file ulxr_mutex.cpp.

References isLocked(), mutex, and ulxr::Mutex::unlock().


Member Function Documentation

bool ulxr::Mutex::TryLocker::isLocked (  ) 

Checks if the mutex has been succesfully requested.

Returns:
false: the mutex was not available

Definition at line 169 of file ulxr_mutex.cpp.

Referenced by ~TryLocker().


Member Data Documentation

Mutex* ulxr::Mutex::TryLocker::mutex [private]

Definition at line 95 of file ulxr_mutex.h.

Referenced by TryLocker(), and ~TryLocker().

bool ulxr::Mutex::TryLocker::locked [private]

Definition at line 96 of file ulxr_mutex.h.

Referenced by TryLocker().


The documentation for this class was generated from the following files:
Generated on Sun Aug 19 20:09:07 2007 for ulxmlrpcpp by  doxygen 1.5.1