11 #ifndef ASIO_DETAIL_COMPLETION_HANDLER_HPP 12 #define ASIO_DETAIL_COMPLETION_HANDLER_HPP 14 #if defined(_MSC_VER) && (_MSC_VER >= 1200) 16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 18 #include "asio/detail/config.hpp" 19 #include "asio/detail/fenced_block.hpp" 20 #include "asio/detail/handler_alloc_helpers.hpp" 21 #include "asio/detail/handler_work.hpp" 22 #include "asio/detail/memory.hpp" 23 #include "asio/detail/operation.hpp" 25 #include "asio/detail/push_options.hpp" 30 template <
typename Handler,
typename IoExecutor>
37 : operation(&completion_handler::do_complete),
38 handler_(ASIO_MOVE_CAST(Handler)(h)),
39 work_(handler_, io_ex)
43 static void do_complete(
void* owner, operation* base,
49 ptr p = { asio::detail::addressof(h->handler_), h, h };
51 ASIO_HANDLER_COMPLETION((*h));
64 Handler handler(ASIO_MOVE_CAST(Handler)(h->handler_));
65 p.h = asio::detail::addressof(handler);
72 ASIO_HANDLER_INVOCATION_BEGIN(());
73 w.complete(handler, handler);
74 ASIO_HANDLER_INVOCATION_END;
86 #include "asio/detail/pop_options.hpp" 88 #endif // ASIO_DETAIL_COMPLETION_HANDLER_HPP
Definition: null_fenced_block.hpp:25
Class to represent an error code value.
Definition: error_code.hpp:80
Definition: any_io_executor.hpp:28
Definition: completion_handler.hpp:31