PrevUpHomeNext

Struct executor

boost::process::executor

Synopsis

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


struct executor {
  // construct/copy/destruct
  executor();

  // public member functions
  template<typename Initializer, class... Initializers> 
    child operator()(const Initializer &, const Initializers...&);

  // public data members
  LPCTSTR exe;
  LPTSTR cmd_line;
  LPSECURITY_ATTRIBUTES proc_attrs;
  LPSECURITY_ATTRIBUTES thread_attrs;
  BOOL inherit_handles;
  DWORD creation_flags;
  LPVOID env;
  LPCTSTR work_dir;
  STARTUPINFO startup_info;
  STARTUPINFOEX startup_info_ex;
  PROCESS_INFORMATION proc_info;
  const char * exe;
  char ** cmd_line;
  char ** env;
};

Description

Starts a program.

boost::process::executor is a functor which calls the system functions to start a program. Before system functions are called it iterates over initializers and calls a member function passing a reference to itself as a parameter. Initializers get then a chance to setup the executor. If system functions fail boost::process::executor again iterates over initializers and calls another member function passing a reference to itself as a parameter. This gives initializers a chance to handle the error.

[Note] Note

Library users shouldn't need to use boost::process::executor. It is recommended to call boost::process::execute which uses boost::pocess::executor internally.

executor public construct/copy/destruct

  1. executor();

    Default constructor.

executor public member functions

  1. template<typename Initializer, class... Initializers> 
      child operator()(const Initializer & initializer, 
                       const Initializers...& initializers);

    Starts a program.

executor public public data members

  1. LPCTSTR exe;

    Program name.

    Windows only.

  2. LPTSTR cmd_line;

    Command line.

    Windows only.

  3. LPSECURITY_ATTRIBUTES proc_attrs;

    Process attributes.

    Windows only.

  4. LPSECURITY_ATTRIBUTES thread_attrs;

    Thread attributes.

    Windows only.

  5. BOOL inherit_handles;

    Flag to inherit handles.

    Windows only.

  6. DWORD creation_flags;

    Creation flags.

    Windows only.

  7. LPVOID env;

    Environment variables.

    Windows only.

  8. LPCTSTR work_dir;

    Work directory.

    Windows only.

  9. STARTUPINFO startup_info;

    Startupinfo structure.

    Windows only.

  10. STARTUPINFOEX startup_info_ex;

    Startupinfoex structure.

    If this member variable is available, startup_info is a reference to StartupInfo in STARTUPINFOEX.

    Windows Vista, Windows Server 2008 or better.

  11. PROCESS_INFORMATION proc_info;

    Process information.

    proc_info contains the result after a child process could be started successfully.

    Windows only.

  12. const char * exe;

    Program name.

    POSIX only.

  13. char ** cmd_line;

    Command line arguments.

    POSIX only.

  14. char ** env;

    Environment variables.

    POSIX only.


PrevUpHomeNext