NLMISC::CUnfairSynchronized< T >::CAccessor Class Reference

#include <mutex.h>


Detailed Description

template<class T>
class NLMISC::CUnfairSynchronized< T >::CAccessor

This class give you a thread safe access to the CSynchronized Value. Look at the example in the CSynchronized.

Definition at line 596 of file mutex.h.

Public Member Functions

 CAccessor (CUnfairSynchronized< T > *cs)
 get the mutex or wait

T & value ()
 access to the Value

 ~CAccessor ()
 release the mutex


Private Attributes

CUnfairSynchronized< T > * Synchronized


Constructor & Destructor Documentation

template<class T>
NLMISC::CUnfairSynchronized< T >::CAccessor::CAccessor CUnfairSynchronized< T > *  cs  )  [inline]
 

get the mutex or wait

Definition at line 602 of file mutex.h.

References NLMISC::CUnfairSynchronized< T >::CAccessor::Synchronized.

00603                 {
00604                         Synchronized = cs;
00605                         const_cast<CMutex&>(Synchronized->_Mutex).enter();
00606                 }

template<class T>
NLMISC::CUnfairSynchronized< T >::CAccessor::~CAccessor  )  [inline]
 

release the mutex

Definition at line 609 of file mutex.h.

References NLMISC::CUnfairSynchronized< T >::CAccessor::Synchronized.

00610                 {
00611                         const_cast<CMutex&>(Synchronized->_Mutex).leave();
00612                 }


Member Function Documentation

template<class T>
T& NLMISC::CUnfairSynchronized< T >::CAccessor::value  )  [inline]
 

access to the Value

Definition at line 615 of file mutex.h.

References NLMISC::CUnfairSynchronized< T >::CAccessor::Synchronized.

00616                 {
00617                         return const_cast<T&>(Synchronized->_Value);
00618                 }


Field Documentation

template<class T>
CUnfairSynchronized<T>* NLMISC::CUnfairSynchronized< T >::CAccessor::Synchronized [private]
 

Definition at line 598 of file mutex.h.

Referenced by NLMISC::CUnfairSynchronized< T >::CAccessor::CAccessor(), NLMISC::CUnfairSynchronized< T >::CAccessor::value(), and NLMISC::CUnfairSynchronized< T >::CAccessor::~CAccessor().


The documentation for this class was generated from the following file:
Generated on Tue Mar 16 13:39:24 2004 for NeL by doxygen 1.3.6