mbo::CLockMulti Class Reference

Multi-Lock implementation. More...

#include <MboSynch.h>

Inheritance diagram for mbo::CLockMulti:

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

Collaboration graph
{mbo::ILock\n||+ ~ILock()\l+ Enter()\l+ Leave()\l+ GetLevel()\l}{mbo::MutexList\n|- m_lEntered\l|+ MutexList()\l+ ~MutexList()\l+ Enter()\l+ Leave()\l+ Try()\l+ GetLock()\l+ GetLevel()\l# IncEntered()\l# DecEntered()\l- GetHandle()\l}{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

 CLockMulti (const IMutex *pmx1=NULL, const IMutex *pmx2=NULL, const IMutex *pmx3=NULL, const IMutex *pmx4=NULL, const IMutex *pmx5=NULL)
 CLockMulti::CLockMulti (const CLockMulti &lx)
virtual ~CLockMulti ()
virtual void AddMutex (const IMutex *pmx) const
virtual bool Try (DWORD nMilliseconds=0) const
virtual void Enter () const
virtual void Leave () const
virtual size_t size () const
virtual const MutexListGetList () const
virtual unsigned long GetLevel () const


Detailed Description

Multi-Lock implementation.

This Lock does not call Enter() upon creation or Leave() in destruction. This is must be done in the objects accepted by the constructor.

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

Definition at line 1177 of file MboSynch.h.


Constructor & Destructor Documentation

mbo::CLockMulti::CLockMulti ( const IMutex pmx1 = NULL,
const IMutex pmx2 = NULL,
const IMutex pmx3 = NULL,
const IMutex pmx4 = NULL,
const IMutex pmx5 = NULL 
) [explicit]

constructor that takes up to 5 IMutex

The IMutex parameters must either be NULL or an instance from any class that implements the IMutex interface.

Parameters:
pmx1  first optional mutex
pmx2  second optional mutex
pmx3  third optional mutex
pmx4  forth optional mutex
pmx5  fith optional mutex

virtual mbo::CLockMulti::~CLockMulti (  )  [virtual]

destructor


Member Function Documentation

mbo::CLockMulti::CLockMulti::CLockMulti ( const CLockMulti lx  )  [explicit]

Copy constructor

Ensure the lock is entered since the destructor will call Leave().

Parameters:
lx  CLockMulti to copy from

virtual void mbo::CLockMulti::AddMutex ( const IMutex pmx  )  const [virtual]

Add a single IMutex

Parameters:
pmx  Add a mutex to the list

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

Try to enter the Lock.

Parameters:
nMilliseconds time in milliseconds to try to enter
Returns:
Whteher or not the Lock was entered

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

Enter the Lock

Implements mbo::ILock.

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

Leave the Lock

Implements mbo::ILock.

virtual size_t mbo::CLockMulti::size (  )  const [virtual]

Number of IMutex elements in Lock

virtual const MutexList& mbo::CLockMulti::GetList (  )  const [virtual]

Reference to internal MutexList (used by CLock)

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

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

This may not be correctly available in which case 1 is returned to signal Enter state.

Implements mbo::ILock.


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