Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::strict_lock_ptr< T, Lockable > Class Template Reference

strict lock providing a pointer access to the synchronized value type. More...

#include <synchronized_value.hpp>

Inheritance diagram for boost::strict_lock_ptr< T, Lockable >:
Collaboration diagram for boost::strict_lock_ptr< T, Lockable >:

Public Types

typedef T value_type
 
typedef Lockable mutex_type
 

Public Member Functions

 strict_lock_ptr (T &val, Lockable &mtx)
 
 strict_lock_ptr (T &val, Lockable &mtx, adopt_lock_t tag)
 
 strict_lock_ptr (BOOST_THREAD_RV_REF(strict_lock_ptr) other)
 Move constructor. More...
 
 ~strict_lock_ptr ()
 
Toperator-> ()
 
Toperator* ()
 
const Toperator-> () const
 
const Toperator* () const
 

Protected Attributes

boost::unique_lock< mutex_typelk_
 
T const & value_
 

Detailed Description

template<typename T, typename Lockable = mutex>
class boost::strict_lock_ptr< T, Lockable >

strict lock providing a pointer access to the synchronized value type.

Parameters
Tthe value type.
Lockablethe mutex type protecting the value type.

Member Typedef Documentation

template<typename T , typename Lockable = mutex>
typedef Lockable boost::const_strict_lock_ptr< T, Lockable >::mutex_type
inherited
template<typename T , typename Lockable = mutex>
typedef T boost::const_strict_lock_ptr< T, Lockable >::value_type
inherited

Constructor & Destructor Documentation

template<typename T , typename Lockable = mutex>
boost::strict_lock_ptr< T, Lockable >::strict_lock_ptr ( T val,
Lockable mtx 
)
inline
Parameters
valuereference of the value to protect.
mtxreference to the mutex used to protect the value. locks the mutex mtx, stores a reference to it and to the value type value.
template<typename T , typename Lockable = mutex>
boost::strict_lock_ptr< T, Lockable >::strict_lock_ptr ( T val,
Lockable mtx,
adopt_lock_t  tag 
)
inline
template<typename T , typename Lockable = mutex>
boost::strict_lock_ptr< T, Lockable >::strict_lock_ptr ( BOOST_THREAD_RV_REF(strict_lock_ptr< T, Lockable >)  other)
inline

Move constructor.

takes ownership of the mutex owned by other, stores a reference to the mutex and the value type of other.

template<typename T , typename Lockable = mutex>
boost::strict_lock_ptr< T, Lockable >::~strict_lock_ptr ( )
inline

Member Function Documentation

template<typename T , typename Lockable = mutex>
const T& boost::const_strict_lock_ptr< T, Lockable >::operator* ( ) const
inlineinherited
Returns
a constant reference to the protected value

References boost::const_strict_lock_ptr< T, Lockable >::value_.

template<typename T , typename Lockable = mutex>
T& boost::strict_lock_ptr< T, Lockable >::operator* ( )
inline
Returns
a reference to the protected value

References T, and boost::const_strict_lock_ptr< T, Lockable >::value_.

template<typename T , typename Lockable = mutex>
const T* boost::const_strict_lock_ptr< T, Lockable >::operator-> ( ) const
inlineinherited
Returns
a constant pointer to the protected value

References boost::const_strict_lock_ptr< T, Lockable >::value_.

template<typename T , typename Lockable = mutex>
T* boost::strict_lock_ptr< T, Lockable >::operator-> ( )
inline
Returns
a pointer to the protected value

References T, and boost::const_strict_lock_ptr< T, Lockable >::value_.

Member Data Documentation

template<typename T , typename Lockable = mutex>
boost::unique_lock<mutex_type> boost::const_strict_lock_ptr< T, Lockable >::lk_
protectedinherited

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