1 #ifndef art_Framework_Services_System_FileCatalogMetadata_h 2 #define art_Framework_Services_System_FileCatalogMetadata_h 22 #include "cetlib/assert_only_one_thread.h" 23 #include "cetlib/canonical_string.h" 24 #include "cetlib/container_algorithms.h" 31 #include <unordered_map> 35 class FileCatalogMetadata;
36 class ActivityRegistry;
56 "This list specifies the metadata that is inherited\n" 57 "from the input file. Currently only the run type and\n" 58 "file type metadata can be inherited. The default list is empty."),
59 std::vector<std::string>{}};
69 fhicl::Comment(
"Can specify 'fileType' only if it is not specified\n" 70 "in the 'metadataFromInput' list."),
76 fhicl::Comment(
"Can specify 'runType' only if it is not specified\n" 77 "in the 'metadataFromInput' list."),
112 for (
auto const& pr : coll) {
113 if (cet::search_all(sortedMdToInherit, translator(pr.first))) {
115 orderedmd_.emplace_back(pr);
129 for (
auto const& pr : fromInput) {
130 auto it = inputmd_.find(pr.first);
131 if (it == cend(inputmd_)) {
133 <<
"Metadata key " << pr.first
134 <<
" missing from list of metadata to inherit from input files.\n";
135 }
else if (it->second != pr.second) {
137 <<
"The value for '" << pr.first
138 <<
"' for the current file is: " << pr.second
139 <<
", which conflicts with the value from the first input file (\"" 140 << it->second <<
"\").\n";
147 std::unordered_map<std::string, std::string>
inputmd_;
150 std::unique_ptr<InheritedMetadata>
imd_{};
166 std::string
const&
value)
176 CET_ASSERT_ONLY_ONE_THREAD();
184 imd_->check_values(mdFromInput);
188 for (
auto const& pr :
imd_->entries()) {
197 cet::copy_all(
md_, std::back_inserter(coll));
#define DECLARE_ART_SERVICE(svc, scope)
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
std::string value(boost::any const &)