1 #ifndef FWCore_ServiceRegistry_ServiceMaker_h 2 #define FWCore_ServiceRegistry_ServiceMaker_h 39 namespace serviceregistry {
41 template <
typename T,
typename TConcrete>
47 template <
typename T,
typename TConcrete = T>
50 return std::make_unique<TConcrete>(iPS, iAR);
54 template <
typename T,
typename TConcrete = T>
57 return std::make_unique<TConcrete>(iPS);
61 template <
typename T,
typename TConcrete = T>
64 return std::make_unique<TConcrete>();
68 template <
typename T,
typename TMaker = AllArgsMaker<T> >
77 std::type_info
const&
serviceType()
const override {
return typeid(
T); }
81 std::unique_ptr<T> pService(maker.make(iPS, iAR));
82 auto ptr = std::make_shared<ServiceWrapper<T> >(
std::move(pService));
97 #define DEFINE_FWK_SERVICE(type) \ 99 edm::serviceregistry::ServicePluginFactory, edm::serviceregistry::ServiceMaker<type>, EDM_STRINGIZE(type)); \ 100 DEFINE_DESC_FILLER_FOR_SERVICES(type, type) 102 #define DEFINE_FWK_SERVICE_MAKER(concrete, maker) \ 103 typedef edm::serviceregistry::ServiceMaker<maker::interface_t, maker> concrete##__t; \ 104 DEFINE_EDM_PLUGIN(edm::serviceregistry::ServicePluginFactory, concrete##__t, #concrete); \ 105 typedef maker::concrete_t concrete##___t; \ 106 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 *)
std::unique_ptr< T > make(ParameterSet const &iPS, ActivityRegistry &) const
std::unique_ptr< T > make(ParameterSet const &, ActivityRegistry &) const
std::type_info const & serviceType() const override
bool processWideService() const override
bool saveConfiguration() const override
bool make(ParameterSet const &iPS, ActivityRegistry &iAR, ServicesManager &oSM) const override
bool testSaveConfiguration(SaveConfiguration const *) const