mirror of
https://git.suyu.dev/suyu/ext-boost.git
synced 2025-12-25 08:44:40 +01:00
Revert "externals: Update boost to 1.72 and add Boost Context"
This commit is contained in:
parent
8b4b26a2fd
commit
faaf93d90b
618 changed files with 14262 additions and 96298 deletions
|
|
@ -22,7 +22,6 @@
|
|||
#include <boost/asio/detail/handler_invoke_helpers.hpp>
|
||||
#include <boost/asio/detail/handler_type_requirements.hpp>
|
||||
#include <boost/asio/detail/non_const_lvalue.hpp>
|
||||
#include <boost/asio/detail/type_traits.hpp>
|
||||
|
||||
#include <boost/asio/detail/push_options.hpp>
|
||||
|
||||
|
|
@ -141,26 +140,11 @@ namespace detail
|
|||
function, this_handler->handler_);
|
||||
}
|
||||
|
||||
template <typename Stream>
|
||||
class initiate_async_buffered_fill
|
||||
struct initiate_async_buffered_fill
|
||||
{
|
||||
public:
|
||||
typedef typename remove_reference<
|
||||
Stream>::type::lowest_layer_type::executor_type executor_type;
|
||||
|
||||
explicit initiate_async_buffered_fill(Stream& next_layer)
|
||||
: next_layer_(next_layer)
|
||||
{
|
||||
}
|
||||
|
||||
executor_type get_executor() const BOOST_ASIO_NOEXCEPT
|
||||
{
|
||||
return next_layer_.lowest_layer().get_executor();
|
||||
}
|
||||
|
||||
template <typename ReadHandler>
|
||||
template <typename ReadHandler, typename Stream>
|
||||
void operator()(BOOST_ASIO_MOVE_ARG(ReadHandler) handler,
|
||||
buffered_stream_storage* storage) const
|
||||
buffered_stream_storage* storage, Stream* next_layer) const
|
||||
{
|
||||
// If you get an error on the following line it means that your handler
|
||||
// does not meet the documented type requirements for a ReadHandler.
|
||||
|
|
@ -169,16 +153,13 @@ namespace detail
|
|||
non_const_lvalue<ReadHandler> handler2(handler);
|
||||
std::size_t previous_size = storage->size();
|
||||
storage->resize(storage->capacity());
|
||||
next_layer_.async_read_some(
|
||||
next_layer->async_read_some(
|
||||
buffer(
|
||||
storage->data() + previous_size,
|
||||
storage->size() - previous_size),
|
||||
buffered_fill_handler<typename decay<ReadHandler>::type>(
|
||||
*storage, previous_size, handler2.value));
|
||||
}
|
||||
|
||||
private:
|
||||
Stream& next_layer_;
|
||||
};
|
||||
} // namespace detail
|
||||
|
||||
|
|
@ -213,18 +194,15 @@ struct associated_executor<
|
|||
#endif // !defined(GENERATING_DOCUMENTATION)
|
||||
|
||||
template <typename Stream>
|
||||
template <
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
|
||||
std::size_t)) ReadHandler>
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
|
||||
template <typename ReadHandler>
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
|
||||
void (boost::system::error_code, std::size_t))
|
||||
buffered_read_stream<Stream>::async_fill(
|
||||
BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
|
||||
{
|
||||
return async_initiate<ReadHandler,
|
||||
void (boost::system::error_code, std::size_t)>(
|
||||
detail::initiate_async_buffered_fill<Stream>(next_layer_),
|
||||
handler, &storage_);
|
||||
detail::initiate_async_buffered_fill(), handler, &storage_, &next_layer_);
|
||||
}
|
||||
|
||||
template <typename Stream>
|
||||
|
|
@ -358,26 +336,12 @@ namespace detail
|
|||
function, this_handler->handler_);
|
||||
}
|
||||
|
||||
template <typename Stream>
|
||||
class initiate_async_buffered_read_some
|
||||
struct initiate_async_buffered_read_some
|
||||
{
|
||||
public:
|
||||
typedef typename remove_reference<
|
||||
Stream>::type::lowest_layer_type::executor_type executor_type;
|
||||
|
||||
explicit initiate_async_buffered_read_some(Stream& next_layer)
|
||||
: next_layer_(next_layer)
|
||||
{
|
||||
}
|
||||
|
||||
executor_type get_executor() const BOOST_ASIO_NOEXCEPT
|
||||
{
|
||||
return next_layer_.lowest_layer().get_executor();
|
||||
}
|
||||
|
||||
template <typename ReadHandler, typename MutableBufferSequence>
|
||||
template <typename ReadHandler, typename Stream,
|
||||
typename MutableBufferSequence>
|
||||
void operator()(BOOST_ASIO_MOVE_ARG(ReadHandler) handler,
|
||||
buffered_stream_storage* storage,
|
||||
buffered_stream_storage* storage, Stream* next_layer,
|
||||
const MutableBufferSequence& buffers) const
|
||||
{
|
||||
// If you get an error on the following line it means that your handler
|
||||
|
|
@ -388,23 +352,20 @@ namespace detail
|
|||
non_const_lvalue<ReadHandler> handler2(handler);
|
||||
if (buffer_size(buffers) == 0 || !storage->empty())
|
||||
{
|
||||
next_layer_.async_read_some(BOOST_ASIO_MUTABLE_BUFFER(0, 0),
|
||||
next_layer->async_read_some(BOOST_ASIO_MUTABLE_BUFFER(0, 0),
|
||||
buffered_read_some_handler<MutableBufferSequence,
|
||||
typename decay<ReadHandler>::type>(
|
||||
*storage, buffers, handler2.value));
|
||||
}
|
||||
else
|
||||
{
|
||||
initiate_async_buffered_fill<Stream>(this->next_layer_)(
|
||||
initiate_async_buffered_fill()(
|
||||
buffered_read_some_handler<MutableBufferSequence,
|
||||
typename decay<ReadHandler>::type>(
|
||||
*storage, buffers, handler2.value),
|
||||
storage);
|
||||
storage, next_layer);
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
Stream& next_layer_;
|
||||
};
|
||||
} // namespace detail
|
||||
|
||||
|
|
@ -447,10 +408,8 @@ struct associated_executor<
|
|||
#endif // !defined(GENERATING_DOCUMENTATION)
|
||||
|
||||
template <typename Stream>
|
||||
template <typename MutableBufferSequence,
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
|
||||
std::size_t)) ReadHandler>
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
|
||||
template <typename MutableBufferSequence, typename ReadHandler>
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
|
||||
void (boost::system::error_code, std::size_t))
|
||||
buffered_read_stream<Stream>::async_read_some(
|
||||
const MutableBufferSequence& buffers,
|
||||
|
|
@ -458,8 +417,8 @@ buffered_read_stream<Stream>::async_read_some(
|
|||
{
|
||||
return async_initiate<ReadHandler,
|
||||
void (boost::system::error_code, std::size_t)>(
|
||||
detail::initiate_async_buffered_read_some<Stream>(next_layer_),
|
||||
handler, &storage_, buffers);
|
||||
detail::initiate_async_buffered_read_some(),
|
||||
handler, &storage_, &next_layer_, buffers);
|
||||
}
|
||||
|
||||
template <typename Stream>
|
||||
|
|
|
|||
|
|
@ -126,39 +126,21 @@ namespace detail
|
|||
function, this_handler->handler_);
|
||||
}
|
||||
|
||||
template <typename Stream>
|
||||
class initiate_async_buffered_flush
|
||||
struct initiate_async_buffered_flush
|
||||
{
|
||||
public:
|
||||
typedef typename remove_reference<
|
||||
Stream>::type::lowest_layer_type::executor_type executor_type;
|
||||
|
||||
explicit initiate_async_buffered_flush(Stream& next_layer)
|
||||
: next_layer_(next_layer)
|
||||
{
|
||||
}
|
||||
|
||||
executor_type get_executor() const BOOST_ASIO_NOEXCEPT
|
||||
{
|
||||
return next_layer_.lowest_layer().get_executor();
|
||||
}
|
||||
|
||||
template <typename WriteHandler>
|
||||
template <typename WriteHandler, typename Stream>
|
||||
void operator()(BOOST_ASIO_MOVE_ARG(WriteHandler) handler,
|
||||
buffered_stream_storage* storage) const
|
||||
buffered_stream_storage* storage, Stream* next_layer) const
|
||||
{
|
||||
// If you get an error on the following line it means that your handler
|
||||
// does not meet the documented type requirements for a WriteHandler.
|
||||
BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check;
|
||||
|
||||
non_const_lvalue<WriteHandler> handler2(handler);
|
||||
async_write(next_layer_, buffer(storage->data(), storage->size()),
|
||||
async_write(*next_layer, buffer(storage->data(), storage->size()),
|
||||
buffered_flush_handler<typename decay<WriteHandler>::type>(
|
||||
*storage, handler2.value));
|
||||
}
|
||||
|
||||
private:
|
||||
Stream& next_layer_;
|
||||
};
|
||||
} // namespace detail
|
||||
|
||||
|
|
@ -193,18 +175,16 @@ struct associated_executor<
|
|||
#endif // !defined(GENERATING_DOCUMENTATION)
|
||||
|
||||
template <typename Stream>
|
||||
template <
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
|
||||
std::size_t)) WriteHandler>
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
|
||||
template <typename WriteHandler>
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
|
||||
void (boost::system::error_code, std::size_t))
|
||||
buffered_write_stream<Stream>::async_flush(
|
||||
BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
|
||||
{
|
||||
return async_initiate<WriteHandler,
|
||||
void (boost::system::error_code, std::size_t)>(
|
||||
detail::initiate_async_buffered_flush<Stream>(next_layer_),
|
||||
handler, &storage_);
|
||||
detail::initiate_async_buffered_flush(),
|
||||
handler, &storage_, &next_layer_);
|
||||
}
|
||||
|
||||
template <typename Stream>
|
||||
|
|
@ -344,26 +324,12 @@ namespace detail
|
|||
function, this_handler->handler_);
|
||||
}
|
||||
|
||||
template <typename Stream>
|
||||
class initiate_async_buffered_write_some
|
||||
struct initiate_async_buffered_write_some
|
||||
{
|
||||
public:
|
||||
typedef typename remove_reference<
|
||||
Stream>::type::lowest_layer_type::executor_type executor_type;
|
||||
|
||||
explicit initiate_async_buffered_write_some(Stream& next_layer)
|
||||
: next_layer_(next_layer)
|
||||
{
|
||||
}
|
||||
|
||||
executor_type get_executor() const BOOST_ASIO_NOEXCEPT
|
||||
{
|
||||
return next_layer_.lowest_layer().get_executor();
|
||||
}
|
||||
|
||||
template <typename WriteHandler, typename ConstBufferSequence>
|
||||
template <typename WriteHandler, typename Stream,
|
||||
typename ConstBufferSequence>
|
||||
void operator()(BOOST_ASIO_MOVE_ARG(WriteHandler) handler,
|
||||
buffered_stream_storage* storage,
|
||||
buffered_stream_storage* storage, Stream* next_layer,
|
||||
const ConstBufferSequence& buffers) const
|
||||
{
|
||||
// If you get an error on the following line it means that your handler
|
||||
|
|
@ -374,23 +340,20 @@ namespace detail
|
|||
non_const_lvalue<WriteHandler> handler2(handler);
|
||||
if (buffer_size(buffers) == 0 || storage->size() < storage->capacity())
|
||||
{
|
||||
next_layer_.async_write_some(BOOST_ASIO_CONST_BUFFER(0, 0),
|
||||
next_layer->async_write_some(BOOST_ASIO_CONST_BUFFER(0, 0),
|
||||
buffered_write_some_handler<ConstBufferSequence,
|
||||
typename decay<WriteHandler>::type>(
|
||||
*storage, buffers, handler2.value));
|
||||
}
|
||||
else
|
||||
{
|
||||
initiate_async_buffered_flush<Stream>(this->next_layer_)(
|
||||
initiate_async_buffered_flush()(
|
||||
buffered_write_some_handler<ConstBufferSequence,
|
||||
typename decay<WriteHandler>::type>(
|
||||
*storage, buffers, handler2.value),
|
||||
storage);
|
||||
storage, next_layer);
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
Stream& next_layer_;
|
||||
};
|
||||
} // namespace detail
|
||||
|
||||
|
|
@ -433,10 +396,8 @@ struct associated_executor<
|
|||
#endif // !defined(GENERATING_DOCUMENTATION)
|
||||
|
||||
template <typename Stream>
|
||||
template <typename ConstBufferSequence,
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
|
||||
std::size_t)) WriteHandler>
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
|
||||
template <typename ConstBufferSequence, typename WriteHandler>
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
|
||||
void (boost::system::error_code, std::size_t))
|
||||
buffered_write_stream<Stream>::async_write_some(
|
||||
const ConstBufferSequence& buffers,
|
||||
|
|
@ -444,8 +405,8 @@ buffered_write_stream<Stream>::async_write_some(
|
|||
{
|
||||
return async_initiate<WriteHandler,
|
||||
void (boost::system::error_code, std::size_t)>(
|
||||
detail::initiate_async_buffered_write_some<Stream>(next_layer_),
|
||||
handler, &storage_, buffers);
|
||||
detail::initiate_async_buffered_write_some(),
|
||||
handler, &storage_, &next_layer_, buffers);
|
||||
}
|
||||
|
||||
template <typename Stream>
|
||||
|
|
|
|||
|
|
@ -90,43 +90,25 @@ awaitable<void, Executor> co_spawn_entry_point(
|
|||
});
|
||||
}
|
||||
|
||||
template <typename Executor>
|
||||
class initiate_co_spawn
|
||||
struct initiate_co_spawn
|
||||
{
|
||||
public:
|
||||
typedef Executor executor_type;
|
||||
|
||||
template <typename OtherExecutor>
|
||||
explicit initiate_co_spawn(const OtherExecutor& ex)
|
||||
: ex_(ex)
|
||||
{
|
||||
}
|
||||
|
||||
executor_type get_executor() const BOOST_ASIO_NOEXCEPT
|
||||
{
|
||||
return ex_;
|
||||
}
|
||||
|
||||
template <typename Handler, typename F>
|
||||
void operator()(Handler&& handler, F&& f) const
|
||||
template <typename Handler, typename Executor, typename F>
|
||||
void operator()(Handler&& handler, const Executor& ex, F&& f) const
|
||||
{
|
||||
typedef typename result_of<F()>::type awaitable_type;
|
||||
typedef typename awaitable_type::executor_type executor_type;
|
||||
|
||||
executor_type ex2(ex);
|
||||
auto a = (co_spawn_entry_point)(static_cast<awaitable_type*>(nullptr),
|
||||
ex_, std::forward<F>(f), std::forward<Handler>(handler));
|
||||
awaitable_handler<executor_type, void>(std::move(a), ex_).launch();
|
||||
ex2, std::forward<F>(f), std::forward<Handler>(handler));
|
||||
awaitable_handler<executor_type, void>(std::move(a), ex2).launch();
|
||||
}
|
||||
|
||||
private:
|
||||
Executor ex_;
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
template <typename Executor, typename F,
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(typename detail::awaitable_signature<
|
||||
typename result_of<F()>::type>::type) CompletionToken>
|
||||
inline BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken,
|
||||
template <typename Executor, typename F, typename CompletionToken>
|
||||
inline BOOST_ASIO_INITFN_RESULT_TYPE(CompletionToken,
|
||||
typename detail::awaitable_signature<typename result_of<F()>::type>::type)
|
||||
co_spawn(const Executor& ex, F&& f, CompletionToken&& token,
|
||||
typename enable_if<
|
||||
|
|
@ -135,15 +117,11 @@ co_spawn(const Executor& ex, F&& f, CompletionToken&& token,
|
|||
{
|
||||
return async_initiate<CompletionToken,
|
||||
typename detail::awaitable_signature<typename result_of<F()>::type>>(
|
||||
detail::initiate_co_spawn<
|
||||
typename result_of<F()>::type::executor_type>(ex),
|
||||
token, std::forward<F>(f));
|
||||
detail::initiate_co_spawn(), token, ex, std::forward<F>(f));
|
||||
}
|
||||
|
||||
template <typename ExecutionContext, typename F,
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(typename detail::awaitable_signature<
|
||||
typename result_of<F()>::type>::type) CompletionToken>
|
||||
inline BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken,
|
||||
template <typename ExecutionContext, typename F, typename CompletionToken>
|
||||
inline BOOST_ASIO_INITFN_RESULT_TYPE(CompletionToken,
|
||||
typename detail::awaitable_signature<typename result_of<F()>::type>::type)
|
||||
co_spawn(ExecutionContext& ctx, F&& f, CompletionToken&& token,
|
||||
typename enable_if<
|
||||
|
|
|
|||
|
|
@ -32,123 +32,13 @@ namespace asio {
|
|||
|
||||
namespace detail
|
||||
{
|
||||
template <typename>
|
||||
struct composed_io_executors;
|
||||
|
||||
template <>
|
||||
struct composed_io_executors<void()>
|
||||
{
|
||||
composed_io_executors() BOOST_ASIO_NOEXCEPT
|
||||
: head_(system_executor())
|
||||
{
|
||||
}
|
||||
|
||||
typedef system_executor head_type;
|
||||
system_executor head_;
|
||||
};
|
||||
|
||||
inline composed_io_executors<void()> make_composed_io_executors()
|
||||
{
|
||||
return composed_io_executors<void()>();
|
||||
}
|
||||
|
||||
template <typename Head>
|
||||
struct composed_io_executors<void(Head)>
|
||||
{
|
||||
explicit composed_io_executors(const Head& ex) BOOST_ASIO_NOEXCEPT
|
||||
: head_(ex)
|
||||
{
|
||||
}
|
||||
|
||||
typedef Head head_type;
|
||||
Head head_;
|
||||
};
|
||||
|
||||
template <typename Head>
|
||||
inline composed_io_executors<void(Head)>
|
||||
make_composed_io_executors(const Head& head)
|
||||
{
|
||||
return composed_io_executors<void(Head)>(head);
|
||||
}
|
||||
|
||||
#if defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)
|
||||
|
||||
template <typename Head, typename... Tail>
|
||||
struct composed_io_executors<void(Head, Tail...)>
|
||||
{
|
||||
explicit composed_io_executors(const Head& head,
|
||||
const Tail&... tail) BOOST_ASIO_NOEXCEPT
|
||||
: head_(head),
|
||||
tail_(tail...)
|
||||
{
|
||||
}
|
||||
|
||||
void reset()
|
||||
{
|
||||
head_.reset();
|
||||
tail_.reset();
|
||||
}
|
||||
|
||||
typedef Head head_type;
|
||||
Head head_;
|
||||
composed_io_executors<void(Tail...)> tail_;
|
||||
};
|
||||
|
||||
template <typename Head, typename... Tail>
|
||||
inline composed_io_executors<void(Head, Tail...)>
|
||||
make_composed_io_executors(const Head& head, const Tail&... tail)
|
||||
{
|
||||
return composed_io_executors<void(Head, Tail...)>(head, tail...);
|
||||
}
|
||||
|
||||
#else // defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)
|
||||
|
||||
#define BOOST_ASIO_PRIVATE_COMPOSED_IO_EXECUTORS_DEF(n) \
|
||||
template <typename Head, BOOST_ASIO_VARIADIC_TPARAMS(n)> \
|
||||
struct composed_io_executors<void(Head, BOOST_ASIO_VARIADIC_TARGS(n))> \
|
||||
{ \
|
||||
explicit composed_io_executors(const Head& head, \
|
||||
BOOST_ASIO_VARIADIC_CONSTREF_PARAMS(n)) BOOST_ASIO_NOEXCEPT \
|
||||
: head_(head), \
|
||||
tail_(BOOST_ASIO_VARIADIC_BYVAL_ARGS(n)) \
|
||||
{ \
|
||||
} \
|
||||
\
|
||||
void reset() \
|
||||
{ \
|
||||
head_.reset(); \
|
||||
tail_.reset(); \
|
||||
} \
|
||||
\
|
||||
typedef Head head_type; \
|
||||
Head head_; \
|
||||
composed_io_executors<void(BOOST_ASIO_VARIADIC_TARGS(n))> tail_; \
|
||||
}; \
|
||||
\
|
||||
template <typename Head, BOOST_ASIO_VARIADIC_TPARAMS(n)> \
|
||||
inline composed_io_executors<void(Head, BOOST_ASIO_VARIADIC_TARGS(n))> \
|
||||
make_composed_io_executors(const Head& head, \
|
||||
BOOST_ASIO_VARIADIC_CONSTREF_PARAMS(n)) \
|
||||
{ \
|
||||
return composed_io_executors< \
|
||||
void(Head, BOOST_ASIO_VARIADIC_TARGS(n))>( \
|
||||
head, BOOST_ASIO_VARIADIC_BYVAL_ARGS(n)); \
|
||||
} \
|
||||
/**/
|
||||
BOOST_ASIO_VARIADIC_GENERATE(BOOST_ASIO_PRIVATE_COMPOSED_IO_EXECUTORS_DEF)
|
||||
#undef BOOST_ASIO_PRIVATE_COMPOSED_IO_EXECUTORS_DEF
|
||||
|
||||
#endif // defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)
|
||||
|
||||
template <typename>
|
||||
struct composed_work;
|
||||
|
||||
template <>
|
||||
struct composed_work<void()>
|
||||
{
|
||||
typedef composed_io_executors<void()> executors_type;
|
||||
|
||||
composed_work(const executors_type&) BOOST_ASIO_NOEXCEPT
|
||||
composed_work() BOOST_ASIO_NOEXCEPT
|
||||
: head_(system_executor())
|
||||
{
|
||||
}
|
||||
|
|
@ -162,13 +52,16 @@ namespace detail
|
|||
executor_work_guard<system_executor> head_;
|
||||
};
|
||||
|
||||
inline composed_work<void()> make_composed_work()
|
||||
{
|
||||
return composed_work<void()>();
|
||||
}
|
||||
|
||||
template <typename Head>
|
||||
struct composed_work<void(Head)>
|
||||
{
|
||||
typedef composed_io_executors<void(Head)> executors_type;
|
||||
|
||||
explicit composed_work(const executors_type& ex) BOOST_ASIO_NOEXCEPT
|
||||
: head_(ex.head_)
|
||||
explicit composed_work(const Head& ex) BOOST_ASIO_NOEXCEPT
|
||||
: head_(ex)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -181,16 +74,21 @@ namespace detail
|
|||
executor_work_guard<Head> head_;
|
||||
};
|
||||
|
||||
template <typename Head>
|
||||
inline composed_work<void(Head)> make_composed_work(const Head& head)
|
||||
{
|
||||
return composed_work<void(Head)>(head);
|
||||
}
|
||||
|
||||
#if defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)
|
||||
|
||||
template <typename Head, typename... Tail>
|
||||
struct composed_work<void(Head, Tail...)>
|
||||
{
|
||||
typedef composed_io_executors<void(Head, Tail...)> executors_type;
|
||||
|
||||
explicit composed_work(const executors_type& ex) BOOST_ASIO_NOEXCEPT
|
||||
: head_(ex.head_),
|
||||
tail_(ex.tail_)
|
||||
explicit composed_work(const Head& head,
|
||||
const Tail&... tail) BOOST_ASIO_NOEXCEPT
|
||||
: head_(head),
|
||||
tail_(tail...)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -205,18 +103,23 @@ namespace detail
|
|||
composed_work<void(Tail...)> tail_;
|
||||
};
|
||||
|
||||
template <typename Head, typename... Tail>
|
||||
inline composed_work<void(Head, Tail...)>
|
||||
make_composed_work(const Head& head, const Tail&... tail)
|
||||
{
|
||||
return composed_work<void(Head, Tail...)>(head, tail...);
|
||||
}
|
||||
|
||||
#else // defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)
|
||||
|
||||
#define BOOST_ASIO_PRIVATE_COMPOSED_WORK_DEF(n) \
|
||||
template <typename Head, BOOST_ASIO_VARIADIC_TPARAMS(n)> \
|
||||
struct composed_work<void(Head, BOOST_ASIO_VARIADIC_TARGS(n))> \
|
||||
{ \
|
||||
typedef composed_io_executors<void(Head, \
|
||||
BOOST_ASIO_VARIADIC_TARGS(n))> executors_type; \
|
||||
\
|
||||
explicit composed_work(const executors_type& ex) BOOST_ASIO_NOEXCEPT \
|
||||
: head_(ex.head_), \
|
||||
tail_(ex.tail_) \
|
||||
explicit composed_work(const Head& head, \
|
||||
BOOST_ASIO_VARIADIC_CONSTREF_PARAMS(n)) BOOST_ASIO_NOEXCEPT \
|
||||
: head_(head), \
|
||||
tail_(BOOST_ASIO_VARIADIC_BYVAL_ARGS(n)) \
|
||||
{ \
|
||||
} \
|
||||
\
|
||||
|
|
@ -230,6 +133,15 @@ namespace detail
|
|||
executor_work_guard<Head> head_; \
|
||||
composed_work<void(BOOST_ASIO_VARIADIC_TARGS(n))> tail_; \
|
||||
}; \
|
||||
\
|
||||
template <typename Head, BOOST_ASIO_VARIADIC_TPARAMS(n)> \
|
||||
inline composed_work<void(Head, BOOST_ASIO_VARIADIC_TARGS(n))> \
|
||||
make_composed_work(const Head& head, BOOST_ASIO_VARIADIC_CONSTREF_PARAMS(n)) \
|
||||
{ \
|
||||
return composed_work< \
|
||||
void(Head, BOOST_ASIO_VARIADIC_TARGS(n))>( \
|
||||
head, BOOST_ASIO_VARIADIC_BYVAL_ARGS(n)); \
|
||||
} \
|
||||
/**/
|
||||
BOOST_ASIO_VARIADIC_GENERATE(BOOST_ASIO_PRIVATE_COMPOSED_WORK_DEF)
|
||||
#undef BOOST_ASIO_PRIVATE_COMPOSED_WORK_DEF
|
||||
|
|
@ -387,46 +299,21 @@ namespace detail
|
|||
function, this_handler->handler_);
|
||||
}
|
||||
|
||||
template <typename Signature, typename Executors>
|
||||
class initiate_composed_op
|
||||
template <typename Signature>
|
||||
struct initiate_composed_op
|
||||
{
|
||||
public:
|
||||
typedef typename composed_io_executors<Executors>::head_type executor_type;
|
||||
|
||||
template <typename T>
|
||||
explicit initiate_composed_op(BOOST_ASIO_MOVE_ARG(T) executors)
|
||||
: executors_(BOOST_ASIO_MOVE_CAST(T)(executors))
|
||||
{
|
||||
}
|
||||
|
||||
executor_type get_executor() const BOOST_ASIO_NOEXCEPT
|
||||
{
|
||||
return executors_.head_;
|
||||
}
|
||||
|
||||
template <typename Handler, typename Impl>
|
||||
template <typename Handler, typename Impl, typename Work>
|
||||
void operator()(BOOST_ASIO_MOVE_ARG(Handler) handler,
|
||||
BOOST_ASIO_MOVE_ARG(Impl) impl) const
|
||||
BOOST_ASIO_MOVE_ARG(Impl) impl,
|
||||
BOOST_ASIO_MOVE_ARG(Work) work) const
|
||||
{
|
||||
composed_op<typename decay<Impl>::type, composed_work<Executors>,
|
||||
composed_op<typename decay<Impl>::type, typename decay<Work>::type,
|
||||
typename decay<Handler>::type, Signature>(
|
||||
BOOST_ASIO_MOVE_CAST(Impl)(impl),
|
||||
composed_work<Executors>(executors_),
|
||||
BOOST_ASIO_MOVE_CAST(Impl)(impl), BOOST_ASIO_MOVE_CAST(Work)(work),
|
||||
BOOST_ASIO_MOVE_CAST(Handler)(handler))();
|
||||
}
|
||||
|
||||
private:
|
||||
composed_io_executors<Executors> executors_;
|
||||
};
|
||||
|
||||
template <typename Signature, typename Executors>
|
||||
inline initiate_composed_op<Signature, Executors> make_initiate_composed_op(
|
||||
BOOST_ASIO_MOVE_ARG(composed_io_executors<Executors>) executors)
|
||||
{
|
||||
return initiate_composed_op<Signature, Executors>(
|
||||
BOOST_ASIO_MOVE_CAST(composed_io_executors<Executors>)(executors));
|
||||
}
|
||||
|
||||
template <typename IoObject>
|
||||
inline typename IoObject::executor_type
|
||||
get_composed_io_executor(IoObject& io_object)
|
||||
|
|
@ -447,31 +334,31 @@ namespace detail
|
|||
|
||||
template <typename CompletionToken, typename Signature,
|
||||
typename Implementation, typename... IoObjectsOrExecutors>
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, Signature)
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(CompletionToken, Signature)
|
||||
async_compose(BOOST_ASIO_MOVE_ARG(Implementation) implementation,
|
||||
BOOST_ASIO_NONDEDUCED_MOVE_ARG(CompletionToken) token,
|
||||
BOOST_ASIO_MOVE_ARG(IoObjectsOrExecutors)... io_objects_or_executors)
|
||||
{
|
||||
return async_initiate<CompletionToken, Signature>(
|
||||
detail::make_initiate_composed_op<Signature>(
|
||||
detail::make_composed_io_executors(
|
||||
detail::get_composed_io_executor(
|
||||
BOOST_ASIO_MOVE_CAST(IoObjectsOrExecutors)(
|
||||
io_objects_or_executors))...)),
|
||||
token, BOOST_ASIO_MOVE_CAST(Implementation)(implementation));
|
||||
detail::initiate_composed_op<Signature>(), token,
|
||||
BOOST_ASIO_MOVE_CAST(Implementation)(implementation),
|
||||
detail::make_composed_work(
|
||||
detail::get_composed_io_executor(
|
||||
BOOST_ASIO_MOVE_CAST(IoObjectsOrExecutors)(
|
||||
io_objects_or_executors))...));
|
||||
}
|
||||
|
||||
#else // defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)
|
||||
|
||||
template <typename CompletionToken, typename Signature, typename Implementation>
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, Signature)
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(CompletionToken, Signature)
|
||||
async_compose(BOOST_ASIO_MOVE_ARG(Implementation) implementation,
|
||||
BOOST_ASIO_NONDEDUCED_MOVE_ARG(CompletionToken) token)
|
||||
{
|
||||
return async_initiate<CompletionToken, Signature>(
|
||||
detail::make_initiate_composed_op<Signature>(
|
||||
detail::make_composed_io_executors()),
|
||||
token, BOOST_ASIO_MOVE_CAST(Implementation)(implementation));
|
||||
detail::initiate_composed_op<Signature>(), token,
|
||||
BOOST_ASIO_MOVE_CAST(Implementation)(implementation),
|
||||
detail::make_composed_work());
|
||||
}
|
||||
|
||||
# define BOOST_ASIO_PRIVATE_GET_COMPOSED_IO_EXECUTOR(n) \
|
||||
|
|
@ -501,16 +388,16 @@ async_compose(BOOST_ASIO_MOVE_ARG(Implementation) implementation,
|
|||
#define BOOST_ASIO_PRIVATE_ASYNC_COMPOSE_DEF(n) \
|
||||
template <typename CompletionToken, typename Signature, \
|
||||
typename Implementation, BOOST_ASIO_VARIADIC_TPARAMS(n)> \
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, Signature) \
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(CompletionToken, Signature) \
|
||||
async_compose(BOOST_ASIO_MOVE_ARG(Implementation) implementation, \
|
||||
BOOST_ASIO_NONDEDUCED_MOVE_ARG(CompletionToken) token, \
|
||||
BOOST_ASIO_VARIADIC_MOVE_PARAMS(n)) \
|
||||
{ \
|
||||
return async_initiate<CompletionToken, Signature>( \
|
||||
detail::make_initiate_composed_op<Signature>( \
|
||||
detail::make_composed_io_executors( \
|
||||
BOOST_ASIO_PRIVATE_GET_COMPOSED_IO_EXECUTOR(n))), \
|
||||
token, BOOST_ASIO_MOVE_CAST(Implementation)(implementation)); \
|
||||
detail::initiate_composed_op<Signature>(), token, \
|
||||
BOOST_ASIO_MOVE_CAST(Implementation)(implementation), \
|
||||
detail::make_composed_work( \
|
||||
BOOST_ASIO_PRIVATE_GET_COMPOSED_IO_EXECUTOR(n))); \
|
||||
} \
|
||||
/**/
|
||||
BOOST_ASIO_VARIADIC_GENERATE(BOOST_ASIO_PRIVATE_ASYNC_COMPOSE_DEF)
|
||||
|
|
|
|||
|
|
@ -455,26 +455,12 @@ namespace detail
|
|||
function, this_handler->handler_);
|
||||
}
|
||||
|
||||
template <typename Protocol, typename Executor>
|
||||
class initiate_async_range_connect
|
||||
struct initiate_async_range_connect
|
||||
{
|
||||
public:
|
||||
typedef Executor executor_type;
|
||||
|
||||
explicit initiate_async_range_connect(basic_socket<Protocol, Executor>& s)
|
||||
: socket_(s)
|
||||
{
|
||||
}
|
||||
|
||||
executor_type get_executor() const BOOST_ASIO_NOEXCEPT
|
||||
{
|
||||
return socket_.get_executor();
|
||||
}
|
||||
|
||||
template <typename RangeConnectHandler,
|
||||
typename EndpointSequence, typename ConnectCondition>
|
||||
template <typename RangeConnectHandler, typename Protocol,
|
||||
typename Executor, typename EndpointSequence, typename ConnectCondition>
|
||||
void operator()(BOOST_ASIO_MOVE_ARG(RangeConnectHandler) handler,
|
||||
const EndpointSequence& endpoints,
|
||||
basic_socket<Protocol, Executor>* s, const EndpointSequence& endpoints,
|
||||
const ConnectCondition& connect_condition) const
|
||||
{
|
||||
// If you get an error on the following line it means that your
|
||||
|
|
@ -485,12 +471,9 @@ namespace detail
|
|||
|
||||
non_const_lvalue<RangeConnectHandler> handler2(handler);
|
||||
range_connect_op<Protocol, Executor, EndpointSequence, ConnectCondition,
|
||||
typename decay<RangeConnectHandler>::type>(socket_, endpoints,
|
||||
typename decay<RangeConnectHandler>::type>(*s, endpoints,
|
||||
connect_condition, handler2.value)(boost::system::error_code(), 1);
|
||||
}
|
||||
|
||||
private:
|
||||
basic_socket<Protocol, Executor>& socket_;
|
||||
};
|
||||
|
||||
template <typename Protocol, typename Executor, typename Iterator,
|
||||
|
|
@ -641,28 +624,13 @@ namespace detail
|
|||
function, this_handler->handler_);
|
||||
}
|
||||
|
||||
template <typename Protocol, typename Executor>
|
||||
class initiate_async_iterator_connect
|
||||
struct initiate_async_iterator_connect
|
||||
{
|
||||
public:
|
||||
typedef Executor executor_type;
|
||||
|
||||
explicit initiate_async_iterator_connect(
|
||||
basic_socket<Protocol, Executor>& s)
|
||||
: socket_(s)
|
||||
{
|
||||
}
|
||||
|
||||
executor_type get_executor() const BOOST_ASIO_NOEXCEPT
|
||||
{
|
||||
return socket_.get_executor();
|
||||
}
|
||||
|
||||
template <typename IteratorConnectHandler,
|
||||
typename Iterator, typename ConnectCondition>
|
||||
template <typename IteratorConnectHandler, typename Protocol,
|
||||
typename Executor, typename Iterator, typename ConnectCondition>
|
||||
void operator()(BOOST_ASIO_MOVE_ARG(IteratorConnectHandler) handler,
|
||||
Iterator begin, Iterator end,
|
||||
const ConnectCondition& connect_condition) const
|
||||
basic_socket<Protocol, Executor>* s, Iterator begin,
|
||||
Iterator end, const ConnectCondition& connect_condition) const
|
||||
{
|
||||
// If you get an error on the following line it means that your
|
||||
// handler does not meet the documented type requirements for an
|
||||
|
|
@ -672,12 +640,9 @@ namespace detail
|
|||
|
||||
non_const_lvalue<IteratorConnectHandler> handler2(handler);
|
||||
iterator_connect_op<Protocol, Executor, Iterator, ConnectCondition,
|
||||
typename decay<IteratorConnectHandler>::type>(socket_, begin, end,
|
||||
typename decay<IteratorConnectHandler>::type>(*s, begin, end,
|
||||
connect_condition, handler2.value)(boost::system::error_code(), 1);
|
||||
}
|
||||
|
||||
private:
|
||||
basic_socket<Protocol, Executor>& socket_;
|
||||
};
|
||||
} // namespace detail
|
||||
|
||||
|
|
@ -765,10 +730,9 @@ struct associated_executor<
|
|||
|
||||
#endif // !defined(GENERATING_DOCUMENTATION)
|
||||
|
||||
template <typename Protocol, typename Executor, typename EndpointSequence,
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
|
||||
typename Protocol::endpoint)) RangeConnectHandler>
|
||||
inline BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(RangeConnectHandler,
|
||||
template <typename Protocol, typename Executor,
|
||||
typename EndpointSequence, typename RangeConnectHandler>
|
||||
inline BOOST_ASIO_INITFN_RESULT_TYPE(RangeConnectHandler,
|
||||
void (boost::system::error_code, typename Protocol::endpoint))
|
||||
async_connect(basic_socket<Protocol, Executor>& s,
|
||||
const EndpointSequence& endpoints,
|
||||
|
|
@ -778,15 +742,14 @@ async_connect(basic_socket<Protocol, Executor>& s,
|
|||
{
|
||||
return async_initiate<RangeConnectHandler,
|
||||
void (boost::system::error_code, typename Protocol::endpoint)>(
|
||||
detail::initiate_async_range_connect<Protocol, Executor>(s),
|
||||
handler, endpoints, detail::default_connect_condition());
|
||||
detail::initiate_async_range_connect(), handler,
|
||||
&s, endpoints, detail::default_connect_condition());
|
||||
}
|
||||
|
||||
#if !defined(BOOST_ASIO_NO_DEPRECATED)
|
||||
template <typename Protocol, typename Executor, typename Iterator,
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
|
||||
Iterator)) IteratorConnectHandler>
|
||||
inline BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(IteratorConnectHandler,
|
||||
template <typename Protocol, typename Executor,
|
||||
typename Iterator, typename IteratorConnectHandler>
|
||||
inline BOOST_ASIO_INITFN_RESULT_TYPE(IteratorConnectHandler,
|
||||
void (boost::system::error_code, Iterator))
|
||||
async_connect(basic_socket<Protocol, Executor>& s, Iterator begin,
|
||||
BOOST_ASIO_MOVE_ARG(IteratorConnectHandler) handler,
|
||||
|
|
@ -794,30 +757,27 @@ async_connect(basic_socket<Protocol, Executor>& s, Iterator begin,
|
|||
{
|
||||
return async_initiate<IteratorConnectHandler,
|
||||
void (boost::system::error_code, Iterator)>(
|
||||
detail::initiate_async_iterator_connect<Protocol, Executor>(s),
|
||||
handler, begin, Iterator(), detail::default_connect_condition());
|
||||
detail::initiate_async_iterator_connect(), handler,
|
||||
&s, begin, Iterator(), detail::default_connect_condition());
|
||||
}
|
||||
#endif // !defined(BOOST_ASIO_NO_DEPRECATED)
|
||||
|
||||
template <typename Protocol, typename Executor, typename Iterator,
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
|
||||
Iterator)) IteratorConnectHandler>
|
||||
inline BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(IteratorConnectHandler,
|
||||
template <typename Protocol, typename Executor,
|
||||
typename Iterator, typename IteratorConnectHandler>
|
||||
inline BOOST_ASIO_INITFN_RESULT_TYPE(IteratorConnectHandler,
|
||||
void (boost::system::error_code, Iterator))
|
||||
async_connect(basic_socket<Protocol, Executor>& s, Iterator begin, Iterator end,
|
||||
BOOST_ASIO_MOVE_ARG(IteratorConnectHandler) handler)
|
||||
{
|
||||
return async_initiate<IteratorConnectHandler,
|
||||
void (boost::system::error_code, Iterator)>(
|
||||
detail::initiate_async_iterator_connect<Protocol, Executor>(s),
|
||||
handler, begin, end, detail::default_connect_condition());
|
||||
detail::initiate_async_iterator_connect(), handler,
|
||||
&s, begin, end, detail::default_connect_condition());
|
||||
}
|
||||
|
||||
template <typename Protocol, typename Executor,
|
||||
typename EndpointSequence, typename ConnectCondition,
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
|
||||
typename Protocol::endpoint)) RangeConnectHandler>
|
||||
inline BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(RangeConnectHandler,
|
||||
template <typename Protocol, typename Executor, typename EndpointSequence,
|
||||
typename ConnectCondition, typename RangeConnectHandler>
|
||||
inline BOOST_ASIO_INITFN_RESULT_TYPE(RangeConnectHandler,
|
||||
void (boost::system::error_code, typename Protocol::endpoint))
|
||||
async_connect(basic_socket<Protocol, Executor>& s,
|
||||
const EndpointSequence& endpoints, ConnectCondition connect_condition,
|
||||
|
|
@ -827,16 +787,14 @@ async_connect(basic_socket<Protocol, Executor>& s,
|
|||
{
|
||||
return async_initiate<RangeConnectHandler,
|
||||
void (boost::system::error_code, typename Protocol::endpoint)>(
|
||||
detail::initiate_async_range_connect<Protocol, Executor>(s),
|
||||
handler, endpoints, connect_condition);
|
||||
detail::initiate_async_range_connect(),
|
||||
handler, &s, endpoints, connect_condition);
|
||||
}
|
||||
|
||||
#if !defined(BOOST_ASIO_NO_DEPRECATED)
|
||||
template <typename Protocol, typename Executor,
|
||||
typename Iterator, typename ConnectCondition,
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
|
||||
Iterator)) IteratorConnectHandler>
|
||||
inline BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(IteratorConnectHandler,
|
||||
template <typename Protocol, typename Executor, typename Iterator,
|
||||
typename ConnectCondition, typename IteratorConnectHandler>
|
||||
inline BOOST_ASIO_INITFN_RESULT_TYPE(IteratorConnectHandler,
|
||||
void (boost::system::error_code, Iterator))
|
||||
async_connect(basic_socket<Protocol, Executor>& s, Iterator begin,
|
||||
ConnectCondition connect_condition,
|
||||
|
|
@ -845,16 +803,14 @@ async_connect(basic_socket<Protocol, Executor>& s, Iterator begin,
|
|||
{
|
||||
return async_initiate<IteratorConnectHandler,
|
||||
void (boost::system::error_code, Iterator)>(
|
||||
detail::initiate_async_iterator_connect<Protocol, Executor>(s),
|
||||
handler, begin, Iterator(), connect_condition);
|
||||
detail::initiate_async_iterator_connect(),
|
||||
handler, &s, begin, Iterator(), connect_condition);
|
||||
}
|
||||
#endif // !defined(BOOST_ASIO_NO_DEPRECATED)
|
||||
|
||||
template <typename Protocol, typename Executor,
|
||||
typename Iterator, typename ConnectCondition,
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
|
||||
Iterator)) IteratorConnectHandler>
|
||||
inline BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(IteratorConnectHandler,
|
||||
template <typename Protocol, typename Executor, typename Iterator,
|
||||
typename ConnectCondition, typename IteratorConnectHandler>
|
||||
inline BOOST_ASIO_INITFN_RESULT_TYPE(IteratorConnectHandler,
|
||||
void (boost::system::error_code, Iterator))
|
||||
async_connect(basic_socket<Protocol, Executor>& s, Iterator begin,
|
||||
Iterator end, ConnectCondition connect_condition,
|
||||
|
|
@ -862,8 +818,8 @@ async_connect(basic_socket<Protocol, Executor>& s, Iterator begin,
|
|||
{
|
||||
return async_initiate<IteratorConnectHandler,
|
||||
void (boost::system::error_code, Iterator)>(
|
||||
detail::initiate_async_iterator_connect<Protocol, Executor>(s),
|
||||
handler, begin, end, connect_condition);
|
||||
detail::initiate_async_iterator_connect(),
|
||||
handler, &s, begin, end, connect_condition);
|
||||
}
|
||||
|
||||
} // namespace asio
|
||||
|
|
|
|||
|
|
@ -26,9 +26,8 @@ namespace boost {
|
|||
namespace asio {
|
||||
namespace detail {
|
||||
|
||||
class initiate_defer
|
||||
struct initiate_defer
|
||||
{
|
||||
public:
|
||||
template <typename CompletionHandler>
|
||||
void operator()(BOOST_ASIO_MOVE_ARG(CompletionHandler) handler) const
|
||||
{
|
||||
|
|
@ -42,63 +41,42 @@ public:
|
|||
|
||||
ex.defer(BOOST_ASIO_MOVE_CAST(CompletionHandler)(handler), alloc);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename Executor>
|
||||
class initiate_defer_with_executor
|
||||
{
|
||||
public:
|
||||
typedef Executor executor_type;
|
||||
|
||||
explicit initiate_defer_with_executor(const Executor& ex)
|
||||
: ex_(ex)
|
||||
{
|
||||
}
|
||||
|
||||
executor_type get_executor() const BOOST_ASIO_NOEXCEPT
|
||||
{
|
||||
return ex_;
|
||||
}
|
||||
|
||||
template <typename CompletionHandler>
|
||||
void operator()(BOOST_ASIO_MOVE_ARG(CompletionHandler) handler) const
|
||||
template <typename CompletionHandler, typename Executor>
|
||||
void operator()(BOOST_ASIO_MOVE_ARG(CompletionHandler) handler,
|
||||
BOOST_ASIO_MOVE_ARG(Executor) ex) const
|
||||
{
|
||||
typedef typename decay<CompletionHandler>::type DecayedHandler;
|
||||
|
||||
typename associated_allocator<DecayedHandler>::type alloc(
|
||||
(get_associated_allocator)(handler));
|
||||
|
||||
ex_.defer(detail::work_dispatcher<DecayedHandler>(
|
||||
ex.defer(detail::work_dispatcher<DecayedHandler>(
|
||||
BOOST_ASIO_MOVE_CAST(CompletionHandler)(handler)), alloc);
|
||||
}
|
||||
|
||||
private:
|
||||
Executor ex_;
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
template <BOOST_ASIO_COMPLETION_TOKEN_FOR(void()) CompletionToken>
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) defer(
|
||||
template <typename CompletionToken>
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(CompletionToken, void()) defer(
|
||||
BOOST_ASIO_MOVE_ARG(CompletionToken) token)
|
||||
{
|
||||
return async_initiate<CompletionToken, void()>(
|
||||
detail::initiate_defer(), token);
|
||||
}
|
||||
|
||||
template <typename Executor,
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void()) CompletionToken>
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) defer(
|
||||
template <typename Executor, typename CompletionToken>
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(CompletionToken, void()) defer(
|
||||
const Executor& ex, BOOST_ASIO_MOVE_ARG(CompletionToken) token,
|
||||
typename enable_if<is_executor<Executor>::value>::type*)
|
||||
{
|
||||
return async_initiate<CompletionToken, void()>(
|
||||
detail::initiate_defer_with_executor<Executor>(ex), token);
|
||||
detail::initiate_defer(), token, ex);
|
||||
}
|
||||
|
||||
template <typename ExecutionContext,
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void()) CompletionToken>
|
||||
inline BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) defer(
|
||||
template <typename ExecutionContext, typename CompletionToken>
|
||||
inline BOOST_ASIO_INITFN_RESULT_TYPE(CompletionToken, void()) defer(
|
||||
ExecutionContext& ctx, BOOST_ASIO_MOVE_ARG(CompletionToken) token,
|
||||
typename enable_if<is_convertible<
|
||||
ExecutionContext&, execution_context&>::value>::type*)
|
||||
|
|
|
|||
|
|
@ -26,9 +26,8 @@ namespace boost {
|
|||
namespace asio {
|
||||
namespace detail {
|
||||
|
||||
class initiate_dispatch
|
||||
struct initiate_dispatch
|
||||
{
|
||||
public:
|
||||
template <typename CompletionHandler>
|
||||
void operator()(BOOST_ASIO_MOVE_ARG(CompletionHandler) handler) const
|
||||
{
|
||||
|
|
@ -42,63 +41,42 @@ public:
|
|||
|
||||
ex.dispatch(BOOST_ASIO_MOVE_CAST(CompletionHandler)(handler), alloc);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename Executor>
|
||||
class initiate_dispatch_with_executor
|
||||
{
|
||||
public:
|
||||
typedef Executor executor_type;
|
||||
|
||||
explicit initiate_dispatch_with_executor(const Executor& ex)
|
||||
: ex_(ex)
|
||||
{
|
||||
}
|
||||
|
||||
executor_type get_executor() const BOOST_ASIO_NOEXCEPT
|
||||
{
|
||||
return ex_;
|
||||
}
|
||||
|
||||
template <typename CompletionHandler>
|
||||
void operator()(BOOST_ASIO_MOVE_ARG(CompletionHandler) handler) const
|
||||
template <typename CompletionHandler, typename Executor>
|
||||
void operator()(BOOST_ASIO_MOVE_ARG(CompletionHandler) handler,
|
||||
BOOST_ASIO_MOVE_ARG(Executor) ex) const
|
||||
{
|
||||
typedef typename decay<CompletionHandler>::type DecayedHandler;
|
||||
|
||||
typename associated_allocator<DecayedHandler>::type alloc(
|
||||
(get_associated_allocator)(handler));
|
||||
|
||||
ex_.dispatch(detail::work_dispatcher<DecayedHandler>(
|
||||
ex.dispatch(detail::work_dispatcher<DecayedHandler>(
|
||||
BOOST_ASIO_MOVE_CAST(CompletionHandler)(handler)), alloc);
|
||||
}
|
||||
|
||||
private:
|
||||
Executor ex_;
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
template <BOOST_ASIO_COMPLETION_TOKEN_FOR(void()) CompletionToken>
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) dispatch(
|
||||
template <typename CompletionToken>
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(CompletionToken, void()) dispatch(
|
||||
BOOST_ASIO_MOVE_ARG(CompletionToken) token)
|
||||
{
|
||||
return async_initiate<CompletionToken, void()>(
|
||||
detail::initiate_dispatch(), token);
|
||||
}
|
||||
|
||||
template <typename Executor,
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void()) CompletionToken>
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) dispatch(
|
||||
template <typename Executor, typename CompletionToken>
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(CompletionToken, void()) dispatch(
|
||||
const Executor& ex, BOOST_ASIO_MOVE_ARG(CompletionToken) token,
|
||||
typename enable_if<is_executor<Executor>::value>::type*)
|
||||
{
|
||||
return async_initiate<CompletionToken, void()>(
|
||||
detail::initiate_dispatch_with_executor<Executor>(ex), token);
|
||||
detail::initiate_dispatch(), token, ex);
|
||||
}
|
||||
|
||||
template <typename ExecutionContext,
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void()) CompletionToken>
|
||||
inline BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) dispatch(
|
||||
template <typename ExecutionContext, typename CompletionToken>
|
||||
inline BOOST_ASIO_INITFN_RESULT_TYPE(CompletionToken, void()) dispatch(
|
||||
ExecutionContext& ctx, BOOST_ASIO_MOVE_ARG(CompletionToken) token,
|
||||
typename enable_if<is_convertible<
|
||||
ExecutionContext&, execution_context&>::value>::type*)
|
||||
|
|
|
|||
|
|
@ -172,7 +172,7 @@ struct io_context::initiate_dispatch
|
|||
};
|
||||
|
||||
template <typename LegacyCompletionHandler>
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(LegacyCompletionHandler, void ())
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(LegacyCompletionHandler, void ())
|
||||
io_context::dispatch(BOOST_ASIO_MOVE_ARG(LegacyCompletionHandler) handler)
|
||||
{
|
||||
return async_initiate<LegacyCompletionHandler, void ()>(
|
||||
|
|
@ -211,7 +211,7 @@ struct io_context::initiate_post
|
|||
};
|
||||
|
||||
template <typename LegacyCompletionHandler>
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(LegacyCompletionHandler, void ())
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(LegacyCompletionHandler, void ())
|
||||
io_context::post(BOOST_ASIO_MOVE_ARG(LegacyCompletionHandler) handler)
|
||||
{
|
||||
return async_initiate<LegacyCompletionHandler, void ()>(
|
||||
|
|
|
|||
|
|
@ -26,9 +26,8 @@ namespace boost {
|
|||
namespace asio {
|
||||
namespace detail {
|
||||
|
||||
class initiate_post
|
||||
struct initiate_post
|
||||
{
|
||||
public:
|
||||
template <typename CompletionHandler>
|
||||
void operator()(BOOST_ASIO_MOVE_ARG(CompletionHandler) handler) const
|
||||
{
|
||||
|
|
@ -42,63 +41,42 @@ public:
|
|||
|
||||
ex.post(BOOST_ASIO_MOVE_CAST(CompletionHandler)(handler), alloc);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename Executor>
|
||||
class initiate_post_with_executor
|
||||
{
|
||||
public:
|
||||
typedef Executor executor_type;
|
||||
|
||||
explicit initiate_post_with_executor(const Executor& ex)
|
||||
: ex_(ex)
|
||||
{
|
||||
}
|
||||
|
||||
executor_type get_executor() const BOOST_ASIO_NOEXCEPT
|
||||
{
|
||||
return ex_;
|
||||
}
|
||||
|
||||
template <typename CompletionHandler>
|
||||
void operator()(BOOST_ASIO_MOVE_ARG(CompletionHandler) handler) const
|
||||
template <typename CompletionHandler, typename Executor>
|
||||
void operator()(BOOST_ASIO_MOVE_ARG(CompletionHandler) handler,
|
||||
BOOST_ASIO_MOVE_ARG(Executor) ex) const
|
||||
{
|
||||
typedef typename decay<CompletionHandler>::type DecayedHandler;
|
||||
|
||||
typename associated_allocator<DecayedHandler>::type alloc(
|
||||
(get_associated_allocator)(handler));
|
||||
|
||||
ex_.post(detail::work_dispatcher<DecayedHandler>(
|
||||
ex.post(detail::work_dispatcher<DecayedHandler>(
|
||||
BOOST_ASIO_MOVE_CAST(CompletionHandler)(handler)), alloc);
|
||||
}
|
||||
|
||||
private:
|
||||
Executor ex_;
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
template <BOOST_ASIO_COMPLETION_TOKEN_FOR(void()) CompletionToken>
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) post(
|
||||
template <typename CompletionToken>
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(CompletionToken, void()) post(
|
||||
BOOST_ASIO_MOVE_ARG(CompletionToken) token)
|
||||
{
|
||||
return async_initiate<CompletionToken, void()>(
|
||||
detail::initiate_post(), token);
|
||||
}
|
||||
|
||||
template <typename Executor,
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void()) CompletionToken>
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) post(
|
||||
template <typename Executor, typename CompletionToken>
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(CompletionToken, void()) post(
|
||||
const Executor& ex, BOOST_ASIO_MOVE_ARG(CompletionToken) token,
|
||||
typename enable_if<is_executor<Executor>::value>::type*)
|
||||
{
|
||||
return async_initiate<CompletionToken, void()>(
|
||||
detail::initiate_post_with_executor<Executor>(ex), token);
|
||||
detail::initiate_post(), token, ex);
|
||||
}
|
||||
|
||||
template <typename ExecutionContext,
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void()) CompletionToken>
|
||||
inline BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) post(
|
||||
template <typename ExecutionContext, typename CompletionToken>
|
||||
inline BOOST_ASIO_INITFN_RESULT_TYPE(CompletionToken, void()) post(
|
||||
ExecutionContext& ctx, BOOST_ASIO_MOVE_ARG(CompletionToken) token,
|
||||
typename enable_if<is_convertible<
|
||||
ExecutionContext&, execution_context&>::value>::type*)
|
||||
|
|
|
|||
|
|
@ -453,26 +453,12 @@ namespace detail
|
|||
boost::system::error_code(), 0, 1);
|
||||
}
|
||||
|
||||
template <typename AsyncReadStream>
|
||||
class initiate_async_read_buffer_sequence
|
||||
struct initiate_async_read_buffer_sequence
|
||||
{
|
||||
public:
|
||||
typedef typename AsyncReadStream::executor_type executor_type;
|
||||
|
||||
explicit initiate_async_read_buffer_sequence(AsyncReadStream& stream)
|
||||
: stream_(stream)
|
||||
{
|
||||
}
|
||||
|
||||
executor_type get_executor() const BOOST_ASIO_NOEXCEPT
|
||||
{
|
||||
return stream_.get_executor();
|
||||
}
|
||||
|
||||
template <typename ReadHandler, typename MutableBufferSequence,
|
||||
typename CompletionCondition>
|
||||
template <typename ReadHandler, typename AsyncReadStream,
|
||||
typename MutableBufferSequence, typename CompletionCondition>
|
||||
void operator()(BOOST_ASIO_MOVE_ARG(ReadHandler) handler,
|
||||
const MutableBufferSequence& buffers,
|
||||
AsyncReadStream* s, const MutableBufferSequence& buffers,
|
||||
BOOST_ASIO_MOVE_ARG(CompletionCondition) completion_cond) const
|
||||
{
|
||||
// If you get an error on the following line it means that your handler
|
||||
|
|
@ -481,13 +467,10 @@ namespace detail
|
|||
|
||||
non_const_lvalue<ReadHandler> handler2(handler);
|
||||
non_const_lvalue<CompletionCondition> completion_cond2(completion_cond);
|
||||
start_read_buffer_sequence_op(stream_, buffers,
|
||||
start_read_buffer_sequence_op(*s, buffers,
|
||||
boost::asio::buffer_sequence_begin(buffers),
|
||||
completion_cond2.value, handler2.value);
|
||||
}
|
||||
|
||||
private:
|
||||
AsyncReadStream& stream_;
|
||||
};
|
||||
} // namespace detail
|
||||
|
||||
|
|
@ -533,11 +516,9 @@ struct associated_executor<
|
|||
|
||||
#endif // !defined(GENERATING_DOCUMENTATION)
|
||||
|
||||
template <typename AsyncReadStream,
|
||||
typename MutableBufferSequence, typename CompletionCondition,
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
|
||||
std::size_t)) ReadHandler>
|
||||
inline BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
|
||||
template <typename AsyncReadStream, typename MutableBufferSequence,
|
||||
typename CompletionCondition, typename ReadHandler>
|
||||
inline BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
|
||||
void (boost::system::error_code, std::size_t))
|
||||
async_read(AsyncReadStream& s, const MutableBufferSequence& buffers,
|
||||
CompletionCondition completion_condition,
|
||||
|
|
@ -548,14 +529,13 @@ async_read(AsyncReadStream& s, const MutableBufferSequence& buffers,
|
|||
{
|
||||
return async_initiate<ReadHandler,
|
||||
void (boost::system::error_code, std::size_t)>(
|
||||
detail::initiate_async_read_buffer_sequence<AsyncReadStream>(s), handler,
|
||||
buffers, BOOST_ASIO_MOVE_CAST(CompletionCondition)(completion_condition));
|
||||
detail::initiate_async_read_buffer_sequence(), handler, &s, buffers,
|
||||
BOOST_ASIO_MOVE_CAST(CompletionCondition)(completion_condition));
|
||||
}
|
||||
|
||||
template <typename AsyncReadStream, typename MutableBufferSequence,
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
|
||||
std::size_t)) ReadHandler>
|
||||
inline BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
|
||||
typename ReadHandler>
|
||||
inline BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
|
||||
void (boost::system::error_code, std::size_t))
|
||||
async_read(AsyncReadStream& s, const MutableBufferSequence& buffers,
|
||||
BOOST_ASIO_MOVE_ARG(ReadHandler) handler,
|
||||
|
|
@ -565,8 +545,8 @@ async_read(AsyncReadStream& s, const MutableBufferSequence& buffers,
|
|||
{
|
||||
return async_initiate<ReadHandler,
|
||||
void (boost::system::error_code, std::size_t)>(
|
||||
detail::initiate_async_read_buffer_sequence<AsyncReadStream>(s),
|
||||
handler, buffers, transfer_all());
|
||||
detail::initiate_async_read_buffer_sequence(),
|
||||
handler, &s, buffers, transfer_all());
|
||||
}
|
||||
|
||||
#if !defined(BOOST_ASIO_NO_DYNAMIC_BUFFER_V1)
|
||||
|
|
@ -712,26 +692,12 @@ namespace detail
|
|||
function, this_handler->handler_);
|
||||
}
|
||||
|
||||
template <typename AsyncReadStream>
|
||||
class initiate_async_read_dynbuf_v1
|
||||
struct initiate_async_read_dynbuf_v1
|
||||
{
|
||||
public:
|
||||
typedef typename AsyncReadStream::executor_type executor_type;
|
||||
|
||||
explicit initiate_async_read_dynbuf_v1(AsyncReadStream& stream)
|
||||
: stream_(stream)
|
||||
{
|
||||
}
|
||||
|
||||
executor_type get_executor() const BOOST_ASIO_NOEXCEPT
|
||||
{
|
||||
return stream_.get_executor();
|
||||
}
|
||||
|
||||
template <typename ReadHandler, typename DynamicBuffer_v1,
|
||||
typename CompletionCondition>
|
||||
template <typename ReadHandler, typename AsyncReadStream,
|
||||
typename DynamicBuffer_v1, typename CompletionCondition>
|
||||
void operator()(BOOST_ASIO_MOVE_ARG(ReadHandler) handler,
|
||||
BOOST_ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
|
||||
AsyncReadStream* s, BOOST_ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
|
||||
BOOST_ASIO_MOVE_ARG(CompletionCondition) completion_cond) const
|
||||
{
|
||||
// If you get an error on the following line it means that your handler
|
||||
|
|
@ -742,13 +708,10 @@ namespace detail
|
|||
non_const_lvalue<CompletionCondition> completion_cond2(completion_cond);
|
||||
read_dynbuf_v1_op<AsyncReadStream, typename decay<DynamicBuffer_v1>::type,
|
||||
CompletionCondition, typename decay<ReadHandler>::type>(
|
||||
stream_, BOOST_ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers),
|
||||
*s, BOOST_ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers),
|
||||
completion_cond2.value, handler2.value)(
|
||||
boost::system::error_code(), 0, 1);
|
||||
}
|
||||
|
||||
private:
|
||||
AsyncReadStream& stream_;
|
||||
};
|
||||
} // namespace detail
|
||||
|
||||
|
|
@ -792,10 +755,9 @@ struct associated_executor<
|
|||
|
||||
#endif // !defined(GENERATING_DOCUMENTATION)
|
||||
|
||||
template <typename AsyncReadStream, typename DynamicBuffer_v1,
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
|
||||
std::size_t)) ReadHandler>
|
||||
inline BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
|
||||
template <typename AsyncReadStream,
|
||||
typename DynamicBuffer_v1, typename ReadHandler>
|
||||
inline BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
|
||||
void (boost::system::error_code, std::size_t))
|
||||
async_read(AsyncReadStream& s,
|
||||
BOOST_ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
|
||||
|
|
@ -810,11 +772,9 @@ async_read(AsyncReadStream& s,
|
|||
transfer_all(), BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
|
||||
}
|
||||
|
||||
template <typename AsyncReadStream,
|
||||
typename DynamicBuffer_v1, typename CompletionCondition,
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
|
||||
std::size_t)) ReadHandler>
|
||||
inline BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
|
||||
template <typename AsyncReadStream, typename DynamicBuffer_v1,
|
||||
typename CompletionCondition, typename ReadHandler>
|
||||
inline BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
|
||||
void (boost::system::error_code, std::size_t))
|
||||
async_read(AsyncReadStream& s,
|
||||
BOOST_ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
|
||||
|
|
@ -831,18 +791,16 @@ async_read(AsyncReadStream& s,
|
|||
|
||||
return async_initiate<ReadHandler,
|
||||
void (boost::system::error_code, std::size_t)>(
|
||||
detail::initiate_async_read_dynbuf_v1<AsyncReadStream>(s),
|
||||
handler, BOOST_ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers),
|
||||
detail::initiate_async_read_dynbuf_v1(), handler, &s,
|
||||
BOOST_ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers),
|
||||
BOOST_ASIO_MOVE_CAST(CompletionCondition)(completion_condition));
|
||||
}
|
||||
|
||||
#if !defined(BOOST_ASIO_NO_EXTENSIONS)
|
||||
#if !defined(BOOST_ASIO_NO_IOSTREAM)
|
||||
|
||||
template <typename AsyncReadStream, typename Allocator,
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
|
||||
std::size_t)) ReadHandler>
|
||||
inline BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
|
||||
template <typename AsyncReadStream, typename Allocator, typename ReadHandler>
|
||||
inline BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
|
||||
void (boost::system::error_code, std::size_t))
|
||||
async_read(AsyncReadStream& s, basic_streambuf<Allocator>& b,
|
||||
BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
|
||||
|
|
@ -851,11 +809,9 @@ async_read(AsyncReadStream& s, basic_streambuf<Allocator>& b,
|
|||
BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
|
||||
}
|
||||
|
||||
template <typename AsyncReadStream,
|
||||
typename Allocator, typename CompletionCondition,
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
|
||||
std::size_t)) ReadHandler>
|
||||
inline BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
|
||||
template <typename AsyncReadStream, typename Allocator,
|
||||
typename CompletionCondition, typename ReadHandler>
|
||||
inline BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
|
||||
void (boost::system::error_code, std::size_t))
|
||||
async_read(AsyncReadStream& s, basic_streambuf<Allocator>& b,
|
||||
CompletionCondition completion_condition,
|
||||
|
|
@ -1017,26 +973,12 @@ namespace detail
|
|||
function, this_handler->handler_);
|
||||
}
|
||||
|
||||
template <typename AsyncReadStream>
|
||||
class initiate_async_read_dynbuf_v2
|
||||
struct initiate_async_read_dynbuf_v2
|
||||
{
|
||||
public:
|
||||
typedef typename AsyncReadStream::executor_type executor_type;
|
||||
|
||||
explicit initiate_async_read_dynbuf_v2(AsyncReadStream& stream)
|
||||
: stream_(stream)
|
||||
{
|
||||
}
|
||||
|
||||
executor_type get_executor() const BOOST_ASIO_NOEXCEPT
|
||||
{
|
||||
return stream_.get_executor();
|
||||
}
|
||||
|
||||
template <typename ReadHandler, typename DynamicBuffer_v2,
|
||||
typename CompletionCondition>
|
||||
template <typename ReadHandler, typename AsyncReadStream,
|
||||
typename DynamicBuffer_v2, typename CompletionCondition>
|
||||
void operator()(BOOST_ASIO_MOVE_ARG(ReadHandler) handler,
|
||||
BOOST_ASIO_MOVE_ARG(DynamicBuffer_v2) buffers,
|
||||
AsyncReadStream* s, BOOST_ASIO_MOVE_ARG(DynamicBuffer_v2) buffers,
|
||||
BOOST_ASIO_MOVE_ARG(CompletionCondition) completion_cond) const
|
||||
{
|
||||
// If you get an error on the following line it means that your handler
|
||||
|
|
@ -1047,13 +989,10 @@ namespace detail
|
|||
non_const_lvalue<CompletionCondition> completion_cond2(completion_cond);
|
||||
read_dynbuf_v2_op<AsyncReadStream, typename decay<DynamicBuffer_v2>::type,
|
||||
CompletionCondition, typename decay<ReadHandler>::type>(
|
||||
stream_, BOOST_ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers),
|
||||
*s, BOOST_ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers),
|
||||
completion_cond2.value, handler2.value)(
|
||||
boost::system::error_code(), 0, 1);
|
||||
}
|
||||
|
||||
private:
|
||||
AsyncReadStream& stream_;
|
||||
};
|
||||
} // namespace detail
|
||||
|
||||
|
|
@ -1097,10 +1036,9 @@ struct associated_executor<
|
|||
|
||||
#endif // !defined(GENERATING_DOCUMENTATION)
|
||||
|
||||
template <typename AsyncReadStream, typename DynamicBuffer_v2,
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
|
||||
std::size_t)) ReadHandler>
|
||||
inline BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
|
||||
template <typename AsyncReadStream,
|
||||
typename DynamicBuffer_v2, typename ReadHandler>
|
||||
inline BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
|
||||
void (boost::system::error_code, std::size_t))
|
||||
async_read(AsyncReadStream& s, DynamicBuffer_v2 buffers,
|
||||
BOOST_ASIO_MOVE_ARG(ReadHandler) handler,
|
||||
|
|
@ -1113,11 +1051,9 @@ async_read(AsyncReadStream& s, DynamicBuffer_v2 buffers,
|
|||
transfer_all(), BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
|
||||
}
|
||||
|
||||
template <typename AsyncReadStream,
|
||||
typename DynamicBuffer_v2, typename CompletionCondition,
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
|
||||
std::size_t)) ReadHandler>
|
||||
inline BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
|
||||
template <typename AsyncReadStream, typename DynamicBuffer_v2,
|
||||
typename CompletionCondition, typename ReadHandler>
|
||||
inline BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
|
||||
void (boost::system::error_code, std::size_t))
|
||||
async_read(AsyncReadStream& s, DynamicBuffer_v2 buffers,
|
||||
CompletionCondition completion_condition,
|
||||
|
|
@ -1132,8 +1068,8 @@ async_read(AsyncReadStream& s, DynamicBuffer_v2 buffers,
|
|||
|
||||
return async_initiate<ReadHandler,
|
||||
void (boost::system::error_code, std::size_t)>(
|
||||
detail::initiate_async_read_dynbuf_v2<AsyncReadStream>(s),
|
||||
handler, BOOST_ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers),
|
||||
detail::initiate_async_read_dynbuf_v2(), handler, &s,
|
||||
BOOST_ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers),
|
||||
BOOST_ASIO_MOVE_CAST(CompletionCondition)(completion_condition));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -321,27 +321,13 @@ namespace detail
|
|||
boost::system::error_code(), 0, 1);
|
||||
}
|
||||
|
||||
template <typename AsyncRandomAccessReadDevice>
|
||||
class initiate_async_read_at_buffer_sequence
|
||||
struct initiate_async_read_at_buffer_sequence
|
||||
{
|
||||
public:
|
||||
typedef typename AsyncRandomAccessReadDevice::executor_type executor_type;
|
||||
|
||||
explicit initiate_async_read_at_buffer_sequence(
|
||||
AsyncRandomAccessReadDevice& device)
|
||||
: device_(device)
|
||||
{
|
||||
}
|
||||
|
||||
executor_type get_executor() const BOOST_ASIO_NOEXCEPT
|
||||
{
|
||||
return device_.get_executor();
|
||||
}
|
||||
|
||||
template <typename ReadHandler, typename MutableBufferSequence,
|
||||
typename CompletionCondition>
|
||||
template <typename ReadHandler, typename AsyncRandomAccessReadDevice,
|
||||
typename MutableBufferSequence, typename CompletionCondition>
|
||||
void operator()(BOOST_ASIO_MOVE_ARG(ReadHandler) handler,
|
||||
uint64_t offset, const MutableBufferSequence& buffers,
|
||||
AsyncRandomAccessReadDevice* d, uint64_t offset,
|
||||
const MutableBufferSequence& buffers,
|
||||
BOOST_ASIO_MOVE_ARG(CompletionCondition) completion_cond) const
|
||||
{
|
||||
// If you get an error on the following line it means that your handler
|
||||
|
|
@ -350,13 +336,10 @@ namespace detail
|
|||
|
||||
non_const_lvalue<ReadHandler> handler2(handler);
|
||||
non_const_lvalue<CompletionCondition> completion_cond2(completion_cond);
|
||||
start_read_at_buffer_sequence_op(device_, offset, buffers,
|
||||
start_read_at_buffer_sequence_op(*d, offset, buffers,
|
||||
boost::asio::buffer_sequence_begin(buffers),
|
||||
completion_cond2.value, handler2.value);
|
||||
}
|
||||
|
||||
private:
|
||||
AsyncRandomAccessReadDevice& device_;
|
||||
};
|
||||
} // namespace detail
|
||||
|
||||
|
|
@ -404,11 +387,9 @@ struct associated_executor<
|
|||
|
||||
#endif // !defined(GENERATING_DOCUMENTATION)
|
||||
|
||||
template <typename AsyncRandomAccessReadDevice,
|
||||
typename MutableBufferSequence, typename CompletionCondition,
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
|
||||
std::size_t)) ReadHandler>
|
||||
inline BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
|
||||
template <typename AsyncRandomAccessReadDevice, typename MutableBufferSequence,
|
||||
typename CompletionCondition, typename ReadHandler>
|
||||
inline BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
|
||||
void (boost::system::error_code, std::size_t))
|
||||
async_read_at(AsyncRandomAccessReadDevice& d,
|
||||
uint64_t offset, const MutableBufferSequence& buffers,
|
||||
|
|
@ -417,16 +398,13 @@ async_read_at(AsyncRandomAccessReadDevice& d,
|
|||
{
|
||||
return async_initiate<ReadHandler,
|
||||
void (boost::system::error_code, std::size_t)>(
|
||||
detail::initiate_async_read_at_buffer_sequence<
|
||||
AsyncRandomAccessReadDevice>(d),
|
||||
handler, offset, buffers,
|
||||
BOOST_ASIO_MOVE_CAST(CompletionCondition)(completion_condition));
|
||||
detail::initiate_async_read_at_buffer_sequence(), handler, &d, offset,
|
||||
buffers, BOOST_ASIO_MOVE_CAST(CompletionCondition)(completion_condition));
|
||||
}
|
||||
|
||||
template <typename AsyncRandomAccessReadDevice, typename MutableBufferSequence,
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
|
||||
std::size_t)) ReadHandler>
|
||||
inline BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
|
||||
typename ReadHandler>
|
||||
inline BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
|
||||
void (boost::system::error_code, std::size_t))
|
||||
async_read_at(AsyncRandomAccessReadDevice& d,
|
||||
uint64_t offset, const MutableBufferSequence& buffers,
|
||||
|
|
@ -434,9 +412,8 @@ async_read_at(AsyncRandomAccessReadDevice& d,
|
|||
{
|
||||
return async_initiate<ReadHandler,
|
||||
void (boost::system::error_code, std::size_t)>(
|
||||
detail::initiate_async_read_at_buffer_sequence<
|
||||
AsyncRandomAccessReadDevice>(d),
|
||||
handler, offset, buffers, transfer_all());
|
||||
detail::initiate_async_read_at_buffer_sequence(),
|
||||
handler, &d, offset, buffers, transfer_all());
|
||||
}
|
||||
|
||||
#if !defined(BOOST_ASIO_NO_EXTENSIONS)
|
||||
|
|
@ -577,27 +554,13 @@ namespace detail
|
|||
function, this_handler->handler_);
|
||||
}
|
||||
|
||||
template <typename AsyncRandomAccessReadDevice>
|
||||
class initiate_async_read_at_streambuf
|
||||
struct initiate_async_read_at_streambuf
|
||||
{
|
||||
public:
|
||||
typedef typename AsyncRandomAccessReadDevice::executor_type executor_type;
|
||||
|
||||
explicit initiate_async_read_at_streambuf(
|
||||
AsyncRandomAccessReadDevice& device)
|
||||
: device_(device)
|
||||
{
|
||||
}
|
||||
|
||||
executor_type get_executor() const BOOST_ASIO_NOEXCEPT
|
||||
{
|
||||
return device_.get_executor();
|
||||
}
|
||||
|
||||
template <typename ReadHandler,
|
||||
template <typename ReadHandler, typename AsyncRandomAccessReadDevice,
|
||||
typename Allocator, typename CompletionCondition>
|
||||
void operator()(BOOST_ASIO_MOVE_ARG(ReadHandler) handler,
|
||||
uint64_t offset, basic_streambuf<Allocator>* b,
|
||||
AsyncRandomAccessReadDevice* d, uint64_t offset,
|
||||
basic_streambuf<Allocator>* b,
|
||||
BOOST_ASIO_MOVE_ARG(CompletionCondition) completion_cond) const
|
||||
{
|
||||
// If you get an error on the following line it means that your handler
|
||||
|
|
@ -608,12 +571,9 @@ namespace detail
|
|||
non_const_lvalue<CompletionCondition> completion_cond2(completion_cond);
|
||||
read_at_streambuf_op<AsyncRandomAccessReadDevice, Allocator,
|
||||
CompletionCondition, typename decay<ReadHandler>::type>(
|
||||
device_, offset, *b, completion_cond2.value, handler2.value)(
|
||||
*d, offset, *b, completion_cond2.value, handler2.value)(
|
||||
boost::system::error_code(), 0, 1);
|
||||
}
|
||||
|
||||
private:
|
||||
AsyncRandomAccessReadDevice& device_;
|
||||
};
|
||||
} // namespace detail
|
||||
|
||||
|
|
@ -657,11 +617,9 @@ struct associated_executor<
|
|||
|
||||
#endif // !defined(GENERATING_DOCUMENTATION)
|
||||
|
||||
template <typename AsyncRandomAccessReadDevice,
|
||||
typename Allocator, typename CompletionCondition,
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
|
||||
std::size_t)) ReadHandler>
|
||||
inline BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
|
||||
template <typename AsyncRandomAccessReadDevice, typename Allocator,
|
||||
typename CompletionCondition, typename ReadHandler>
|
||||
inline BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
|
||||
void (boost::system::error_code, std::size_t))
|
||||
async_read_at(AsyncRandomAccessReadDevice& d,
|
||||
uint64_t offset, boost::asio::basic_streambuf<Allocator>& b,
|
||||
|
|
@ -670,15 +628,13 @@ async_read_at(AsyncRandomAccessReadDevice& d,
|
|||
{
|
||||
return async_initiate<ReadHandler,
|
||||
void (boost::system::error_code, std::size_t)>(
|
||||
detail::initiate_async_read_at_streambuf<AsyncRandomAccessReadDevice>(d),
|
||||
handler, offset, &b,
|
||||
BOOST_ASIO_MOVE_CAST(CompletionCondition)(completion_condition));
|
||||
detail::initiate_async_read_at_streambuf(), handler, &d, offset,
|
||||
&b, BOOST_ASIO_MOVE_CAST(CompletionCondition)(completion_condition));
|
||||
}
|
||||
|
||||
template <typename AsyncRandomAccessReadDevice, typename Allocator,
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
|
||||
std::size_t)) ReadHandler>
|
||||
inline BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
|
||||
typename ReadHandler>
|
||||
inline BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
|
||||
void (boost::system::error_code, std::size_t))
|
||||
async_read_at(AsyncRandomAccessReadDevice& d,
|
||||
uint64_t offset, boost::asio::basic_streambuf<Allocator>& b,
|
||||
|
|
@ -686,8 +642,8 @@ async_read_at(AsyncRandomAccessReadDevice& d,
|
|||
{
|
||||
return async_initiate<ReadHandler,
|
||||
void (boost::system::error_code, std::size_t)>(
|
||||
detail::initiate_async_read_at_streambuf<AsyncRandomAccessReadDevice>(d),
|
||||
handler, offset, &b, transfer_all());
|
||||
detail::initiate_async_read_at_streambuf(),
|
||||
handler, &d, offset, &b, transfer_all());
|
||||
}
|
||||
|
||||
#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
|
||||
|
|
|
|||
|
|
@ -952,25 +952,12 @@ namespace detail
|
|||
function, this_handler->handler_);
|
||||
}
|
||||
|
||||
template <typename AsyncReadStream>
|
||||
class initiate_async_read_until_delim_v1
|
||||
struct initiate_async_read_until_delim_v1
|
||||
{
|
||||
public:
|
||||
typedef typename AsyncReadStream::executor_type executor_type;
|
||||
|
||||
explicit initiate_async_read_until_delim_v1(AsyncReadStream& stream)
|
||||
: stream_(stream)
|
||||
{
|
||||
}
|
||||
|
||||
executor_type get_executor() const BOOST_ASIO_NOEXCEPT
|
||||
{
|
||||
return stream_.get_executor();
|
||||
}
|
||||
|
||||
template <typename ReadHandler, typename DynamicBuffer_v1>
|
||||
template <typename ReadHandler, typename AsyncReadStream,
|
||||
typename DynamicBuffer_v1>
|
||||
void operator()(BOOST_ASIO_MOVE_ARG(ReadHandler) handler,
|
||||
BOOST_ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
|
||||
AsyncReadStream* s, BOOST_ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
|
||||
char delim) const
|
||||
{
|
||||
// If you get an error on the following line it means that your handler
|
||||
|
|
@ -981,12 +968,9 @@ namespace detail
|
|||
read_until_delim_op_v1<AsyncReadStream,
|
||||
typename decay<DynamicBuffer_v1>::type,
|
||||
typename decay<ReadHandler>::type>(
|
||||
stream_, BOOST_ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers),
|
||||
*s, BOOST_ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers),
|
||||
delim, handler2.value)(boost::system::error_code(), 0, 1);
|
||||
}
|
||||
|
||||
private:
|
||||
AsyncReadStream& stream_;
|
||||
};
|
||||
} // namespace detail
|
||||
|
||||
|
|
@ -1030,10 +1014,9 @@ struct associated_executor<
|
|||
|
||||
#endif // !defined(GENERATING_DOCUMENTATION)
|
||||
|
||||
template <typename AsyncReadStream, typename DynamicBuffer_v1,
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
|
||||
std::size_t)) ReadHandler>
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
|
||||
template <typename AsyncReadStream,
|
||||
typename DynamicBuffer_v1, typename ReadHandler>
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
|
||||
void (boost::system::error_code, std::size_t))
|
||||
async_read_until(AsyncReadStream& s,
|
||||
BOOST_ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
|
||||
|
|
@ -1045,8 +1028,8 @@ async_read_until(AsyncReadStream& s,
|
|||
{
|
||||
return async_initiate<ReadHandler,
|
||||
void (boost::system::error_code, std::size_t)>(
|
||||
detail::initiate_async_read_until_delim_v1<AsyncReadStream>(s),
|
||||
handler, BOOST_ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers), delim);
|
||||
detail::initiate_async_read_until_delim_v1(), handler,
|
||||
&s, BOOST_ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers), delim);
|
||||
}
|
||||
|
||||
namespace detail
|
||||
|
|
@ -1236,25 +1219,12 @@ namespace detail
|
|||
function, this_handler->handler_);
|
||||
}
|
||||
|
||||
template <typename AsyncReadStream>
|
||||
class initiate_async_read_until_delim_string_v1
|
||||
struct initiate_async_read_until_delim_string_v1
|
||||
{
|
||||
public:
|
||||
typedef typename AsyncReadStream::executor_type executor_type;
|
||||
|
||||
explicit initiate_async_read_until_delim_string_v1(AsyncReadStream& stream)
|
||||
: stream_(stream)
|
||||
{
|
||||
}
|
||||
|
||||
executor_type get_executor() const BOOST_ASIO_NOEXCEPT
|
||||
{
|
||||
return stream_.get_executor();
|
||||
}
|
||||
|
||||
template <typename ReadHandler, typename DynamicBuffer_v1>
|
||||
template <typename ReadHandler, typename AsyncReadStream,
|
||||
typename DynamicBuffer_v1>
|
||||
void operator()(BOOST_ASIO_MOVE_ARG(ReadHandler) handler,
|
||||
BOOST_ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
|
||||
AsyncReadStream* s, BOOST_ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
|
||||
const std::string& delim) const
|
||||
{
|
||||
// If you get an error on the following line it means that your handler
|
||||
|
|
@ -1265,12 +1235,9 @@ namespace detail
|
|||
read_until_delim_string_op_v1<AsyncReadStream,
|
||||
typename decay<DynamicBuffer_v1>::type,
|
||||
typename decay<ReadHandler>::type>(
|
||||
stream_, BOOST_ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers),
|
||||
*s, BOOST_ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers),
|
||||
delim, handler2.value)(boost::system::error_code(), 0, 1);
|
||||
}
|
||||
|
||||
private:
|
||||
AsyncReadStream& stream_;
|
||||
};
|
||||
} // namespace detail
|
||||
|
||||
|
|
@ -1314,10 +1281,9 @@ struct associated_executor<
|
|||
|
||||
#endif // !defined(GENERATING_DOCUMENTATION)
|
||||
|
||||
template <typename AsyncReadStream, typename DynamicBuffer_v1,
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
|
||||
std::size_t)) ReadHandler>
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
|
||||
template <typename AsyncReadStream,
|
||||
typename DynamicBuffer_v1, typename ReadHandler>
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
|
||||
void (boost::system::error_code, std::size_t))
|
||||
async_read_until(AsyncReadStream& s,
|
||||
BOOST_ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
|
||||
|
|
@ -1330,8 +1296,8 @@ async_read_until(AsyncReadStream& s,
|
|||
{
|
||||
return async_initiate<ReadHandler,
|
||||
void (boost::system::error_code, std::size_t)>(
|
||||
detail::initiate_async_read_until_delim_string_v1<AsyncReadStream>(s),
|
||||
handler, BOOST_ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers),
|
||||
detail::initiate_async_read_until_delim_string_v1(),
|
||||
handler, &s, BOOST_ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers),
|
||||
static_cast<std::string>(delim));
|
||||
}
|
||||
|
||||
|
|
@ -1528,25 +1494,13 @@ namespace detail
|
|||
function, this_handler->handler_);
|
||||
}
|
||||
|
||||
template <typename AsyncReadStream>
|
||||
class initiate_async_read_until_expr_v1
|
||||
struct initiate_async_read_until_expr_v1
|
||||
{
|
||||
public:
|
||||
typedef typename AsyncReadStream::executor_type executor_type;
|
||||
|
||||
explicit initiate_async_read_until_expr_v1(AsyncReadStream& stream)
|
||||
: stream_(stream)
|
||||
{
|
||||
}
|
||||
|
||||
executor_type get_executor() const BOOST_ASIO_NOEXCEPT
|
||||
{
|
||||
return stream_.get_executor();
|
||||
}
|
||||
|
||||
template <typename ReadHandler, typename DynamicBuffer_v1, typename RegEx>
|
||||
template <typename ReadHandler, typename AsyncReadStream,
|
||||
typename DynamicBuffer_v1, typename RegEx>
|
||||
void operator()(BOOST_ASIO_MOVE_ARG(ReadHandler) handler,
|
||||
BOOST_ASIO_MOVE_ARG(DynamicBuffer_v1) buffers, const RegEx& expr) const
|
||||
AsyncReadStream* s, BOOST_ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
|
||||
const RegEx& expr) const
|
||||
{
|
||||
// If you get an error on the following line it means that your handler
|
||||
// does not meet the documented type requirements for a ReadHandler.
|
||||
|
|
@ -1556,12 +1510,9 @@ namespace detail
|
|||
read_until_expr_op_v1<AsyncReadStream,
|
||||
typename decay<DynamicBuffer_v1>::type,
|
||||
RegEx, typename decay<ReadHandler>::type>(
|
||||
stream_, BOOST_ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers),
|
||||
*s, BOOST_ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers),
|
||||
expr, handler2.value)(boost::system::error_code(), 0, 1);
|
||||
}
|
||||
|
||||
private:
|
||||
AsyncReadStream& stream_;
|
||||
};
|
||||
} // namespace detail
|
||||
|
||||
|
|
@ -1605,10 +1556,9 @@ struct associated_executor<
|
|||
|
||||
#endif // !defined(GENERATING_DOCUMENTATION)
|
||||
|
||||
template <typename AsyncReadStream, typename DynamicBuffer_v1,
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
|
||||
std::size_t)) ReadHandler>
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
|
||||
template <typename AsyncReadStream,
|
||||
typename DynamicBuffer_v1, typename ReadHandler>
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
|
||||
void (boost::system::error_code, std::size_t))
|
||||
async_read_until(AsyncReadStream& s,
|
||||
BOOST_ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
|
||||
|
|
@ -1621,8 +1571,8 @@ async_read_until(AsyncReadStream& s,
|
|||
{
|
||||
return async_initiate<ReadHandler,
|
||||
void (boost::system::error_code, std::size_t)>(
|
||||
detail::initiate_async_read_until_expr_v1<AsyncReadStream>(s),
|
||||
handler, BOOST_ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers), expr);
|
||||
detail::initiate_async_read_until_expr_v1(), handler,
|
||||
&s, BOOST_ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers), expr);
|
||||
}
|
||||
|
||||
#endif // defined(BOOST_ASIO_HAS_BOOST_REGEX)
|
||||
|
|
@ -1815,26 +1765,12 @@ namespace detail
|
|||
function, this_handler->handler_);
|
||||
}
|
||||
|
||||
template <typename AsyncReadStream>
|
||||
class initiate_async_read_until_match_v1
|
||||
struct initiate_async_read_until_match_v1
|
||||
{
|
||||
public:
|
||||
typedef typename AsyncReadStream::executor_type executor_type;
|
||||
|
||||
explicit initiate_async_read_until_match_v1(AsyncReadStream& stream)
|
||||
: stream_(stream)
|
||||
{
|
||||
}
|
||||
|
||||
executor_type get_executor() const BOOST_ASIO_NOEXCEPT
|
||||
{
|
||||
return stream_.get_executor();
|
||||
}
|
||||
|
||||
template <typename ReadHandler,
|
||||
template <typename ReadHandler, typename AsyncReadStream,
|
||||
typename DynamicBuffer_v1, typename MatchCondition>
|
||||
void operator()(BOOST_ASIO_MOVE_ARG(ReadHandler) handler,
|
||||
BOOST_ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
|
||||
AsyncReadStream* s, BOOST_ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
|
||||
MatchCondition match_condition) const
|
||||
{
|
||||
// If you get an error on the following line it means that your handler
|
||||
|
|
@ -1845,12 +1781,9 @@ namespace detail
|
|||
read_until_match_op_v1<AsyncReadStream,
|
||||
typename decay<DynamicBuffer_v1>::type,
|
||||
MatchCondition, typename decay<ReadHandler>::type>(
|
||||
stream_, BOOST_ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers),
|
||||
*s, BOOST_ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers),
|
||||
match_condition, handler2.value)(boost::system::error_code(), 0, 1);
|
||||
}
|
||||
|
||||
private:
|
||||
AsyncReadStream& stream_;
|
||||
};
|
||||
} // namespace detail
|
||||
|
||||
|
|
@ -1894,11 +1827,9 @@ struct associated_executor<
|
|||
|
||||
#endif // !defined(GENERATING_DOCUMENTATION)
|
||||
|
||||
template <typename AsyncReadStream,
|
||||
typename DynamicBuffer_v1, typename MatchCondition,
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
|
||||
std::size_t)) ReadHandler>
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
|
||||
template <typename AsyncReadStream, typename DynamicBuffer_v1,
|
||||
typename MatchCondition, typename ReadHandler>
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
|
||||
void (boost::system::error_code, std::size_t))
|
||||
async_read_until(AsyncReadStream& s,
|
||||
BOOST_ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
|
||||
|
|
@ -1911,16 +1842,14 @@ async_read_until(AsyncReadStream& s,
|
|||
{
|
||||
return async_initiate<ReadHandler,
|
||||
void (boost::system::error_code, std::size_t)>(
|
||||
detail::initiate_async_read_until_match_v1<AsyncReadStream>(s), handler,
|
||||
BOOST_ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers), match_condition);
|
||||
detail::initiate_async_read_until_match_v1(), handler,
|
||||
&s, BOOST_ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers), match_condition);
|
||||
}
|
||||
|
||||
#if !defined(BOOST_ASIO_NO_IOSTREAM)
|
||||
|
||||
template <typename AsyncReadStream, typename Allocator,
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
|
||||
std::size_t)) ReadHandler>
|
||||
inline BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
|
||||
template <typename AsyncReadStream, typename Allocator, typename ReadHandler>
|
||||
inline BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
|
||||
void (boost::system::error_code, std::size_t))
|
||||
async_read_until(AsyncReadStream& s,
|
||||
boost::asio::basic_streambuf<Allocator>& b,
|
||||
|
|
@ -1930,10 +1859,8 @@ async_read_until(AsyncReadStream& s,
|
|||
delim, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
|
||||
}
|
||||
|
||||
template <typename AsyncReadStream, typename Allocator,
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
|
||||
std::size_t)) ReadHandler>
|
||||
inline BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
|
||||
template <typename AsyncReadStream, typename Allocator, typename ReadHandler>
|
||||
inline BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
|
||||
void (boost::system::error_code, std::size_t))
|
||||
async_read_until(AsyncReadStream& s,
|
||||
boost::asio::basic_streambuf<Allocator>& b,
|
||||
|
|
@ -1946,10 +1873,8 @@ async_read_until(AsyncReadStream& s,
|
|||
|
||||
#if defined(BOOST_ASIO_HAS_BOOST_REGEX)
|
||||
|
||||
template <typename AsyncReadStream, typename Allocator,
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
|
||||
std::size_t)) ReadHandler>
|
||||
inline BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
|
||||
template <typename AsyncReadStream, typename Allocator, typename ReadHandler>
|
||||
inline BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
|
||||
void (boost::system::error_code, std::size_t))
|
||||
async_read_until(AsyncReadStream& s,
|
||||
boost::asio::basic_streambuf<Allocator>& b, const boost::regex& expr,
|
||||
|
|
@ -1961,10 +1886,9 @@ async_read_until(AsyncReadStream& s,
|
|||
|
||||
#endif // defined(BOOST_ASIO_HAS_BOOST_REGEX)
|
||||
|
||||
template <typename AsyncReadStream, typename Allocator, typename MatchCondition,
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
|
||||
std::size_t)) ReadHandler>
|
||||
inline BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
|
||||
template <typename AsyncReadStream, typename Allocator,
|
||||
typename MatchCondition, typename ReadHandler>
|
||||
inline BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
|
||||
void (boost::system::error_code, std::size_t))
|
||||
async_read_until(AsyncReadStream& s,
|
||||
boost::asio::basic_streambuf<Allocator>& b,
|
||||
|
|
@ -2163,25 +2087,13 @@ namespace detail
|
|||
function, this_handler->handler_);
|
||||
}
|
||||
|
||||
template <typename AsyncReadStream>
|
||||
class initiate_async_read_until_delim_v2
|
||||
struct initiate_async_read_until_delim_v2
|
||||
{
|
||||
public:
|
||||
typedef typename AsyncReadStream::executor_type executor_type;
|
||||
|
||||
explicit initiate_async_read_until_delim_v2(AsyncReadStream& stream)
|
||||
: stream_(stream)
|
||||
{
|
||||
}
|
||||
|
||||
executor_type get_executor() const BOOST_ASIO_NOEXCEPT
|
||||
{
|
||||
return stream_.get_executor();
|
||||
}
|
||||
|
||||
template <typename ReadHandler, typename DynamicBuffer_v2>
|
||||
template <typename ReadHandler, typename AsyncReadStream,
|
||||
typename DynamicBuffer_v2>
|
||||
void operator()(BOOST_ASIO_MOVE_ARG(ReadHandler) handler,
|
||||
BOOST_ASIO_MOVE_ARG(DynamicBuffer_v2) buffers, char delim) const
|
||||
AsyncReadStream* s, BOOST_ASIO_MOVE_ARG(DynamicBuffer_v2) buffers,
|
||||
char delim) const
|
||||
{
|
||||
// If you get an error on the following line it means that your handler
|
||||
// does not meet the documented type requirements for a ReadHandler.
|
||||
|
|
@ -2191,12 +2103,9 @@ namespace detail
|
|||
read_until_delim_op_v2<AsyncReadStream,
|
||||
typename decay<DynamicBuffer_v2>::type,
|
||||
typename decay<ReadHandler>::type>(
|
||||
stream_, BOOST_ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers),
|
||||
*s, BOOST_ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers),
|
||||
delim, handler2.value)(boost::system::error_code(), 0, 1);
|
||||
}
|
||||
|
||||
private:
|
||||
AsyncReadStream& stream_;
|
||||
};
|
||||
} // namespace detail
|
||||
|
||||
|
|
@ -2240,10 +2149,9 @@ struct associated_executor<
|
|||
|
||||
#endif // !defined(GENERATING_DOCUMENTATION)
|
||||
|
||||
template <typename AsyncReadStream, typename DynamicBuffer_v2,
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
|
||||
std::size_t)) ReadHandler>
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
|
||||
template <typename AsyncReadStream,
|
||||
typename DynamicBuffer_v2, typename ReadHandler>
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
|
||||
void (boost::system::error_code, std::size_t))
|
||||
async_read_until(AsyncReadStream& s, DynamicBuffer_v2 buffers,
|
||||
char delim, BOOST_ASIO_MOVE_ARG(ReadHandler) handler,
|
||||
|
|
@ -2253,8 +2161,8 @@ async_read_until(AsyncReadStream& s, DynamicBuffer_v2 buffers,
|
|||
{
|
||||
return async_initiate<ReadHandler,
|
||||
void (boost::system::error_code, std::size_t)>(
|
||||
detail::initiate_async_read_until_delim_v2<AsyncReadStream>(s),
|
||||
handler, BOOST_ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers), delim);
|
||||
detail::initiate_async_read_until_delim_v2(), handler,
|
||||
&s, BOOST_ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers), delim);
|
||||
}
|
||||
|
||||
namespace detail
|
||||
|
|
@ -2452,25 +2360,12 @@ namespace detail
|
|||
function, this_handler->handler_);
|
||||
}
|
||||
|
||||
template <typename AsyncReadStream>
|
||||
class initiate_async_read_until_delim_string_v2
|
||||
struct initiate_async_read_until_delim_string_v2
|
||||
{
|
||||
public:
|
||||
typedef typename AsyncReadStream::executor_type executor_type;
|
||||
|
||||
explicit initiate_async_read_until_delim_string_v2(AsyncReadStream& stream)
|
||||
: stream_(stream)
|
||||
{
|
||||
}
|
||||
|
||||
executor_type get_executor() const BOOST_ASIO_NOEXCEPT
|
||||
{
|
||||
return stream_.get_executor();
|
||||
}
|
||||
|
||||
template <typename ReadHandler, typename DynamicBuffer_v2>
|
||||
template <typename ReadHandler, typename AsyncReadStream,
|
||||
typename DynamicBuffer_v2>
|
||||
void operator()(BOOST_ASIO_MOVE_ARG(ReadHandler) handler,
|
||||
BOOST_ASIO_MOVE_ARG(DynamicBuffer_v2) buffers,
|
||||
AsyncReadStream* s, BOOST_ASIO_MOVE_ARG(DynamicBuffer_v2) buffers,
|
||||
const std::string& delim) const
|
||||
{
|
||||
// If you get an error on the following line it means that your handler
|
||||
|
|
@ -2481,12 +2376,9 @@ namespace detail
|
|||
read_until_delim_string_op_v2<AsyncReadStream,
|
||||
typename decay<DynamicBuffer_v2>::type,
|
||||
typename decay<ReadHandler>::type>(
|
||||
stream_, BOOST_ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers),
|
||||
*s, BOOST_ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers),
|
||||
delim, handler2.value)(boost::system::error_code(), 0, 1);
|
||||
}
|
||||
|
||||
private:
|
||||
AsyncReadStream& stream_;
|
||||
};
|
||||
} // namespace detail
|
||||
|
||||
|
|
@ -2531,10 +2423,8 @@ struct associated_executor<
|
|||
#endif // !defined(GENERATING_DOCUMENTATION)
|
||||
|
||||
template <typename AsyncReadStream,
|
||||
typename DynamicBuffer_v2,
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
|
||||
std::size_t)) ReadHandler>
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
|
||||
typename DynamicBuffer_v2, typename ReadHandler>
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
|
||||
void (boost::system::error_code, std::size_t))
|
||||
async_read_until(AsyncReadStream& s,
|
||||
DynamicBuffer_v2 buffers, BOOST_ASIO_STRING_VIEW_PARAM delim,
|
||||
|
|
@ -2545,8 +2435,8 @@ async_read_until(AsyncReadStream& s,
|
|||
{
|
||||
return async_initiate<ReadHandler,
|
||||
void (boost::system::error_code, std::size_t)>(
|
||||
detail::initiate_async_read_until_delim_string_v2<AsyncReadStream>(s),
|
||||
handler, BOOST_ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers),
|
||||
detail::initiate_async_read_until_delim_string_v2(),
|
||||
handler, &s, BOOST_ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers),
|
||||
static_cast<std::string>(delim));
|
||||
}
|
||||
|
||||
|
|
@ -2751,25 +2641,12 @@ namespace detail
|
|||
function, this_handler->handler_);
|
||||
}
|
||||
|
||||
template <typename AsyncReadStream>
|
||||
class initiate_async_read_until_expr_v2
|
||||
struct initiate_async_read_until_expr_v2
|
||||
{
|
||||
public:
|
||||
typedef typename AsyncReadStream::executor_type executor_type;
|
||||
|
||||
explicit initiate_async_read_until_expr_v2(AsyncReadStream& stream)
|
||||
: stream_(stream)
|
||||
{
|
||||
}
|
||||
|
||||
executor_type get_executor() const BOOST_ASIO_NOEXCEPT
|
||||
{
|
||||
return stream_.get_executor();
|
||||
}
|
||||
|
||||
template <typename ReadHandler, typename DynamicBuffer_v2, typename RegEx>
|
||||
template <typename ReadHandler, typename AsyncReadStream,
|
||||
typename DynamicBuffer_v2, typename RegEx>
|
||||
void operator()(BOOST_ASIO_MOVE_ARG(ReadHandler) handler,
|
||||
BOOST_ASIO_MOVE_ARG(DynamicBuffer_v2) buffers,
|
||||
AsyncReadStream* s, BOOST_ASIO_MOVE_ARG(DynamicBuffer_v2) buffers,
|
||||
const RegEx& expr) const
|
||||
{
|
||||
// If you get an error on the following line it means that your handler
|
||||
|
|
@ -2780,12 +2657,9 @@ namespace detail
|
|||
read_until_expr_op_v2<AsyncReadStream,
|
||||
typename decay<DynamicBuffer_v2>::type,
|
||||
RegEx, typename decay<ReadHandler>::type>(
|
||||
stream_, BOOST_ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers),
|
||||
*s, BOOST_ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers),
|
||||
expr, handler2.value)(boost::system::error_code(), 0, 1);
|
||||
}
|
||||
|
||||
private:
|
||||
AsyncReadStream& stream_;
|
||||
};
|
||||
} // namespace detail
|
||||
|
||||
|
|
@ -2829,10 +2703,9 @@ struct associated_executor<
|
|||
|
||||
#endif // !defined(GENERATING_DOCUMENTATION)
|
||||
|
||||
template <typename AsyncReadStream, typename DynamicBuffer_v2,
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
|
||||
std::size_t)) ReadHandler>
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
|
||||
template <typename AsyncReadStream,
|
||||
typename DynamicBuffer_v2, typename ReadHandler>
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
|
||||
void (boost::system::error_code, std::size_t))
|
||||
async_read_until(AsyncReadStream& s, DynamicBuffer_v2 buffers,
|
||||
const boost::regex& expr, BOOST_ASIO_MOVE_ARG(ReadHandler) handler,
|
||||
|
|
@ -2842,8 +2715,8 @@ async_read_until(AsyncReadStream& s, DynamicBuffer_v2 buffers,
|
|||
{
|
||||
return async_initiate<ReadHandler,
|
||||
void (boost::system::error_code, std::size_t)>(
|
||||
detail::initiate_async_read_until_expr_v2<AsyncReadStream>(s),
|
||||
handler, BOOST_ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers), expr);
|
||||
detail::initiate_async_read_until_expr_v2(), handler,
|
||||
&s, BOOST_ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers), expr);
|
||||
}
|
||||
|
||||
#endif // defined(BOOST_ASIO_HAS_BOOST_REGEX)
|
||||
|
|
@ -3044,26 +2917,12 @@ namespace detail
|
|||
function, this_handler->handler_);
|
||||
}
|
||||
|
||||
template <typename AsyncReadStream>
|
||||
class initiate_async_read_until_match_v2
|
||||
struct initiate_async_read_until_match_v2
|
||||
{
|
||||
public:
|
||||
typedef typename AsyncReadStream::executor_type executor_type;
|
||||
|
||||
explicit initiate_async_read_until_match_v2(AsyncReadStream& stream)
|
||||
: stream_(stream)
|
||||
{
|
||||
}
|
||||
|
||||
executor_type get_executor() const BOOST_ASIO_NOEXCEPT
|
||||
{
|
||||
return stream_.get_executor();
|
||||
}
|
||||
|
||||
template <typename ReadHandler,
|
||||
template <typename ReadHandler, typename AsyncReadStream,
|
||||
typename DynamicBuffer_v2, typename MatchCondition>
|
||||
void operator()(BOOST_ASIO_MOVE_ARG(ReadHandler) handler,
|
||||
BOOST_ASIO_MOVE_ARG(DynamicBuffer_v2) buffers,
|
||||
AsyncReadStream* s, BOOST_ASIO_MOVE_ARG(DynamicBuffer_v2) buffers,
|
||||
MatchCondition match_condition) const
|
||||
{
|
||||
// If you get an error on the following line it means that your handler
|
||||
|
|
@ -3074,12 +2933,9 @@ namespace detail
|
|||
read_until_match_op_v2<AsyncReadStream,
|
||||
typename decay<DynamicBuffer_v2>::type,
|
||||
MatchCondition, typename decay<ReadHandler>::type>(
|
||||
stream_, BOOST_ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers),
|
||||
*s, BOOST_ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers),
|
||||
match_condition, handler2.value)(boost::system::error_code(), 0, 1);
|
||||
}
|
||||
|
||||
private:
|
||||
AsyncReadStream& stream_;
|
||||
};
|
||||
} // namespace detail
|
||||
|
||||
|
|
@ -3123,11 +2979,9 @@ struct associated_executor<
|
|||
|
||||
#endif // !defined(GENERATING_DOCUMENTATION)
|
||||
|
||||
template <typename AsyncReadStream,
|
||||
typename DynamicBuffer_v2, typename MatchCondition,
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
|
||||
std::size_t)) ReadHandler>
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
|
||||
template <typename AsyncReadStream, typename DynamicBuffer_v2,
|
||||
typename MatchCondition, typename ReadHandler>
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
|
||||
void (boost::system::error_code, std::size_t))
|
||||
async_read_until(AsyncReadStream& s, DynamicBuffer_v2 buffers,
|
||||
MatchCondition match_condition, BOOST_ASIO_MOVE_ARG(ReadHandler) handler,
|
||||
|
|
@ -3138,8 +2992,8 @@ async_read_until(AsyncReadStream& s, DynamicBuffer_v2 buffers,
|
|||
{
|
||||
return async_initiate<ReadHandler,
|
||||
void (boost::system::error_code, std::size_t)>(
|
||||
detail::initiate_async_read_until_match_v2<AsyncReadStream>(s), handler,
|
||||
BOOST_ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers), match_condition);
|
||||
detail::initiate_async_read_until_match_v2(), handler,
|
||||
&s, BOOST_ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers), match_condition);
|
||||
}
|
||||
|
||||
#endif // !defined(BOOST_ASIO_NO_EXTENSIONS)
|
||||
|
|
|
|||
|
|
@ -418,26 +418,12 @@ namespace detail
|
|||
boost::system::error_code(), 0, 1);
|
||||
}
|
||||
|
||||
template <typename AsyncWriteStream>
|
||||
class initiate_async_write_buffer_sequence
|
||||
struct initiate_async_write_buffer_sequence
|
||||
{
|
||||
public:
|
||||
typedef typename AsyncWriteStream::executor_type executor_type;
|
||||
|
||||
explicit initiate_async_write_buffer_sequence(AsyncWriteStream& stream)
|
||||
: stream_(stream)
|
||||
{
|
||||
}
|
||||
|
||||
executor_type get_executor() const BOOST_ASIO_NOEXCEPT
|
||||
{
|
||||
return stream_.get_executor();
|
||||
}
|
||||
|
||||
template <typename WriteHandler, typename ConstBufferSequence,
|
||||
typename CompletionCondition>
|
||||
template <typename WriteHandler, typename AsyncWriteStream,
|
||||
typename ConstBufferSequence, typename CompletionCondition>
|
||||
void operator()(BOOST_ASIO_MOVE_ARG(WriteHandler) handler,
|
||||
const ConstBufferSequence& buffers,
|
||||
AsyncWriteStream* s, const ConstBufferSequence& buffers,
|
||||
BOOST_ASIO_MOVE_ARG(CompletionCondition) completion_cond) const
|
||||
{
|
||||
// If you get an error on the following line it means that your handler
|
||||
|
|
@ -446,13 +432,10 @@ namespace detail
|
|||
|
||||
non_const_lvalue<WriteHandler> handler2(handler);
|
||||
non_const_lvalue<CompletionCondition> completion_cond2(completion_cond);
|
||||
start_write_buffer_sequence_op(stream_, buffers,
|
||||
start_write_buffer_sequence_op(*s, buffers,
|
||||
boost::asio::buffer_sequence_begin(buffers),
|
||||
completion_cond2.value, handler2.value);
|
||||
}
|
||||
|
||||
private:
|
||||
AsyncWriteStream& stream_;
|
||||
};
|
||||
} // namespace detail
|
||||
|
||||
|
|
@ -498,11 +481,9 @@ struct associated_executor<
|
|||
|
||||
#endif // !defined(GENERATING_DOCUMENTATION)
|
||||
|
||||
template <typename AsyncWriteStream,
|
||||
typename ConstBufferSequence, typename CompletionCondition,
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
|
||||
std::size_t)) WriteHandler>
|
||||
inline BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
|
||||
template <typename AsyncWriteStream, typename ConstBufferSequence,
|
||||
typename CompletionCondition, typename WriteHandler>
|
||||
inline BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
|
||||
void (boost::system::error_code, std::size_t))
|
||||
async_write(AsyncWriteStream& s, const ConstBufferSequence& buffers,
|
||||
CompletionCondition completion_condition,
|
||||
|
|
@ -513,15 +494,13 @@ async_write(AsyncWriteStream& s, const ConstBufferSequence& buffers,
|
|||
{
|
||||
return async_initiate<WriteHandler,
|
||||
void (boost::system::error_code, std::size_t)>(
|
||||
detail::initiate_async_write_buffer_sequence<AsyncWriteStream>(s),
|
||||
handler, buffers,
|
||||
detail::initiate_async_write_buffer_sequence(), handler, &s, buffers,
|
||||
BOOST_ASIO_MOVE_CAST(CompletionCondition)(completion_condition));
|
||||
}
|
||||
|
||||
template <typename AsyncWriteStream, typename ConstBufferSequence,
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
|
||||
std::size_t)) WriteHandler>
|
||||
inline BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
|
||||
typename WriteHandler>
|
||||
inline BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
|
||||
void (boost::system::error_code, std::size_t))
|
||||
async_write(AsyncWriteStream& s, const ConstBufferSequence& buffers,
|
||||
BOOST_ASIO_MOVE_ARG(WriteHandler) handler,
|
||||
|
|
@ -531,8 +510,8 @@ async_write(AsyncWriteStream& s, const ConstBufferSequence& buffers,
|
|||
{
|
||||
return async_initiate<WriteHandler,
|
||||
void (boost::system::error_code, std::size_t)>(
|
||||
detail::initiate_async_write_buffer_sequence<AsyncWriteStream>(s),
|
||||
handler, buffers, transfer_all());
|
||||
detail::initiate_async_write_buffer_sequence(),
|
||||
handler, &s, buffers, transfer_all());
|
||||
}
|
||||
|
||||
#if !defined(BOOST_ASIO_NO_DYNAMIC_BUFFER_V1)
|
||||
|
|
@ -650,26 +629,12 @@ namespace detail
|
|||
function, this_handler->handler_);
|
||||
}
|
||||
|
||||
template <typename AsyncWriteStream>
|
||||
class initiate_async_write_dynbuf_v1
|
||||
struct initiate_async_write_dynbuf_v1
|
||||
{
|
||||
public:
|
||||
typedef typename AsyncWriteStream::executor_type executor_type;
|
||||
|
||||
explicit initiate_async_write_dynbuf_v1(AsyncWriteStream& stream)
|
||||
: stream_(stream)
|
||||
{
|
||||
}
|
||||
|
||||
executor_type get_executor() const BOOST_ASIO_NOEXCEPT
|
||||
{
|
||||
return stream_.get_executor();
|
||||
}
|
||||
|
||||
template <typename WriteHandler, typename DynamicBuffer_v1,
|
||||
typename CompletionCondition>
|
||||
template <typename WriteHandler, typename AsyncWriteStream,
|
||||
typename DynamicBuffer_v1, typename CompletionCondition>
|
||||
void operator()(BOOST_ASIO_MOVE_ARG(WriteHandler) handler,
|
||||
BOOST_ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
|
||||
AsyncWriteStream* s, BOOST_ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
|
||||
BOOST_ASIO_MOVE_ARG(CompletionCondition) completion_cond) const
|
||||
{
|
||||
// If you get an error on the following line it means that your handler
|
||||
|
|
@ -681,13 +646,10 @@ namespace detail
|
|||
write_dynbuf_v1_op<AsyncWriteStream,
|
||||
typename decay<DynamicBuffer_v1>::type,
|
||||
CompletionCondition, typename decay<WriteHandler>::type>(
|
||||
stream_, BOOST_ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers),
|
||||
*s, BOOST_ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers),
|
||||
completion_cond2.value, handler2.value)(
|
||||
boost::system::error_code(), 0, 1);
|
||||
}
|
||||
|
||||
private:
|
||||
AsyncWriteStream& stream_;
|
||||
};
|
||||
} // namespace detail
|
||||
|
||||
|
|
@ -731,10 +693,9 @@ struct associated_executor<
|
|||
|
||||
#endif // !defined(GENERATING_DOCUMENTATION)
|
||||
|
||||
template <typename AsyncWriteStream, typename DynamicBuffer_v1,
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
|
||||
std::size_t)) WriteHandler>
|
||||
inline BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
|
||||
template <typename AsyncWriteStream,
|
||||
typename DynamicBuffer_v1, typename WriteHandler>
|
||||
inline BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
|
||||
void (boost::system::error_code, std::size_t))
|
||||
async_write(AsyncWriteStream& s,
|
||||
BOOST_ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
|
||||
|
|
@ -749,11 +710,9 @@ async_write(AsyncWriteStream& s,
|
|||
transfer_all(), BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
|
||||
}
|
||||
|
||||
template <typename AsyncWriteStream,
|
||||
typename DynamicBuffer_v1, typename CompletionCondition,
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
|
||||
std::size_t)) WriteHandler>
|
||||
inline BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
|
||||
template <typename AsyncWriteStream, typename DynamicBuffer_v1,
|
||||
typename CompletionCondition, typename WriteHandler>
|
||||
inline BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
|
||||
void (boost::system::error_code, std::size_t))
|
||||
async_write(AsyncWriteStream& s,
|
||||
BOOST_ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
|
||||
|
|
@ -766,18 +725,16 @@ async_write(AsyncWriteStream& s,
|
|||
{
|
||||
return async_initiate<WriteHandler,
|
||||
void (boost::system::error_code, std::size_t)>(
|
||||
detail::initiate_async_write_dynbuf_v1<AsyncWriteStream>(s),
|
||||
handler, BOOST_ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers),
|
||||
detail::initiate_async_write_dynbuf_v1(), handler, &s,
|
||||
BOOST_ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers),
|
||||
BOOST_ASIO_MOVE_CAST(CompletionCondition)(completion_condition));
|
||||
}
|
||||
|
||||
#if !defined(BOOST_ASIO_NO_EXTENSIONS)
|
||||
#if !defined(BOOST_ASIO_NO_IOSTREAM)
|
||||
|
||||
template <typename AsyncWriteStream, typename Allocator,
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
|
||||
std::size_t)) WriteHandler>
|
||||
inline BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
|
||||
template <typename AsyncWriteStream, typename Allocator, typename WriteHandler>
|
||||
inline BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
|
||||
void (boost::system::error_code, std::size_t))
|
||||
async_write(AsyncWriteStream& s,
|
||||
boost::asio::basic_streambuf<Allocator>& b,
|
||||
|
|
@ -787,11 +744,9 @@ async_write(AsyncWriteStream& s,
|
|||
BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
|
||||
}
|
||||
|
||||
template <typename AsyncWriteStream,
|
||||
typename Allocator, typename CompletionCondition,
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
|
||||
std::size_t)) WriteHandler>
|
||||
inline BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
|
||||
template <typename AsyncWriteStream, typename Allocator,
|
||||
typename CompletionCondition, typename WriteHandler>
|
||||
inline BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
|
||||
void (boost::system::error_code, std::size_t))
|
||||
async_write(AsyncWriteStream& s,
|
||||
boost::asio::basic_streambuf<Allocator>& b,
|
||||
|
|
@ -920,26 +875,12 @@ namespace detail
|
|||
function, this_handler->handler_);
|
||||
}
|
||||
|
||||
template <typename AsyncWriteStream>
|
||||
class initiate_async_write_dynbuf_v2
|
||||
struct initiate_async_write_dynbuf_v2
|
||||
{
|
||||
public:
|
||||
typedef typename AsyncWriteStream::executor_type executor_type;
|
||||
|
||||
explicit initiate_async_write_dynbuf_v2(AsyncWriteStream& stream)
|
||||
: stream_(stream)
|
||||
{
|
||||
}
|
||||
|
||||
executor_type get_executor() const BOOST_ASIO_NOEXCEPT
|
||||
{
|
||||
return stream_.get_executor();
|
||||
}
|
||||
|
||||
template <typename WriteHandler, typename DynamicBuffer_v2,
|
||||
typename CompletionCondition>
|
||||
template <typename WriteHandler, typename AsyncWriteStream,
|
||||
typename DynamicBuffer_v2, typename CompletionCondition>
|
||||
void operator()(BOOST_ASIO_MOVE_ARG(WriteHandler) handler,
|
||||
BOOST_ASIO_MOVE_ARG(DynamicBuffer_v2) buffers,
|
||||
AsyncWriteStream* s, BOOST_ASIO_MOVE_ARG(DynamicBuffer_v2) buffers,
|
||||
BOOST_ASIO_MOVE_ARG(CompletionCondition) completion_cond) const
|
||||
{
|
||||
// If you get an error on the following line it means that your handler
|
||||
|
|
@ -951,13 +892,10 @@ namespace detail
|
|||
write_dynbuf_v2_op<AsyncWriteStream,
|
||||
typename decay<DynamicBuffer_v2>::type,
|
||||
CompletionCondition, typename decay<WriteHandler>::type>(
|
||||
stream_, BOOST_ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers),
|
||||
*s, BOOST_ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers),
|
||||
completion_cond2.value, handler2.value)(
|
||||
boost::system::error_code(), 0, 1);
|
||||
}
|
||||
|
||||
private:
|
||||
AsyncWriteStream& stream_;
|
||||
};
|
||||
} // namespace detail
|
||||
|
||||
|
|
@ -1001,10 +939,9 @@ struct associated_executor<
|
|||
|
||||
#endif // !defined(GENERATING_DOCUMENTATION)
|
||||
|
||||
template <typename AsyncWriteStream, typename DynamicBuffer_v2,
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
|
||||
std::size_t)) WriteHandler>
|
||||
inline BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
|
||||
template <typename AsyncWriteStream,
|
||||
typename DynamicBuffer_v2, typename WriteHandler>
|
||||
inline BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
|
||||
void (boost::system::error_code, std::size_t))
|
||||
async_write(AsyncWriteStream& s, DynamicBuffer_v2 buffers,
|
||||
BOOST_ASIO_MOVE_ARG(WriteHandler) handler,
|
||||
|
|
@ -1017,11 +954,9 @@ async_write(AsyncWriteStream& s, DynamicBuffer_v2 buffers,
|
|||
transfer_all(), BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
|
||||
}
|
||||
|
||||
template <typename AsyncWriteStream,
|
||||
typename DynamicBuffer_v2, typename CompletionCondition,
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
|
||||
std::size_t)) WriteHandler>
|
||||
inline BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
|
||||
template <typename AsyncWriteStream, typename DynamicBuffer_v2,
|
||||
typename CompletionCondition, typename WriteHandler>
|
||||
inline BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
|
||||
void (boost::system::error_code, std::size_t))
|
||||
async_write(AsyncWriteStream& s, DynamicBuffer_v2 buffers,
|
||||
CompletionCondition completion_condition,
|
||||
|
|
@ -1032,8 +967,8 @@ async_write(AsyncWriteStream& s, DynamicBuffer_v2 buffers,
|
|||
{
|
||||
return async_initiate<WriteHandler,
|
||||
void (boost::system::error_code, std::size_t)>(
|
||||
detail::initiate_async_write_dynbuf_v2<AsyncWriteStream>(s),
|
||||
handler, BOOST_ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers),
|
||||
detail::initiate_async_write_dynbuf_v2(), handler, &s,
|
||||
BOOST_ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers),
|
||||
BOOST_ASIO_MOVE_CAST(CompletionCondition)(completion_condition));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -306,27 +306,13 @@ namespace detail
|
|||
boost::system::error_code(), 0, 1);
|
||||
}
|
||||
|
||||
template <typename AsyncRandomAccessWriteDevice>
|
||||
class initiate_async_write_at_buffer_sequence
|
||||
struct initiate_async_write_at_buffer_sequence
|
||||
{
|
||||
public:
|
||||
typedef typename AsyncRandomAccessWriteDevice::executor_type executor_type;
|
||||
|
||||
explicit initiate_async_write_at_buffer_sequence(
|
||||
AsyncRandomAccessWriteDevice& device)
|
||||
: device_(device)
|
||||
{
|
||||
}
|
||||
|
||||
executor_type get_executor() const BOOST_ASIO_NOEXCEPT
|
||||
{
|
||||
return device_.get_executor();
|
||||
}
|
||||
|
||||
template <typename WriteHandler, typename ConstBufferSequence,
|
||||
typename CompletionCondition>
|
||||
template <typename WriteHandler, typename AsyncRandomAccessWriteDevice,
|
||||
typename ConstBufferSequence, typename CompletionCondition>
|
||||
void operator()(BOOST_ASIO_MOVE_ARG(WriteHandler) handler,
|
||||
uint64_t offset, const ConstBufferSequence& buffers,
|
||||
AsyncRandomAccessWriteDevice* d, uint64_t offset,
|
||||
const ConstBufferSequence& buffers,
|
||||
BOOST_ASIO_MOVE_ARG(CompletionCondition) completion_cond) const
|
||||
{
|
||||
// If you get an error on the following line it means that your handler
|
||||
|
|
@ -335,13 +321,10 @@ namespace detail
|
|||
|
||||
non_const_lvalue<WriteHandler> handler2(handler);
|
||||
non_const_lvalue<CompletionCondition> completion_cond2(completion_cond);
|
||||
start_write_at_buffer_sequence_op(device_, offset, buffers,
|
||||
start_write_at_buffer_sequence_op(*d, offset, buffers,
|
||||
boost::asio::buffer_sequence_begin(buffers),
|
||||
completion_cond2.value, handler2.value);
|
||||
}
|
||||
|
||||
private:
|
||||
AsyncRandomAccessWriteDevice& device_;
|
||||
};
|
||||
} // namespace detail
|
||||
|
||||
|
|
@ -389,11 +372,9 @@ struct associated_executor<
|
|||
|
||||
#endif // !defined(GENERATING_DOCUMENTATION)
|
||||
|
||||
template <typename AsyncRandomAccessWriteDevice,
|
||||
typename ConstBufferSequence, typename CompletionCondition,
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
|
||||
std::size_t)) WriteHandler>
|
||||
inline BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
|
||||
template <typename AsyncRandomAccessWriteDevice, typename ConstBufferSequence,
|
||||
typename CompletionCondition, typename WriteHandler>
|
||||
inline BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
|
||||
void (boost::system::error_code, std::size_t))
|
||||
async_write_at(AsyncRandomAccessWriteDevice& d,
|
||||
uint64_t offset, const ConstBufferSequence& buffers,
|
||||
|
|
@ -402,16 +383,13 @@ async_write_at(AsyncRandomAccessWriteDevice& d,
|
|||
{
|
||||
return async_initiate<WriteHandler,
|
||||
void (boost::system::error_code, std::size_t)>(
|
||||
detail::initiate_async_write_at_buffer_sequence<
|
||||
AsyncRandomAccessWriteDevice>(d),
|
||||
handler, offset, buffers,
|
||||
BOOST_ASIO_MOVE_CAST(CompletionCondition)(completion_condition));
|
||||
detail::initiate_async_write_at_buffer_sequence(), handler, &d, offset,
|
||||
buffers, BOOST_ASIO_MOVE_CAST(CompletionCondition)(completion_condition));
|
||||
}
|
||||
|
||||
template <typename AsyncRandomAccessWriteDevice, typename ConstBufferSequence,
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
|
||||
std::size_t)) WriteHandler>
|
||||
inline BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
|
||||
typename WriteHandler>
|
||||
inline BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
|
||||
void (boost::system::error_code, std::size_t))
|
||||
async_write_at(AsyncRandomAccessWriteDevice& d,
|
||||
uint64_t offset, const ConstBufferSequence& buffers,
|
||||
|
|
@ -419,9 +397,8 @@ async_write_at(AsyncRandomAccessWriteDevice& d,
|
|||
{
|
||||
return async_initiate<WriteHandler,
|
||||
void (boost::system::error_code, std::size_t)>(
|
||||
detail::initiate_async_write_at_buffer_sequence<
|
||||
AsyncRandomAccessWriteDevice>(d),
|
||||
handler, offset, buffers, transfer_all());
|
||||
detail::initiate_async_write_at_buffer_sequence(),
|
||||
handler, &d, offset, buffers, transfer_all());
|
||||
}
|
||||
|
||||
#if !defined(BOOST_ASIO_NO_EXTENSIONS)
|
||||
|
|
@ -507,27 +484,13 @@ namespace detail
|
|||
function, this_handler->handler_);
|
||||
}
|
||||
|
||||
template <typename AsyncRandomAccessWriteDevice>
|
||||
class initiate_async_write_at_streambuf
|
||||
struct initiate_async_write_at_streambuf
|
||||
{
|
||||
public:
|
||||
typedef typename AsyncRandomAccessWriteDevice::executor_type executor_type;
|
||||
|
||||
explicit initiate_async_write_at_streambuf(
|
||||
AsyncRandomAccessWriteDevice& device)
|
||||
: device_(device)
|
||||
{
|
||||
}
|
||||
|
||||
executor_type get_executor() const BOOST_ASIO_NOEXCEPT
|
||||
{
|
||||
return device_.get_executor();
|
||||
}
|
||||
|
||||
template <typename WriteHandler,
|
||||
template <typename WriteHandler, typename AsyncRandomAccessWriteDevice,
|
||||
typename Allocator, typename CompletionCondition>
|
||||
void operator()(BOOST_ASIO_MOVE_ARG(WriteHandler) handler,
|
||||
uint64_t offset, basic_streambuf<Allocator>* b,
|
||||
AsyncRandomAccessWriteDevice* d, uint64_t offset,
|
||||
basic_streambuf<Allocator>* b,
|
||||
BOOST_ASIO_MOVE_ARG(CompletionCondition) completion_condition) const
|
||||
{
|
||||
// If you get an error on the following line it means that your handler
|
||||
|
|
@ -535,14 +498,11 @@ namespace detail
|
|||
BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check;
|
||||
|
||||
non_const_lvalue<WriteHandler> handler2(handler);
|
||||
async_write_at(device_, offset, b->data(),
|
||||
async_write_at(*d, offset, b->data(),
|
||||
BOOST_ASIO_MOVE_CAST(CompletionCondition)(completion_condition),
|
||||
write_at_streambuf_op<Allocator, typename decay<WriteHandler>::type>(
|
||||
*b, handler2.value));
|
||||
}
|
||||
|
||||
private:
|
||||
AsyncRandomAccessWriteDevice& device_;
|
||||
};
|
||||
} // namespace detail
|
||||
|
||||
|
|
@ -580,11 +540,9 @@ struct associated_executor<
|
|||
|
||||
#endif // !defined(GENERATING_DOCUMENTATION)
|
||||
|
||||
template <typename AsyncRandomAccessWriteDevice,
|
||||
typename Allocator, typename CompletionCondition,
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
|
||||
std::size_t)) WriteHandler>
|
||||
inline BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
|
||||
template <typename AsyncRandomAccessWriteDevice, typename Allocator,
|
||||
typename CompletionCondition, typename WriteHandler>
|
||||
inline BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
|
||||
void (boost::system::error_code, std::size_t))
|
||||
async_write_at(AsyncRandomAccessWriteDevice& d,
|
||||
uint64_t offset, boost::asio::basic_streambuf<Allocator>& b,
|
||||
|
|
@ -593,16 +551,13 @@ async_write_at(AsyncRandomAccessWriteDevice& d,
|
|||
{
|
||||
return async_initiate<WriteHandler,
|
||||
void (boost::system::error_code, std::size_t)>(
|
||||
detail::initiate_async_write_at_streambuf<
|
||||
AsyncRandomAccessWriteDevice>(d),
|
||||
handler, offset, &b,
|
||||
BOOST_ASIO_MOVE_CAST(CompletionCondition)(completion_condition));
|
||||
detail::initiate_async_write_at_streambuf(), handler, &d, offset,
|
||||
&b, BOOST_ASIO_MOVE_CAST(CompletionCondition)(completion_condition));
|
||||
}
|
||||
|
||||
template <typename AsyncRandomAccessWriteDevice, typename Allocator,
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
|
||||
std::size_t)) WriteHandler>
|
||||
inline BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
|
||||
typename WriteHandler>
|
||||
inline BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
|
||||
void (boost::system::error_code, std::size_t))
|
||||
async_write_at(AsyncRandomAccessWriteDevice& d,
|
||||
uint64_t offset, boost::asio::basic_streambuf<Allocator>& b,
|
||||
|
|
@ -610,9 +565,8 @@ async_write_at(AsyncRandomAccessWriteDevice& d,
|
|||
{
|
||||
return async_initiate<WriteHandler,
|
||||
void (boost::system::error_code, std::size_t)>(
|
||||
detail::initiate_async_write_at_streambuf<
|
||||
AsyncRandomAccessWriteDevice>(d),
|
||||
handler, offset, &b, transfer_all());
|
||||
detail::initiate_async_write_at_streambuf(),
|
||||
handler, &d, offset, &b, transfer_all());
|
||||
}
|
||||
|
||||
#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue