Public Member Functions | Private Attributes

cmtk::LockingPtr< T > Class Template Reference
[cmtkSystem Library]

Class for mutually exclusive access to objects. More...

#include <cmtkLockingPtr.h>

Collaboration diagram for cmtk::LockingPtr< T >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 LockingPtr (volatile T &object, volatile MutexLock &mutexLock)
 Create locking pointer and lock mutex.
 ~LockingPtr ()
 Destroy locking pointer and unlock mutex.
T & operator* ()
 Dereferencing operator.
T * operator-> ()
 Member access operator.

Private Attributes

T * m_Object
 Pointer to the accessed object.
MutexLockm_MutexLock
 The mutex lock.

Detailed Description

template<class T>
class cmtk::LockingPtr< T >

Class for mutually exclusive access to objects.

This class is an adapted version of a concept by Andrei Alexandrescu of RealNetworks Inc.

See also:
http://www.cuj.com/experts/1902/alexandr.htm?topic=experts

Definition at line 52 of file cmtkLockingPtr.h.


Constructor & Destructor Documentation

template<class T>
cmtk::LockingPtr< T >::LockingPtr ( volatile T &  object,
volatile MutexLock mutexLock 
) [inline]

Create locking pointer and lock mutex.

Definition at line 56 of file cmtkLockingPtr.h.

template<class T>
cmtk::LockingPtr< T >::~LockingPtr (  ) [inline]

Destroy locking pointer and unlock mutex.

Definition at line 64 of file cmtkLockingPtr.h.


Member Function Documentation

template<class T>
T& cmtk::LockingPtr< T >::operator* (  ) [inline]

Dereferencing operator.

Definition at line 70 of file cmtkLockingPtr.h.

template<class T>
T* cmtk::LockingPtr< T >::operator-> (  ) [inline]

Member access operator.

Definition at line 76 of file cmtkLockingPtr.h.


Member Data Documentation

template<class T>
MutexLock* cmtk::LockingPtr< T >::m_MutexLock [private]

The mutex lock.

Definition at line 86 of file cmtkLockingPtr.h.

template<class T>
T* cmtk::LockingPtr< T >::m_Object [private]

Pointer to the accessed object.

Definition at line 83 of file cmtkLockingPtr.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines