1 #ifndef FWCore_ServiceRegistry_ServiceMaker_h
2 #define FWCore_ServiceRegistry_ServiceMaker_h
38 namespace serviceregistry {
40 template <
typename T,
typename TConcrete>
46 template <
typename T,
typename TConcrete = T>
49 return std::make_unique<TConcrete>(iPS, iAR);
53 template <
typename T,
typename TConcrete = T>
56 return std::make_unique<TConcrete>(iPS);
60 template <
typename T,
typename TConcrete = T>
63 return std::make_unique<TConcrete>();
67 template <
typename T,
typename TMaker = AllArgsMaker<T> >
76 std::type_info
const&
serviceType()
const override {
return typeid(
T); }
80 std::unique_ptr<T> pService(maker.make(iPS, iAR));
81 auto ptr = std::make_shared<ServiceWrapper<T> >(
std::move(pService));
96 #define DEFINE_FWK_SERVICE(type) \
97 DEFINE_EDM_PLUGIN(edm::serviceregistry::ServicePluginFactory, edm::serviceregistry::ServiceMaker<type>, #type); \
98 DEFINE_DESC_FILLER_FOR_SERVICES(type, type)
100 #define DEFINE_FWK_SERVICE_MAKER(concrete, maker) \
101 typedef edm::serviceregistry::ServiceMaker<maker::interface_t, maker> concrete##_##_t; \
102 DEFINE_EDM_PLUGIN(edm::serviceregistry::ServicePluginFactory, concrete##_##_t, #concrete); \
103 typedef maker::concrete_t concrete##_##_##_t; \
104 DEFINE_DESC_FILLER_FOR_SERVICES(concrete, concrete##_##_##_t)
std::unique_ptr< T > make(ParameterSet const &iPS, ActivityRegistry &iAR) const
bool put(std::shared_ptr< ServiceWrapper< T >> iPtr)
returns false if put fails because a service of this type already exists
ServiceMaker const & operator=(ServiceMaker const &)=delete
bool isProcessWideService(TFileService const *)
bool testSaveConfiguration(SaveConfiguration const *) const
std::unique_ptr< T > make(ParameterSet const &iPS, ActivityRegistry &) const
std::type_info const & serviceType() const override
bool processWideService() const override
bool saveConfiguration() const override
std::unique_ptr< T > make(ParameterSet const &, ActivityRegistry &) const
bool make(ParameterSet const &iPS, ActivityRegistry &iAR, ServicesManager &oSM) const override