File indexing completed on 2025-01-18 09:50:13
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029 #ifndef BOOST_PROCESS_ASYNC_HPP_
0030 #define BOOST_PROCESS_ASYNC_HPP_
0031
0032 #include <boost/process/detail/traits.hpp>
0033 #include <boost/process/detail/on_exit.hpp>
0034
0035 #include <boost/asio/io_context.hpp>
0036 #include <boost/asio/streambuf.hpp>
0037 #include <boost/asio/buffer.hpp>
0038 #include <type_traits>
0039 #include <boost/fusion/iterator/deref.hpp>
0040
0041 #if defined(BOOST_POSIX_API)
0042 #include <boost/process/detail/posix/io_context_ref.hpp>
0043 #include <boost/process/detail/posix/async_in.hpp>
0044 #include <boost/process/detail/posix/async_out.hpp>
0045 #include <boost/process/detail/posix/on_exit.hpp>
0046
0047 #elif defined(BOOST_WINDOWS_API)
0048 #include <boost/process/detail/windows/io_context_ref.hpp>
0049 #include <boost/process/detail/windows/async_in.hpp>
0050 #include <boost/process/detail/windows/async_out.hpp>
0051 #include <boost/process/detail/windows/on_exit.hpp>
0052 #endif
0053
0054 namespace boost { namespace process { namespace detail {
0055
0056 struct async_tag;
0057
0058 template<typename T>
0059 struct is_io_context : std::false_type {};
0060 template<>
0061 struct is_io_context<api::io_context_ref> : std::true_type {};
0062
0063 template<typename Tuple>
0064 inline asio::io_context& get_io_context(const Tuple & tup)
0065 {
0066 auto& ref = *boost::fusion::find_if<is_io_context<boost::mpl::_>>(tup);
0067 return ref.get();
0068 }
0069
0070 struct async_builder
0071 {
0072 boost::asio::io_context * ios;
0073
0074 void operator()(boost::asio::io_context & ios_) {this->ios = &ios_;};
0075
0076 typedef api::io_context_ref result_type;
0077 api::io_context_ref get_initializer() {return api::io_context_ref (*ios);};
0078 };
0079
0080
0081 template<>
0082 struct initializer_builder<async_tag>
0083 {
0084 typedef async_builder type;
0085 };
0086
0087 }
0088
0089 using ::boost::asio::buffer;
0090
0091
0092 #if defined(BOOST_PROCESS_DOXYGEN)
0093
0094
0095
0096
0097
0098
0099
0100
0101
0102
0103
0104
0105
0106
0107
0108
0109
0110
0111
0112
0113
0114
0115
0116
0117
0118
0119
0120
0121
0122
0123
0124
0125 constexpr static ::boost::process::detail::on_exit_ on_exit{};
0126 #endif
0127
0128 }}
0129
0130
0131
0132 #endif