mbo::CUnlock Class Reference

Automatic local Lock unlock. More...

#include <MboSynch.h>

Inheritance diagram for mbo::CUnlock:

Inheritance graph
{mbo::ILock\n||+ ~ILock()\l+ Enter()\l+ Leave()\l+ GetLevel()\l}
[legend]
Collaboration diagram for mbo::CUnlock:

Collaboration graph
{mbo::ILock\n||+ ~ILock()\l+ Enter()\l+ Leave()\l+ GetLevel()\l}
[legend]

List of all members.

Public Member Functions

 CUnlock (const ILock &lx)
virtual ~CUnlock ()


Detailed Description

Automatic local Lock unlock.

The Unlock automatically calls Enter() upon creation and Leave() in destruction but exchanges Enter/Leave calles for the given Lock. Hence it temporarily unlocks the given Lock.

Note:
Use with caution.
Warning:
You must ensure the Unlock is destructed before its corresponding Lock.
Note:
If you create an Unlock from another Unlock it becomes a Lock again because it wil exchange Enter/Leave twice.

As long as the Lock is based on a single CriticalSection or Mutex all enter levels will be quit on creation and restored on destruction.

This class is distributed under the following license GNU Lesser General Public License, version 2.1.

Definition at line 1265 of file MboSynch.h.


Constructor & Destructor Documentation

mbo::CUnlock::CUnlock ( const ILock lx  )  [inline, explicit]

constructor (from any ILock pointer)

Parameters:
lx reference to Lock to use

Definition at line 1272 of file MboSynch.h.

01273         : m_lx(lx)
01274         , m_lLevel(lx.GetLevel())
01275     {
01276         assert(m_lLevel);
01277         Enter();
01278     }

virtual mbo::CUnlock::~CUnlock (  )  [inline, virtual]

Definition at line 1280 of file MboSynch.h.

01281     {
01282         Leave();
01283     }


The documentation for this class was generated from the following file:
  Hosted on code.google.com  
© Marcus Börger
Generated on Fri Jan 18 21:21:13 2008 for MBO-lib by doxygen 1.5.4