| The Gaudi Framework v32r1 (f65d50dc)

Public Member Functions | Private Member Functions | Private Attributes | List of all members
LockedHandle< T, MutexType >::Guard Class Reference

`#include <GaudiKernel/LockedHandle.h>`

## Public Member Functions
| Guard (Guard &&a)
| Guard (T *ptr, MutexType &mutex)
| ~Guard ()
T & | operator * ()
T * | operator-> ()
| operator T & ()

## Private Member Functions
| Guard (const Guard &a)=delete

## Private Attributes
T * | m_ptr {nullptr}
MutexType * | m_mutex {nullptr}

## Detailed Description

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

Definition at line 44 of file LockedHandle.h.

## Constructor & Destructor Documentation

## ◆ Guard() [1/3]

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

LockedHandle< T, MutexType >::Guard::Guard | ( | const Guard & | a | ) |
| private delete

## ◆ Guard() [2/3]

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

LockedHandle< T, MutexType >::Guard::Guard | ( | Guard && | a | ) |
| inline

Definition at line 48 of file LockedHandle.h.

48 : m_ptr( a.m_ptr ), m_mutex( a.m_mutex ) { a.m_mutex = nullptr; }
LockedHandle::Guard::m_ptr
T * m_ptr
Definition: LockedHandle.h:58
LockedHandle::Guard::m_mutex
MutexType * m_mutex
Definition: LockedHandle.h:59

## ◆ Guard() [3/3]

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

LockedHandle< T, MutexType >::Guard::Guard | ( | T * | ptr,
|  | MutexType & | mutex
| ) |  |
| inline

Definition at line 50 of file LockedHandle.h.

50 : m_ptr( ptr ), m_mutex( &mutex ) { m_mutex->lock(); }
LockedHandle::Guard::m_ptr
T * m_ptr
Definition: LockedHandle.h:58
LockedHandle::Guard::m_mutex
MutexType * m_mutex
Definition: LockedHandle.h:59

## ◆ ~Guard()

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

LockedHandle< T, MutexType >::Guard::~Guard | ( |  | ) |
| inline

Definition at line 51 of file LockedHandle.h.

51 { m_mutex->unlock(); }
LockedHandle::Guard::m_mutex
MutexType * m_mutex
Definition: LockedHandle.h:59

## Member Function Documentation

## ◆ operator *()

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

T& LockedHandle< T, MutexType >::Guard::operator * | ( |  | ) |
| inline

Definition at line 52 of file LockedHandle.h.

52 { return *m_ptr; }
LockedHandle::Guard::m_ptr
T * m_ptr
Definition: LockedHandle.h:58

## ◆ operator T &()

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

LockedHandle< T, MutexType >::Guard::operator T & | ( |  | ) |
| inline

Definition at line 55 of file LockedHandle.h.

55 { return *m_ptr; }
LockedHandle::Guard::m_ptr
T * m_ptr
Definition: LockedHandle.h:58

## ◆ operator->()

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

T* LockedHandle< T, MutexType >::Guard::operator-> | ( |  | ) |
| inline

Definition at line 53 of file LockedHandle.h.

53 { return m_ptr; }
LockedHandle::Guard::m_ptr
T * m_ptr
Definition: LockedHandle.h:58

## Member Data Documentation

## ◆ m_mutex

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

MutexType* LockedHandle< T, MutexType >::Guard::m_mutex {nullptr}
| private

Definition at line 59 of file LockedHandle.h.

## ◆ m_ptr

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

T* LockedHandle< T, MutexType >::Guard::m_ptr {nullptr}
| private

Definition at line 58 of file LockedHandle.h.

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

- GaudiKernel/GaudiKernel/LockedHandle.h