5 // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com)
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)
11 #ifndef ARCHETYPES_ASYNC_RESULT_HPP
12 #define ARCHETYPES_ASYNC_RESULT_HPP
14 #include <boost/asio/async_result.hpp>
16 namespace archetypes {
22 struct concrete_handler
24 concrete_handler(lazy_handler)
28 template <typename Arg1>
33 template <typename Arg1, typename Arg2>
34 void operator()(Arg1, Arg2)
38 #if defined(BOOST_ASIO_HAS_MOVE)
39 concrete_handler(concrete_handler&&) {}
41 concrete_handler(const concrete_handler&);
42 #endif // defined(BOOST_ASIO_HAS_MOVE)
45 } // namespace archetypes
50 template <typename Signature>
51 class async_result<archetypes::lazy_handler, Signature>
54 // The concrete completion handler type.
55 typedef archetypes::concrete_handler completion_handler_type;
57 // The return type of the initiating function.
58 typedef int return_type;
60 // Construct an async_result from a given handler.
61 explicit async_result(completion_handler_type&)
65 // Obtain the value to be returned from the initiating function.
72 // Disallow copying and assignment.
73 async_result(const async_result&) BOOST_ASIO_DELETED;
74 async_result& operator=(const async_result&) BOOST_ASIO_DELETED;
80 #endif // ARCHETYPES_ASYNC_RESULT_HPP