ifw-daq
3.0.0-pre2
IFW Data Acquisition modules
|
Interface to asynchronous process. More...
#include <asyncProcess.hpp>
Public Member Functions | |
virtual | ~AsyncProcessIf () |
virtual boost::future< int > | Initiate ()=0 |
Initiates async operation by executing the specified process. More... | |
virtual std::optional< pid_t > | GetPid () const noexcept=0 |
Get PID. More... | |
virtual std::error_code | Abort () noexcept=0 |
Aborts the operation by terminating process which completes the operation. More... | |
virtual std::error_code | Signal (int sig) noexcept=0 |
Send signal to process. More... | |
virtual std::vector< std::string > const & | GetArguments () const noexcept=0 |
virtual bool | IsRunning () const noexcept=0 |
Signals | |
using | SigOutStream = boost::signals2::signal< void(pid_t, std::string const &)> |
Signal type for stdout/stderr signals. More... | |
virtual boost::signals2::connection | ConnectStdout (SigOutStream::slot_type const &slot)=0 |
Connect slot to line-buffered stdout signal. More... | |
virtual boost::signals2::connection | ConnectStderr (SigOutStream::slot_type const &slot)=0 |
Connect slot to line-buffered stderr signal. More... | |
Interface to asynchronous process.
Definition at line 27 of file asyncProcess.hpp.
using daq::AsyncProcessIf::SigOutStream = boost::signals2::signal<void(pid_t, std::string const&)> |
Signal type for stdout/stderr signals.
Definition at line 82 of file asyncProcess.hpp.
|
inlinevirtual |
Definition at line 29 of file asyncProcess.hpp.
|
pure virtualnoexcept |
Aborts the operation by terminating process which completes the operation.
If process is not running this will not do anything.
Implemented in daq::AsyncProcess.
|
pure virtual |
Connect slot to line-buffered stderr signal.
Signal is invoked for every line read from process.
Implemented in daq::MockAsyncProcess, and daq::AsyncProcess.
|
pure virtual |
Connect slot to line-buffered stdout signal.
Signal is invoked for every line read from process.
Implemented in daq::MockAsyncProcess, and daq::AsyncProcess.
|
pure virtualnoexcept |
Implemented in daq::AsyncProcess.
|
pure virtualnoexcept |
Get PID.
Implemented in daq::AsyncProcess.
|
pure virtual |
Initiates async operation by executing the specified process.
This can only be called once.
Implemented in daq::MockAsyncProcess, daq::RsyncAsyncProcess, and daq::AsyncProcess.
|
pure virtualnoexcept |
Implemented in daq::AsyncProcess.
|
pure virtualnoexcept |
Send signal to process.
Unlike Abort() this can be used to gracefully terminate application by sending e.g. SIGTERM.
sig | Signal to send. |
Implemented in daq::AsyncProcess.