Scippy

UG

Ubiquity Generator framework

LockRAII Class Reference

Class to do RAII with a lock. The constructor will acquire the lock and the destructor will delete it. More...

#include <paraPthLock.h>

Inheritance diagram for LockRAII:
LockRAIIHelper

Public Member Functions

 LockRAII (Lock *l)
 Constructor. The constructor calls l->lock() to acquire the lock. More...
 
 LockRAII (Lock *l, char const *file, int line)
 Constructor. The constructor calls l->lock(file,line) to acquire the lock. More...
 
 ~LockRAII ()
 Destructor. Releases the lock that was acquired in the constructor. More...
 

Private Member Functions

 LockRAII (LockRAII const &)
 No copying or assignment for instances of this class. More...
 
LockRAII const & operator= (LockRAII const &)
 

Private Attributes

Lock *const lck
 lock More...
 

Detailed Description

Class to do RAII with a lock. The constructor will acquire the lock and the destructor will delete it.

Definition at line 178 of file paraPthLock.h.

Constructor & Destructor Documentation

◆ LockRAII() [1/3]

LockRAII ( LockRAII const &  )
private

No copying or assignment for instances of this class.

◆ LockRAII() [2/3]

LockRAII ( Lock l)

Constructor. The constructor calls l->lock() to acquire the lock.

Definition at line 196 of file paraPthLock.h.

References LockRAII::lck, and Lock::lock().

◆ LockRAII() [3/3]

LockRAII ( Lock l,
char const *  file,
int  line 
)

Constructor. The constructor calls l->lock(file,line) to acquire the lock.

Definition at line 210 of file paraPthLock.h.

References LockRAII::lck, and Lock::lock().

◆ ~LockRAII()

~LockRAII ( )

Destructor. Releases the lock that was acquired in the constructor.

Definition at line 225 of file paraPthLock.h.

References LockRAII::lck, and Lock::unlock().

Member Function Documentation

◆ operator=()

LockRAII const & operator= ( LockRAII const &  )
private

Member Data Documentation

◆ lck

Lock* const lck
private

lock

Definition at line 180 of file paraPthLock.h.

Referenced by LockRAII::LockRAII(), and LockRAII::~LockRAII().