The Gaudi Framework  master (37c0b60a)
LockedHandle< T, MutexType >::ConstGuard Class Reference

#include </builds/gaudi/Gaudi/GaudiKernel/include/GaudiKernel/LockedHandle.h>

Public Member Functions

 ConstGuard (ConstGuard &&a)
 
 ConstGuard (const T *ptr, MutexType &mutex)
 
 ~ConstGuard ()
 
const T & operator* () const
 
const T * operator-> () const
 
 operator const T & () const
 

Private Member Functions

 ConstGuard (const ConstGuard &a)=delete
 

Private Attributes

const T * m_ptr
 
MutexType * m_mutex
 

Detailed Description

template<class T, class MutexType = std::mutex>
class LockedHandle< T, MutexType >::ConstGuard

Definition at line 72 of file LockedHandle.h.

Constructor & Destructor Documentation

◆ ConstGuard() [1/3]

template<class T , class MutexType = std::mutex>
LockedHandle< T, MutexType >::ConstGuard::ConstGuard ( const ConstGuard a)
privatedelete

◆ ConstGuard() [2/3]

template<class T , class MutexType = std::mutex>
LockedHandle< T, MutexType >::ConstGuard::ConstGuard ( ConstGuard &&  a)
inline

Definition at line 76 of file LockedHandle.h.

76 : m_ptr( a.m_ptr ), m_mutex( a.m_mutex ) { a.m_mutex = nullptr; }

◆ ConstGuard() [3/3]

template<class T , class MutexType = std::mutex>
LockedHandle< T, MutexType >::ConstGuard::ConstGuard ( const T *  ptr,
MutexType &  mutex 
)
inline

Definition at line 78 of file LockedHandle.h.

78 : m_ptr( ptr ), m_mutex( &mutex ) { m_mutex->lock(); }

◆ ~ConstGuard()

template<class T , class MutexType = std::mutex>
LockedHandle< T, MutexType >::ConstGuard::~ConstGuard ( )
inline

Definition at line 79 of file LockedHandle.h.

79 { m_mutex->unlock(); }

Member Function Documentation

◆ operator const T &()

template<class T , class MutexType = std::mutex>
LockedHandle< T, MutexType >::ConstGuard::operator const T & ( ) const
inline

Definition at line 83 of file LockedHandle.h.

83 { return *m_ptr; }

◆ operator*()

template<class T , class MutexType = std::mutex>
const T& LockedHandle< T, MutexType >::ConstGuard::operator* ( ) const
inline

Definition at line 80 of file LockedHandle.h.

80 { return *m_ptr; }

◆ operator->()

template<class T , class MutexType = std::mutex>
const T* LockedHandle< T, MutexType >::ConstGuard::operator-> ( ) const
inline

Definition at line 81 of file LockedHandle.h.

81 { return m_ptr; }

Member Data Documentation

◆ m_mutex

template<class T , class MutexType = std::mutex>
MutexType* LockedHandle< T, MutexType >::ConstGuard::m_mutex
private

Definition at line 87 of file LockedHandle.h.

◆ m_ptr

template<class T , class MutexType = std::mutex>
const T* LockedHandle< T, MutexType >::ConstGuard::m_ptr
private

Definition at line 86 of file LockedHandle.h.


The documentation for this class was generated from the following file:
LockedHandle::ConstGuard::m_ptr
const T * m_ptr
Definition: LockedHandle.h:86
LockedHandle::ConstGuard::m_mutex
MutexType * m_mutex
Definition: LockedHandle.h:87