1 #include "artdaq-core/Data/FragmentNameHelper.hh"
2 #include "artdaq-core/Data/ContainerFragment.hh"
9 TLOG(TLVL_DEBUG) <<
"ArtdaqFragmentNameHelper CONSTRUCTOR START";
10 TLOG(TLVL_DEBUG) <<
"ArtdaqFragmentNameHelper CONSTRUCTOR END";
23 std::set<std::string> output;
26 std::string instance_name = map_iter.second;
27 if (output.count(instance_name) == 0u)
29 output.insert(instance_name);
30 TLOG(TLVL_TRACE) <<
"Adding product instance name \"" << map_iter.second
31 <<
"\" to list of expected names";
36 if (container_type != type_map_.end())
38 std::string container_type_name = container_type->second;
39 std::set<std::string> tmp_copy = output;
40 for (
const auto& set_iter : tmp_copy)
42 output.insert(container_type_name + set_iter);
49 std::pair<bool, std::string>
53 bool success_code =
true;
54 std::string instance_name;
57 if (primary_type != type_map_end)
59 TLOG(TLVL_TRACE) <<
"Found matching instance name " << primary_type->second <<
" for Fragment type " << fragment.
type();
60 instance_name = primary_type->second;
65 if (contained_type != type_map_end)
67 instance_name += contained_type->second;
78 return std::make_pair(success_code, instance_name);
virtual ~ArtdaqFragmentNameHelper()
DefaultArtdaqFragmentNameHelper Destructor.
The artdaq::ContainerFragment class represents a Fragment which contains other Fragments.
std::string unidentified_instance_name_
The name to use for unknown Fragment types.
virtual std::set< std::string > GetAllProductInstanceNames() const
Returns the full set of product instance names which may be present in the data, based on the types t...
detail::RawFragmentHeader::type_t type_t
typedef for type_t from RawFragmentHeader
std::map< artdaq::Fragment::type_t, std::string > type_map_
Map relating Fragment Type to strings.
Fragment::type_t fragment_type() const
Get the Fragment::type_t of stored Fragment objects.
static constexpr type_t ContainerFragmentType
Copy ContainerFragmentType from RawFragmentHeader.
type_t type() const
Type of the Fragment, from the Fragment header.
virtual std::pair< bool, std::string > GetInstanceNameForFragment(artdaq::Fragment const &fragment) const
Returns the product instance name for the specified fragment, based on the types that have been speci...
A Fragment contains the data from one piece of the DAQ system for one event The artdaq::Fragment is t...
ArtdaqFragmentNameHelper(std::string unidentified_instance_name, std::vector< std::pair< artdaq::Fragment::type_t, std::string >> extraTypes)
NetMonTransportService Constructor.
virtual std::string GetInstanceNameForType(artdaq::Fragment::type_t type_id) const
Returns the basic translation for the specified type. Defaults to the specified unidentified_instance...