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>
51 return std::make_unique<TConcrete>(iPS, iAR);
55 template<
typename T,
typename TConcrete = T>
59 return std::make_unique<TConcrete>(iPS);
63 template<
typename T,
typename TConcrete = T>
67 return std::make_unique<TConcrete>();
71 template<
typename T,
typename TMaker = AllArgsMaker<T> >
79 virtual std::type_info
const&
serviceType()
const {
return typeid(
T); }
85 std::unique_ptr<T> pService(maker.make(iPS, iAR));
86 auto ptr = std::make_shared<ServiceWrapper<T> >(
std::move(pService));
113 #define DEFINE_FWK_SERVICE(type) \
114 DEFINE_EDM_PLUGIN (edm::serviceregistry::ServicePluginFactory, edm::serviceregistry::ServiceMaker<type>, #type); \
115 DEFINE_DESC_FILLER_FOR_SERVICES(type, type)
117 #define DEFINE_FWK_SERVICE_MAKER(concrete, maker) \
118 typedef edm::serviceregistry::ServiceMaker<maker::interface_t, maker> concrete ## _ ## _t; \
119 DEFINE_EDM_PLUGIN (edm::serviceregistry::ServicePluginFactory, concrete ## _ ## _t , #concrete); \
120 typedef maker::concrete_t concrete ## _ ## _ ## _t; \
121 DEFINE_DESC_FILLER_FOR_SERVICES(concrete, concrete ## _ ## _ ## _t)
std::unique_ptr< T > make(ParameterSet const &iPS, ActivityRegistry &iAR) const
bool isProcessWideService(TFileService const *)
virtual bool saveConfiguration() const
bool testSaveConfiguration(SaveConfiguration const *) const
bool put(std::shared_ptr< ServiceWrapper< T > > iPtr)
returns false if put fails because a service of this type already exists
virtual bool processWideService() const
std::unique_ptr< T > make(ParameterSet const &iPS, ActivityRegistry &) const
virtual std::type_info const & serviceType() const
virtual bool make(ParameterSet const &iPS, ActivityRegistry &iAR, ServicesManager &oSM) const
ServiceMaker const & operator=(ServiceMaker const &)
std::unique_ptr< T > make(ParameterSet const &, ActivityRegistry &) const