11 #ifndef ASIO_IMPL_BUFFERED_WRITE_STREAM_HPP 12 #define ASIO_IMPL_BUFFERED_WRITE_STREAM_HPP 14 #if defined(_MSC_VER) && (_MSC_VER >= 1200) 16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 27 template <
typename Stream>
30 std::size_t bytes_written =
write(next_layer_,
31 buffer(storage_.data(), storage_.size()));
32 storage_.consume(bytes_written);
36 template <
typename Stream>
39 std::size_t bytes_written =
write(next_layer_,
40 buffer(storage_.data(), storage_.size()),
42 storage_.consume(bytes_written);
48 template <
typename WriteHandler>
53 WriteHandler& handler)
59 #if defined(ASIO_HAS_MOVE) 71 #endif // defined(ASIO_HAS_MOVE) 74 const std::size_t bytes_written)
85 template <
typename WriteHandler>
93 template <
typename WriteHandler>
98 pointer, size, this_handler->
handler_);
101 template <
typename WriteHandler>
109 template <
typename Function,
typename WriteHandler>
117 template <
typename Function,
typename WriteHandler>
126 template <
typename Stream>
127 template <
typename WriteHandler>
149 template <
typename Stream>
150 template <
typename ConstBufferSequence>
152 const ConstBufferSequence&
buffers)
160 return this->copy(buffers);
163 template <
typename Stream>
164 template <
typename ConstBufferSequence>
176 return this->copy(buffers);
181 template <
typename ConstBufferSequence,
typename WriteHandler>
186 const ConstBufferSequence&
buffers, WriteHandler& handler)
193 #if defined(ASIO_HAS_MOVE) 207 #endif // defined(ASIO_HAS_MOVE) 213 const std::size_t length = 0;
221 std::size_t length = bytes_avail < space_avail
222 ? bytes_avail : space_avail;
236 template <
typename ConstBufferSequence,
typename WriteHandler>
239 ConstBufferSequence, WriteHandler>* this_handler)
242 size, this_handler->handler_);
245 template <
typename ConstBufferSequence,
typename WriteHandler>
248 ConstBufferSequence, WriteHandler>* this_handler)
251 pointer, size, this_handler->handler_);
254 template <
typename ConstBufferSequence,
typename WriteHandler>
257 ConstBufferSequence, WriteHandler>* this_handler)
260 this_handler->handler_);
263 template <
typename Function,
typename ConstBufferSequence,
264 typename WriteHandler>
267 ConstBufferSequence, WriteHandler>* this_handler)
270 function, this_handler->handler_);
273 template <
typename Function,
typename ConstBufferSequence,
274 typename WriteHandler>
277 ConstBufferSequence, WriteHandler>* this_handler)
280 function, this_handler->handler_);
284 template <
typename Stream>
285 template <
typename ConstBufferSequence,
typename WriteHandler>
289 const ConstBufferSequence&
buffers,
320 template <
typename Stream>
321 template <
typename ConstBufferSequence>
323 const ConstBufferSequence&
buffers)
328 std::size_t length = bytes_avail < space_avail ? bytes_avail : space_avail;
338 #endif // ASIO_IMPL_BUFFERED_WRITE_STREAM_HPP void operator()(const asio::error_code &ec, const std::size_t bytes_written)
void asio_handler_deallocate(void *pointer, std::size_t size, binder1< Handler, Arg1 > *this_handler)
detail::buffered_stream_storage & storage_
void * asio_handler_allocate(std::size_t size, binder1< Handler, Arg1 > *this_handler)
void operator()(const asio::error_code &ec, std::size_t)
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)
std::size_t write(SyncWriteStream &s, const ConstBufferSequence &buffers, CompletionCondition completion_condition, asio::error_code &ec)
Write a certain amount of data to a stream before returning.
mutable_buffers_1 buffer(const mutable_buffer &b)
Create a new modifiable buffer from an existing buffer.
detail::transfer_all_t transfer_all()
void resize(size_type length)
ASIO_INITFN_RESULT_TYPE(ComposedConnectHandler, void(asio::error_code, Iterator)) async_connect(basic_socket< Protocol
std::size_t buffer_size(const mutable_buffer &b)
Get the number of bytes in a modifiable buffer.
void invoke(Function &function, Context &context)
const MutableBufferSequence & buffers
void asio_handler_invoke(Function &function, binder1< Handler, Arg1 > *this_handler)
asio::basic_streambuf< Allocator > CompletionCondition ASIO_MOVE_ARG(ReadHandler) handler)
bool is_continuation(Context &context)
void consume(size_type count)
detail::buffered_stream_storage & storage_
Class to represent an error code value.
void deallocate(void *p, std::size_t s, Handler &h)
size_type capacity() const
void * allocate(std::size_t s, Handler &h)
handler_type< Handler, Signature >::type handler
buffered_write_some_handler(detail::buffered_stream_storage &storage, const ConstBufferSequence &buffers, WriteHandler &handler)
#define ASIO_MOVE_CAST(type)
async_result< typename handler_type< Handler, Signature >::type > result
#define ASIO_WRITE_HANDLER_CHECK(handler_type, handler)
ConstBufferSequence buffers_
std::size_t write_some(const ConstBufferSequence &buffers)
bool asio_handler_is_continuation(binder1< Handler, Arg1 > *this_handler)
std::size_t buffer_copy(const mutable_buffer &target, const const_buffer &source)
Copies bytes from a source buffer to a target buffer.
Adds buffering to the write-related operations of a stream.
buffered_flush_handler(detail::buffered_stream_storage &storage, WriteHandler &handler)