41 namespace serviceregistry {
46 : maker_(iMaker), pset_(&iPSet), registry_(&iRegistry), wasAdded_(
false) {}
74 std::vector<ParameterSet>& iConfiguration,
81 typedef std::set<TypeIDBase> TypeSet;
83 for (Type2Maker::iterator itType =
type2Maker_->begin(), itTypeEnd =
type2Maker_->end(); itType != itTypeEnd;
85 configTypes.insert(itType->first);
89 if (
nullptr != iToken.
manager_.get()) {
90 for (Type2Service::iterator itType = iToken.
manager_->type2Service_.begin(),
91 itTypeEnd = iToken.
manager_->type2Service_.end();
94 tokenTypes.insert(itType->first);
97 typedef std::set<TypeIDBase> IntersectionType;
99 std::set_intersection(configTypes.begin(),
103 inserter(intersection, intersection.end()));
107 if (!intersection.empty()) {
111 .find(*(intersection.begin()))
112 ->second.pset_->getParameter<
std::string>(
"@service_type")
113 <<
" already has an instance of that type of Service";
124 for (IntersectionType::iterator itType = intersection.begin(), itTypeEnd = intersection.end();
127 Type2Maker::iterator itFound =
type2Maker_->find(*itType);
129 if (itFound->second.maker_->saveConfiguration()) {
130 itFound->second.pset_->addUntrackedParameter(
"@save_config",
true);
140 for (IntersectionType::iterator itType = intersection.begin(), itTypeEnd = intersection.end();
143 Type2Maker::iterator itFound =
type2Maker_->find(*itType);
144 if (itFound->second.maker_->processWideService()) {
147 if (itFound->second.maker_->saveConfiguration()) {
148 itFound->second.pset_->addUntrackedParameter(
"@save_config",
true);
151 LogInfo(
"Configuration") <<
"Warning: You have reconfigured service\n" 152 <<
"'" << type <<
"' in a subprocess.\n" 153 <<
"This service has already been configured.\n" 154 <<
"This particular service may not be reconfigured in a subprocess.\n" 155 <<
"The reconfiguration will be ignored.\n";
188 Type2Service::iterator itService =
type2Service_.find(*idIter);
193 itService->second.reset();
221 for (std::vector<ParameterSet>::iterator itParam = iConfiguration.begin(), itParamEnd = iConfiguration.end();
222 itParam != itParamEnd;
224 std::shared_ptr<ServiceMakerBase>
base(
227 if (
nullptr == base.get()) {
229 <<
"could not find a service named " << itParam->getParameter<
std::string>(
"@service_type")
230 <<
". Please check spelling.";
235 <<
" the service " << itParam->getParameter<
std::string>(
"@service_type")
236 <<
" provides the same service as " << itFound->second.pset_->getParameter<
std::string>(
"@service_type")
237 <<
"\n Please reconfigure job to only use one of these services.";
253 std::unique_ptr<ParameterSetDescriptionFillerBase>
filler(
256 filler->fill(descriptions);
261 std::ostringstream ost;
262 ost <<
"Validating configuration of service of type " << serviceType;
272 std::ostringstream ost;
273 ost <<
"Constructing service of type " << serviceType;
281 std::shared_ptr<ServicesManager> shareThis(
this, NoOp());
296 Type2Maker::iterator itMaker =
type2Maker_->find(*idIter);
Type2Service type2Service_
T getParameter(std::string const &) const
MakerHolder(std::shared_ptr< ServiceMakerBase > iMaker, ParameterSet &iPSet, ActivityRegistry &)
void fillListOfMakers(std::vector< ParameterSet > &)
def create(alignables, pedeDump, additionalData, outputFile, config)
void createServiceFor(MakerHolder const &)
void copySlotsTo(ActivityRegistry &)
copy our Service's slots to the argument's signals
std::map< TypeIDBase, MakerHolder > Type2Maker
void copySlotsFrom(ActivityRegistry &iOther)
edm::propagate_const< std::shared_ptr< ServiceMakerBase > > maker_
std::vector< TypeIDBase > actualCreationOrder_
Container::value_type value_type
double intersection(double r12)
void connectTo(ActivityRegistry &iOther)
causes iOther's signals to be forward to us
base
Make Sure CMSSW is Setup ##.
bool add(ServicesManager &) const
void copySlotsFrom(ActivityRegistry &)
the copy the argument's slots to the our signals
std::vector< TypeIDBase > requestedCreationOrder_
void addUntrackedParameter(std::string const &name, T const &value)
std::string typeDemangle(char const *mangledName)
void addContext(std::string const &context)
ActivityRegistry registry_
edm::propagate_const< std::unique_ptr< Type2Maker > > type2Maker_
ServicesManager(std::vector< ParameterSet > &iConfiguration)
std::shared_ptr< edm::serviceregistry::ServicesManager > manager_
edm::propagate_const< std::shared_ptr< ServicesManager > > associatedManager_
ActivityRegistry * registry_
auto wrap(F iFunc) -> decltype(iFunc())
void connect(ActivityRegistry &iOther)
causes our ActivityRegistry's signals to be forwarded to iOther
T get(const Candidate &c)
def operate(timelog, memlog, json_f, num)
void connect(ActivityRegistry &iOther)
forwards our signals to slots connected to iOther