36 auto index = resolver->kInitialIndex;
37 auto newType = modtype;
41 if (not alternativeTypes.empty()) {
42 alternativeTypes.append(
", ");
44 auto [ttype, tindex] = resolver->resolveType(
std::move(newType),
index);
47 alternativeTypes.append(newType);
48 }
while (
index != resolver->kLastIndex);
49 if (tries == 1 and alternativeTypes == modtype) {
52 alternativeTypes.insert(0,
"These alternative types were tried: ");
59 FDEBUG(1) <<
"Factory: module_type = " << modtype << std::endl;
60 MakerMap::iterator it =
makers_.find(modtype);
63 auto make = [](
auto resolver,
const auto& modtype,
auto const&
p) {
66 auto newType = modtype;
85 std::unique_ptr<Maker> wm =
make(resolver, modtype,
p);
86 FDEBUG(1) <<
"Factory: created worker of type " << modtype << std::endl;
88 std::pair<MakerMap::iterator, bool>
ret =
makers_.insert(std::pair<std::string, Maker*>(modtype, wm.get()));
102 auto mod(maker->makeModule(
p, pre, post));
108 MakerMap::iterator it =
makers_.find(modtype);
110 return it->second->makeReplacementModule(
p);
112 return std::shared_ptr<maker::ModuleHolder>{};
static constexpr int kInitialIndex
static constexpr int kLastIndex
ret
prodAgent to be discontinued
S make(const edm::ParameterSet &cfg)
static void cleanup(const Factory::MakerMap::value_type &v)
std::shared_ptr< maker::ModuleHolder > makeReplacementModule(const edm::ParameterSet &) const
Maker * findMaker(const MakeModuleParams &p, const ModuleTypeResolverBase *) const
static void annotateExceptionAndRethrow(cms::Exception &except, const MakeModuleParams &p, std::string const &modtype, ModuleTypeResolverBase const *resolver)
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Container::value_type value_type
static Factory const singleInstance_
void addAdditionalInfo(std::string const &info)
#define EDM_REGISTER_PLUGINFACTORY(_factory_, _category_)
std::shared_ptr< maker::ModuleHolder > makeModule(const MakeModuleParams &, const ModuleTypeResolverBase *, signalslot::Signal< void(const ModuleDescription &)> &pre, signalslot::Signal< void(const ModuleDescription &)> &post) const
static Factory const * get()
virtual std::pair< std::string, int > resolveType(std::string basename, int index) const =0
T mod(const T &a, const T &b)