Faro Engine 0.0.0.b519570 (main)
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Faro::ThreadSafe< T > Class Template Reference

Container class providing thread-safe access to the internal object. More...

#include <ThreadSafety.hpp>

Public Member Functions

 ThreadSafe ()
 
 ThreadSafe (T initialValue)
 
void Lock ()
 Gain exclusive access to this object.
 
void Unlock ()
 Release exclusive access to this object.
 
void Set (T value)
 Set the value of this object.
 
GetCopy ()
 Get a copy of the contained value.
 
T & Get ()
 Get a reference to the contained value.
 
T * operator-> ()
 Get a pointer to the contained value.
 

Detailed Description

template<class T>
class Faro::ThreadSafe< T >

Container class providing thread-safe access to the internal object.

Template Parameters
TType of the contained data object

Constructor & Destructor Documentation

◆ ThreadSafe() [1/2]

template<class T >
Faro::ThreadSafe< T >::ThreadSafe ( )
inline

◆ ThreadSafe() [2/2]

template<class T >
Faro::ThreadSafe< T >::ThreadSafe ( initialValue)
inline

Member Function Documentation

◆ Get()

template<class T >
T & Faro::ThreadSafe< T >::Get ( )
inline

Get a reference to the contained value.

Warning
Must be locked with Lock and unlocked with Unlock
Returns
T& Reference to the contained value

◆ GetCopy()

template<class T >
T Faro::ThreadSafe< T >::GetCopy ( )
inline

Get a copy of the contained value.

Returns
T Copy of the contained value

◆ Lock()

template<class T >
void Faro::ThreadSafe< T >::Lock ( )
inline

Gain exclusive access to this object.

◆ operator->()

template<class T >
T * Faro::ThreadSafe< T >::operator-> ( )
inline

Get a pointer to the contained value.

Warning
Must be locked with Lock and unlocked with Unlock
Returns
T* Pointer to the contained value

◆ Set()

template<class T >
void Faro::ThreadSafe< T >::Set ( value)
inline

Set the value of this object.

Parameters
valueNew value of the object

◆ Unlock()

template<class T >
void Faro::ThreadSafe< T >::Unlock ( )
inline

Release exclusive access to this object.


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