File indexing completed on 2025-01-18 09:50:13
0001
0002
0003
0004
0005 #ifndef BOOST_PROCESS_V2_PROCESS_HANDLE_HPP
0006 #define BOOST_PROCESS_V2_PROCESS_HANDLE_HPP
0007
0008 #include <boost/process/v2/detail/config.hpp>
0009
0010 #if defined(BOOST_PROCESS_V2_WINDOWS)
0011 #include <boost/process/v2/detail/process_handle_windows.hpp>
0012 #else
0013
0014 #if defined(BOOST_PROCESS_V2_PIDFD_OPEN)
0015 #include <boost/process/v2/detail/process_handle_fd.hpp>
0016 #elif defined(BOOST_PROCESS_V2_PDFORK)
0017 #include <boost/process/v2/detail/process_handle_fd_or_signal.hpp>
0018 #else
0019
0020 #include <boost/process/v2/detail/process_handle_signal.hpp>
0021 #endif
0022 #endif
0023
0024 BOOST_PROCESS_V2_BEGIN_NAMESPACE
0025
0026
0027 #if defined(GENERATING_DOCUMENTATION)
0028
0029
0030
0031
0032
0033
0034
0035 template<typename Executor = BOOST_PROCESS_V2_ASIO_NAMESPACE::any_io_executor>
0036 struct basic_process_handle
0037 {
0038
0039
0040 using native_handle_type = implementation_defined;
0041
0042
0043 using executor_type = Executor;
0044
0045
0046 executor_type get_executor();
0047
0048
0049 template<typename Executor1>
0050 struct rebind_executor
0051 {
0052
0053 typedef basic_process_handle<Executor1> other;
0054 };
0055
0056
0057
0058
0059
0060
0061 template<typename ExecutionContext>
0062 basic_process_handle(ExecutionContext &context);
0063
0064
0065 basic_process_handle(executor_type executor);
0066
0067
0068
0069
0070
0071 basic_process_handle(executor_type executor, pid_type pid);
0072
0073
0074
0075
0076 basic_process_handle(executor_type executor, pid_type pid, native_handle_type process_handle);
0077
0078
0079 template<typename Executor1>
0080 basic_process_handle(basic_process_handle<Executor1> &&handle);
0081
0082
0083 pid_type id() const
0084 { return pid_; }
0085
0086
0087 void terminate_if_running(error_code &);
0088
0089
0090 void terminate_if_running();
0091
0092 void wait(native_exit_code_type &exit_status, error_code &ec);
0093
0094 void wait(native_exit_code_type &exit_status);
0095
0096
0097
0098 void interrupt(error_code &ec);
0099
0100
0101 void interrupt();
0102
0103
0104 void request_exit(error_code &ec);
0105
0106
0107 void request_exit()
0108
0109
0110 void terminate(native_exit_code_type &exit_status, error_code &ec);\
0111
0112 void terminate(native_exit_code_type &exit_status);/
0113
0114
0115
0116
0117 bool running(native_exit_code_type &exit_code, error_code &ec);
0118
0119 bool running(native_exit_code_type &exit_code);
0120
0121
0122 bool is_open() const;
0123
0124
0125 template<BOOST_PROCESS_V2_COMPLETION_TOKEN_FOR(void(error_code, native_exit_code_type))
0126 WaitHandler BOOST_PROCESS_V2_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
0127 BOOST_PROCESS_V2_INITFN_AUTO_RESULT_TYPE(WaitHandler, void (error_code, native_exit_code_type))
0128 async_wait(WaitHandler &&handler BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(executor_type));
0129
0130 };
0131
0132
0133 #else
0134 #if defined(BOOST_PROCESS_V2_WINDOWS)
0135 template<typename Executor = BOOST_PROCESS_V2_ASIO_NAMESPACE::any_io_executor>
0136 using basic_process_handle = detail::basic_process_handle_win<Executor>;
0137 #else
0138
0139 #if defined(BOOST_PROCESS_V2_PIDFD_OPEN)
0140 template<typename Executor = BOOST_PROCESS_V2_ASIO_NAMESPACE::any_io_executor>
0141 using basic_process_handle = detail::basic_process_handle_fd<Executor>;
0142 #elif defined(BOOST_PROCESS_V2_PDFORK)
0143 template<typename Executor = BOOST_PROCESS_V2_ASIO_NAMESPACE::any_io_executor>
0144 using basic_process_handle = detail::basic_process_handle_fd_or_signal<Executor>;
0145 #else
0146
0147 template<typename Executor = BOOST_PROCESS_V2_ASIO_NAMESPACE::any_io_executor>
0148 using basic_process_handle = detail::basic_process_handle_signal<Executor>;
0149
0150 #endif
0151 #endif
0152
0153
0154 using process_handle = basic_process_handle<>;
0155
0156 #endif
0157
0158 BOOST_PROCESS_V2_END_NAMESPACE
0159
0160 #if defined(BOOST_PROCESS_V2_HEADER_ONLY)
0161
0162 #include <boost/process/v2/impl/process_handle.ipp>
0163
0164 #endif
0165
0166
0167
0168
0169 #endif