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>
67 bool replaceExisting)
const override;
94 template <
class T,
class TComponent>
99 bool replaceExisting)
const {
104 if (!replaceExisting) {
105 std::shared_ptr<typename T::base_type> alreadyMadeComponent =
106 T::getComponentAndRegisterProcess(esController, iConfiguration);
108 if (alreadyMadeComponent) {
113 std::shared_ptr<TComponent> component(
114 std::static_pointer_cast<TComponent, typename T::base_type>(alreadyMadeComponent));
115 T::addTo(iProvider, component, iConfiguration,
true);
120 std::shared_ptr<TComponent> component = std::make_shared<TComponent>(iConfiguration);
123 this->setDescription(component.get(),
description);
124 this->setDescriptionForFinder(component.get(),
description);
125 this->setPostConstruction(component.get(), iConfiguration);
127 if (replaceExisting) {
136 T::replaceExisting(iProvider, component);
142 T::addTo(iProvider, component, iConfiguration,
false);
143 T::putComponent(esController, iConfiguration, component);