Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

PrevUpHomeNext

Struct handler

boost::process::extend::handler

Synopsis

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


struct handler {

  // public member functions
  template<typename Executor> void on_setup(Executor &) const;
  template<typename Executor> 
    void on_error(Executor &, const std::error_code &) const;
  template<typename Executor> void on_success(Executor &) const;
  template<typename Executor> 
    void on_fork_error(Executor &, const std::error_code &) const;
  template<typename Executor> void on_exec_setup(Executor &) const;
  template<typename Executor> 
    void on_exec_error(Executor &, const std::error_code &) const;
};

Description

This class is the base for every initializer, to be used for extensions.

The usage is done through compile-time polymorphism, so that the required functions can be overloaded.

[Note] Note

None of the function need to be const.

handler public member functions

  1. template<typename Executor> void on_setup(Executor &) const;
    This function is invoked before the process launch.
    [Note] Note

    It is not required to be const.

  2. template<typename Executor> 
      void on_error(Executor &, const std::error_code &) const;

    This function is invoked if an error occured while trying to launch the process.

    [Note] Note

    It is not required to be const.

  3. template<typename Executor> void on_success(Executor &) const;

    This function is invoked if the process was successfully launched.

    [Note] Note

    It is not required to be const.

  4. template<typename Executor> 
      void on_fork_error(Executor &, const std::error_code &) const;

    This function is invoked if an error occured during the call of fork.

    [Note] Note

    This function will only be called on posix.

  5. template<typename Executor> void on_exec_setup(Executor &) const;

    This function is invoked if the call of fork was successful, before calling execve.

    [Note] Note

    This function will only be called on posix.

    [Note] Note

    It will be invoked from the new process.

  6. template<typename Executor> 
      void on_exec_error(Executor &, const std::error_code &) const;

    This function is invoked if the call of execve failed.

    [Note] Note

    This function will only be called on posix.

    [Note] Note

    It will be invoked from the new process.


PrevUpHomeNext