10 #ifndef DAQ_DPM_MOCK_MOCKASYNCPROCESS_HPP
11 #define DAQ_DPM_MOCK_MOCKASYNCPROCESS_HPP
13 #include <gmock/gmock.h>
22 virtual boost::future<int>
Initiate()
override {
33 boost::signals2::connection
ConnectStdout(SigOutStream::slot_type
const& slot)
override {
34 return stdout.connect(slot);
36 boost::signals2::connection
ConnectStderr(SigOutStream::slot_type
const& slot)
override {
37 return stderr.connect(slot);
47 boost::signals2::connection
ConnectProgress(SigProgress::slot_type
const& slot)
override {
Interface to asynchronous process.
virtual std::error_code Abort() noexcept=0
Aborts the operation by terminating process which completes the operation.
virtual std::vector< std::string > const & GetArguments() const noexcept=0
boost::signals2::signal< void(pid_t, std::string const &)> SigOutStream
Signal type for stdout/stderr signals.
virtual std::error_code Signal(int sig) noexcept=0
Send signal to process.
virtual bool IsRunning() const noexcept=0
virtual std::optional< pid_t > GetPid() const noexcept=0
Get PID.
More specialized version for rsync which also monitors transfer progress.
boost::signals2::signal< void(pid_t, RsyncProgress const &)> SigProgress
Progress update signal.
daq::RsyncAsyncProcess and related class declarations.
boost::signals2::connection ConnectStderr(SigOutStream::slot_type const &slot) override
Connect slot to line-buffered stderr signal.
MOCK_METHOD(std::optional< pid_t >, GetPid,(),(const, noexcept, override))
MOCK_METHOD(std::error_code, Abort,(),(noexcept, override))
boost::promise< int > promise
virtual boost::future< int > Initiate() override
Initiates async operation by executing the specified process.
MOCK_METHOD(std::error_code, Signal,(int),(override, noexcept))
MOCK_METHOD(std::vector< std::string > const &, GetArguments,(),(const, override, noexcept))
boost::signals2::connection ConnectStdout(SigOutStream::slot_type const &slot) override
Connect slot to line-buffered stdout signal.
MOCK_METHOD(bool, IsRunning,(),(const, noexcept, override))
boost::signals2::connection ConnectProgress(SigProgress::slot_type const &slot) override
Connect to progress signal.