ifw-daq  3.0.0-pre2
IFW Data Acquisition modules
parsing.hpp
Go to the documentation of this file.
1 /**
2  * @file
3  * @ingroup daq_ocm_libdaqif_suppport
4  * @copyright 2022 ESO - European Southern Observatory
5  *
6  * @brief Contains parse functions for daqif
7  */
8 #ifndef OCMIF_PARSING_HPP_
9 #define OCMIF_PARSING_HPP_
10 #include <Daqif.hpp>
11 #include <string_view>
12 
13 
14 namespace daqif {
15 
16 template<class To>
17 To FromString(std::string_view input);
18 
19 /**
20  * Parse state name.
21  *
22  * @returns State if the case-insensitive name matches a valid state.
23  * @throws std::invalid_argument if no state matches.
24  */
25 template<>
26 DaqState FromString<DaqState>(std::string_view state);
27 
28 /**
29  * Parse sub-state name.
30  *
31  * @returns State if the case-insensitive name matches a valid state.
32  * @throws std::invalid_argument if no state matches.
33  */
34 template<>
35 DaqSubState FromString<DaqSubState>(std::string_view state);
36 
37 }
38 #endif // #ifndef OCMIF_PARSING_HPP_
To FromString(std::string_view input)
DaqState FromString< DaqState >(std::string_view state)
Parse state name.
Definition: parsing.cpp:20
DaqSubState FromString< DaqSubState >(std::string_view state)
Parse sub-state name.
Definition: parsing.cpp:34