Geant4  10.02.p03
G4TemplateAutoLock< M, L, U > Class Template Reference

#include <G4AutoLock.hh>

Collaboration diagram for G4TemplateAutoLock< M, L, U >:

Public Member Functions

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

Private Member Functions

 G4TemplateAutoLock (const G4TemplateAutoLock &rhs)
 
G4TemplateAutoLockoperator= (const G4TemplateAutoLock &rhs)
 

Private Attributes

G4bool locked
 
M * _m
 
L _l
 
_u
 

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

◆ G4TemplateAutoLock() [1/2]

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  }
Here is the caller graph for this function:

◆ ~G4TemplateAutoLock()

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  }

◆ G4TemplateAutoLock() [2/2]

template<class M, typename L, typename U>
G4TemplateAutoLock< M, L, U >::G4TemplateAutoLock ( const G4TemplateAutoLock< M, L, U > &  rhs)
private

Member Function Documentation

◆ lock()

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:

◆ operator=()

template<class M, typename L, typename U>
G4TemplateAutoLock& G4TemplateAutoLock< M, L, U >::operator= ( const G4TemplateAutoLock< M, L, U > &  rhs)
private
Here is the caller graph for this function:

◆ unlock()

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  }

Member Data Documentation

◆ _l

template<class M, typename L, typename U>
L G4TemplateAutoLock< M, L, U >::_l
private

Definition at line 104 of file G4AutoLock.hh.

◆ _m

template<class M, typename L, typename U>
M* G4TemplateAutoLock< M, L, U >::_m
private

Definition at line 103 of file G4AutoLock.hh.

◆ _u

template<class M, typename L, typename U>
U G4TemplateAutoLock< M, L, U >::_u
private

Definition at line 105 of file G4AutoLock.hh.

◆ locked

template<class M, typename L, typename U>
G4bool G4TemplateAutoLock< M, L, U >::locked
private

Definition at line 102 of file G4AutoLock.hh.


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