ifw-daq  1.0.0
IFW Data Acquisition modules
conversion.hpp
Go to the documentation of this file.
1 /**
2  * @file
3  * @ingroup daq_ocm_libocmif_suppport
4  * @copyright 2021 ESO - European Southern Observatory
5  *
6  * @brief Contains support functions for ocmif
7  */
8 #ifndef OCMIF_CONVERSION_HPP_
9 #define OCMIF_CONVERSION_HPP_
10 #include <Ocmif.hpp>
11 #include <string_view>
12 
13 namespace daq {
14 struct Status;
15 enum class State;
16 }
17 
18 namespace ocmif {
19 
20 
21 /**
22  * Convert daq::Status -> ocmif::DaqStatus by populating @a rhs.
23  */
24 DaqStatus& operator<<(ocmif::DaqStatus& status, daq::Status const& rhs);
25 
26 /**
27  * Converts daq::State to DaqSubstate.
28  */
29 DaqSubState MakeState(daq::State state) noexcept;
30 
31 /**
32  * Converts DaqSubstate to daq::State. This assumes ocmif::DaqState is Acquiring.
33  *
34  * @throw std::invalid_argument if state is not convertible.
35  */
36 daq::State MakeState(ocmif::DaqSubState state);
37 
38 /**
39  * @return string representation of enumeration.
40  */
41 std::string_view ToString(ocmif::DaqState state) noexcept;
42 
43 /**
44  * @return string representation of enumeration.
45  */
46 std::string_view ToString(ocmif::DaqSubState state) noexcept;
47 }
48 #endif // #ifndef OCMIF_CONVERSION_HPP_
ocmif::ToString
std::string_view ToString(ocmif::DaqState state) noexcept
Definition: conversion.cpp:78
daq::State
State
Observable states of the data acquisition process.
Definition: state.hpp:41
daq
Definition: daqController.cpp:18
ocmif::operator<<
DaqStatus & operator<<(DaqStatus &status, daq::Status const &rhs)
Definition: conversion.cpp:17
ocmif::MakeState
ocmif::DaqSubState MakeState(daq::State state) noexcept
Converts daq::State to DaqSubstate.
Definition: conversion.cpp:32
ocmif
Definition: conversion.cpp:15
daq::Status
Non observable status object that keeps stores status of data acquisition.
Definition: status.hpp:32