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 106 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 108 of file FileCatalogMetadata.h.

References gammaraytel::pr, and cet::search_all().

110  {
111  NewToOld const translator;
112  for (auto const& pr : coll) {
113  if (cet::search_all(sortedMdToInherit, translator(pr.first))) {
114  inputmd_.insert(pr);
115  orderedmd_.emplace_back(pr);
116  }
117  }
118  }
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 127 of file FileCatalogMetadata.h.

References it, art::errors::LogicError, art::errors::MismatchedInputFiles, and gammaraytel::pr.

128  {
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";
141  }
142  }
143  }
set< int >::iterator it
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 121 of file FileCatalogMetadata.h.

122  {
123  return orderedmd_;
124  }

Member Data Documentation

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

Definition at line 147 of file FileCatalogMetadata.h.

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

Definition at line 146 of file FileCatalogMetadata.h.


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