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

#include <mutex.h>


Detailed Description

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

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

Definition at line 651 of file mutex.h.

Public Member Functions

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

T & value ()
 access to the Value

 ~CAccessor ()
 release the mutex


Private Attributes

CFairSynchronized< T > * Synchronized


Constructor & Destructor Documentation

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

get the mutex or wait

Definition at line 657 of file mutex.h.

00658                 {
00659                         Synchronized = cs;
00660                         const_cast<CFairMutex&>(Synchronized->_Cs).enter();
00661                 }

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

release the mutex

Definition at line 664 of file mutex.h.

00665                 {
00666                         const_cast<CFairMutex&>(Synchronized->_Cs).leave();
00667                 }


Member Function Documentation

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

access to the Value

Definition at line 670 of file mutex.h.

00671                 {
00672                         return const_cast<T&>(Synchronized->_Value);
00673                 }


Field Documentation

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

Definition at line 653 of file mutex.h.


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