diff options
Diffstat (limited to '3rdparty/asio/include/asio/buffered_stream.hpp')
-rw-r--r-- | 3rdparty/asio/include/asio/buffered_stream.hpp | 61 |
1 files changed, 31 insertions, 30 deletions
diff --git a/3rdparty/asio/include/asio/buffered_stream.hpp b/3rdparty/asio/include/asio/buffered_stream.hpp index cabab60726f..5d71bf66105 100644 --- a/3rdparty/asio/include/asio/buffered_stream.hpp +++ b/3rdparty/asio/include/asio/buffered_stream.hpp @@ -2,7 +2,7 @@ // buffered_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) @@ -23,7 +23,6 @@ #include "asio/buffered_stream_fwd.hpp" #include "asio/detail/noncopyable.hpp" #include "asio/error.hpp" -#include "asio/io_context.hpp" #include "asio/detail/push_options.hpp" @@ -96,22 +95,6 @@ public: return stream_impl_.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 stream_impl_.get_io_context(); - } - - /// (Deprecated: Use get_executor().) Get the io_context associated with the - /// object. - asio::io_context& get_io_service() - { - return stream_impl_.get_io_service(); - } -#endif // !defined(ASIO_NO_DEPRECATED) - /// Close the stream. void close() { @@ -142,10 +125,15 @@ public: } /// 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)) { return stream_impl_.next_layer().async_flush( ASIO_MOVE_CAST(WriteHandler)(handler)); @@ -170,11 +158,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)) { return stream_impl_.async_write_some(buffers, ASIO_MOVE_CAST(WriteHandler)(handler)); @@ -195,10 +187,15 @@ public: } /// Start an asynchronous fill. - template <typename ReadHandler> - ASIO_INITFN_RESULT_TYPE(ReadHandler, + template < + 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_fill(ASIO_MOVE_ARG(ReadHandler) handler) + async_fill( + ASIO_MOVE_ARG(ReadHandler) handler + ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)) { return stream_impl_.async_fill(ASIO_MOVE_CAST(ReadHandler)(handler)); } @@ -222,11 +219,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 stream_impl_.async_read_some(buffers, ASIO_MOVE_CAST(ReadHandler)(handler)); |