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> >
74 std::type_info
const&
serviceType()
const override {
return typeid(
T); }
78 std::unique_ptr<T> pService(maker.make(iPS, iAR));
79 auto ptr = std::make_shared<ServiceWrapper<T> >(
std::move(pService));
105 #define DEFINE_FWK_SERVICE(type) \ 106 DEFINE_EDM_PLUGIN(edm::serviceregistry::ServicePluginFactory, edm::serviceregistry::ServiceMaker<type>, #type); \ 107 DEFINE_DESC_FILLER_FOR_SERVICES(type, type) 109 #define DEFINE_FWK_SERVICE_MAKER(concrete, maker) \ 110 typedef edm::serviceregistry::ServiceMaker<maker::interface_t, maker> concrete##_##_t; \ 111 DEFINE_EDM_PLUGIN(edm::serviceregistry::ServicePluginFactory, concrete##_##_t, #concrete); \ 112 typedef maker::concrete_t concrete##_##_##_t; \ 113 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
bool isProcessWideService(TFileService const *)
bool testSaveConfiguration(SaveConfiguration const *) const
std::unique_ptr< T > make(ParameterSet const &iPS, ActivityRegistry &) const
bool make(ParameterSet const &iPS, ActivityRegistry &iAR, ServicesManager &oSM) const override
bool processWideService() const override
bool saveConfiguration() const override
std::unique_ptr< T > make(ParameterSet const &, ActivityRegistry &) const
std::type_info const & serviceType() const override