]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/asio/test/archetypes/async_result.hpp
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / boost / libs / asio / test / archetypes / async_result.hpp
1 //
2 // async_result.hpp
3 // ~~~~~~~~~~~~~~~~
4 //
5 // Copyright (c) 2003-2018 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 ARCHETYPES_ASYNC_RESULT_HPP
12 #define ARCHETYPES_ASYNC_RESULT_HPP
13
14 #include <boost/asio/async_result.hpp>
15
16 namespace archetypes {
17
18 struct lazy_handler
19 {
20 };
21
22 struct concrete_handler
23 {
24 concrete_handler(lazy_handler)
25 {
26 }
27
28 template <typename Arg1>
29 void operator()(Arg1)
30 {
31 }
32
33 template <typename Arg1, typename Arg2>
34 void operator()(Arg1, Arg2)
35 {
36 }
37
38 #if defined(BOOST_ASIO_HAS_MOVE)
39 concrete_handler(concrete_handler&&) {}
40 private:
41 concrete_handler(const concrete_handler&);
42 #endif // defined(BOOST_ASIO_HAS_MOVE)
43 };
44
45 } // namespace archetypes
46
47 namespace boost {
48 namespace asio {
49
50 template <typename Signature>
51 class async_result<archetypes::lazy_handler, Signature>
52 {
53 public:
54 // The concrete completion handler type.
55 typedef archetypes::concrete_handler completion_handler_type;
56
57 // The return type of the initiating function.
58 typedef int return_type;
59
60 // Construct an async_result from a given handler.
61 explicit async_result(completion_handler_type&)
62 {
63 }
64
65 // Obtain the value to be returned from the initiating function.
66 return_type get()
67 {
68 return 42;
69 }
70
71 private:
72 // Disallow copying and assignment.
73 async_result(const async_result&) BOOST_ASIO_DELETED;
74 async_result& operator=(const async_result&) BOOST_ASIO_DELETED;
75 };
76
77 } // namespace asio
78 } // namespace boost
79
80 #endif // ARCHETYPES_ASYNC_RESULT_HPP