diff options
Diffstat (limited to '3rdparty/asio/include/asio/buffered_write_stream.hpp')
-rw-r--r-- | 3rdparty/asio/include/asio/buffered_write_stream.hpp | 50 |
1 files changed, 23 insertions, 27 deletions
diff --git a/3rdparty/asio/include/asio/buffered_write_stream.hpp b/3rdparty/asio/include/asio/buffered_write_stream.hpp index 9cdab8b1d25..526cd602916 100644 --- a/3rdparty/asio/include/asio/buffered_write_stream.hpp +++ b/3rdparty/asio/include/asio/buffered_write_stream.hpp @@ -2,7 +2,7 @@ // buffered_write_stream.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2021 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) @@ -25,7 +25,6 @@ #include "asio/detail/noncopyable.hpp" #include "asio/detail/type_traits.hpp" #include "asio/error.hpp" -#include "asio/io_context.hpp" #include "asio/write.hpp" #include "asio/detail/push_options.hpp" @@ -105,22 +104,6 @@ public: return next_layer_.lowest_layer().get_executor(); } -#if !defined(ASIO_NO_DEPRECATED) - /// (Deprecated: Use get_executor().) Get the io_context associated with the - /// object. - asio::io_context& get_io_context() - { - return next_layer_.get_io_context(); - } - - /// (Deprecated: Use get_executor().) Get the io_context associated with the - /// object. - asio::io_context& get_io_service() - { - return next_layer_.get_io_service(); - } -#endif // !defined(ASIO_NO_DEPRECATED) - /// Close the stream. void close() { @@ -145,10 +128,15 @@ public: std::size_t flush(asio::error_code& ec); /// Start an asynchronous flush. - template <typename WriteHandler> - ASIO_INITFN_RESULT_TYPE(WriteHandler, + template < + ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code, + std::size_t)) WriteHandler + ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)> + ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler, void (asio::error_code, std::size_t)) - async_flush(ASIO_MOVE_ARG(WriteHandler) handler); + async_flush( + ASIO_MOVE_ARG(WriteHandler) handler + ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)); /// Write the given data to the stream. Returns the number of bytes written. /// Throws an exception on failure. @@ -163,11 +151,15 @@ public: /// Start an asynchronous write. The data being written must be valid for the /// lifetime of the asynchronous operation. - template <typename ConstBufferSequence, typename WriteHandler> - ASIO_INITFN_RESULT_TYPE(WriteHandler, + template <typename ConstBufferSequence, + ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code, + std::size_t)) WriteHandler + ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)> + ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler, void (asio::error_code, std::size_t)) async_write_some(const ConstBufferSequence& buffers, - ASIO_MOVE_ARG(WriteHandler) handler); + ASIO_MOVE_ARG(WriteHandler) handler + ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)); /// Read some data from the stream. Returns the number of bytes read. Throws /// an exception on failure. @@ -188,11 +180,15 @@ public: /// 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 MutableBufferSequence, typename ReadHandler> - ASIO_INITFN_RESULT_TYPE(ReadHandler, + template <typename MutableBufferSequence, + ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code, + std::size_t)) ReadHandler + ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)> + ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler, void (asio::error_code, std::size_t)) async_read_some(const MutableBufferSequence& buffers, - ASIO_MOVE_ARG(ReadHandler) handler) + ASIO_MOVE_ARG(ReadHandler) handler + ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)) { return next_layer_.async_read_some(buffers, ASIO_MOVE_CAST(ReadHandler)(handler)); |