mbo::CMutexFake Class Reference

Mutex emulation. More...

#include <MboSynch.h>

Inheritance diagram for mbo::CMutexFake:

Inheritance graph
{mbo::IMutex\n||+ Enter()\l+ Try()\l+ GetLock()\l# GetHandle()\l# IncEntered()\l# DecEntered()\l}{mbo::ICriticalSection\n||+ ~ICriticalSection()\l+ Enter()\l+ Leave()\l+ GetLock()\l+ GetLevel()\l}
[legend]
Collaboration diagram for mbo::CMutexFake:

Collaboration graph
{mbo::IMutex\n||+ Enter()\l+ Try()\l+ GetLock()\l# GetHandle()\l# IncEntered()\l# DecEntered()\l}{mbo::ICriticalSection\n||+ ~ICriticalSection()\l+ Enter()\l+ Leave()\l+ GetLock()\l+ GetLevel()\l}
[legend]

List of all members.

Public Member Functions

 CMutexFake ()
virtual void Enter () const
virtual void Leave () const
virtual bool Try (DWORD nMilliseconds=0) const
virtual CLock GetLock () const
virtual unsigned long GetLevel () const

Protected Member Functions

virtual IncDecVal IncEntered () const
virtual IncDecVal DecEntered () const

Protected Attributes

IncDecVal m_lEntered


Detailed Description

Mutex emulation.

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

Definition at line 1050 of file MboSynch.h.


Constructor & Destructor Documentation

mbo::CMutexFake::CMutexFake (  ) 

constructor


Member Function Documentation

virtual void mbo::CMutexFake::Enter (  )  const [virtual]

Enter the Mutex (enter critical section)

Reimplemented from mbo::IMutex.

virtual void mbo::CMutexFake::Leave (  )  const [virtual]

Leave the Mutex (leave critical section)

Implements mbo::ICriticalSection.

virtual bool mbo::CMutexFake::Try ( DWORD  nMilliseconds = 0  )  const [virtual]

Try to enter the Mutex (enter critical section)

Returns:
When the mutex was entered the return value is true.
Parameters:
nMilliseconds time to try to enter in milliseconds
Returns:
whether or not the mutex was entered

Implements mbo::IMutex.

virtual CLock mbo::CMutexFake::GetLock (  )  const [virtual]

Get lock for this mutex

The created lock will be returned as an object. That requires full return by value and invoking copy operators. But that is the only possible solution since we need a local copy that will be destructed locally - the sense of the lock.

Returns:
Lock for this Mutex

Implements mbo::IMutex.

virtual unsigned long mbo::CMutexFake::GetLevel (  )  const [virtual]

Returns:
Number of times CriticalSection is entered
Note:
This is only valie when the CriticalSection/Mutex is owned by the current thread.

Implements mbo::ICriticalSection.

virtual IncDecVal mbo::CMutexFake::IncEntered (  )  const [protected, virtual]

Inform that the Mutex was entered.

Implements mbo::IMutex.

virtual IncDecVal mbo::CMutexFake::DecEntered (  )  const [protected, virtual]

Inform that the Mutex was leaved.

Implements mbo::IMutex.


Member Data Documentation

IncDecVal mbo::CMutexFake::m_lEntered [mutable, protected]

number of times Mutex was entered

Definition at line 1094 of file MboSynch.h.


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