EyeAI
Loading...
Searching...
No Matches
MutexGuard< T > Class Template Reference

#include <MutexGuard.hpp>

Classes

struct  ConstScopedAccess
 
struct  ScopedAccess
 

Public Member Functions

 MutexGuard (T &&value) noexcept
 
template<typename... Args>
 MutexGuard (Args &&... args) noexcept
 
 ~MutexGuard ()=default
 
 MutexGuard (MutexGuard &&) noexcept=default
 
 MutexGuard (const MutexGuard &)=delete
 
MutexGuardoperator= (MutexGuard &&) noexcept=default
 
MutexGuardoperator= (const MutexGuard &)=delete
 
ScopedAccess lock ()
 
ConstScopedAccess const_lock () const
 

Detailed Description

template<typename T>
class MutexGuard< T >

Helper class that encapsulates T value and protects every access to it using a mutex

Constructor & Destructor Documentation

◆ MutexGuard() [1/4]

template<typename T>
MutexGuard< T >::MutexGuard ( T && value)
inlineexplicitnoexcept

◆ MutexGuard() [2/4]

template<typename T>
template<typename... Args>
MutexGuard< T >::MutexGuard ( Args &&... args)
inlineexplicitnoexcept

◆ ~MutexGuard()

template<typename T>
MutexGuard< T >::~MutexGuard ( )
default

◆ MutexGuard() [3/4]

template<typename T>
MutexGuard< T >::MutexGuard ( MutexGuard< T > && )
defaultnoexcept

◆ MutexGuard() [4/4]

template<typename T>
MutexGuard< T >::MutexGuard ( const MutexGuard< T > & )
delete

Member Function Documentation

◆ const_lock()

template<typename T>
ConstScopedAccess MutexGuard< T >::const_lock ( ) const
inline
Returns
RAII object that locks the mutex and provides access to the value

◆ lock()

template<typename T>
ScopedAccess MutexGuard< T >::lock ( )
inline
Returns
RAII object that locks the mutex and provides access to the value

◆ operator=() [1/2]

template<typename T>
MutexGuard & MutexGuard< T >::operator= ( const MutexGuard< T > & )
delete

◆ operator=() [2/2]

template<typename T>
MutexGuard & MutexGuard< T >::operator= ( MutexGuard< T > && )
defaultnoexcept