Clementine
is_executor.hpp
1 //
2 // detail/is_executor.hpp
3 // ~~~~~~~~~~~~~~~~~~~~~~
4 //
5 // Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com)
6 //
7 // Distributed under the Boost Software License, Version 1.0. (See accompanying
8 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
9 //
10 
11 #ifndef ASIO_DETAIL_IS_EXECUTOR_HPP
12 #define ASIO_DETAIL_IS_EXECUTOR_HPP
13 
14 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
15 # pragma once
16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
17 
18 #include "asio/detail/config.hpp"
19 #include "asio/detail/type_traits.hpp"
20 
21 #include "asio/detail/push_options.hpp"
22 
23 namespace asio {
24 namespace detail {
25 
27 {
28  void context();
29  void on_work_started();
30  void on_work_finished();
31  void dispatch();
32  void post();
33  void defer();
34 };
35 
36 template <typename T>
39 {
40 };
41 
42 template <typename T, T>
44 {
45 };
46 
47 template <typename>
48 char (&context_memfn_helper(...))[2];
49 
50 template <typename T>
51 char context_memfn_helper(
53  void (executor_memfns_base::*)(),
55 
56 template <typename>
57 char (&on_work_started_memfn_helper(...))[2];
58 
59 template <typename T>
60 char on_work_started_memfn_helper(
62  void (executor_memfns_base::*)(),
64 
65 template <typename>
66 char (&on_work_finished_memfn_helper(...))[2];
67 
68 template <typename T>
69 char on_work_finished_memfn_helper(
71  void (executor_memfns_base::*)(),
73 
74 template <typename>
75 char (&dispatch_memfn_helper(...))[2];
76 
77 template <typename T>
78 char dispatch_memfn_helper(
80  void (executor_memfns_base::*)(),
82 
83 template <typename>
84 char (&post_memfn_helper(...))[2];
85 
86 template <typename T>
87 char post_memfn_helper(
89  void (executor_memfns_base::*)(),
91 
92 template <typename>
93 char (&defer_memfn_helper(...))[2];
94 
95 template <typename T>
96 char defer_memfn_helper(
98  void (executor_memfns_base::*)(),
100 
101 template <typename T>
103  : integral_constant<bool,
104  sizeof(context_memfn_helper<T>(0)) != 1 &&
105  sizeof(on_work_started_memfn_helper<T>(0)) != 1 &&
106  sizeof(on_work_finished_memfn_helper<T>(0)) != 1 &&
107  sizeof(dispatch_memfn_helper<T>(0)) != 1 &&
108  sizeof(post_memfn_helper<T>(0)) != 1 &&
109  sizeof(defer_memfn_helper<T>(0)) != 1>
110 {
111 };
112 
113 template <typename T>
115  : conditional<is_class<T>::value,
116  is_executor_class<T>,
117  false_type>::type
118 {
119 };
120 
121 } // namespace detail
122 } // namespace asio
123 
124 #include "asio/detail/pop_options.hpp"
125 
126 #endif // ASIO_DETAIL_IS_EXECUTOR_HPP
Definition: is_executor.hpp:43
Definition: chrono.h:284
Definition: is_executor.hpp:102
Definition: is_executor.hpp:114
Definition: is_executor.hpp:26
Definition: is_executor.hpp:37
Definition: any_io_executor.hpp:28