mbo::CLock Class Reference

#include <MboSynch.h>

Inheritance diagram for mbo::CLock:

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

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

List of all members.

Public Member Functions

 CLock (const ICriticalSection *pmx)
 CLock (const ILock *plx)
 CLock (const CLockSingle &lx)
 CLock (const CLockMulti &lx)
 CLock (const CLockFake &lx)
 CLock (const CLock &lx)
 CLock (const IMutex *pmx1, const IMutex *pmx2=NULL, const IMutex *pmx3=NULL, const IMutex *pmx4=NULL, const IMutex *pmx5=NULL)
virtual ~CLock ()
virtual unsigned long GetLevel () const

Friends

class CUnlock


Detailed Description

Definition at line 695 of file MboSynch.h.


Constructor & Destructor Documentation

mbo::CLock::CLock ( const ICriticalSection pmx  )  [inline, explicit]

constructor that takes a single Critical Section

Definition at line 702 of file MboSynch.h.

00703         : m_plx(NULL)
00704         , m_pmx(pmx)
00705     {
00706         assert(m_pmx);
00707         m_pmx->Enter();
00708     }

mbo::CLock::CLock ( const ILock plx  )  [explicit]

constructor (from any ILock pointer)

Parameters:
plx pointer to Lock to use

mbo::CLock::CLock ( const CLockSingle lx  )  [inline]

constructor (using a reference to a SingleLock)

Parameters:
lx SingleLock to use

Definition at line 720 of file MboSynch.h.

00721         : m_plx(NULL)
00722         , m_pmx(lx.m_pmx) // must be set
00723     {
00724         m_pmx->Enter();
00725     }

mbo::CLock::CLock ( const CLockMulti lx  ) 

constructor (using a reference to a MultiLock)

Parameters:
lx MultiLock to use

mbo::CLock::CLock ( const CLockFake lx  ) 

constructor (using a reference to a CLockFake)

Parameters:
lx MultiLock to use

mbo::CLock::CLock ( const CLock lx  ) 

constructor is necessary here since we dynamically allocate to m_plx

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

constructor that takes up to 5 IMutex

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

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

the destructor ensures Leave() is called


Member Function Documentation

virtual unsigned long mbo::CLock::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.


Friends And Related Function Documentation

friend class CUnlock [friend]

Definition at line 697 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:12 2008 for MBO-lib by doxygen 1.5.4