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);