1 #ifndef Framework_ComponentMaker_h 2 #define Framework_ComponentMaker_h 25 #include <fmt/format.h> 37 namespace eventsetup {
38 class EventSetupProvider;
39 class EventSetupsController;
40 class ESProductResolverProvider;
57 bool replaceExisting)
const = 0;
60 template <
class T,
class TComponent>
72 bool replaceExisting)
const override;
95 template <
class T,
class TComponent>
100 bool replaceExisting)
const {
111 fillDetails::fillIfExists<TComponent>(descriptions);
112 fillDetails::prevalidateIfExists<TComponent>(descriptions);
118 "Validating configuration of {} of type {} with label: '{}'", T::baseType(), modtype,
moduleLabel));
123 if (!replaceExisting) {
124 std::shared_ptr<typename T::base_type> alreadyMadeComponent =
125 T::getComponentAndRegisterProcess(esController, iConfiguration);
127 if (alreadyMadeComponent) {
132 std::shared_ptr<TComponent> component(
133 std::static_pointer_cast<TComponent, typename T::base_type>(alreadyMadeComponent));
134 T::addTo(iProvider, component, iConfiguration,
true);
139 std::shared_ptr<TComponent> component = std::make_shared<TComponent>(iConfiguration);
142 this->setDescription(component.get(),
description);
143 this->setDescriptionForFinder(component.get(),
description);
144 this->setPostConstruction(component.get(), iConfiguration);
146 if (replaceExisting) {
155 T::replaceExisting(iProvider, component);
161 T::addTo(iProvider, component, iConfiguration,
false);
162 T::putComponent(esController, iConfiguration, component);
T getParameter(std::string const &) const
ComponentDescription createComponentDescription(ParameterSet const &iConfiguration) const
void validate(ParameterSet &pset, std::string const &moduleLabel) const
void setDescriptionForFinder(void *, const ComponentDescription &) const
std::shared_ptr< base_type > addTo(EventSetupsController &esController, EventSetupProvider &iProvider, ParameterSet &iConfiguration, bool replaceExisting) const override
virtual std::shared_ptr< base_type > addTo(EventSetupsController &esController, EventSetupProvider &iProvider, ParameterSet &iConfiguration, bool replaceExisting) const =0
void setDescription(void *, const ComponentDescription &) const
virtual ~ComponentMakerBaseHelper()
void setDescription(const ComponentDescription &iDescription)
ParameterSet const & registerIt()
void setDescription(ESProductResolverProvider *iProv, const ComponentDescription &iDesc) const
void setPostConstruction(ESProductResolverProvider *iProv, const edm::ParameterSet &iPSet) const
void setPostConstruction(void *, const edm::ParameterSet &) const
void setDescriptionForFinder(const eventsetup::ComponentDescription &iDescription)
void addContext(std::string const &context)
void setAppendToDataLabel(const edm::ParameterSet &)
void setDescriptionForFinder(EventSetupRecordIntervalFinder *iFinder, const ComponentDescription &iDesc) const
const ComponentMaker & operator=(const ComponentMaker &)=delete
auto wrap(F iFunc) -> decltype(iFunc())