ifw-daq  2.1.0-pre1
IFW Data Acquisition modules
recifMock.hpp
Go to the documentation of this file.
1 /**
2  * @file
3  * @ingroup daq_test
4  * @copyright 2022 ESO - European Southern Observatory
5  *
6  * @brief Mockup of metadaqif classes
7  */
8 // GCOVR_EXCL_START
9 #ifndef OCM_DAQ_TEST_MOCK_RECIF_ASYNC_MOCK_HPP
10 #define OCM_DAQ_TEST_MOCK_RECIF_ASYNC_MOCK_HPP
11 #include <Recif.hpp>
12 #include <daq/config.hpp>
13 #include <gmock/gmock.h>
14 
15 namespace daq {
16 
17 struct RecCmdsAsyncMock : recif::RecCmdsAsync {
18  MOCK_METHOD1(RecStart,
19  ::elt::mal::future<std::shared_ptr<::recif::RecStatus>>(
20  const std::shared_ptr<::recif::RecProperties>&));
21  MOCK_METHOD0(RecContinue,
22  ::elt::mal::future<std::shared_ptr<::recif::RecStatus>>());
23  MOCK_METHOD0(RecStop,
24  ::elt::mal::future<std::shared_ptr<::recif::RecStatus>>());
25  MOCK_METHOD0(RecAbort, ::elt::mal::future<std::string>());
26  MOCK_METHOD0(RecPause,
27  ::elt::mal::future<std::shared_ptr<::recif::RecStatus>>());
28  MOCK_METHOD1(RecStatus,
29  ::elt::mal::future<std::shared_ptr<::recif::RecStatus>>(const std::string&));
30  MOCK_METHOD1(RecWait,
31  ::elt::mal::future<std::shared_ptr<::recif::RecWaitStatus>>(
32  const std::shared_ptr<recif::RecWaitSpec>&));
33 
34  // mal API stuff
35  MOCK_CONST_METHOD0(getMal, std::shared_ptr<::elt::mal::Mal>());
36  MOCK_METHOD0(asyncConnect, ::elt::mal::future<void>());
38  registerConnectionListener,
39  elt::mal::rr::ListenerRegistration(elt::mal::rr::ClientRrEntity::ConnectionListener));
40 };
41 
42 struct RecStatusMock : recif::RecStatus {
43 public:
44  MOCK_CONST_METHOD0(getId, std::string());
45  MOCK_METHOD1(setId, void(const std::string&));
46 
47  MOCK_CONST_METHOD0(getDpFiles, std::vector<std::string>());
48  MOCK_METHOD1(setDpFiles, void(const std::vector<std::string>&));
49 
50  MOCK_CONST_METHOD0(getEndTime, double());
51  MOCK_METHOD1(setEndTime, void(double end_time));
52 
53  MOCK_CONST_METHOD0(getFilesGenerated, int32_t());
54  MOCK_METHOD1(setFilesGenerated, void(int32_t files_generated));
55 
56  MOCK_CONST_METHOD0(getFramesProcessed, int32_t());
57  MOCK_METHOD1(setFramesProcessed, void(int32_t frames_recorded));
58 
59  MOCK_CONST_METHOD0(getFramesRemaining, int32_t());
60  MOCK_METHOD1(setFramesRemaining, void(int32_t frames_remaining));
61 
62  MOCK_CONST_METHOD0(getInfo, std::string());
63  MOCK_METHOD1(setInfo, void(std::string const&));
64 
65  MOCK_CONST_METHOD0(getRemainingTime, double());
66  MOCK_METHOD1(setRemainingTime, void(double remaining_time));
67 
68  MOCK_CONST_METHOD0(getSizeRecorded, int32_t());
69  MOCK_METHOD1(setSizeRecorded, void(int32_t size_recorded));
70 
71  MOCK_CONST_METHOD0(getStartTime, double());
72  MOCK_METHOD1(setStartTime, void(double start_time));
73 
74  MOCK_CONST_METHOD0(getStatus, ::recif::RecStatusNames());
75  MOCK_METHOD1(setStatus, void(::recif::RecStatusNames status));
76 
77  MOCK_CONST_METHOD0(getTimeElapsed, double());
78  MOCK_METHOD1(setTimeElapsed, void(double time_elapsed));
79 
80  // Mal stuff
81  std::unique_ptr<recif::RecStatus> clone() const override {
82  return {};
83  }
84  std::unique_ptr<recif::RecStatus> cloneKey() const override {
85  return {};
86  }
87  bool hasKey() const override {
88  return false;
89  };
90  bool keyEquals(const recif::RecStatus& other) const override {
91  return false;
92  }
93 };
94 
95 } // namespace daq
96 #endif // #ifndef OCM_DAQ_TEST_MOCK_RECIF_ASYNC_MOCK_HPP
97 // GCOVR_EXCL_STOP
daq::RecCmdsAsyncMock::MOCK_METHOD1
MOCK_METHOD1(registerConnectionListener, elt::mal::rr::ListenerRegistration(elt::mal::rr::ClientRrEntity::ConnectionListener))
daq::RecStatusMock::MOCK_METHOD1
MOCK_METHOD1(setStartTime, void(double start_time))
daq::RecStatusMock::MOCK_METHOD1
MOCK_METHOD1(setTimeElapsed, void(double time_elapsed))
daq::RecStatusMock::MOCK_METHOD1
MOCK_METHOD1(setFramesProcessed, void(int32_t frames_recorded))
daq::RecStatusMock::MOCK_CONST_METHOD0
MOCK_CONST_METHOD0(getSizeRecorded, int32_t())
daq::RecStatusMock::hasKey
bool hasKey() const override
Definition: recifMock.hpp:87
daq::RecStatusMock::MOCK_CONST_METHOD0
MOCK_CONST_METHOD0(getFilesGenerated, int32_t())
daq::RecStatusMock::MOCK_CONST_METHOD0
MOCK_CONST_METHOD0(getStartTime, double())
daq::RecStatusMock::MOCK_METHOD1
MOCK_METHOD1(setFramesRemaining, void(int32_t frames_remaining))
daq::RecCmdsAsyncMock::MOCK_METHOD1
MOCK_METHOD1(RecWait, ::elt::mal::future< std::shared_ptr<::recif::RecWaitStatus >>(const std::shared_ptr< recif::RecWaitSpec > &))
daq::RecStatusMock::MOCK_CONST_METHOD0
MOCK_CONST_METHOD0(getInfo, std::string())
daq::RecStatusMock::MOCK_METHOD1
MOCK_METHOD1(setSizeRecorded, void(int32_t size_recorded))
daq::RecCmdsAsyncMock::MOCK_CONST_METHOD0
MOCK_CONST_METHOD0(getMal, std::shared_ptr<::elt::mal::Mal >())
daq::RecStatusMock::MOCK_CONST_METHOD0
MOCK_CONST_METHOD0(getFramesRemaining, int32_t())
daq::RecStatusMock
Definition: recifMock.hpp:42
daq
Definition: asyncProcess.cpp:15
config.hpp
daq::RecStatusMock::cloneKey
std::unique_ptr< recif::RecStatus > cloneKey() const override
Definition: recifMock.hpp:84
daq::RecStatusMock::MOCK_CONST_METHOD0
MOCK_CONST_METHOD0(getFramesProcessed, int32_t())
daq::RecStatusMock::MOCK_METHOD1
MOCK_METHOD1(setRemainingTime, void(double remaining_time))
daq::RecCmdsAsyncMock
Definition: recifMock.hpp:17
daq::RecStatusMock::MOCK_CONST_METHOD0
MOCK_CONST_METHOD0(getRemainingTime, double())
daq::RecStatusMock::MOCK_METHOD1
MOCK_METHOD1(setFilesGenerated, void(int32_t files_generated))
daq::RecStatusMock::MOCK_METHOD1
MOCK_METHOD1(setId, void(const std::string &))
daq::RecStatusMock::MOCK_CONST_METHOD0
MOCK_CONST_METHOD0(getTimeElapsed, double())
daq::RecStatusMock::keyEquals
bool keyEquals(const recif::RecStatus &other) const override
Definition: recifMock.hpp:90
daq::RecCmdsAsyncMock::MOCK_METHOD0
MOCK_METHOD0(RecContinue, ::elt::mal::future< std::shared_ptr<::recif::RecStatus >>())
daq::RecStatusMock::MOCK_METHOD1
MOCK_METHOD1(setInfo, void(std::string const &))
daq::RecCmdsAsyncMock::MOCK_METHOD0
MOCK_METHOD0(RecAbort, ::elt::mal::future< std::string >())
daq::RecStatusMock::MOCK_CONST_METHOD0
MOCK_CONST_METHOD0(getId, std::string())
daq::RecStatusMock::MOCK_METHOD1
MOCK_METHOD1(setEndTime, void(double end_time))
daq::RecStatusMock::MOCK_METHOD1
MOCK_METHOD1(setDpFiles, void(const std::vector< std::string > &))
daq::RecStatusMock::clone
std::unique_ptr< recif::RecStatus > clone() const override
Definition: recifMock.hpp:81
daq::RecCmdsAsyncMock::MOCK_METHOD1
MOCK_METHOD1(RecStatus, ::elt::mal::future< std::shared_ptr<::recif::RecStatus >>(const std::string &))
daq::RecStatusMock::MOCK_CONST_METHOD0
MOCK_CONST_METHOD0(getEndTime, double())
daq::RecCmdsAsyncMock::MOCK_METHOD0
MOCK_METHOD0(RecPause, ::elt::mal::future< std::shared_ptr<::recif::RecStatus >>())
daq::RecCmdsAsyncMock::MOCK_METHOD1
MOCK_METHOD1(RecStart, ::elt::mal::future< std::shared_ptr<::recif::RecStatus >>(const std::shared_ptr<::recif::RecProperties > &))
daq::RecStatusMock::MOCK_METHOD1
MOCK_METHOD1(setStatus, void(::recif::RecStatusNames status))
daq::RecCmdsAsyncMock::MOCK_METHOD0
MOCK_METHOD0(RecStop, ::elt::mal::future< std::shared_ptr<::recif::RecStatus >>())
daq::RecStatusMock::MOCK_CONST_METHOD0
MOCK_CONST_METHOD0(getStatus, ::recif::RecStatusNames())
daq::RecCmdsAsyncMock::MOCK_METHOD0
MOCK_METHOD0(asyncConnect, ::elt::mal::future< void >())
daq::RecStatusMock::MOCK_CONST_METHOD0
MOCK_CONST_METHOD0(getDpFiles, std::vector< std::string >())