mn::basic_shared_object< TOBJECT > Class Template Reference
#include <mn_shared.hpp>
Collaboration diagram for mn::basic_shared_object< TOBJECT >:
Public Types | |
using | object_t = TOBJECT |
using | ref_object_t = TOBJECT & |
Public Member Functions | |
basic_shared_object (const ref_object_t refValue) | |
ref_object_t | get_object () const |
void | set_object (const ref_object_t refNewValue) |
void | operator= (const ref_object_t refNewValue) |
operator object_t () const | |
Protected Attributes | |
mutex_t | m_pReadWriteLock |
ref_object_t | m_refValue |
Detailed Description
template<class TOBJECT>
class mn::basic_shared_object< TOBJECT >
Template class used to protect a shared resource with a Mutex.
Member Typedef Documentation
◆ object_t
template<class TOBJECT >
using mn::basic_shared_object< TOBJECT >::object_t = TOBJECT |
◆ ref_object_t
template<class TOBJECT >
using mn::basic_shared_object< TOBJECT >::ref_object_t = TOBJECT& |
Constructor & Destructor Documentation
◆ basic_shared_object()
template<class TOBJECT >
|
inline |
Resource constructor.
- Parameters
-
value sets the initial value of the resource.
Member Function Documentation
◆ get_object()
template<class TOBJECT >
|
inline |
Get the value of the shared resource.
- Returns
- The value of the shared resource.
◆ operator object_t()
template<class TOBJECT >
|
inline |
Operator to get the value of the shared resource.
- Returns
- The value of the shared resource.
◆ operator=()
template<class TOBJECT >
|
inline |
Operator to set the value of the shared resource.
- Parameters
-
refNewValue The new value for this shared resource
◆ set_object()
template<class TOBJECT >
|
inline |
Sets the value of the shared resource with the specified new_value.
- Parameters
-
refNewValue The new value for this shared resource
Member Data Documentation
◆ m_pReadWriteLock
template<class TOBJECT >
|
protected |
the controll mutex
◆ m_refValue
template<class TOBJECT >
|
protected |
reference of the object
The documentation for this class was generated from the following file: