1 #ifndef ServiceRegistry_ServiceRegistry_h 2 #define ServiceRegistry_ServiceRegistry_h 33 namespace serviceregistry {
55 friend class edm::FwkImpl;
64 if(
nullptr == manager_.get()) {
67 " no ServiceRegistry has been set for this thread");
69 return manager_->
template get<T>();
74 if(
nullptr == manager_.get()) {
77 " no ServiceRegistry has been set for this thread");
79 return manager_->
template isAvailable<T>();
93 static ServiceToken createSet(std::vector<ParameterSet>&);
94 static ServiceToken createSet(std::vector<ParameterSet>&,
97 bool associate =
true);
101 std::vector<edm::ParameterSet>
config;
102 auto manager = std::make_shared<serviceregistry::ServicesManager>(
config);
103 auto wrapper = std::make_shared<serviceregistry::ServiceWrapper<T> >(
std::move(iService));
104 manager->put(wrapper);
111 std::vector<edm::ParameterSet>
config;
112 auto manager = std::make_shared<serviceregistry::ServicesManager>(iToken, iLegacy,
config);
113 auto wrapper = std::make_shared<serviceregistry::ServiceWrapper<T> >(
std::move(iService));
114 manager->put(wrapper);
120 std::vector<edm::ParameterSet>
config;
121 auto manager = std::make_shared<serviceregistry::ServicesManager>(
config);
122 manager->put(iWrapper);
129 std::vector<edm::ParameterSet>
config;
130 auto manager = std::make_shared<serviceregistry::ServicesManager>(iToken, iLegacy,
config);
131 manager->put(iWrapper);
146 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