19 ConsumesInfo::~ConsumesInfo() =
default;
21 ConsumesInfo::ConsumesInfo() { requireConsumes_ =
false; }
36 switch (pi.consumableType) {
37 case ProductInfo::ConsumableType::Product:
40 case ProductInfo::ConsumableType::ViewElement:
41 result +=
"consumesView";
43 case ProductInfo::ConsumableType::Many:
44 result +=
"consumesMany";
49 result += pi.typeID.className();
58 if (pi.consumableType == ProductInfo::ConsumableType::Many) {
68 if (!pi.process.name().empty()) {
70 result += pi.instance;
72 result += pi.process.name();
73 }
else if (!pi.instance.empty()) {
75 result += pi.instance;
84 string result{
"module label: '"};
86 result +=
"' of class type '";
93 ConsumesInfo::setRequireConsumes(
bool const val)
95 requireConsumes_ =
val;
99 ConsumesInfo::collectConsumes(
100 string const& module_label,
103 std::lock_guard sentry{mutex_};
104 consumables_.emplace(module_label, consumables);
113 std::lock_guard sentry{mutex_};
119 if (requireConsumes_.load()) {
121 "Consumer: an error occurred during validation of a " 122 "retrieved product\n\n")
123 <<
"The following consumes (or mayConsume) statement is missing from\n" 124 << module_context(md) <<
":\n\n" 125 <<
" " << assemble_consumes_statement(bt, productInfo) <<
"\n\n";
131 ConsumesInfo::showMissingConsumes()
const 133 std::lock_guard sentry{mutex_};
134 for (
auto const& modLabelAndarySetPI : missingConsumes_) {
135 auto const& modLabel = modLabelAndarySetPI.first;
136 auto const& arySetPI = modLabelAndarySetPI.second;
141 <<
"The following consumes (or mayConsume) statements are missing " 143 <<
"module label: " << modLabel <<
'\n' 144 << rule(
'-') <<
'\n';
146 for (
auto const& setPI : arySetPI) {
147 for (
auto const&
pi : setPI) {
149 << assemble_consumes_statement(static_cast<BranchType>(i),
pi)
std::string const & moduleLabel() const
const std::string instance
std::string const & moduleName() const
std::string const & BranchTypeToString(BranchType const bt)
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
auto array(Array const &a)
Returns a manipulator which will print the specified array.
bool binary_search_all(FwdCont const &, Datum const &)