Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

lfc::Guard Class Reference

resource aquisition is initialization for Mutexes. More...

Inheritance diagram for lfc::Guard::

lfc::Object List of all members.

Public Methods

 Guard (Mutex &rMutex)
 creates a Guard from rMutex and locks rMutex. More...

virtual ~Guard () throw ()
 if this is the last Guard that locked a shared Mutex, unlock it. More...

long lockCount () const
 number of locks on currently managed Mutex. More...

void lock ()
 attempts to lock the Mutex. increments lock count. More...

bool tryLock ()
 tries to lock the managed Mutex but doesn't block in waiting if the Mutex is already locked. More...

void unlock ()
 unlocks the managed Mutex; decrements the lock count. More...


Protected Attributes

Mutexm_rMutex
 managed Mutex object. More...

long m_lockCount
 the lock counter. More...


Detailed Description

resource aquisition is initialization for Mutexes.


Constructor & Destructor Documentation

lfc::Guard::Guard Mutex   rMutex [inline]
 

creates a Guard from rMutex and locks rMutex.

virtual lfc::Guard::~Guard   throw () [inline, virtual]
 

if this is the last Guard that locked a shared Mutex, unlock it.


Member Function Documentation

long lfc::Guard::lockCount   const [inline]
 

number of locks on currently managed Mutex.

void lfc::Guard::lock   [inline]
 

attempts to lock the Mutex. increments lock count.

bool lfc::Guard::tryLock   [inline]
 

tries to lock the managed Mutex but doesn't block in waiting if the Mutex is already locked.

void lfc::Guard::unlock   [inline]
 

unlocks the managed Mutex; decrements the lock count.


Member Data Documentation

Mutex& lfc::Guard::m_rMutex [protected]
 

managed Mutex object.

long lfc::Guard::m_lockCount [protected]
 

the lock counter.


The documentation for this class was generated from the following file:
Generated on Fri Jan 25 03:13:07 2002 for LFC2 by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001