/usr/include/boost/asio
NameSizeModeActions
detail/-0755rm
execution/-0755rm
generic/-0755rm
impl/-0755rm
ip/-0755rm
local/-0755rm
posix/-0755rm
ssl/-0755rm
traits/-0755rm
ts/-0755rm
windows/-0755rm
any_io_executor.hpp26250644editdlrm
associated_allocator.hpp37910644editdlrm
associated_executor.hpp50570644editdlrm
async_result.hpp194230644editdlrm
awaitable.hpp32700644editdlrm
basic_datagram_socket.hpp475210644editdlrm
basic_deadline_timer.hpp241580644editdlrm
basic_io_object.hpp80960644editdlrm
basic_raw_socket.hpp469960644editdlrm
basic_seq_packet_socket.hpp291840644editdlrm
basic_serial_port.hpp319120644editdlrm
basic_signal_set.hpp198760644editdlrm
basic_socket.hpp655160644editdlrm
basic_socket_acceptor.hpp880620644editdlrm
basic_socket_iostream.hpp132980644editdlrm
basic_socket_streambuf.hpp217130644editdlrm
basic_streambuf.hpp137140644editdlrm
basic_streambuf_fwd.hpp9200644editdlrm
basic_stream_socket.hpp415200644editdlrm
basic_waitable_timer.hpp285280644editdlrm
bind_executor.hpp165100644editdlrm
buffer.hpp832540644editdlrm
buffered_read_stream.hpp84240644editdlrm
buffered_read_stream_fwd.hpp6990644editdlrm
buffered_stream.hpp90740644editdlrm
buffered_stream_fwd.hpp6690644editdlrm
buffered_write_stream.hpp80420644editdlrm
buffered_write_stream_fwd.hpp7050644editdlrm
buffers_iterator.hpp140490644editdlrm
completion_condition.hpp55000644editdlrm
compose.hpp45960644editdlrm
connect.hpp431570644editdlrm
coroutine.hpp98970644editdlrm
co_spawn.hpp145090644editdlrm
deadline_timer.hpp11380644editdlrm
defer.hpp50700644editdlrm
detached.hpp35170644editdlrm
dispatch.hpp45370644editdlrm
error.hpp103510644editdlrm
execution.hpp18710644editdlrm
execution_context.hpp143410644editdlrm
executor.hpp104670644editdlrm
executor_work_guard.hpp80390644editdlrm
handler_alloc_hook.hpp34710644editdlrm
handler_continuation_hook.hpp14740644editdlrm
handler_invoke_hook.hpp37440644editdlrm
high_resolution_timer.hpp13940644editdlrm
io_context.hpp552260644editdlrm
io_context_strand.hpp137060644editdlrm
io_service.hpp8610644editdlrm
io_service_strand.hpp5750644editdlrm
is_applicable_property.hpp16050644editdlrm
is_executor.hpp13060644editdlrm
is_read_buffered.hpp16460644editdlrm
is_write_buffered.hpp16670644editdlrm
multiple_exceptions.hpp16310644editdlrm
packaged_task.hpp33580644editdlrm
placeholders.hpp41460644editdlrm
post.hpp47600644editdlrm
prefer.hpp188210644editdlrm
query.hpp83230644editdlrm
read.hpp538940644editdlrm
read_at.hpp277660644editdlrm
read_until.hpp1194770644editdlrm
redirect_error.hpp19380644editdlrm
require.hpp149260644editdlrm
require_concept.hpp92180644editdlrm
serial_port.hpp10100644editdlrm
serial_port_base.hpp49750644editdlrm
signal_set.hpp7480644editdlrm
socket_base.hpp159390644editdlrm
spawn.hpp117930644editdlrm
ssl.hpp8480644editdlrm
static_thread_pool.hpp8260644editdlrm
steady_timer.hpp13060644editdlrm
strand.hpp171930644editdlrm
streambuf.hpp8260644editdlrm
system_context.hpp26490644editdlrm
system_executor.hpp225290644editdlrm
system_timer.hpp13060644editdlrm
this_coro.hpp11490644editdlrm
thread_pool.hpp375670644editdlrm
time_traits.hpp22810644editdlrm
unyield.hpp3810644editdlrm
uses_executor.hpp23480644editdlrm
use_awaitable.hpp58210644editdlrm
use_future.hpp48200644editdlrm
version.hpp6860644editdlrm
wait_traits.hpp14510644editdlrm
write.hpp529590644editdlrm
write_at.hpp295140644editdlrm
yield.hpp4820644editdlrm
Edit: /usr/include/boost/asio/buffered_write_stream.hpp (8042B)
// // buffered_write_stream.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~ // // Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // #ifndef BOOST_ASIO_BUFFERED_WRITE_STREAM_HPP #define BOOST_ASIO_BUFFERED_WRITE_STREAM_HPP #if defined(_MSC_VER) && (_MSC_VER >= 1200) # pragma once #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) #include #include #include #include #include #include #include #include #include #include #include #include namespace boost { namespace asio { /// Adds buffering to the write-related operations of a stream. /** * The buffered_write_stream class template can be used to add buffering to the * synchronous and asynchronous write operations of a stream. * * @par Thread Safety * @e Distinct @e objects: Safe.@n * @e Shared @e objects: Unsafe. * * @par Concepts: * AsyncReadStream, AsyncWriteStream, Stream, SyncReadStream, SyncWriteStream. */ template class buffered_write_stream : private noncopyable { public: /// The type of the next layer. typedef typename remove_reference::type next_layer_type; /// The type of the lowest layer. typedef typename next_layer_type::lowest_layer_type lowest_layer_type; /// The type of the executor associated with the object. typedef typename lowest_layer_type::executor_type executor_type; #if defined(GENERATING_DOCUMENTATION) /// The default buffer size. static const std::size_t default_buffer_size = implementation_defined; #else BOOST_ASIO_STATIC_CONSTANT(std::size_t, default_buffer_size = 1024); #endif /// Construct, passing the specified argument to initialise the next layer. template explicit buffered_write_stream(Arg& a) : next_layer_(a), storage_(default_buffer_size) { } /// Construct, passing the specified argument to initialise the next layer. template buffered_write_stream(Arg& a, std::size_t buffer_size) : next_layer_(a), storage_(buffer_size) { } /// Get a reference to the next layer. next_layer_type& next_layer() { return next_layer_; } /// Get a reference to the lowest layer. lowest_layer_type& lowest_layer() { return next_layer_.lowest_layer(); } /// Get a const reference to the lowest layer. const lowest_layer_type& lowest_layer() const { return next_layer_.lowest_layer(); } /// Get the executor associated with the object. executor_type get_executor() BOOST_ASIO_NOEXCEPT { return next_layer_.lowest_layer().get_executor(); } /// Close the stream. void close() { next_layer_.close(); } /// Close the stream. BOOST_ASIO_SYNC_OP_VOID close(boost::system::error_code& ec) { next_layer_.close(ec); BOOST_ASIO_SYNC_OP_VOID_RETURN(ec); } /// 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. std::size_t flush(); /// 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. std::size_t flush(boost::system::error_code& ec); /// Start an asynchronous flush. template < BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code, std::size_t)) WriteHandler BOOST_ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)> BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler, void (boost::system::error_code, std::size_t)) async_flush( BOOST_ASIO_MOVE_ARG(WriteHandler) handler BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)); /// Write the given data to the stream. Returns the number of bytes written. /// Throws an exception on failure. template std::size_t write_some(const ConstBufferSequence& buffers); /// Write the given data to the stream. Returns the number of bytes written, /// or 0 if an error occurred and the error handler did not throw. template std::size_t write_some(const ConstBufferSequence& buffers, boost::system::error_code& ec); /// Start an asynchronous write. The data being written must be valid for the /// lifetime of the asynchronous operation. template BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler, void (boost::system::error_code, std::size_t)) async_write_some(const ConstBufferSequence& buffers, BOOST_ASIO_MOVE_ARG(WriteHandler) handler BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)); /// Read some data from the stream. Returns the number of bytes read. Throws /// an exception on failure. template std::size_t read_some(const MutableBufferSequence& buffers) { return next_layer_.read_some(buffers); } /// Read some data from the stream. Returns the number of bytes read or 0 if /// an error occurred. template std::size_t read_some(const MutableBufferSequence& buffers, boost::system::error_code& ec) { return next_layer_.read_some(buffers, ec); } /// Start an asynchronous read. The buffer into which the data will be read /// must be valid for the lifetime of the asynchronous operation. template BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler, void (boost::system::error_code, std::size_t)) async_read_some(const MutableBufferSequence& buffers, BOOST_ASIO_MOVE_ARG(ReadHandler) handler BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)) { return next_layer_.async_read_some(buffers, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler)); } /// Peek at the incoming data on the stream. Returns the number of bytes read. /// Throws an exception on failure. template std::size_t peek(const MutableBufferSequence& buffers) { return next_layer_.peek(buffers); } /// Peek at the incoming data on the stream. Returns the number of bytes read, /// or 0 if an error occurred. template std::size_t peek(const MutableBufferSequence& buffers, boost::system::error_code& ec) { return next_layer_.peek(buffers, ec); } /// Determine the amount of data that may be read without blocking. std::size_t in_avail() { return next_layer_.in_avail(); } /// Determine the amount of data that may be read without blocking. std::size_t in_avail(boost::system::error_code& ec) { return next_layer_.in_avail(ec); } private: /// Copy data into the internal buffer from the specified source buffer. /// Returns the number of bytes copied. template std::size_t copy(const ConstBufferSequence& buffers); /// The next layer. Stream next_layer_; // The data in the buffer. detail::buffered_stream_storage storage_; }; } // namespace asio } // namespace boost #include #include #endif // BOOST_ASIO_BUFFERED_WRITE_STREAM_HPP