11 #ifndef ASIO_BUFFERED_READ_STREAM_HPP 12 #define ASIO_BUFFERED_READ_STREAM_HPP 14 #if defined(_MSC_VER) && (_MSC_VER >= 1200) 16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 47 template <
typename Stream>
58 #if defined(GENERATING_DOCUMENTATION) 59 static const std::size_t default_buffer_size = implementation_defined;
66 template <
typename Arg>
69 storage_(default_buffer_size)
74 template <
typename Arg>
90 return next_layer_.lowest_layer();
96 return next_layer_.lowest_layer();
102 return next_layer_.get_io_service();
114 return next_layer_.close(ec);
119 template <
typename ConstBufferSequence>
122 return next_layer_.write_some(buffers);
127 template <
typename ConstBufferSequence>
131 return next_layer_.write_some(buffers, ec);
136 template <
typename ConstBufferSequence,
typename WriteHandler>
139 async_write_some(
const ConstBufferSequence&
buffers,
146 next_layer_.async_write_some(buffers,
162 template <
typename ReadHandler>
169 template <
typename MutableBufferSequence>
170 std::size_t
read_some(
const MutableBufferSequence& buffers);
174 template <
typename MutableBufferSequence>
175 std::size_t
read_some(
const MutableBufferSequence& buffers,
180 template <
typename MutableBufferSequence,
typename ReadHandler>
183 async_read_some(
const MutableBufferSequence& buffers,
188 template <
typename MutableBufferSequence>
189 std::size_t
peek(
const MutableBufferSequence& buffers);
193 template <
typename MutableBufferSequence>
194 std::size_t
peek(
const MutableBufferSequence& buffers,
200 return storage_.
size();
207 return storage_.
size();
213 template <
typename MutableBufferSequence>
214 std::size_t copy(
const MutableBufferSequence& buffers)
217 buffers, storage_.
data(), storage_.
size());
218 storage_.
consume(bytes_copied);
225 template <
typename MutableBufferSequence>
226 std::size_t peek_copy(
const MutableBufferSequence& buffers)
244 #endif // ASIO_BUFFERED_READ_STREAM_HPP
std::size_t in_avail()
Determine the amount of data that may be read without blocking.
std::size_t write_some(const ConstBufferSequence &buffers, asio::error_code &ec)
Provides core I/O functionality.
lowest_layer_type & lowest_layer()
Get a reference to the lowest layer.
next_layer_type & next_layer()
Get a reference to the next layer.
asio::basic_streambuf< Allocator > MatchCondition enable_if< is_match_condition< MatchCondition >::value >::type *detail::async_result_init< ReadHandler, void(asio::error_code, std::size_t)> init(ASIO_MOVE_CAST(ReadHandler)(handler))
#define ASIO_HANDLER_TYPE(h, sig)
const lowest_layer_type & lowest_layer() const
Get a const reference to the lowest layer.
ASIO_INITFN_RESULT_TYPE(WriteHandler, void(asio::error_code, std::size_t)) async_write_some(const ConstBufferSequence &buffers
remove_reference< Stream >::type next_layer_type
The type of the next layer.
ASIO_MOVE_ARG(WriteHandler) handler)
buffered_read_stream(Arg &a, std::size_t buffer_size)
Construct, passing the specified argument to initialise the next layer.
std::size_t write_some(const ConstBufferSequence &buffers)
std::size_t buffer_size(const mutable_buffer &b)
Get the number of bytes in a modifiable buffer.
const MutableBufferSequence & buffers
std::size_t peek(const MutableBufferSequence &buffers)
Adds buffering to the read-related operations of a stream.
buffered_read_stream(Arg &a)
Construct, passing the specified argument to initialise the next layer.
void consume(size_type count)
Class to represent an error code value.
asio::io_service & get_io_service()
Get the io_service associated with the object.
std::size_t in_avail(asio::error_code &ec)
Determine the amount of data that may be read without blocking.
ASIO_STATIC_CONSTANT(std::size_t, default_buffer_size=1024)
handler_type< Handler, Signature >::type handler
#define ASIO_MOVE_CAST(type)
asio::error_code close(asio::error_code &ec)
Close the stream.
std::size_t read_some(const MutableBufferSequence &buffers)
async_result< typename handler_type< Handler, Signature >::type > result
void close()
Close the stream.
std::size_t buffer_copy(const mutable_buffer &target, const const_buffer &source)
Copies bytes from a source buffer to a target buffer.
next_layer_type::lowest_layer_type lowest_layer_type
The type of the lowest layer.