The Gaudi Framework
v29r0 (ff2e7097)
|
Smart pointer with a scoped locking mechanism. More...
#include <src/threadpool/boost/threadpool/detail/locking_ptr.hpp>
Public Member Functions | |
locking_ptr (volatile T &obj, const volatile Mutex &mtx) | |
Constructor. More... | |
~locking_ptr () | |
Destructor. More... | |
T & | operator* () const |
Returns a reference to the stored instance. More... | |
T * | operator-> () const |
Returns a pointer to the stored instance. More... | |
Private Attributes | |
T * | m_obj |
The instance pointer. More... | |
Mutex & | m_mutex |
Mutex is used for scoped locking. More... | |
Smart pointer with a scoped locking mechanism.
This class is a wrapper for a volatile pointer. It enables synchronized access to the internal pointer by locking the passed mutex.
Definition at line 37 of file locking_ptr.hpp.
|
inline |
Constructor.
Definition at line 45 of file locking_ptr.hpp.
|
inline |
Destructor.
Definition at line 55 of file locking_ptr.hpp.
|
inline |
Returns a reference to the stored instance.
Definition at line 65 of file locking_ptr.hpp.
|
inline |
Returns a pointer to the stored instance.
Definition at line 74 of file locking_ptr.hpp.
|
private |
Mutex is used for scoped locking.
Definition at line 41 of file locking_ptr.hpp.
|
private |
The instance pointer.
Definition at line 40 of file locking_ptr.hpp.