• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //
2 // any_io_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 BOOST_ASIO_ANY_IO_EXECUTOR_HPP
12 #define BOOST_ASIO_ANY_IO_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 <boost/asio/detail/config.hpp>
19 #if defined(BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT)
20 # include <boost/asio/executor.hpp>
21 #else // defined(BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT)
22 # include <boost/asio/execution.hpp>
23 # include <boost/asio/execution_context.hpp>
24 #endif // defined(BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT)
25 
26 #include <boost/asio/detail/push_options.hpp>
27 
28 namespace boost {
29 namespace asio {
30 
31 #if defined(BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT)
32 
33 typedef executor any_io_executor;
34 
35 #else // defined(BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT)
36 
37 /// Polymorphic executor type for use with I/O objects.
38 /**
39  * The @c any_io_executor type is a polymorphic executor that supports the set
40  * of properties required by I/O objects. It is defined as the
41  * execution::any_executor class template parameterised as follows:
42  * @code execution::any_executor<
43  *   execution::context_as_t<execution_context&>,
44  *   execution::blocking_t::never_t,
45  *   execution::prefer_only<execution::blocking_t::possibly_t>,
46  *   execution::prefer_only<execution::outstanding_work_t::tracked_t>,
47  *   execution::prefer_only<execution::outstanding_work_t::untracked_t>,
48  *   execution::prefer_only<execution::relationship_t::fork_t>,
49  *   execution::prefer_only<execution::relationship_t::continuation_t>
50  * > @endcode
51  */
52 #if defined(GENERATING_DOCUMENTATION)
53 typedef execution::any_executor<...> any_io_executor;
54 #else // defined(GENERATING_DOCUMENTATION)
55 typedef execution::any_executor<
56     execution::context_as_t<execution_context&>,
57     execution::blocking_t::never_t,
58     execution::prefer_only<execution::blocking_t::possibly_t>,
59     execution::prefer_only<execution::outstanding_work_t::tracked_t>,
60     execution::prefer_only<execution::outstanding_work_t::untracked_t>,
61     execution::prefer_only<execution::relationship_t::fork_t>,
62     execution::prefer_only<execution::relationship_t::continuation_t>
63   > any_io_executor;
64 #endif // defined(GENERATING_DOCUMENTATION)
65 
66 #endif // defined(BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT)
67 
68 } // namespace asio
69 } // namespace boost
70 
71 #include <boost/asio/detail/pop_options.hpp>
72 
73 #endif // BOOST_ASIO_ANY_IO_EXECUTOR_HPP
74