#include <buffered_stream.hpp>
Inherits asio::detail::noncopyable.
Public Types | |
| typedef boost::remove_reference < Stream >::type | next_layer_type |
| The type of the next layer. | |
| typedef next_layer_type::lowest_layer_type | lowest_layer_type |
| The type of the lowest layer. | |
Public Member Functions | |
| template<typename Arg> | |
| buffered_stream (Arg &a) | |
| Construct, passing the specified argument to initialise the next layer. | |
| 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. | |
| next_layer_type & | next_layer () |
| Get a reference to the next layer. | |
| lowest_layer_type & | lowest_layer () |
| Get a reference to the lowest layer. | |
| asio::io_service & | io_service () |
| Get the io_service associated with the object. | |
| void | close () |
| Close the stream. | |
| asio::error_code | close (asio::error_code &ec) |
| Close the stream. | |
| std::size_t | flush () |
| std::size_t | flush (asio::error_code &ec) |
| template<typename WriteHandler> | |
| void | async_flush (WriteHandler handler) |
| Start an asynchronous flush. | |
| 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> | |
| void | async_write_some (const ConstBufferSequence &buffers, WriteHandler handler) |
| std::size_t | fill () |
| std::size_t | fill (asio::error_code &ec) |
| template<typename ReadHandler> | |
| void | async_fill (ReadHandler handler) |
| Start an asynchronous fill. | |
| 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> | |
| void | async_read_some (const MutableBufferSequence &buffers, 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. | |
| std::size_t | in_avail (asio::error_code &ec) |
| Determine the amount of data that may be read without blocking. | |
Private Types | |
| typedef buffered_write_stream < Stream > | write_stream_type |
| typedef buffered_read_stream < write_stream_type & > | read_stream_type |
Private Attributes | |
| write_stream_type | inner_stream_impl_ |
| read_stream_type | stream_impl_ |
The buffered_stream class template can be used to add buffering to the synchronous and asynchronous read and write operations of a stream.
Definition at line 47 of file buffered_stream.hpp.
| typedef boost::remove_reference<Stream>::type asio::buffered_stream< Stream >::next_layer_type |
| typedef next_layer_type::lowest_layer_type asio::buffered_stream< Stream >::lowest_layer_type |
typedef buffered_write_stream<Stream> asio::buffered_stream< Stream >::write_stream_type [private] |
Definition at line 231 of file buffered_stream.hpp.
typedef buffered_read_stream<write_stream_type&> asio::buffered_stream< Stream >::read_stream_type [private] |
Definition at line 235 of file buffered_stream.hpp.
| asio::buffered_stream< Stream >::buffered_stream | ( | Arg & | a | ) | [inline, explicit] |
Construct, passing the specified argument to initialise the next layer.
Definition at line 59 of file buffered_stream.hpp.
| asio::buffered_stream< Stream >::buffered_stream | ( | Arg & | a, | |
| std::size_t | read_buffer_size, | |||
| std::size_t | write_buffer_size | |||
| ) | [inline, explicit] |
Construct, passing the specified argument to initialise the next layer.
Definition at line 67 of file buffered_stream.hpp.
| next_layer_type& asio::buffered_stream< Stream >::next_layer | ( | ) | [inline] |
Get a reference to the next layer.
Definition at line 75 of file buffered_stream.hpp.
References asio::buffered_read_stream< Stream >::next_layer(), and asio::buffered_stream< Stream >::stream_impl_.
| lowest_layer_type& asio::buffered_stream< Stream >::lowest_layer | ( | ) | [inline] |
Get a reference to the lowest layer.
Definition at line 81 of file buffered_stream.hpp.
References asio::buffered_read_stream< Stream >::lowest_layer(), and asio::buffered_stream< Stream >::stream_impl_.
| asio::io_service& asio::buffered_stream< Stream >::io_service | ( | ) | [inline] |
Get the io_service associated with the object.
Definition at line 87 of file buffered_stream.hpp.
References asio::buffered_read_stream< Stream >::io_service(), and asio::buffered_stream< Stream >::stream_impl_.
| void asio::buffered_stream< Stream >::close | ( | ) | [inline] |
Close the stream.
Definition at line 93 of file buffered_stream.hpp.
References asio::buffered_read_stream< Stream >::close(), and asio::buffered_stream< Stream >::stream_impl_.
| asio::error_code asio::buffered_stream< Stream >::close | ( | asio::error_code & | ec | ) | [inline] |
Close the stream.
Definition at line 99 of file buffered_stream.hpp.
References asio::buffered_read_stream< Stream >::close(), and asio::buffered_stream< Stream >::stream_impl_.
| 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 107 of file buffered_stream.hpp.
References asio::buffered_read_stream< Stream >::next_layer(), and asio::buffered_stream< Stream >::stream_impl_.
| 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 115 of file buffered_stream.hpp.
References asio::buffered_read_stream< Stream >::next_layer(), and asio::buffered_stream< Stream >::stream_impl_.
| void asio::buffered_stream< Stream >::async_flush | ( | WriteHandler | handler | ) | [inline] |
Start an asynchronous flush.
Definition at line 122 of file buffered_stream.hpp.
References asio::buffered_read_stream< Stream >::next_layer(), and asio::buffered_stream< Stream >::stream_impl_.
| 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 130 of file buffered_stream.hpp.
References asio::buffered_stream< Stream >::stream_impl_, and asio::buffered_read_stream< Stream >::write_some().
| 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 138 of file buffered_stream.hpp.
References asio::buffered_stream< Stream >::stream_impl_, and asio::buffered_read_stream< Stream >::write_some().
| void asio::buffered_stream< Stream >::async_write_some | ( | const ConstBufferSequence & | buffers, | |
| WriteHandler | handler | |||
| ) | [inline] |
Start an asynchronous write. The data being written must be valid for the lifetime of the asynchronous operation.
Definition at line 147 of file buffered_stream.hpp.
References asio::buffered_read_stream< Stream >::async_write_some(), and asio::buffered_stream< Stream >::stream_impl_.
| 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 155 of file buffered_stream.hpp.
References asio::buffered_read_stream< Stream >::fill(), and asio::buffered_stream< Stream >::stream_impl_.
| 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 162 of file buffered_stream.hpp.
References asio::buffered_read_stream< Stream >::fill(), and asio::buffered_stream< Stream >::stream_impl_.
| void asio::buffered_stream< Stream >::async_fill | ( | ReadHandler | handler | ) | [inline] |
Start an asynchronous fill.
Definition at line 169 of file buffered_stream.hpp.
References asio::buffered_read_stream< Stream >::async_fill(), and asio::buffered_stream< Stream >::stream_impl_.
| 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 177 of file buffered_stream.hpp.
References asio::buffered_read_stream< Stream >::read_some(), and asio::buffered_stream< Stream >::stream_impl_.
| 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 185 of file buffered_stream.hpp.
References asio::buffered_read_stream< Stream >::read_some(), and asio::buffered_stream< Stream >::stream_impl_.
| void asio::buffered_stream< Stream >::async_read_some | ( | const MutableBufferSequence & | buffers, | |
| ReadHandler | handler | |||
| ) | [inline] |
Start an asynchronous read. The buffer into which the data will be read must be valid for the lifetime of the asynchronous operation.
Definition at line 194 of file buffered_stream.hpp.
References asio::buffered_read_stream< Stream >::async_read_some(), and asio::buffered_stream< Stream >::stream_impl_.
| 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 203 of file buffered_stream.hpp.
References asio::buffered_read_stream< Stream >::peek(), and asio::buffered_stream< Stream >::stream_impl_.
| 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 211 of file buffered_stream.hpp.
References asio::buffered_read_stream< Stream >::peek(), and asio::buffered_stream< Stream >::stream_impl_.
| std::size_t asio::buffered_stream< Stream >::in_avail | ( | ) | [inline] |
Determine the amount of data that may be read without blocking.
Definition at line 218 of file buffered_stream.hpp.
References asio::buffered_read_stream< Stream >::in_avail(), and asio::buffered_stream< Stream >::stream_impl_.
| 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 224 of file buffered_stream.hpp.
References asio::buffered_read_stream< Stream >::in_avail(), and asio::buffered_stream< Stream >::stream_impl_.
write_stream_type asio::buffered_stream< Stream >::inner_stream_impl_ [private] |
Definition at line 232 of file buffered_stream.hpp.
read_stream_type asio::buffered_stream< Stream >::stream_impl_ [private] |
Definition at line 236 of file buffered_stream.hpp.
Referenced by asio::buffered_stream< Stream >::async_fill(), asio::buffered_stream< Stream >::async_flush(), asio::buffered_stream< Stream >::async_read_some(), asio::buffered_stream< Stream >::async_write_some(), asio::buffered_stream< Stream >::close(), asio::buffered_stream< Stream >::fill(), asio::buffered_stream< Stream >::flush(), asio::buffered_stream< Stream >::in_avail(), asio::buffered_stream< Stream >::io_service(), asio::buffered_stream< Stream >::lowest_layer(), asio::buffered_stream< Stream >::next_layer(), asio::buffered_stream< Stream >::peek(), asio::buffered_stream< Stream >::read_some(), and asio::buffered_stream< Stream >::write_some().
1.5.6