Public Member Functions | Private Attributes | List of all members
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::stringinputmd_
 

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_
bool search_all(FwdCont const &, Datum const &)

Member Function Documentation

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

Definition at line 105 of file FileCatalogMetadata.h.

106  {
107  for (auto const& pr : fromInput) {
108  auto it = inputmd_.find(pr.first);
109  if (it == cend(inputmd_)) {
111  << "Metadata key " << pr.first
112  << " missing from list of metadata to inherit from input "
113  "files.\n";
114  } else if (it->second != pr.second) {
116  << "The value for '" << pr.first
117  << "' for the current file is: " << pr.second
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:87
std::unordered_map< std::string, std::string > inputmd_
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: