123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160 |
- #ifndef BOOST_PROCESS_V2_PROCESS_HANDLE_HPP
- #define BOOST_PROCESS_V2_PROCESS_HANDLE_HPP
- #include <boost/process/v2/detail/config.hpp>
- #if defined(BOOST_PROCESS_V2_WINDOWS)
- #include <boost/process/v2/detail/process_handle_windows.hpp>
- #else
- #if defined(BOOST_PROCESS_V2_PIDFD_OPEN)
- #include <boost/process/v2/detail/process_handle_fd.hpp>
- #elif defined(BOOST_PROCESS_V2_PDFORK)
- #include <boost/process/v2/detail/process_handle_fd_or_signal.hpp>
- #else
- #include <boost/process/v2/detail/process_handle_signal.hpp>
- #endif
- #endif
- BOOST_PROCESS_V2_BEGIN_NAMESPACE
- #if defined(GENERATING_DOCUMENTATION)
- template<typename Executor = BOOST_PROCESS_V2_ASIO_NAMESPACE::any_io_executor>
- struct basic_process_handle
- {
-
-
- using native_handle_type = implementation_defined;
-
- using executor_type = Executor;
-
- executor_type get_executor();
-
- template<typename Executor1>
- struct rebind_executor
- {
-
- typedef basic_process_handle<Executor1> other;
- };
-
-
- template<typename ExecutionContext>
- basic_process_handle(ExecutionContext &context);
-
- basic_process_handle(executor_type executor);
-
-
- basic_process_handle(executor_type executor, pid_type pid);
-
-
- basic_process_handle(executor_type executor, pid_type pid, native_handle_type process_handle);
-
- template<typename Executor1>
- basic_process_handle(basic_process_handle<Executor1> &&handle);
-
- pid_type id() const
- { return pid_; }
-
- void terminate_if_running(error_code &);
-
- void terminate_if_running();
-
- void wait(native_exit_code_type &exit_status, error_code &ec);
-
- void wait(native_exit_code_type &exit_status);
-
-
- void interrupt(error_code &ec);
-
- void interrupt();
-
- void request_exit(error_code &ec);
-
- void request_exit()
-
- void terminate(native_exit_code_type &exit_status, error_code &ec);\
-
- void terminate(native_exit_code_type &exit_status);/
-
-
-
- bool running(native_exit_code_type &exit_code, error_code &ec);
-
- bool running(native_exit_code_type &exit_code);
-
- bool is_open() const;
-
- template<BOOST_PROCESS_V2_COMPLETION_TOKEN_FOR(void(error_code, native_exit_code_type))
- WaitHandler BOOST_PROCESS_V2_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
- BOOST_PROCESS_V2_INITFN_AUTO_RESULT_TYPE(WaitHandler, void (error_code, native_exit_code_type))
- async_wait(WaitHandler &&handler BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(executor_type));
- };
- #else
- #if defined(BOOST_PROCESS_V2_WINDOWS)
- template<typename Executor = BOOST_PROCESS_V2_ASIO_NAMESPACE::any_io_executor>
- using basic_process_handle = detail::basic_process_handle_win<Executor>;
- #else
- #if defined(BOOST_PROCESS_V2_PIDFD_OPEN)
- template<typename Executor = BOOST_PROCESS_V2_ASIO_NAMESPACE::any_io_executor>
- using basic_process_handle = detail::basic_process_handle_fd<Executor>;
- #elif defined(BOOST_PROCESS_V2_PDFORK)
- template<typename Executor = BOOST_PROCESS_V2_ASIO_NAMESPACE::any_io_executor>
- using basic_process_handle = detail::basic_process_handle_fd_or_signal<Executor>;
- #else
- template<typename Executor = BOOST_PROCESS_V2_ASIO_NAMESPACE::any_io_executor>
- using basic_process_handle = detail::basic_process_handle_signal<Executor>;
- #endif
- #endif
- using process_handle = basic_process_handle<>;
- #endif
- BOOST_PROCESS_V2_END_NAMESPACE
- #endif
|