VR-Forces 4.5 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends
DtCriticalSection Class Reference

RAII manager object for accessing paralle tick functionality. More...

Inheritance diagram for DtCriticalSection:
Inheritance graph
[legend]

Public Types

typedef
DtParallelTickManager::AccessType 
AccessType

Public Member Functions

 DtCriticalSection (DtSimManager *, AccessType initState)
 Construct and set mutex state to initial state.
 DtCriticalSection (DtSimManager *)
 Construct and do not change mutex state.
 ~DtCriticalSection ()
void reset (AccessType access)
 Change mutex state.
void unlock ()
 Set mutex state to UNLOCKED.
void lockShared ()
 Set mutex state to SHARED.
void lock ()
 Set mutex state to EXCLUSIVE.
void release ()
 Set mutex state to value it had when this object was created.
 DtCriticalSection (DtCriticalSection &, AccessType to)
 Construct when there is already another critical section object on the stack.
 DtCriticalSection (DtCriticalSection &)

Protected Member Functions

 DtCriticalSection (DtParallelTickManager *, AccessType to)
 DtCriticalSection (DtParallelTickManager *)

Protected Attributes

DtParallelTickManagermgr
DtParallelTickManager::ThreadLocalInfoinfo
AccessType from
AccessType to

Friends

class DtParallelTickManager

Detailed Description

RAII manager object for accessing paralle tick functionality.

This class works similarly to the scoped lock classes that most mutexes use.

This class is used to change the state of the global mutex and guarantee that it is reset to the original value regardless of how the code exits the block where the critical section is defined.

For examples of usage see the parallelTick example.

Member Typedef Documentation

Constructor & Destructor Documentation

DtCriticalSection::DtCriticalSection ( DtSimManager ,
AccessType  initState 
)
explicit

Construct and set mutex state to initial state.

DtCriticalSection::DtCriticalSection ( DtSimManager )
explicit

Construct and do not change mutex state.

DtCriticalSection::DtCriticalSection ( DtCriticalSection ,
AccessType  to 
)
explicit

Construct when there is already another critical section object on the stack.

Note: other constructors will work here but this one may be more efficient.

DtCriticalSection::DtCriticalSection ( DtCriticalSection )
explicit
DtCriticalSection::~DtCriticalSection ( )
DtCriticalSection::DtCriticalSection ( DtParallelTickManager ,
AccessType  to 
)
explicitprotected
DtCriticalSection::DtCriticalSection ( DtParallelTickManager )
explicitprotected

Member Function Documentation

void DtCriticalSection::reset ( AccessType  access)

Change mutex state.

void DtCriticalSection::unlock ( )

Set mutex state to UNLOCKED.

void DtCriticalSection::lockShared ( )

Set mutex state to SHARED.

void DtCriticalSection::lock ( )

Set mutex state to EXCLUSIVE.

void DtCriticalSection::release ( )
inline

Set mutex state to value it had when this object was created.

Friends And Related Function Documentation

friend class DtParallelTickManager
friend

Member Data Documentation

DtParallelTickManager* DtCriticalSection::mgr
protected
DtParallelTickManager::ThreadLocalInfo* DtCriticalSection::info
protected
AccessType DtCriticalSection::from
protected
AccessType DtCriticalSection::to
protected

The documentation for this class was generated from the following file:

Document ID: Generated on Thu Mar 23 18:54:12 EDT 2017 from SVN revision 174804
Copyright © 2005-2017 VT MÄK. All Rights Reserved (www.mak.com)