Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Class child

boost::process::child

Synopsis

// In header: <boost/process/child.hpp>


class child {
public:
  // construct/copy/destruct
  ();
  (child &&);
  template< Args> ();
  () = ;
  child & (child &&);
  ~();

  // private member functions
   ();
   ();
   ();
   () ;
   () ;
   () ;
   () ;
   ();
   () ;
   ();
   () ;
  template<typename Rep, typename Period> 
     ();
   (, 
                ) ;
  template<typename Clock, typename Duration> 
     ();
   (, 
                  ) ;
   () ;
  () ;
   () ;
   () ;
   ();
   () ;
};

Description

The main class to hold a child process. It is simliar to std::thread, in that it has a join and detach function.

[Note] Note

The destructor will call terminate on the process if not joined or detached without any warning.

child public construct/copy/destruct

  1. ( pid);

    Construct the child from a pid.

    [Note] Note

    There is no guarantee that this will work. The process need the right access rights, which are very platform specific.

  2. (child && lhs);

    Move-Constructor.

  3. template< Args> ( args);

    Construct a child from a property list and launch it The standard version is to create a subprocess, which will spawn the process.

  4. () = ;

    Construct an empty child.

  5. child & (child && lhs);

    Move assign.

  6. ~();

    Destructor.

    [Note] Note

    Will call terminate (without warning) when the child was neither joined nor detached.

child private member functions

  1.  ();

    Detach the child, i.e. let it run after this handle dies.

  2.  ();

    Join the child. This just calls wait, but that way the naming is similar to std::thread

  3.  ();

    Check if the child is joinable.

  4.  () ;

    Get the native handle for the child process.

  5.  () ;

    Get the exit_code. The return value is without any meaning if the child wasn't waited for or if it was terminated.

  6.  () ;

    Get the Process Identifier.

  7.  () ;

    Get the native, uninterpreted exit code. The return value is without any meaning if the child wasn't waited for or if it was terminated.

  8.  ();

    Check if the child process is running.

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

  9.  ( ec) ;
  10.  ();

    Wait for the child process to exit.

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

  11.  ( ec) ;
  12. template<typename Rep, typename Period> 
       ( rel_time);

    Wait for the child process to exit for a period of time. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

    Returns:

    True if child exited while waiting.

  13.  ( rel_time, 
                   ec) ;
  14. template<typename Clock, typename Duration> 
       ( timeout_time);

    Wait for the child process to exit until a point in time. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

    Returns:

    True if child exited while waiting.

  15.  ( timeout_time, 
                     ec) ;
  16.  () ;

    Check if this handle holds a child process.

    [Note] Note

    That does not mean, that the process is still running. It only means, that the handle does or did exist.

  17. () ;

    Same as valid, for convenience.

  18.  () ;

    Check if the the chlid process is in any process group.

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

  19.  ( ec) ;
  20.  ();

    Terminate the child process.

    This function will cause the child process to unconditionally and immediately exit. It is implement with SIGKILL on posix and TerminateProcess on windows.

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

  21.  ( ec) ;

PrevUpHomeNext