123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134 |
- #ifndef BOOST_PROCESS_ASYNC_HPP_
- #define BOOST_PROCESS_ASYNC_HPP_
- #include <boost/process/v1/detail/traits.hpp>
- #include <boost/process/v1/detail/on_exit.hpp>
- #include <boost/asio/io_context.hpp>
- #include <boost/asio/streambuf.hpp>
- #include <boost/asio/buffer.hpp>
- #include <type_traits>
- #include <boost/fusion/iterator/deref.hpp>
- #if defined(BOOST_POSIX_API)
- #include <boost/process/v1/detail/posix/io_context_ref.hpp>
- #include <boost/process/v1/detail/posix/async_in.hpp>
- #include <boost/process/v1/detail/posix/async_out.hpp>
- #include <boost/process/v1/detail/posix/on_exit.hpp>
- #elif defined(BOOST_WINDOWS_API)
- #include <boost/process/v1/detail/windows/io_context_ref.hpp>
- #include <boost/process/v1/detail/windows/async_in.hpp>
- #include <boost/process/v1/detail/windows/async_out.hpp>
- #include <boost/process/v1/detail/windows/on_exit.hpp>
- #endif
- namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 { namespace detail {
- struct async_tag;
- template<typename T>
- struct is_io_context : std::false_type {};
- template<>
- struct is_io_context<api::io_context_ref> : std::true_type {};
- template<typename Tuple>
- inline asio::io_context& get_io_context(const Tuple & tup)
- {
- auto& ref = *boost::fusion::find_if<is_io_context<boost::mpl::_>>(tup);
- return ref.get();
- }
- struct async_builder
- {
- boost::asio::io_context * ios;
- void operator()(boost::asio::io_context & ios_) {this->ios = &ios_;};
- typedef api::io_context_ref result_type;
- api::io_context_ref get_initializer() {return api::io_context_ref (*ios);};
- };
- template<>
- struct initializer_builder<async_tag>
- {
- typedef async_builder type;
- };
- }
- using ::boost::asio::buffer;
- #if defined(BOOST_PROCESS_DOXYGEN)
- constexpr static ::boost::process::v1::detail::on_exit_ on_exit{};
- #endif
- }}}
- #endif
|