ifw-daq  2.1.0-pre1
IFW Data Acquisition modules
mockScheduler.hpp
Go to the documentation of this file.
1 /**
2  * @file
3  * @ingroup daq_common_libdpm
4  * @copyright (c) Copyright ESO 2022
5  * All Rights Reserved
6  * ESO (eso.org) is an Intergovernmental Organisation, and therefore special legal conditions apply.
7  *
8  * @brief Mocks for daq::dpm::Scheduler and daq::dpm::DaqScheduler
9  */
10 #ifndef DAQ_DPM_MOCK_MOCKSCHEDULER_HPP
11 #define DAQ_DPM_MOCK_MOCKSCHEDULER_HPP
12 
13 #include <gmock/gmock.h>
14 
15 #include <daq/dpm/scheduler.hpp>
16 
17 namespace daq::dpm {
18 
20  MOCK_METHOD(void, Start, (), (override));
21  MOCK_METHOD(void, Stop, (), (override));
22  MOCK_METHOD(std::string, QueueDaq, (std::string const&), (override));
23  MOCK_METHOD(void, AbortDaq, (std::string const&), (override));
24  MOCK_METHOD(bool, IsQueued, (std::string const&), (const, noexcept, override));
25  MOCK_METHOD(Status, GetDaqStatus, (std::string const&), (const, override));
26  MOCK_METHOD(std::vector<std::string>, GetQueue, (), (const, noexcept, override));
27  MOCK_METHOD(boost::signals2::connection,
29  (StatusSignal::slot_type const& slot),
30  (override));
31 };
32 
34  MOCK_METHOD(void, Start, (), (override));
35  MOCK_METHOD(void, Stop, (), (override));
36  MOCK_METHOD(bool, IsStopped, (), (const, noexcept, override));
37  MOCK_METHOD(void, Poll, (), (override));
38  MOCK_METHOD(std::string const&, GetId, (), (const, noexcept, override));
39  MOCK_METHOD(bool, GetErrorFlag, (), (const, noexcept, override));
40  MOCK_METHOD(State, GetState, (), (const, noexcept, override));
41  MOCK_METHOD(std::filesystem::path const&, GetResult, (), (const, noexcept, override));
42  MOCK_METHOD(ObservableStatus const&, GetStatus, (), (const, noexcept, override));
43  MOCK_METHOD(ObservableStatus&, GetStatus, (), (noexcept, override));
44 };
45 
46 } // namespace daq::dpm
47 #endif // #ifndef DAQ_DPM_MOCK_MOCKSCHEDULER_HPP
daq::dpm::DaqController::IsStopped
virtual bool IsStopped() const noexcept=0
daq::State
State
Observable states of the data acquisition process.
Definition: state.hpp:39
daq::dpm::DaqController::Poll
virtual void Poll()=0
daq::dpm::DaqController::GetResult
virtual auto GetResult() const noexcept -> std::filesystem::path const &=0
daq::dpm::MockScheduler::MOCK_METHOD
MOCK_METHOD(void, AbortDaq,(std::string const &),(override))
daq::dpm::Scheduler::GetQueue
virtual std::vector< std::string > GetQueue() const noexcept=0
Queries current DAQ queue.
daq::dpm::MockScheduler::MOCK_METHOD
MOCK_METHOD(void, Stop,(),(override))
daq::dpm::MockDaqController::MOCK_METHOD
MOCK_METHOD(State, GetState,(),(const, noexcept, override))
daq::dpm::MockDaqController::MOCK_METHOD
MOCK_METHOD(std::filesystem::path const &, GetResult,(),(const, noexcept, override))
daq::dpm::MockScheduler::MOCK_METHOD
MOCK_METHOD(std::string, QueueDaq,(std::string const &),(override))
daq::dpm::DaqController::Start
virtual void Start()=0
Start/stop operations.
daq::dpm::MockScheduler::MOCK_METHOD
MOCK_METHOD(Status, GetDaqStatus,(std::string const &),(const, override))
daq::dpm::Scheduler::AbortDaq
virtual void AbortDaq(std::string const &id)=0
Abort merging DAQ identified by id.
daq::dpm::MockScheduler::MOCK_METHOD
MOCK_METHOD(std::vector< std::string >, GetQueue,(),(const, noexcept, override))
daq::dpm::MockDaqController::MOCK_METHOD
MOCK_METHOD(bool, IsStopped,(),(const, noexcept, override))
daq::dpm::MockDaqController::MOCK_METHOD
MOCK_METHOD(void, Poll,(),(override))
scheduler.hpp
daq::dpm::Scheduler and related class declarations.
daq::dpm::DaqController
Controller for specific DAQ.
Definition: scheduler.hpp:59
daq::ObservableStatus
Stores data acquisition status and allows subscription to status changes.
Definition: status.hpp:161
daq::dpm::Scheduler::QueueDaq
virtual std::string QueueDaq(std::string const &dp_spec)=0
Queues DAQ for processing.
daq::dpm::MockScheduler::MOCK_METHOD
MOCK_METHOD(boost::signals2::connection, ConnectStatus,(StatusSignal::slot_type const &slot),(override))
daq::dpm::MockDaqController::MOCK_METHOD
MOCK_METHOD(void, Start,(),(override))
daq::dpm::Scheduler
Schedules asynchronous activities that results in merged Data Product and delivery.
Definition: scheduler.hpp:274
daq::dpm::Scheduler::Stop
virtual void Stop()=0
daq::dpm
Definition: testDpSpec.cpp:16
daq::dpm::DaqController::GetStatus
virtual auto GetStatus() noexcept -> ObservableStatus &=0
daq::dpm::MockDaqController::MOCK_METHOD
MOCK_METHOD(ObservableStatus const &, GetStatus,(),(const, noexcept, override))
daq::dpm::MockDaqController
Definition: mockScheduler.hpp:33
daq::Status
Non observable status object that keeps stores status of data acquisition.
Definition: status.hpp:120
daq::dpm::DaqController::GetErrorFlag
virtual auto GetErrorFlag() const noexcept -> bool=0
daq::dpm::MockScheduler::MOCK_METHOD
MOCK_METHOD(void, Start,(),(override))
daq::dpm::MockDaqController::MOCK_METHOD
MOCK_METHOD(bool, GetErrorFlag,(),(const, noexcept, override))
daq::dpm::MockScheduler::MOCK_METHOD
MOCK_METHOD(bool, IsQueued,(std::string const &),(const, noexcept, override))
daq::dpm::DaqController::Stop
virtual void Stop()=0
daq::dpm::MockDaqController::MOCK_METHOD
MOCK_METHOD(ObservableStatus &, GetStatus,(),(noexcept, override))
daq::dpm::Scheduler::IsQueued
virtual bool IsQueued(std::string const &id) const noexcept=0
Queries if DAQ with ID has been queued before in the current workspace.
daq::dpm::MockDaqController::MOCK_METHOD
MOCK_METHOD(void, Stop,(),(override))
daq::dpm::DaqController::GetId
virtual auto GetId() const noexcept -> std::string const &=0
daq::dpm::DaqController::GetState
virtual auto GetState() const noexcept -> State=0
daq::dpm::MockDaqController::MOCK_METHOD
MOCK_METHOD(std::string const &, GetId,(),(const, noexcept, override))
daq::dpm::Scheduler::ConnectStatus
virtual boost::signals2::connection ConnectStatus(StatusSignal::slot_type const &slot)=0
Signals.
daq::dpm::Scheduler::GetDaqStatus
virtual Status GetDaqStatus(std::string const &id) const =0
Queries current DAQ status, possibly from last recorded status in workspace.
daq::dpm::Scheduler::Start
virtual void Start()=0
Start/stop operations.
daq::dpm::MockScheduler
Definition: mockScheduler.hpp:19