CWhileInExclusiveCS Class Reference
[MCCore]

Inheritance diagram for CWhileInExclusiveCS:
TMCObject

List of all members.

Public Member Functions

 CWhileInExclusiveCS (TMCSharedCriticalSection &theCS)
 ~CWhileInExclusiveCS ()
void Clean ()

Protected Attributes

TMCSharedCriticalSection * fCS

Detailed Description

This class should be used to declare a local variable. The life span of this variable determines what block of code is encapsulated in the critical section in exclusive access mode. For more information on critical region see TMCSharedCriticalSection.

One of the advantage of using a local variable is that the destructor is called if an exception is thrown or if return is called in the middle of the function

For instance, you could write:

 {
   CWhileInExclusiveCS cs(criticalSection);

   // Code excuted inside the critical section
   ...
 }
 // Code excuted outside the critical section
 ...

Constructor & Destructor Documentation

CWhileInExclusiveCS::CWhileInExclusiveCS ( TMCSharedCriticalSection &  theCS  )  [inline]
CWhileInExclusiveCS::~CWhileInExclusiveCS (  )  [inline]

Member Function Documentation

void CWhileInExclusiveCS::Clean (  )  [inline]

Member Data Documentation

TMCSharedCriticalSection* CWhileInExclusiveCS::fCS [protected]

The documentation for this class was generated from the following file:
Generated on Mon Apr 26 22:47:35 2010 for Carrara SDK Doc by  doxygen 1.6.3