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

externally_locked cloaks an object of type T, and actually provides full access to that object through the get and set member functions, provided you pass a reference to a strict lock object More...

#include <externally_locked.hpp>

Inheritance diagram for boost::externally_locked< T, MutexType >:

Public Types

typedef MutexType mutex_type
 

Public Member Functions

 externally_locked (mutex_type &mtx, const T &obj)
 Requires: T is a model of CopyConstructible. More...
 
 externally_locked (mutex_type &mtx, BOOST_THREAD_RV_REF(T) obj)
 Requires: T is a model of Movable. More...
 
 externally_locked (mutex_type &mtx)
 Requires: T is a model of DefaultConstructible. More...
 
 externally_locked (externally_locked const &rhs)
 Copy constructor. More...
 
 externally_locked (BOOST_THREAD_RV_REF(externally_locked) rhs)
 Move constructor. More...
 
externally_lockedoperator= (externally_locked const &rhs)
 assignment More...
 
externally_lockedoperator= (BOOST_THREAD_RV_REF(externally_locked) rhs)
 move assignment More...
 
void swap (externally_locked &rhs)
 
Tget (strict_lock< mutex_type > &lk)
 Requires: The lk parameter must be locking the associated mtx. More...
 
const Tget (strict_lock< mutex_type > &lk) const
 
template<class Lock >
Tget (nested_strict_lock< Lock > &lk)
 
template<class Lock >
const Tget (nested_strict_lock< Lock > &lk) const
 
template<class Lock >
Tget (Lock &lk)
 Requires: The lk parameter must be locking the associated mtx. More...
 
mutex_typemutex () const BOOST_NOEXCEPT
 
void lock ()
 
void unlock ()
 
bool try_lock ()
 

Detailed Description

template<typename T, typename MutexType>
class boost::externally_locked< T, MutexType >

externally_locked cloaks an object of type T, and actually provides full access to that object through the get and set member functions, provided you pass a reference to a strict lock object

Member Typedef Documentation

template<typename T, typename MutexType>
typedef MutexType boost::externally_locked< T, MutexType >::mutex_type

Constructor & Destructor Documentation

template<typename T, typename MutexType>
boost::externally_locked< T, MutexType >::externally_locked ( mutex_type mtx,
const T obj 
)
inline

Requires: T is a model of CopyConstructible.

Effects: Constructs an externally locked object copying the cloaked type.

template<typename T, typename MutexType>
boost::externally_locked< T, MutexType >::externally_locked ( mutex_type mtx,
BOOST_THREAD_RV_REF(T obj 
)
inline

Requires: T is a model of Movable.

Effects: Constructs an externally locked object by moving the cloaked type.

template<typename T, typename MutexType>
boost::externally_locked< T, MutexType >::externally_locked ( mutex_type mtx)
inline

Requires: T is a model of DefaultConstructible.

Effects: Constructs an externally locked object initializing the cloaked type with the default constructor.

template<typename T, typename MutexType>
boost::externally_locked< T, MutexType >::externally_locked ( externally_locked< T, MutexType > const &  rhs)
inline

Copy constructor.

template<typename T, typename MutexType>
boost::externally_locked< T, MutexType >::externally_locked ( BOOST_THREAD_RV_REF(externally_locked< T, MutexType >)  rhs)
inline

Move constructor.

Member Function Documentation

template<typename T, typename MutexType>
T& boost::externally_locked< T, MutexType >::get ( strict_lock< mutex_type > &  lk)
inline

Requires: The lk parameter must be locking the associated mtx.

Returns: The address of the cloaked object..

Throws: lock_error if BOOST_THREAD_THROW_IF_PRECONDITION_NOT_SATISFIED is not defined and the lk parameter doesn't satisfy the preconditions

template<typename T, typename MutexType>
const T& boost::externally_locked< T, MutexType >::get ( strict_lock< mutex_type > &  lk) const
inline
template<typename T, typename MutexType>
template<class Lock >
T& boost::externally_locked< T, MutexType >::get ( nested_strict_lock< Lock > &  lk)
inline
template<typename T, typename MutexType>
template<class Lock >
const T& boost::externally_locked< T, MutexType >::get ( nested_strict_lock< Lock > &  lk) const
inline
template<typename T, typename MutexType>
template<class Lock >
T& boost::externally_locked< T, MutexType >::get ( Lock lk)
inline

Requires: The lk parameter must be locking the associated mtx.

Returns: The address of the cloaked object..

Throws: lock_error if BOOST_THREAD_THROW_IF_PRECONDITION_NOT_SATISFIED is not defined and the lk parameter doesn't satisfy the preconditions

template<typename T, typename MutexType>
void boost::externally_locked< T, MutexType >::lock ( void  )
inline
template<typename T, typename MutexType>
mutex_type* boost::externally_locked< T, MutexType >::mutex ( ) const
inline
template<typename T, typename MutexType>
externally_locked& boost::externally_locked< T, MutexType >::operator= ( externally_locked< T, MutexType > const &  rhs)
inline

assignment

template<typename T, typename MutexType>
externally_locked& boost::externally_locked< T, MutexType >::operator= ( BOOST_THREAD_RV_REF(externally_locked< T, MutexType >)  rhs)
inline

move assignment

template<typename T, typename MutexType>
void boost::externally_locked< T, MutexType >::swap ( externally_locked< T, MutexType > &  rhs)
inline
template<typename T, typename MutexType>
bool boost::externally_locked< T, MutexType >::try_lock ( void  )
inline
template<typename T, typename MutexType>
void boost::externally_locked< T, MutexType >::unlock ( void  )
inline

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