Realistic 3D camera system
3D camera system components
Public Types | Public Member Functions | List of all members
asio::buffered_stream< Stream > Class Template Reference

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

#include <buffered_stream.hpp>

Inheritance diagram for asio::buffered_stream< Stream >:
asio::detail::noncopyable

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

template<typename Arg >
 buffered_stream (Arg &a)
 Construct, passing the specified argument to initialise the next layer. More...
 
template<typename Arg >
 buffered_stream (Arg &a, std::size_t read_buffer_size, std::size_t write_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...
 
asio::io_serviceget_io_service ()
 Get the io_service associated with the object. More...
 
void close ()
 Close the stream. More...
 
asio::error_code close (asio::error_code &ec)
 Close the stream. More...
 
std::size_t flush ()
 
std::size_t flush (asio::error_code &ec)
 
template<typename WriteHandler >
 ASIO_INITFN_RESULT_TYPE (WriteHandler, void(asio::error_code, std::size_t)) async_flush(ASIO_MOVE_ARG(WriteHandler) handler)
 Start an asynchronous flush. More...
 
template<typename ConstBufferSequence >
std::size_t write_some (const ConstBufferSequence &buffers)
 
template<typename ConstBufferSequence >
std::size_t write_some (const ConstBufferSequence &buffers, asio::error_code &ec)
 
template<typename ConstBufferSequence , typename WriteHandler >
 ASIO_INITFN_RESULT_TYPE (WriteHandler, void(asio::error_code, std::size_t)) async_write_some(const ConstBufferSequence &buffers
 
 ASIO_MOVE_ARG (WriteHandler) handler)
 
std::size_t fill ()
 
std::size_t fill (asio::error_code &ec)
 
template<typename ReadHandler >
 ASIO_INITFN_RESULT_TYPE (ReadHandler, void(asio::error_code, std::size_t)) async_fill(ASIO_MOVE_ARG(ReadHandler) handler)
 Start an asynchronous fill. More...
 
template<typename MutableBufferSequence >
std::size_t read_some (const MutableBufferSequence &buffers)
 
template<typename MutableBufferSequence >
std::size_t read_some (const MutableBufferSequence &buffers, asio::error_code &ec)
 
template<typename MutableBufferSequence , typename ReadHandler >
 ASIO_INITFN_RESULT_TYPE (ReadHandler, void(asio::error_code, std::size_t)) async_read_some(const MutableBufferSequence &buffers
 
 ASIO_MOVE_ARG (ReadHandler) handler)
 
template<typename MutableBufferSequence >
std::size_t peek (const MutableBufferSequence &buffers)
 
template<typename MutableBufferSequence >
std::size_t peek (const MutableBufferSequence &buffers, asio::error_code &ec)
 
std::size_t in_avail ()
 Determine the amount of data that may be read without blocking. More...
 
std::size_t in_avail (asio::error_code &ec)
 Determine the amount of data that may be read without blocking. More...
 

Detailed Description

template<typename Stream>
class asio::buffered_stream< Stream >

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

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

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

Definition at line 45 of file buffered_stream.hpp.

Member Typedef Documentation

template<typename Stream >
typedef next_layer_type::lowest_layer_type asio::buffered_stream< Stream >::lowest_layer_type

The type of the lowest layer.

Definition at line 53 of file buffered_stream.hpp.

template<typename Stream >
typedef remove_reference<Stream>::type asio::buffered_stream< Stream >::next_layer_type

The type of the next layer.

Definition at line 50 of file buffered_stream.hpp.

Constructor & Destructor Documentation

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

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

Definition at line 57 of file buffered_stream.hpp.

template<typename Stream >
template<typename Arg >
asio::buffered_stream< Stream >::buffered_stream ( Arg &  a,
std::size_t  read_buffer_size,
std::size_t  write_buffer_size 
)
inlineexplicit

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

Definition at line 65 of file buffered_stream.hpp.

Member Function Documentation

template<typename Stream >
template<typename WriteHandler >
asio::buffered_stream< Stream >::ASIO_INITFN_RESULT_TYPE ( WriteHandler  ,
void(asio::error_code, std::size_t)   
)
inline

Start an asynchronous flush.

Definition at line 126 of file buffered_stream.hpp.

template<typename Stream >
template<typename ConstBufferSequence , typename WriteHandler >
asio::buffered_stream< Stream >::ASIO_INITFN_RESULT_TYPE ( WriteHandler  ,
void(asio::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 >
asio::buffered_stream< Stream >::ASIO_INITFN_RESULT_TYPE ( ReadHandler  ,
void(asio::error_code, std::size_t)   
)
inline

Start an asynchronous fill.

Definition at line 179 of file buffered_stream.hpp.

template<typename Stream >
template<typename MutableBufferSequence , typename ReadHandler >
asio::buffered_stream< Stream >::ASIO_INITFN_RESULT_TYPE ( ReadHandler  ,
void(asio::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 >
asio::buffered_stream< Stream >::ASIO_MOVE_ARG ( WriteHandler  )
inline

Definition at line 157 of file buffered_stream.hpp.

template<typename Stream >
asio::buffered_stream< Stream >::ASIO_MOVE_ARG ( ReadHandler  )
inline

Definition at line 209 of file buffered_stream.hpp.

template<typename Stream >
void asio::buffered_stream< Stream >::close ( )
inline

Close the stream.

Definition at line 97 of file buffered_stream.hpp.

template<typename Stream >
asio::error_code asio::buffered_stream< Stream >::close ( asio::error_code ec)
inline

Close the stream.

Definition at line 103 of file buffered_stream.hpp.

template<typename Stream >
std::size_t asio::buffered_stream< Stream >::fill ( )
inline

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.

Definition at line 165 of file buffered_stream.hpp.

template<typename Stream >
std::size_t asio::buffered_stream< Stream >::fill ( asio::error_code ec)
inline

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.

Definition at line 172 of file buffered_stream.hpp.

template<typename Stream >
std::size_t asio::buffered_stream< Stream >::flush ( )
inline

Flush all data from the buffer to the next layer. Returns the number of bytes written to the next layer on the last write operation. Throws an exception on failure.

Definition at line 111 of file buffered_stream.hpp.

template<typename Stream >
std::size_t asio::buffered_stream< Stream >::flush ( asio::error_code ec)
inline

Flush all data from the buffer to the next layer. Returns the number of bytes written to the next layer on the last write operation, or 0 if an error occurred.

Definition at line 119 of file buffered_stream.hpp.

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

Get the io_service associated with the object.

Definition at line 91 of file buffered_stream.hpp.

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

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

Definition at line 233 of file buffered_stream.hpp.

template<typename Stream >
std::size_t asio::buffered_stream< Stream >::in_avail ( asio::error_code ec)
inline

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

Definition at line 239 of file buffered_stream.hpp.

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

Get a reference to the lowest layer.

Definition at line 79 of file buffered_stream.hpp.

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

Get a const reference to the lowest layer.

Definition at line 85 of file buffered_stream.hpp.

template<typename Stream >
next_layer_type& asio::buffered_stream< Stream >::next_layer ( )
inline

Get a reference to the next layer.

Definition at line 73 of file buffered_stream.hpp.

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

Peek at the incoming data on the stream. Returns the number of bytes read. Throws an exception on failure.

Definition at line 218 of file buffered_stream.hpp.

template<typename Stream >
template<typename MutableBufferSequence >
std::size_t asio::buffered_stream< Stream >::peek ( const MutableBufferSequence &  buffers,
asio::error_code ec 
)
inline

Peek at the incoming data on the stream. Returns the number of bytes read, or 0 if an error occurred.

Definition at line 226 of file buffered_stream.hpp.

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

Read some data from the stream. Returns the number of bytes read. Throws an exception on failure.

Definition at line 189 of file buffered_stream.hpp.

template<typename Stream >
template<typename MutableBufferSequence >
std::size_t asio::buffered_stream< Stream >::read_some ( const MutableBufferSequence &  buffers,
asio::error_code ec 
)
inline

Read some data from the stream. Returns the number of bytes read or 0 if an error occurred.

Definition at line 197 of file buffered_stream.hpp.

template<typename Stream >
template<typename ConstBufferSequence >
std::size_t asio::buffered_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.

Definition at line 137 of file buffered_stream.hpp.

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

Write the given data to the stream. Returns the number of bytes written, or 0 if an error occurred.

Definition at line 145 of file buffered_stream.hpp.


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