Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

MutexHolder Class Reference

A lightweight C++ object whose constructor calls lock() and whose destructor calls release() on a mutex. More...

#include <mutexHolder.h>

List of all members.

Public Member Functions

 MutexHolder (const Mutex &mutex)
 MutexHolder (Mutex *&mutex)
 If the MutexHolder constructor is given a pointer to a Mutex object (instead of an actual object), it will first check to see if the pointer is NULL, and allocate a new Mutex if it is.

 ~MutexHolder ()

Private Member Functions

 MutexHolder (const MutexHolder &copy)
 Do not attempt to copy MutexHolders.

void operator= (const MutexHolder &copy)
 Do not attempt to copy MutexHolders.


Detailed Description

A lightweight C++ object whose constructor calls lock() and whose destructor calls release() on a mutex.

It is a C++ convenience wrapper to call release() automatically when a block exits (for instance, on return).

Definition at line 43 of file mutexHolder.h.


Constructor & Destructor Documentation

MutexHolder::MutexHolder const Mutex mutex  )  [inline]
 

Definition at line 31 of file mutexHolder.I.

MutexHolder::MutexHolder Mutex *&  mutex  )  [inline]
 

If the MutexHolder constructor is given a pointer to a Mutex object (instead of an actual object), it will first check to see if the pointer is NULL, and allocate a new Mutex if it is.

This is intended as a convenience for functions that may need to reference a Mutex at static init time, when it is impossible to guarantee ordering of initializers.

Definition at line 59 of file mutexHolder.I.

References INLINE.

MutexHolder::~MutexHolder  )  [inline]
 

Definition at line 77 of file mutexHolder.I.

References INLINE, and nassertv.

MutexHolder::MutexHolder const MutexHolder &  copy  )  [inline, private]
 

Do not attempt to copy MutexHolders.

Definition at line 92 of file mutexHolder.I.


Member Function Documentation

void MutexHolder::operator= const MutexHolder &  copy  )  [inline, private]
 

Do not attempt to copy MutexHolders.

Definition at line 105 of file mutexHolder.I.


The documentation for this class was generated from the following files:
Generated on Fri May 2 00:52:30 2003 for Panda by doxygen1.3