MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / initiate_dispatch

Class initiate_dispatch

3rd/asio-1.24.0/include/asio/impl/dispatch.hpp:31–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29namespace detail {
30
31class initiate_dispatch
32{
33public:
34 template <typename CompletionHandler>
35 void operator()(ASIO_MOVE_ARG(CompletionHandler) handler,
36 typename enable_if<
37 execution::is_executor<
38 typename associated_executor<
39 typename decay<CompletionHandler>::type
40 >::type
41 >::value
42 >::type* = 0) const
43 {
44 typedef typename decay<CompletionHandler>::type handler_t;
45
46 typename associated_executor<handler_t>::type ex(
47 (get_associated_executor)(handler));
48
49 typename associated_allocator<handler_t>::type alloc(
50 (get_associated_allocator)(handler));
51
52 execution::execute(
53 asio::prefer(ex,
54 execution::blocking.possibly,
55 execution::allocator(alloc)),
56 asio::detail::bind_handler(
57 ASIO_MOVE_CAST(CompletionHandler)(handler)));
58 }
59
60 template <typename CompletionHandler>
61 void operator()(ASIO_MOVE_ARG(CompletionHandler) handler,
62 typename enable_if<
63 !execution::is_executor<
64 typename associated_executor<
65 typename decay<CompletionHandler>::type
66 >::type
67 >::value
68 >::type* = 0) const
69 {
70 typedef typename decay<CompletionHandler>::type handler_t;
71
72 typename associated_executor<handler_t>::type ex(
73 (get_associated_executor)(handler));
74
75 typename associated_allocator<handler_t>::type alloc(
76 (get_associated_allocator)(handler));
77
78 ex.dispatch(asio::detail::bind_handler(
79 ASIO_MOVE_CAST(CompletionHandler)(handler)), alloc);
80 }
81};
82
83template <typename Executor>
84class initiate_dispatch_with_executor

Callers 2

io_context.hppFile · 0.70
dispatch.hppFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected