57 ExternalProcess(std::function<
void(
const std::string&)> callbackStdOut, std::function<
void(
const std::string&)> callbackStdErr);
63 void setCallbacks(std::function<
void(
const std::string&)> callbackStdOut, std::function<
void(
const std::string&)> callbackStdErr);
78 RETURNSTATE run(
const std::string& exe,
const std::vector<std::string>& args,
const std::string& working_dir,
const bool verbose, std::string& error_msg,
79 IO_MODE io_mode = IO_MODE::READ_WRITE,
80 const std::map<std::string, std::string>& env = {},
81 std::function<void()> idle_callback =
nullptr);
86 RETURNSTATE run(
const std::string& exe,
const std::vector<std::string>& args,
const std::string& working_dir,
const bool verbose,
87 IO_MODE io_mode = IO_MODE::READ_WRITE,
88 const std::map<std::string, std::string>& env = {},
89 std::function<void()> idle_callback =
nullptr);
A wrapper around boost::process to conveniently start an external program and forward its outputs.
Definition ExternalProcess.h:33
ExternalProcess(std::function< void(const std::string &)> callbackStdOut, std::function< void(const std::string &)> callbackStdErr)
set the callback functions to process stdout and stderr output when the external process generates it
ExternalProcess()
default Ctor; callbacks for stdout/stderr are empty
RETURNSTATE
result of calling an external executable
Definition ExternalProcess.h:37
void setCallbacks(std::function< void(const std::string &)> callbackStdOut, std::function< void(const std::string &)> callbackStdErr)
re-wire the callbacks used during run()
std::function< void(const std::string &)> callbackStdOut_
Definition ExternalProcess.h:92
std::function< void(const std::string &)> callbackStdErr_
Definition ExternalProcess.h:93
IO_MODE
Open mode for the process.
Definition ExternalProcess.h:46
RETURNSTATE run(const std::string &exe, const std::vector< std::string > &args, const std::string &working_dir, const bool verbose, std::string &error_msg, IO_MODE io_mode=IO_MODE::READ_WRITE, const std::map< std::string, std::string > &env={}, std::function< void()> idle_callback=nullptr)
Runs a program and calls the callback functions from time to time if output from the external program...
RETURNSTATE run(const std::string &exe, const std::vector< std::string > &args, const std::string &working_dir, const bool verbose, IO_MODE io_mode=IO_MODE::READ_WRITE, const std::map< std::string, std::string > &env={}, std::function< void()> idle_callback=nullptr)
Same as other overload, just without a returned error message.
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19