ifw-daq  3.0.0-pre2
IFW Data Acquisition modules
dpmClientMock.hpp
Go to the documentation of this file.
1 /**
2  * @file
3  * @ingroup daq_ocm_libdaq_test
4  * @copyright 2022 ESO - European Southern Observatory
5  *
6  * @brief `daq::DpmClient`
7  */
8 #ifndef DAQ_MOCK_DPMCLIENT_MOCK_HPP
9 #define DAQ_MOCK_DPMCLIENT_MOCK_HPP
10 #include <daq/dpmClient.hpp>
11 
12 #include <gmock/gmock.h>
13 
14 namespace daq {
15 
16 /**
17  * Combined mock and fake of interface to DPM server
18  */
19 class DpmClientMock : public DpmClient {
20 public:
21  /**
22  * Schedule merging.
23  */
24  MOCK_METHOD(boost::future<State>, ScheduleAsync, (std::string const& spec), (override));
25 
26  /**
27  * Abort merging.
28  */
29  MOCK_METHOD(boost::future<State>,
30  AbortAsync,
31  (std::string const& id),
32  (override));
33 
34  auto ConnectStatusSignal(StatusSignal::slot_type const& slot)
35  -> boost::signals2::connection override {
36  return status_signal.connect(slot);
37  }
38 
39  auto ConnectStorageSignal(StorageSignal::slot_type const& slot)
40  -> boost::signals2::connection override {
41  return storage_signal.connect(slot);
42  }
45 };
46 
47 } // namespace daq
48 #endif
Combined mock and fake of interface to DPM server.
auto ConnectStorageSignal(StorageSignal::slot_type const &slot) -> boost::signals2::connection override
Connect slot to storage change signal.
MOCK_METHOD(boost::future< State >, ScheduleAsync,(std::string const &spec),(override))
Schedule merging.
StatusSignal status_signal
auto ConnectStatusSignal(StatusSignal::slot_type const &slot) -> boost::signals2::connection override
Connect slot to status change signal.
StorageSignal storage_signal
MOCK_METHOD(boost::future< State >, AbortAsync,(std::string const &id),(override))
Abort merging.
Interface to DPM server.
Definition: dpmClient.hpp:38
boost::signals2::signal< void(Status)> StatusSignal
Definition: dpmClient.hpp:41
virtual auto AbortAsync(std::string const &id) -> boost::future< State >=0
Abort merging.
virtual auto ScheduleAsync(std::string const &spec) -> boost::future< State >=0
Schedule merging.
boost::signals2::signal< void(std::filesystem::space_info)> StorageSignal
Definition: dpmClient.hpp:40
daq::DpmClient