41 namespace serviceregistry {
46 : maker_(iMaker), pset_(&iPSet), registry_(&iRegistry), wasAdded_(
false) {}
50 wasAdded_ = maker_->make(*pset_, *
registry_, oManager);
51 if (wasAdded_ && maker_->saveConfiguration()) {
52 pset_->addUntrackedParameter(
"@save_config",
true);
74 std::vector<ParameterSet>& iConfiguration,
76 : associatedManager_(associate ? iToken.manager_ :
std::shared_ptr<
ServicesManager>()),
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(),
112 ->second.pset_->getParameter<
std::string>(
"@service_type")
113 <<
" already has an instance of that type of Service";
127 Type2Maker::iterator itFound =
type2Maker_->find(*itType);
129 if (itFound->second.maker_->saveConfiguration()) {
130 itFound->second.pset_->addUntrackedParameter(
"@save_config",
true);
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);