// detail/win_iocp_overlapped_op.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2019 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
namespace asio {
namespace detail {
-template <typename Handler>
+template <typename Handler, typename IoExecutor>
class win_iocp_overlapped_op : public operation
{
public:
BOOST_ASIO_DEFINE_HANDLER_PTR(win_iocp_overlapped_op);
- win_iocp_overlapped_op(Handler& handler)
+ win_iocp_overlapped_op(Handler& handler, const IoExecutor& io_ex)
: operation(&win_iocp_overlapped_op::do_complete),
- handler_(BOOST_ASIO_MOVE_CAST(Handler)(handler))
+ handler_(BOOST_ASIO_MOVE_CAST(Handler)(handler)),
+ io_executor_(io_ex)
{
- handler_work<Handler>::start(handler_);
+ handler_work<Handler, IoExecutor>::start(handler_, io_executor_);
}
static void do_complete(void* owner, operation* base,
// Take ownership of the operation object.
win_iocp_overlapped_op* o(static_cast<win_iocp_overlapped_op*>(base));
ptr p = { boost::asio::detail::addressof(o->handler_), o, o };
- handler_work<Handler> w(o->handler_);
+ handler_work<Handler, IoExecutor> w(o->handler_, o->io_executor_);
BOOST_ASIO_HANDLER_COMPLETION((*o));
private:
Handler handler_;
+ IoExecutor io_executor_;
};
} // namespace detail