ifw-daq  3.0.0-pre2
IFW Data Acquisition modules
Public Types | Public Member Functions | Public Attributes | List of all members
daq::MockAsyncProcess Struct Reference

Combined fake/mock. More...

#include <mockAsyncProcess.hpp>

+ Inheritance diagram for daq::MockAsyncProcess:

Public Types

using SigOutStream = boost::signals2::signal< void(pid_t, std::string const &)>
 Signal type for stdout/stderr signals. More...
 
- Public Types inherited from daq::AsyncProcessIf
using SigOutStream = boost::signals2::signal< void(pid_t, std::string const &)>
 Signal type for stdout/stderr signals. More...
 

Public Member Functions

virtual boost::future< int > Initiate () override
 Initiates async operation by executing the specified process. More...
 
 MOCK_METHOD (std::optional< pid_t >, GetPid,(),(const, noexcept, override))
 
 MOCK_METHOD (std::error_code, Abort,(),(noexcept, override))
 
 MOCK_METHOD (std::error_code, Signal,(int),(override, noexcept))
 
 MOCK_METHOD (std::vector< std::string > const &, GetArguments,(),(const, override, noexcept))
 
 MOCK_METHOD (bool, IsRunning,(),(const, noexcept, override))
 
boost::signals2::connection ConnectStdout (SigOutStream::slot_type const &slot) override
 Connect slot to line-buffered stdout signal. More...
 
boost::signals2::connection ConnectStderr (SigOutStream::slot_type const &slot) override
 Connect slot to line-buffered stderr signal. More...
 
- Public Member Functions inherited from daq::AsyncProcessIf
virtual ~AsyncProcessIf ()
 
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
 

Public Attributes

SigOutStream stdout
 
SigOutStream stderr
 
boost::promise< int > promise
 

Detailed Description

Combined fake/mock.

Definition at line 21 of file mockAsyncProcess.hpp.

Member Typedef Documentation

◆ SigOutStream

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.

Member Function Documentation

◆ ConnectStderr()

boost::signals2::connection daq::MockAsyncProcess::ConnectStderr ( SigOutStream::slot_type const &  slot)
inlineoverridevirtual

Connect slot to line-buffered stderr signal.

Signal is invoked for every line read from process.

Returns
connection object.

Implements daq::AsyncProcessIf.

Definition at line 36 of file mockAsyncProcess.hpp.

◆ ConnectStdout()

boost::signals2::connection daq::MockAsyncProcess::ConnectStdout ( SigOutStream::slot_type const &  slot)
inlineoverridevirtual

Connect slot to line-buffered stdout signal.

Signal is invoked for every line read from process.

Returns
connection object.

Implements daq::AsyncProcessIf.

Definition at line 33 of file mockAsyncProcess.hpp.

◆ Initiate()

virtual boost::future<int> daq::MockAsyncProcess::Initiate ( )
inlineoverridevirtual

Initiates async operation by executing the specified process.

This can only be called once.

Implements daq::AsyncProcessIf.

Definition at line 22 of file mockAsyncProcess.hpp.

◆ MOCK_METHOD() [1/5]

daq::MockAsyncProcess::MOCK_METHOD ( bool  ,
IsRunning  ,
()  ,
(const, noexcept, override)   
)

◆ MOCK_METHOD() [2/5]

daq::MockAsyncProcess::MOCK_METHOD ( std::error_code  ,
Abort  ,
()  ,
(noexcept, override)   
)

◆ MOCK_METHOD() [3/5]

daq::MockAsyncProcess::MOCK_METHOD ( std::error_code  ,
Signal  ,
(int)  ,
(override, noexcept)   
)

◆ MOCK_METHOD() [4/5]

daq::MockAsyncProcess::MOCK_METHOD ( std::optional< pid_t >  ,
GetPid  ,
()  ,
(const, noexcept, override)   
)

◆ MOCK_METHOD() [5/5]

daq::MockAsyncProcess::MOCK_METHOD ( std::vector< std::string > const &  ,
GetArguments  ,
()  ,
(const, override, noexcept)   
)

Member Data Documentation

◆ promise

boost::promise<int> daq::MockAsyncProcess::promise

Definition at line 42 of file mockAsyncProcess.hpp.

◆ stderr

SigOutStream daq::MockAsyncProcess::stderr

Definition at line 41 of file mockAsyncProcess.hpp.

◆ stdout

SigOutStream daq::MockAsyncProcess::stdout

Definition at line 40 of file mockAsyncProcess.hpp.


The documentation for this struct was generated from the following file: