LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
art::FileCatalogMetadata::InheritedMetadata Class Reference

Public Member Functions

 InheritedMetadata (std::vector< std::string > const &sortedMdToInherit, collection_type const &coll)
 
auto const & entries () const
 
void check_values (collection_type const &fromInput) const
 

Private Attributes

collection_type orderedmd_
 
std::unordered_map< std::string, std::string > inputmd_
 

Detailed Description

Definition at line 84 of file FileCatalogMetadata.h.

Constructor & Destructor Documentation

art::FileCatalogMetadata::InheritedMetadata::InheritedMetadata ( std::vector< std::string > const &  sortedMdToInherit,
collection_type const &  coll 
)
inline

Definition at line 86 of file FileCatalogMetadata.h.

88  {
89  detail::OldToNew const translator;
90  for (auto const& pr : coll) {
91  if (cet::search_all(sortedMdToInherit, translator(pr.first))) {
92  inputmd_.insert(pr);
93  orderedmd_.emplace_back(pr);
94  }
95  }
96  }
std::unordered_map< std::string, std::string > inputmd_

Member Function Documentation

void art::FileCatalogMetadata::InheritedMetadata::check_values ( collection_type const &  fromInput) const
inline

Definition at line 105 of file FileCatalogMetadata.h.

References util::cend(), art::errors::LogicError, art::errors::MismatchedInputFiles, and value.

106  {
107  for (auto const& [key, value] : fromInput) {
108  auto it = inputmd_.find(key);
109  if (it == cend(inputmd_)) {
111  << "Metadata key " << key
112  << " missing from list of metadata to inherit from input "
113  "files.\n";
114  } else if (it->second != value) {
116  << "The value for '" << key
117  << "' for the current file is: " << value
118  << ", which conflicts with the value from the first input file "
119  "(\""
120  << it->second << "\").\n";
121  }
122  }
123  }
decltype(auto) constexpr cend(T &&obj)
ADL-aware version of std::cend.
Definition: StdUtils.h:93
std::unordered_map< std::string, std::string > inputmd_
double value
Definition: spectrum.C:18
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
auto const& art::FileCatalogMetadata::InheritedMetadata::entries ( ) const
inline

Definition at line 99 of file FileCatalogMetadata.h.

100  {
101  return orderedmd_;
102  }

Member Data Documentation

std::unordered_map<std::string, std::string> art::FileCatalogMetadata::InheritedMetadata::inputmd_
private

Definition at line 127 of file FileCatalogMetadata.h.

collection_type art::FileCatalogMetadata::InheritedMetadata::orderedmd_
private

Definition at line 126 of file FileCatalogMetadata.h.


The documentation for this class was generated from the following file: