41 namespace serviceregistry {
48 registry_(&iRegistry),
54 wasAdded_ = maker_->make(*pset_, *
registry_, oManager);
55 if(wasAdded_ && maker_->saveConfiguration()) {
56 pset_->addUntrackedParameter(
"@save_config",
true);
79 std::vector<ParameterSet>& iConfiguration,
81 associatedManager_(associate ? iToken.manager_ : std::shared_ptr<
ServicesManager>()),
86 typedef std::set< TypeIDBase> TypeSet;
91 configTypes.insert(itType->first);
96 for(Type2Service::iterator itType = iToken.
manager_->type2Service_.begin(),
97 itTypeEnd = iToken.
manager_->type2Service_.end();
100 tokenTypes.insert(itType->first);
103 typedef std::set<TypeIDBase> IntersectionType;
105 std::set_intersection(configTypes.begin(), configTypes.end(),
106 tokenTypes.begin(), tokenTypes.end(),
107 inserter(intersection, intersection.end()));
111 if(!intersection.empty()) {
113 <<
"the Service " << (*type2Maker_).find(*(intersection.begin()))->second.pset_->getParameter<
std::string>(
"@service_type")
114 <<
" already has an instance of that type of Service";
125 for(IntersectionType::iterator itType = intersection.begin(), itTypeEnd = intersection.end();
128 Type2Maker::iterator itFound =
type2Maker_->find(*itType);
130 if(itFound->second.maker_->saveConfiguration()) {
131 itFound->second.pset_->addUntrackedParameter(
"@save_config",
true);
141 for(IntersectionType::iterator itType = intersection.begin(), itTypeEnd = intersection.end();
144 Type2Maker::iterator itFound =
type2Maker_->find(*itType);
145 if(itFound->second.maker_->processWideService()) {
148 if(itFound->second.maker_->saveConfiguration()) {
149 itFound->second.pset_->addUntrackedParameter(
"@save_config",
true);
152 LogInfo(
"Configuration") <<
"Warning: You have reconfigured service\n"
153 <<
"'" << type <<
"' in a subprocess.\n"
154 <<
"This service has already been configured.\n"
155 <<
"This particular service may not be reconfigured in a subprocess.\n"
156 <<
"The reconfiguration will be ignored.\n";
189 Type2Service::iterator itService =
type2Service_.find(*idIter);
195 itService->second.reset();
236 for(std::vector<ParameterSet>::iterator itParam = iConfiguration.begin(),
237 itParamEnd = iConfiguration.end();
238 itParam != itParamEnd;
242 if(0 == base.get()) {
244 <<
"could not find a service named "
245 << itParam->getParameter<
std::string>(
"@service_type")
246 <<
". Please check spelling.";
251 <<
" the service " << itParam->getParameter<
std::string>(
"@service_type")
252 <<
" provides the same service as "
253 << itFound->second.pset_->getParameter<
std::string>(
"@service_type")
254 <<
"\n Please reconfigure job to only use one of these services.";
273 std::unique_ptr<ParameterSetDescriptionFillerBase> filler(
276 filler->fill(descriptions);
280 descriptions.validate(*(iMaker.
pset_), serviceType);
284 std::ostringstream ost;
285 ost <<
"Validating configuration of service of type " << serviceType;
296 std::ostringstream ost;
297 ost <<
"Constructing service of type " << serviceType;
307 std::shared_ptr<ServicesManager> shareThis(
this, NoOp());
322 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 > &)
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)
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
bool add(ServicesManager &) const
void copySlotsFrom(ActivityRegistry &)
the copy the argument's slots to the our signals
std::vector< TypeIDBase > requestedCreationOrder_
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_
auto wrap(F iFunc) -> decltype(iFunc())
volatile std::atomic< bool > shutdown_flag false
void connect(ActivityRegistry &iOther)
causes our ActivityRegistry's signals to be forwarded to iOther
T get(const Candidate &c)
void connect(ActivityRegistry &iOther)
forwards our signals to slots connected to iOther