otsdaq  v2_05_02_indev
FragmentType.hh
1 #ifndef artdaq_ots_Overlays_FragmentType_hh
2 #define artdaq_ots_Overlays_FragmentType_hh
3 #include "artdaq-core/Data/Fragment.hh"
4 
5 namespace ots
6 {
7 static std::vector<std::string> const names{"MISSED", "UDP", "UNKNOWN"};
8 
9 namespace detail
10 {
11 enum FragmentType : artdaq::Fragment::type_t
12 {
13  MISSED = artdaq::Fragment::FirstUserFragmentType,
14  UDP,
15  INVALID // Should always be last.
16 };
17 
18 // Safety check.
19 static_assert(artdaq::Fragment::isUserFragmentType(FragmentType::INVALID - 1), "Too many user-defined fragments!");
20 } // namespace detail
21 
22 using detail::FragmentType;
23 
29 FragmentType toFragmentType(std::string t_string);
30 
36 std::string fragmentTypeToString(FragmentType val);
37 
42 std::map<artdaq::Fragment::type_t, std::string> makeFragmentTypeMap();
43 } // namespace ots
44 #endif /* artdaq_ots_core_Overlays_FragmentType_hh */