ifw-daq  2.1.0-pre1
IFW Data Acquisition modules
stop.hpp
Go to the documentation of this file.
1 /**
2  * @file
3  * @ingroup daq_common_libdaq
4  * @copyright 2022 ESO - European Southern Observatory
5  *
6  * @brief Contains declaration for the StopAsync operation
7  */
8 #ifndef OCM_DAQ_OP_STOP_HPP_
9 #define OCM_DAQ_OP_STOP_HPP_
10 #include "../config.hpp"
11 
12 #include <vector>
13 
14 #include <boost/thread/future.hpp>
15 
16 #include "../dpPart.hpp"
17 #include "../error.hpp"
18 #include "asyncOpParams.hpp"
19 
20 namespace daq::op {
21 
22 /**
23  * A composite async operation that starts DAQ
24  *
25  * @ingroup daq_common_libdaq
26  */
27 struct StopAsync {
28  public:
29  explicit StopAsync(ErrorPolicy policy, AsyncOpParams params) noexcept;
30  /**
31  * Initiates operation that stop metadata acquisition.
32  *
33  * @note Caller is responsible for keeping object alive until
34  * result is set.
35  *
36  * @todo: Return a move-only type containing only the data?
37  */
38  [[nodiscard]] boost::future<Result<DpParts>> Initiate();
39 
40  private:
41  [[nodiscard]] boost::future<void> StopMeta();
42  [[nodiscard]] boost::future<void> StopPrim();
43 
44  ErrorPolicy m_policy;
45  AsyncOpParams m_params;
46  bool m_error;
47  std::vector<DpPart> m_parts;
48  std::string m_keywords;
49 };
50 
51 } // namespace daq::op
52 #endif // #ifndef OCM_DAQ_OP_STOP_HPP_
asyncOpParams.hpp
daq::op::StopAsync
A composite async operation that starts DAQ.
Definition: stop.hpp:27
daq::op
Definition: abort.hpp:19
daq::op::AsyncOpParams
Parameters required for each async operation.
Definition: asyncOpParams.hpp:67
daq::op::StopAsync::Initiate
boost::future< Result< DpParts > > Initiate()
Initiates operation that stop metadata acquisition.
Definition: stop.cpp:25
daq::ErrorPolicy
ErrorPolicy
Error policy supported by certain operations.
Definition: error.hpp:25
daq::op::StopAsync::StopAsync
StopAsync(ErrorPolicy policy, AsyncOpParams params) noexcept
Definition: stop.cpp:21