1 #ifndef Framework_ComponentMaker_h 2 #define Framework_ComponentMaker_h 33 namespace eventsetup {
34 class EventSetupProvider;
35 class EventSetupsController;
36 class DataProxyProvider;
53 bool replaceExisting)
const = 0;
56 template <
class T,
class TComponent>
68 bool replaceExisting)
const override;
91 template <
class T,
class TComponent>
96 bool replaceExisting)
const {
101 if (!replaceExisting) {
102 std::shared_ptr<typename T::base_type> alreadyMadeComponent =
103 T::getComponentAndRegisterProcess(esController, iConfiguration);
105 if (alreadyMadeComponent) {
110 std::shared_ptr<TComponent> component(
111 std::static_pointer_cast<TComponent, typename T::base_type>(alreadyMadeComponent));
112 T::addTo(iProvider, component, iConfiguration,
true);
117 std::shared_ptr<TComponent> component = std::make_shared<TComponent>(iConfiguration);
120 this->setDescription(component.get(),
description);
121 this->setDescriptionForFinder(component.get(),
description);
122 this->setPostConstruction(component.get(), iConfiguration);
124 if (replaceExisting) {
133 T::replaceExisting(iProvider, component);
139 T::addTo(iProvider, component, iConfiguration,
false);
140 T::putComponent(esController, iConfiguration, component);
void setPostConstruction(DataProxyProvider *iProv, const edm::ParameterSet &iPSet) const
ComponentDescription createComponentDescription(ParameterSet const &iConfiguration) const
void setDescription(const ComponentDescription &iDescription)
void setDescriptionForFinder(void *, const ComponentDescription &) const
void setDescription(void *, const ComponentDescription &) const
virtual ~ComponentMakerBaseHelper()
virtual std::shared_ptr< base_type > addTo(EventSetupsController &esController, EventSetupProvider &iProvider, ParameterSet const &iConfiguration, bool replaceExisting) const =0
void setDescription(DataProxyProvider *iProv, const ComponentDescription &iDesc) const
void setPostConstruction(void *, const edm::ParameterSet &) const
void setDescriptionForFinder(const eventsetup::ComponentDescription &iDescription)
void setAppendToDataLabel(const edm::ParameterSet &)
void setDescriptionForFinder(EventSetupRecordIntervalFinder *iFinder, const ComponentDescription &iDesc) const
const ComponentMaker & operator=(const ComponentMaker &)=delete
std::shared_ptr< base_type > addTo(EventSetupsController &esController, EventSetupProvider &iProvider, ParameterSet const &iConfiguration, bool replaceExisting) const override