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_stream< Stream, RecursiveMutex > Class Template Reference

externally_locked_stream cloaks a reference to an stream of type Stream, 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_stream.hpp>

Inheritance diagram for boost::externally_locked_stream< Stream, RecursiveMutex >:
Collaboration diagram for boost::externally_locked_stream< Stream, RecursiveMutex >:

Public Types

typedef RecursiveMutex mutex_type
 

Public Member Functions

 externally_locked_stream (Stream &stream, RecursiveMutex &mtx) BOOST_NOEXCEPT
 Effects: Constructs an externally locked object storing the cloaked reference object. More...
 
stream_guard< Stream,
RecursiveMutex > 
hold () BOOST_NOEXCEPT
 
Stream & bypass () const
 
void swap (externally_locked &rhs)
 
Stream && get (strict_lock< mutex_type > &lk)
 Requires: The lk parameter must be locking the associated mtx. More...
 
const Stream && get (strict_lock< mutex_type > &lk) const
 
Stream && get (nested_strict_lock< Lock > &lk)
 
const Stream && get (nested_strict_lock< Lock > &lk) const
 
Stream && get (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 Stream, typename RecursiveMutex>
class boost::externally_locked_stream< Stream, RecursiveMutex >

externally_locked_stream cloaks a reference to an stream of type Stream, 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

typedef RecursiveMutex boost::externally_locked< Stream & , RecursiveMutex >::mutex_type
inherited

Constructor & Destructor Documentation

template<typename Stream, typename RecursiveMutex>
boost::externally_locked_stream< Stream, RecursiveMutex >::externally_locked_stream ( Stream &  stream,
RecursiveMutex &  mtx 
)
inline

Effects: Constructs an externally locked object storing the cloaked reference object.

Member Function Documentation

template<typename Stream, typename RecursiveMutex>
Stream& boost::externally_locked_stream< Stream, RecursiveMutex >::bypass ( ) const
inline
Stream & & boost::externally_locked< Stream & , RecursiveMutex >::get ( strict_lock< mutex_type > &  lk)
inlineinherited

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

References boost::interprocess::lock_error.

Referenced by boost::operator>>().

const Stream & & boost::externally_locked< Stream & , RecursiveMutex >::get ( strict_lock< mutex_type > &  lk) const
inlineinherited
Stream & & boost::externally_locked< Stream & , RecursiveMutex >::get ( nested_strict_lock< Lock > &  lk)
inlineinherited
const Stream & & boost::externally_locked< Stream & , RecursiveMutex >::get ( nested_strict_lock< Lock > &  lk) const
inlineinherited
Stream & & boost::externally_locked< Stream & , RecursiveMutex >::get ( Lock lk)
inlineinherited

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

References boost::BOOST_STATIC_ASSERT(), boost::interprocess::lock_error, and boost::program_options::value().

template<typename Stream, typename RecursiveMutex>
stream_guard<Stream, RecursiveMutex> boost::externally_locked_stream< Stream, RecursiveMutex >::hold ( )
inline
void boost::externally_locked< Stream & , RecursiveMutex >::lock ( void  )
inlineinherited
mutex_type* boost::externally_locked< Stream & , RecursiveMutex >::mutex ( ) const
inlineinherited
void boost::externally_locked< Stream & , RecursiveMutex >::swap ( externally_locked< Stream &, RecursiveMutex > &  rhs)
inlineinherited
bool boost::externally_locked< Stream & , RecursiveMutex >::try_lock ( void  )
inlineinherited
void boost::externally_locked< Stream & , RecursiveMutex >::unlock ( void  )
inlineinherited

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