Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Struct template basic_process_handle

boost::process::v2::basic_process_handle

Synopsis

// In header: <boost/process/v2/process_handle.hpp>

template<typename Executor> 
struct basic_process_handle {
  // types
  typedef  ;
  typedef                ;       // The executor_type of the process_handle. 

  // member classes/structs/unions

  // Rebinds the process_handle to another executor.
  template<typename Executor1> 
  struct rebind_executor {
    // types
    typedef basic_process_handle<  ;  // The socket type when rebound to the specified executor. 
  };

  // construct/copy/destruct
  template<typename ExecutionContext> ();
  ();
  (, );
  (, , );
  template<typename Executor1> 
    (basic_process_handle< );

  // public member functions
   ();
   () ;
   ();
   ();
   (, );
   ();
   ();
   ();
   ();
   ();
   ();
   (, );
   ();
   () ;
  template< DEFAULT_TYPE> 
     ();

  // public data members
   ec;
};

Description

A process handle is an unmanaged version of a process. This means it does not terminate the proces on destruction and will not keep track of the exit-code.

Note that the exit code might be discovered early, during a call to running. Thus it can only be discovered that process has exited already.

basic_process_handle public types

  1. typedef ;

    This might be undefined on posix systems that only support signals

basic_process_handle public construct/copy/destruct

  1. template<typename ExecutionContext> 
      ( context);
    Construct a basic_process_handle from an execution_context.

    Template Parameters:

    ExecutionContext

    The context must fulfill the asio::execution_context requirements

  2. ( executor);
    Construct an empty process_handle from an executor.
  3. ( executor,  pid);
    Construct an empty process_handle from an executor and bind it to a pid.

    On NON-linux posix systems this call is not able to obtain a file-descriptor and will thus rely on signals.

  4. ( executor,  pid, 
                          process_handle);
    Construct an empty process_handle from an executor and bind it to a pid and the native-handle.

    On some non-linux posix systems this overload is not present.

  5. template<typename Executor1> 
      (basic_process_handle<  handle);
    Move construct and rebind the executor.

basic_process_handle public member functions

  1.  ();
    Getter for the executor.
  2.  () ;
    Get the id of the process.
  3.  ();
    Terminate the process if it's still running and ignore the result.
  4.  ();

    This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

  5.  ( exit_status,  ec);
    wait for the process to exit and store the exit code in exit_status.

    This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

  6.  ( exit_status);
  7.  ( ec);
    Sends the process a signal to ask for an interrupt, which the process may interpret as a shutdown.

    Maybe be ignored by the subprocess.

  8.  ();

    This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

  9.  ( ec);
    Sends the process a signal to ask for a graceful shutdown. Maybe be ignored by the subprocess.

    This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

  10.  ();
    Unconditionally terminates the process and stores the exit code in exit_status.
  11.  ( exit_status);

    This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

  12.  ( exit_code,  ec);
    Checks if the current process is running.

    If it has already completed, it assigns the exit code to exit_code.

    This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

  13.  ( exit_code);
  14.  () ;
    Check if the process handle is referring to an existing process.
  15. template< DEFAULT_TYPE> 
       ( DEFAULT);
    Asynchronously wait for the process to exit and deliver the native exit-code in the completion handler.

PrevUpHomeNext