Smart pointer with a scoped locking mechanism. More...
#include <locking_ptr.hpp>
Public Member Functions | |
locking_ptr (volatile T &obj, const volatile Mutex &mtx) | |
Constructor. | |
T & | operator* () const |
T * | operator-> () const |
~locking_ptr () | |
Destructor. | |
Private Attributes | |
Mutex & | m_mutex |
Mutex is used for scoped locking. | |
T * | m_obj |
The instance pointer. |
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.
boost::threadpool::detail::locking_ptr< T, Mutex >::locking_ptr | ( | volatile T & | obj, |
const volatile Mutex & | mtx | ||
) | [inline] |
Constructor.
Definition at line 45 of file locking_ptr.hpp.
boost::threadpool::detail::locking_ptr< T, Mutex >::~locking_ptr | ( | ) | [inline] |
Destructor.
Definition at line 55 of file locking_ptr.hpp.
T& boost::threadpool::detail::locking_ptr< T, Mutex >::operator* | ( | ) | const [inline] |
Returns a reference to the stored instance.
Definition at line 65 of file locking_ptr.hpp.
T* boost::threadpool::detail::locking_ptr< T, Mutex >::operator-> | ( | ) | const [inline] |
Returns a pointer to the stored instance.
Definition at line 74 of file locking_ptr.hpp.
Mutex& boost::threadpool::detail::locking_ptr< T, Mutex >::m_mutex [private] |
Mutex is used for scoped locking.
Definition at line 41 of file locking_ptr.hpp.
T* boost::threadpool::detail::locking_ptr< T, Mutex >::m_obj [private] |
The instance pointer.
Definition at line 40 of file locking_ptr.hpp.