1 #ifndef ServiceRegistry_ServiceRegistry_h 2 #define ServiceRegistry_ServiceRegistry_h 34 namespace serviceregistry {
67 "No ServiceRegistry has been set for this thread. Tried to get a Service ",
78 "No ServiceRegistry has been set for this thread. Tried to ask availability of a Service ",
81 return manager_->template isAvailable<T>();
99 bool associate =
true);
101 template <
typename T>
103 std::vector<edm::ParameterSet>
config;
104 auto manager = std::make_shared<serviceregistry::ServicesManager>(
config);
105 auto wrapper = std::make_shared<serviceregistry::ServiceWrapper<T> >(
std::move(iService));
109 template <
typename T>
112 bool iOverrideIfServiceInToken) {
113 std::vector<edm::ParameterSet>
config;
116 auto wrapper = std::make_shared<serviceregistry::ServiceWrapper<T> >(
std::move(iService));
117 manager->put(
wrapper, iOverrideIfServiceInToken);
121 template <
typename T>
123 std::vector<edm::ParameterSet>
config;
124 auto manager = std::make_shared<serviceregistry::ServicesManager>(
config);
125 manager->put(iWrapper);
128 template <
typename T>
132 std::vector<edm::ParameterSet>
config;
133 auto manager = std::make_shared<serviceregistry::ServicesManager>(iToken, iLegacy,
config);
134 manager->put(iWrapper);
146 std::shared_ptr<serviceregistry::ServicesManager>
manager_;
ServiceToken setContext(ServiceToken const &iNewToken)
static ServiceToken createServicesFromConfig(std::unique_ptr< ParameterSet > params)
static ServiceToken createContaining(std::shared_ptr< serviceregistry::ServiceWrapper< T > > iWrapper)
create a service token that holds the service held by iWrapper
virtual ~ServiceRegistry()
Operate const & operator=(Operate const &)=delete
static ServiceToken createContaining(std::unique_ptr< T > iService, ServiceToken iToken, bool iOverrideIfServiceInToken)
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)
ServiceRegistry const & operator=(ServiceRegistry const &)=delete
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)
friend int main(int argc, char *argv[])
static ServiceToken createSet(std::vector< ParameterSet > &)
std::string typeDemangle(char const *mangledName)
dictionary config
Read in AllInOne config in JSON format.
friend class edm::FwkImpl
static ServiceToken createContaining(std::shared_ptr< serviceregistry::ServiceWrapper< T > > iWrapper, ServiceToken iToken, serviceregistry::ServiceLegacy iLegacy)
ServiceToken presentToken() const
std::shared_ptr< serviceregistry::ServicesManager > manager_
static HepMC::HEPEVT_Wrapper wrapper