| Home | Libraries | People | FAQ | More

## 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
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
   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
   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
   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
   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
   This function will only be called on posix.

   | 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
   This function will only be called on posix.

   | Note
   It will be invoked from the new process.