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

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

#include <synchronized_value.hpp>

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

Public Types

typedef T value_type
 
typedef Lockable mutex_type
 

Public Member Functions

 const_strict_lock_ptr (T const &val, Lockable &mtx)
 
 const_strict_lock_ptr (T const &val, Lockable &mtx, adopt_lock_t tag) BOOST_NOEXCEPT
 
 const_strict_lock_ptr (BOOST_THREAD_RV_REF(const_strict_lock_ptr) other) BOOST_NOEXCEPT
 Move constructor. More...
 
 ~const_strict_lock_ptr ()
 
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::const_strict_lock_ptr< T, Lockable >

strict lock providing a const 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
template<typename T , typename Lockable = mutex>
typedef T boost::const_strict_lock_ptr< T, Lockable >::value_type

Constructor & Destructor Documentation

template<typename T , typename Lockable = mutex>
boost::const_strict_lock_ptr< T, Lockable >::const_strict_lock_ptr ( T const &  val,
Lockable mtx 
)
inline
Parameters
valueconstant reference 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::const_strict_lock_ptr< T, Lockable >::const_strict_lock_ptr ( T const &  val,
Lockable mtx,
adopt_lock_t  tag 
)
inline
template<typename T , typename Lockable = mutex>
boost::const_strict_lock_ptr< T, Lockable >::const_strict_lock_ptr ( BOOST_THREAD_RV_REF(const_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::const_strict_lock_ptr< T, Lockable >::~const_strict_lock_ptr ( )
inline

Member Function Documentation

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

References 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
inline
Returns
a constant pointer to the protected value

References 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_
protected

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