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_ : boost::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);
153 LogInfo(
"Configuration") <<
"Warning: You have reconfigured service\n"
154 <<
"'" << type <<
"' in a subprocess.\n"
155 <<
"This service has already been configured.\n"
156 <<
"This particular service may not be reconfigured in a subprocess.\n"
157 <<
"The reconfiguration will be ignored.\n";
190 Type2Service::iterator itService =
type2Service_.find(*idIter);
196 itService->second.reset();
237 for(std::vector<ParameterSet>::iterator itParam = iConfiguration.begin(),
238 itParamEnd = iConfiguration.end();
239 itParam != itParamEnd;
243 if(0 == base.get()) {
245 <<
"could not find a service named "
246 << itParam->getParameter<std::string>(
"@service_type")
247 <<
". Please check spelling.";
252 <<
" the service " << itParam->getParameter<std::string>(
"@service_type")
253 <<
" provides the same service as "
254 << itFound->second.pset_->getParameter<std::string>(
"@service_type")
255 <<
"\n Please reconfigure job to only use one of these services.";
275 boost::shared_ptr<ServicesManager> shareThis(
this, NoOp());
290 Type2Maker::iterator itMaker =
type2Maker_->find(*idIter);
296 std::string serviceType = itMaker->second.pset_->getParameter<std::string>(
"@service_type");
297 std::auto_ptr<ParameterSetDescriptionFillerBase> filler(
300 filler->fill(descriptions);
304 descriptions.
validate(*(itMaker->second.pset_), serviceType);
314 std::ostringstream ost;
315 ost <<
"Validating configuration of service of type " << serviceType;
322 itMaker->second.add(*
this);
332 std::ostringstream ost;
333 ost <<
"Constructing service of type " << serviceType;
Type2Service type2Service_
void fillListOfMakers(std::vector< ParameterSet > &)
void copySlotsTo(ActivityRegistry &)
copy our Service's slots to the argument's signals
std::map< TypeIDBase, MakerHolder > Type2Maker
void copySlotsFrom(ActivityRegistry &iOther)
std::auto_ptr< Type2Maker > type2Maker_
std::vector< TypeIDBase > actualCreationOrder_
void typeDemangle(char const *mangledName, std::string &demangledName)
double intersection(double r12)
void connectTo(ActivityRegistry &iOther)
causes iOther's signals to be forward to us
void stdToEDM(std::exception const &e)
boost::shared_ptr< edm::serviceregistry::ServicesManager > manager_
bool add(ServicesManager &) const
Container::value_type value_type
MakerHolder(boost::shared_ptr< ServiceMakerBase > iMaker, ParameterSet &iPSet, ActivityRegistry &)
boost::shared_ptr< ServicesManager > associatedManager_
void charPtrToEDM(char const *c)
void stringToEDM(std::string &s)
void copySlotsFrom(ActivityRegistry &)
the copy the argument's slots to the our signals
std::vector< TypeIDBase > requestedCreationOrder_
void addContext(std::string const &context)
ActivityRegistry registry_
ServicesManager(std::vector< ParameterSet > &iConfiguration)
void validate(ParameterSet &pset, std::string const &moduleLabel) const
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