1 #ifndef ServiceRegistry_ServiceRegistry_h 2 #define ServiceRegistry_ServiceRegistry_h 33 namespace serviceregistry {
52 friend class edm::FwkImpl;
61 if (
nullptr == manager_.get()) {
64 " no ServiceRegistry has been set for this thread");
66 return manager_->template get<T>();
71 if (
nullptr == manager_.get()) {
74 " no ServiceRegistry has been set for this thread");
76 return manager_->template isAvailable<T>();
87 static ServiceToken createServicesFromConfig(std::unique_ptr<ParameterSet> params);
90 static ServiceToken createSet(std::vector<ParameterSet>&);
91 static ServiceToken createSet(std::vector<ParameterSet>&,
94 bool associate =
true);
98 std::vector<edm::ParameterSet>
config;
99 auto manager = std::make_shared<serviceregistry::ServicesManager>(
config);
100 auto wrapper = std::make_shared<serviceregistry::ServiceWrapper<T> >(
std::move(iService));
101 manager->put(wrapper);
104 template <
typename T>
108 std::vector<edm::ParameterSet>
config;
109 auto manager = std::make_shared<serviceregistry::ServicesManager>(iToken, iLegacy,
config);
110 auto wrapper = std::make_shared<serviceregistry::ServiceWrapper<T> >(
std::move(iService));
111 manager->put(wrapper);
115 template <
typename T>
117 std::vector<edm::ParameterSet>
config;
118 auto manager = std::make_shared<serviceregistry::ServicesManager>(
config);
119 manager->put(iWrapper);
122 template <
typename T>
126 std::vector<edm::ParameterSet>
config;
127 auto manager = std::make_shared<serviceregistry::ServicesManager>(iToken, iLegacy,
config);
128 manager->put(iWrapper);
143 std::shared_ptr<serviceregistry::ServicesManager>
manager_;
static ServiceToken createContaining(std::shared_ptr< serviceregistry::ServiceWrapper< T > > iWrapper)
create a service token that holds the service held by iWrapper
static ServiceToken createContaining(std::unique_ptr< T > iService, ServiceToken iToken, serviceregistry::ServiceLegacy iLegacy)
static PFTauRenderPlugin instance
static void throwThis(Code category, char const *message0="", char const *message1="", char const *message2="", char const *message3="", char const *message4="")
void unsetContext(ServiceToken const &iOldToken)
static ServiceRegistry & instance()
static ServiceToken createContaining(std::unique_ptr< T > iService)
create a service token that holds the service defined by iService
Operate(ServiceToken const &iToken)
static ServiceToken createContaining(std::shared_ptr< serviceregistry::ServiceWrapper< T > > iWrapper, ServiceToken iToken, serviceregistry::ServiceLegacy iLegacy)
std::shared_ptr< serviceregistry::ServicesManager > manager_
static HepMC::HEPEVT_Wrapper wrapper