24 void throwProducesWithoutAbility(
const char* runOrLumi,
28 <<
"Module declares it can produce a product of type \'" << productTypeName
29 <<
"\'\nin a " << runOrLumi <<
", but does not have the ability to produce in " 30 << runOrLumi <<
"s.\n" 31 <<
"You must add a template parameter of type Begin" << runOrLumi <<
"Producer\n" 32 <<
"or End" << runOrLumi <<
"Producer to the EDProducer or EDFilter base class\n" 33 <<
"of the module. Or you could remove the call to the function \'produces\'\n" 34 <<
"(Note legacy modules are not ever allowed to produce in Runs or Lumis)\n";
40 TypeLabelList::const_iterator
const& iEnd,
46 std::vector<std::string> missingDictionaries;
47 std::vector<std::string> producedTypes;
48 std::set<std::tuple<BranchType,std::type_index,std::string>> registeredProducts;
50 for(TypeLabelList::const_iterator
p = iBegin;
p != iEnd; ++
p) {
54 throwProducesWithoutAbility(
"Run",
p->typeID_.userClassName());
59 throwProducesWithoutAbility(
"LuminosityBlock",
p->typeID_.userClassName());
64 producedTypes.emplace_back(
p->typeID_.className());
69 std::tuple<BranchType, std::type_index, std::string>
entry{
branchType,
p->typeID_.typeInfo(),
p->productInstanceName_};
70 if(registeredProducts.end() != registeredProducts.find(
entry) ) {
75 registeredProducts.insert(
entry);
83 p->typeID_.userClassName(),
84 p->typeID_.friendlyClassName(),
85 p->productInstanceName_,
92 if (pdesc.transient()) {
93 if (!
checkDictionary(missingDictionaries, pdesc.wrappedName(), pdesc.wrappedType())) {
97 producedTypes.emplace_back(pdesc.className());
103 producedTypes.emplace_back(pdesc.className());
111 if (!missingDictionaries.empty()) {
112 std::string context(
"Calling ProductRegistryHelper::addToRegistry, checking dictionaries for produced types");
void throwMissingDictionariesException(std::vector< std::string > &missingDictionaries, std::string const &context)
std::string const & processName() const
TypeLabelList typeLabelList_
TypeLabelList const & typeLabelList() const
used by the fwk to register the list of products of this module
std::string const & moduleName() const
virtual ~ProductRegistryHelper() noexcept(false)
static void addToRegistry(TypeLabelList::const_iterator const &iBegin, TypeLabelList::const_iterator const &iEnd, ModuleDescription const &iDesc, ProductRegistry &iReg, ProductRegistryHelper *iProd, bool iIsListener=false)
std::string const & moduleLabel() const
constexpr bool isEndTransition(Transition iValue)
virtual bool hasAbilityToProduceInRuns() const
std::vector< TypeLabelItem > TypeLabelList
bool checkDictionary(std::vector< std::string > &missingDictionaries, TypeID const &typeID)
bool checkClassDictionaries(std::vector< std::string > &missingDictionaries, TypeID const &typeID)
virtual bool hasAbilityToProduceInLumis() const
ParameterSetID const & parameterSetID() const
bool checkDictionaryOfWrappedType(std::vector< std::string > &missingDictionaries, TypeID const &unwrappedTypeID)
void addProduct(BranchDescription const &productdesc, bool iFromListener=false)
constexpr BranchType convertToBranchType(Transition iValue)
void insertBranchAlias(std::string const &alias)
def branchType(schema, name)