]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/asio/include/boost/asio/handler_type.hpp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / asio / include / boost / asio / handler_type.hpp
1 //
2 // handler_type.hpp
3 // ~~~~~~~~~~~~~~~~
4 //
5 // Copyright (c) 2003-2016 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 BOOST_ASIO_HANDLER_TYPE_HPP
12 #define BOOST_ASIO_HANDLER_TYPE_HPP
13
14 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
15 # pragma once
16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
17
18 #include <boost/asio/detail/config.hpp>
19
20 #include <boost/asio/detail/push_options.hpp>
21
22 namespace boost {
23 namespace asio {
24
25 /// Default handler type traits provided for all handlers.
26 /**
27 * The handler_type traits class is used for determining the concrete handler
28 * type to be used for an asynchronous operation. It allows the handler type to
29 * be determined at the point where the specific completion handler signature
30 * is known.
31 *
32 * This template may be specialised for user-defined handler types.
33 */
34 template <typename Handler, typename Signature>
35 struct handler_type
36 {
37 /// The handler type for the specific signature.
38 typedef Handler type;
39 };
40
41 #if !defined(GENERATING_DOCUMENTATION)
42
43 template <typename Handler, typename Signature>
44 struct handler_type<const Handler, Signature>
45 : handler_type<Handler, Signature> {};
46
47 template <typename Handler, typename Signature>
48 struct handler_type<volatile Handler, Signature>
49 : handler_type<Handler, Signature> {};
50
51 template <typename Handler, typename Signature>
52 struct handler_type<const volatile Handler, Signature>
53 : handler_type<Handler, Signature> {};
54
55 template <typename Handler, typename Signature>
56 struct handler_type<const Handler&, Signature>
57 : handler_type<Handler, Signature> {};
58
59 template <typename Handler, typename Signature>
60 struct handler_type<volatile Handler&, Signature>
61 : handler_type<Handler, Signature> {};
62
63 template <typename Handler, typename Signature>
64 struct handler_type<const volatile Handler&, Signature>
65 : handler_type<Handler, Signature> {};
66
67 template <typename Handler, typename Signature>
68 struct handler_type<Handler&, Signature>
69 : handler_type<Handler, Signature> {};
70
71 #if defined(BOOST_ASIO_HAS_MOVE)
72 template <typename Handler, typename Signature>
73 struct handler_type<Handler&&, Signature>
74 : handler_type<Handler, Signature> {};
75 #endif // defined(BOOST_ASIO_HAS_MOVE)
76
77 template <typename ReturnType, typename Signature>
78 struct handler_type<ReturnType(), Signature>
79 : handler_type<ReturnType(*)(), Signature> {};
80
81 template <typename ReturnType, typename Arg1, typename Signature>
82 struct handler_type<ReturnType(Arg1), Signature>
83 : handler_type<ReturnType(*)(Arg1), Signature> {};
84
85 template <typename ReturnType, typename Arg1, typename Arg2, typename Signature>
86 struct handler_type<ReturnType(Arg1, Arg2), Signature>
87 : handler_type<ReturnType(*)(Arg1, Arg2), Signature> {};
88
89 template <typename ReturnType, typename Arg1, typename Arg2, typename Arg3,
90 typename Signature>
91 struct handler_type<ReturnType(Arg1, Arg2, Arg3), Signature>
92 : handler_type<ReturnType(*)(Arg1, Arg2, Arg3), Signature> {};
93
94 template <typename ReturnType, typename Arg1, typename Arg2, typename Arg3,
95 typename Arg4, typename Signature>
96 struct handler_type<ReturnType(Arg1, Arg2, Arg3, Arg4), Signature>
97 : handler_type<ReturnType(*)(Arg1, Arg2, Arg3, Arg4), Signature> {};
98
99 template <typename ReturnType, typename Arg1, typename Arg2, typename Arg3,
100 typename Arg4, typename Arg5, typename Signature>
101 struct handler_type<ReturnType(Arg1, Arg2, Arg3, Arg4, Arg5), Signature>
102 : handler_type<ReturnType(*)(Arg1, Arg2, Arg3, Arg4, Arg5), Signature> {};
103
104 #endif // !defined(GENERATING_DOCUMENTATION)
105
106 } // namespace asio
107 } // namespace boost
108
109 #include <boost/asio/detail/pop_options.hpp>
110
111 #define BOOST_ASIO_HANDLER_TYPE(h, sig) \
112 typename handler_type<h, sig>::type
113
114 #endif // BOOST_ASIO_HANDLER_TYPE_HPP