Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::asio::buffered_read_stream< Stream > Singleton Reference

Adds buffering to the read-related operations of a stream. More...

#include <buffered_read_stream_fwd.hpp>

Inheritance diagram for boost::asio::buffered_read_stream< Stream >:
Collaboration diagram for boost::asio::buffered_read_stream< Stream >:

Public Types

typedef remove_reference
< Stream >::type 
next_layer_type
 The type of the next layer. More...
 
typedef
next_layer_type::lowest_layer_type 
lowest_layer_type
 The type of the lowest layer. More...
 

Public Member Functions

 BOOST_ASIO_STATIC_CONSTANT (std::size_t, default_buffer_size=1024)
 
template<typename Arg >
 buffered_read_stream (Arg &a)
 Construct, passing the specified argument to initialise the next layer. More...
 
template<typename Arg >
 buffered_read_stream (Arg &a, std::size_t buffer_size)
 Construct, passing the specified argument to initialise the next layer. More...
 
next_layer_typenext_layer ()
 Get a reference to the next layer. More...
 
lowest_layer_typelowest_layer ()
 Get a reference to the lowest layer. More...
 
const lowest_layer_typelowest_layer () const
 Get a const reference to the lowest layer. More...
 
boost::asio::io_serviceget_io_service ()
 Get the io_service associated with the object. More...
 
void close ()
 Close the stream. More...
 
boost::system::error_code close (boost::system::error_code &ec)
 Close the stream. More...
 
template<typename ConstBufferSequence >
std::size_t write_some (const ConstBufferSequence &buffers)
 Write the given data to the stream. More...
 
template<typename ConstBufferSequence >
std::size_t write_some (const ConstBufferSequence &buffers, boost::system::error_code &ec)
 Write the given data to the stream. More...
 
template<typename ConstBufferSequence , typename WriteHandler >
 BOOST_ASIO_INITFN_RESULT_TYPE (WriteHandler, void(boost::system::error_code, std::size_t)) async_write_some(const ConstBufferSequence &buffers
 Start an asynchronous write. More...
 
 BOOST_ASIO_MOVE_ARG (WriteHandler) handler)
 
std::size_t fill ()
 Fill the buffer with some data. More...
 
std::size_t fill (boost::system::error_code &ec)
 Fill the buffer with some data. More...
 
template<typename ReadHandler >
 BOOST_ASIO_INITFN_RESULT_TYPE (ReadHandler, void(boost::system::error_code, std::size_t)) async_fill(BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
 Start an asynchronous fill. More...
 
template<typename MutableBufferSequence >
std::size_t read_some (const MutableBufferSequence &buffers)
 Read some data from the stream. More...
 
template<typename MutableBufferSequence >
std::size_t read_some (const MutableBufferSequence &buffers, boost::system::error_code &ec)
 Read some data from the stream. More...
 
template<typename MutableBufferSequence , typename ReadHandler >
 BOOST_ASIO_INITFN_RESULT_TYPE (ReadHandler, void(boost::system::error_code, std::size_t)) async_read_some(const MutableBufferSequence &buffers
 Start an asynchronous read. More...
 
 BOOST_ASIO_MOVE_ARG (ReadHandler) handler)
 
template<typename MutableBufferSequence >
std::size_t peek (const MutableBufferSequence &buffers)
 Peek at the incoming data on the stream. More...
 
template<typename MutableBufferSequence >
std::size_t peek (const MutableBufferSequence &buffers, boost::system::error_code &ec)
 Peek at the incoming data on the stream. More...
 
std::size_t in_avail ()
 Determine the amount of data that may be read without blocking. More...
 
std::size_t in_avail (boost::system::error_code &ec)
 Determine the amount of data that may be read without blocking. More...
 

Detailed Description

template<typename Stream>
singleton boost::asio::buffered_read_stream< Stream >

Adds buffering to the read-related operations of a stream.

The buffered_read_stream class template can be used to add buffering to the synchronous and asynchronous read operations of a stream.

Thread Safety
Distinct objects: Safe.
Shared objects: Unsafe.
Concepts:
AsyncReadStream, AsyncWriteStream, Stream, SyncReadStream, SyncWriteStream.

Member Typedef Documentation

template<typename Stream>
typedef next_layer_type::lowest_layer_type boost::asio::buffered_read_stream< Stream >::lowest_layer_type

The type of the lowest layer.

template<typename Stream>
typedef remove_reference<Stream>::type boost::asio::buffered_read_stream< Stream >::next_layer_type

The type of the next layer.

Constructor & Destructor Documentation

template<typename Stream>
template<typename Arg >
boost::asio::buffered_read_stream< Stream >::buffered_read_stream ( Arg &  a)
inlineexplicit

Construct, passing the specified argument to initialise the next layer.

template<typename Stream>
template<typename Arg >
boost::asio::buffered_read_stream< Stream >::buffered_read_stream ( Arg &  a,
std::size_t  buffer_size 
)
inline

Construct, passing the specified argument to initialise the next layer.

Member Function Documentation

template<typename Stream>
template<typename ConstBufferSequence , typename WriteHandler >
boost::asio::buffered_read_stream< Stream >::BOOST_ASIO_INITFN_RESULT_TYPE ( WriteHandler  ,
void(boost::system::error_code, std::size_t)   
) const

Start an asynchronous write.

The data being written must be valid for the lifetime of the asynchronous operation.

template<typename Stream>
template<typename ReadHandler >
boost::asio::buffered_read_stream< Stream >::BOOST_ASIO_INITFN_RESULT_TYPE ( ReadHandler  ,
void(boost::system::error_code, std::size_t)   
)

Start an asynchronous fill.

template<typename Stream>
template<typename MutableBufferSequence , typename ReadHandler >
boost::asio::buffered_read_stream< Stream >::BOOST_ASIO_INITFN_RESULT_TYPE ( ReadHandler  ,
void(boost::system::error_code, std::size_t)   
) const

Start an asynchronous read.

The buffer into which the data will be read must be valid for the lifetime of the asynchronous operation.

template<typename Stream>
boost::asio::buffered_read_stream< Stream >::BOOST_ASIO_MOVE_ARG ( WriteHandler  )
inline
template<typename Stream>
boost::asio::buffered_read_stream< Stream >::BOOST_ASIO_MOVE_ARG ( ReadHandler  )
template<typename Stream>
boost::asio::buffered_read_stream< Stream >::BOOST_ASIO_STATIC_CONSTANT ( std::size_t  ,
default_buffer_size  = 1024 
)
template<typename Stream>
void boost::asio::buffered_read_stream< Stream >::close ( )
inline

Close the stream.

Referenced by boost::asio::buffered_stream< Stream >::close().

template<typename Stream>
boost::system::error_code boost::asio::buffered_read_stream< Stream >::close ( boost::system::error_code ec)
inline

Close the stream.

template<typename Stream>
std::size_t boost::asio::buffered_read_stream< Stream >::fill ( )

Fill the buffer with some data.

Returns the number of bytes placed in the buffer as a result of the operation. Throws an exception on failure.

Referenced by boost::asio::buffered_stream< Stream >::fill().

template<typename Stream>
std::size_t boost::asio::buffered_read_stream< Stream >::fill ( boost::system::error_code ec)

Fill the buffer with some data.

Returns the number of bytes placed in the buffer as a result of the operation, or 0 if an error occurred.

template<typename Stream>
boost::asio::io_service& boost::asio::buffered_read_stream< Stream >::get_io_service ( )
inline

Get the io_service associated with the object.

Referenced by boost::asio::buffered_stream< Stream >::get_io_service().

template<typename Stream>
std::size_t boost::asio::buffered_read_stream< Stream >::in_avail ( )
inline

Determine the amount of data that may be read without blocking.

Referenced by boost::asio::buffered_stream< Stream >::in_avail().

template<typename Stream>
std::size_t boost::asio::buffered_read_stream< Stream >::in_avail ( boost::system::error_code ec)
inline

Determine the amount of data that may be read without blocking.

template<typename Stream>
lowest_layer_type& boost::asio::buffered_read_stream< Stream >::lowest_layer ( )
inline

Get a reference to the lowest layer.

Referenced by boost::asio::buffered_stream< Stream >::lowest_layer().

template<typename Stream>
const lowest_layer_type& boost::asio::buffered_read_stream< Stream >::lowest_layer ( ) const
inline

Get a const reference to the lowest layer.

template<typename Stream>
template<typename MutableBufferSequence >
std::size_t boost::asio::buffered_read_stream< Stream >::peek ( const MutableBufferSequence &  buffers)

Peek at the incoming data on the stream.

Returns the number of bytes read. Throws an exception on failure.

Referenced by boost::asio::buffered_stream< Stream >::peek().

template<typename Stream>
template<typename MutableBufferSequence >
std::size_t boost::asio::buffered_read_stream< Stream >::peek ( const MutableBufferSequence &  buffers,
boost::system::error_code ec 
)

Peek at the incoming data on the stream.

Returns the number of bytes read, or 0 if an error occurred.

template<typename Stream>
template<typename MutableBufferSequence >
std::size_t boost::asio::buffered_read_stream< Stream >::read_some ( const MutableBufferSequence &  buffers)

Read some data from the stream.

Returns the number of bytes read. Throws an exception on failure.

Referenced by boost::asio::buffered_stream< Stream >::read_some().

template<typename Stream>
template<typename MutableBufferSequence >
std::size_t boost::asio::buffered_read_stream< Stream >::read_some ( const MutableBufferSequence &  buffers,
boost::system::error_code ec 
)

Read some data from the stream.

Returns the number of bytes read or 0 if an error occurred.

template<typename Stream>
template<typename ConstBufferSequence >
std::size_t boost::asio::buffered_read_stream< Stream >::write_some ( const ConstBufferSequence &  buffers)
inline

Write the given data to the stream.

Returns the number of bytes written. Throws an exception on failure.

Referenced by boost::asio::buffered_stream< Stream >::write_some().

template<typename Stream>
template<typename ConstBufferSequence >
std::size_t boost::asio::buffered_read_stream< Stream >::write_some ( const ConstBufferSequence &  buffers,
boost::system::error_code ec 
)
inline

Write the given data to the stream.

Returns the number of bytes written, or 0 if an error occurred.


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