Luanti 5.16.0-dev
Loading...
Searching...
No Matches
MutexedVariable< T > Class Template Reference

#include <thread.h>

Collaboration diagram for MutexedVariable< T >:

Public Member Functions

 MutexedVariable ()
 MutexedVariable (const T &value)
 MutexedVariable (T &&value)
get ()
void set (const T &value)
void set (T &&value)

Private Attributes

m_value
std::mutex m_mutex

Constructor & Destructor Documentation

◆ MutexedVariable() [1/3]

template<typename T>
MutexedVariable< T >::MutexedVariable ( )
inline

◆ MutexedVariable() [2/3]

template<typename T>
MutexedVariable< T >::MutexedVariable ( const T & value)
inline

References m_value.

◆ MutexedVariable() [3/3]

template<typename T>
MutexedVariable< T >::MutexedVariable ( T && value)
inline

References m_value.

Member Function Documentation

◆ get()

template<typename T>
T MutexedVariable< T >::get ( )
inline

References m_mutex, and m_value.

◆ set() [1/2]

template<typename T>
void MutexedVariable< T >::set ( const T & value)
inline

References m_mutex, and m_value.

◆ set() [2/2]

template<typename T>
void MutexedVariable< T >::set ( T && value)
inline

References m_mutex, and m_value.

Member Data Documentation

◆ m_mutex

template<typename T>
std::mutex MutexedVariable< T >::m_mutex
private

Referenced by get(), set(), and set().

◆ m_value

template<typename T>
T MutexedVariable< T >::m_value
private

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