Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4TemplateAutoLock< M, L, U > Class Template Reference

#include <G4AutoLock.hh>

Public Member Functions

 G4TemplateAutoLock (M *mtx, L l, U u)
 
virtual ~G4TemplateAutoLock ()
 
void unlock ()
 
void lock ()
 

Detailed Description

template<class M, typename L, typename U>
class G4TemplateAutoLock< M, L, U >

Definition at line 68 of file G4AutoLock.hh.

Constructor & Destructor Documentation

template<class M, typename L, typename U>
G4TemplateAutoLock< M, L, U >::G4TemplateAutoLock ( M *  mtx,
L  l,
u 
)
inline

Definition at line 72 of file G4AutoLock.hh.

72  : locked(false), _m(mtx), _l(l), _u(u)
73  {
74  lock();
75  }
template<class M, typename L, typename U>
virtual G4TemplateAutoLock< M, L, U >::~G4TemplateAutoLock ( )
inlinevirtual

Definition at line 77 of file G4AutoLock.hh.

78  {
79  unlock();
80  }

Member Function Documentation

template<class M, typename L, typename U>
void G4TemplateAutoLock< M, L, U >::lock ( )
inline

Definition at line 88 of file G4AutoLock.hh.

88  {
89  if ( locked ) return;
90  _l(_m);
91  locked = true;
92  }

Here is the caller graph for this function:

template<class M, typename L, typename U>
void G4TemplateAutoLock< M, L, U >::unlock ( )
inline

Definition at line 82 of file G4AutoLock.hh.

82  {
83  if ( !locked ) return;
84  _u(_m);
85  locked = false;
86  }

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