Go to the documentation of this file.
11 #ifndef GAUDIKERNEL_LOCKEDHANDLE
12 #define GAUDIKERNEL_LOCKEDHANDLE 1
37 template <
class T,
class MutexType = std::mutex>
45 void set( T* ptr, MutexType* mut ) {
65 operator T&() {
return *
m_ptr; }
83 operator const T&()
const {
return *
m_ptr; }
102 operator bool()
const {
return m_ptr; }
Guard(T *ptr, MutexType &mutex)
const T * operator->() const
void setMutex(MutexType *mut)
LockedHandle(T *ptr, MutexType &mut)
const T & operator*() const
void set(T *ptr, MutexType *mut)
Guard operator*()
Aquire and release the lock before and after the object is accessed.
Guard(const Guard &a)=delete
ConstGuard(const ConstGuard &a)=delete
ConstGuard operator*() const
Aquire and release the lock before and after the const object is accessed.
ConstGuard(const T *ptr, MutexType &mutex)
ConstGuard(ConstGuard &&a)
Guard operator->()
Aquire and release the lock before and after the object is accessed.
ConstGuard operator->() const
Aquire and release the lock before and after the const object is accessed.
LockedHandle(T *ptr, MutexType *mut)