37 namespace serviceregistry {
44 registry_(&iRegistry),
50 wasAdded_ = maker_->make(*pset_, *
registry_, oManager);
51 if(wasAdded_ && maker_->saveConfiguration()) {
52 pset_->addUntrackedParameter(
"@save_config",
true);
75 std::vector<ParameterSet>& iConfiguration,
77 associatedManager_(associate ? iToken.manager_ : boost::shared_ptr<
ServicesManager>()),
82 typedef std::set< TypeIDBase> TypeSet;
87 configTypes.insert(itType->first);
92 for(Type2Service::iterator itType = iToken.
manager_->type2Service_.begin(),
93 itTypeEnd = iToken.
manager_->type2Service_.end();
96 tokenTypes.insert(itType->first);
99 typedef std::set<TypeIDBase> IntersectionType;
101 std::set_intersection(configTypes.begin(), configTypes.end(),
102 tokenTypes.begin(), tokenTypes.end(),
103 inserter(intersection, intersection.end()));
107 if(!intersection.empty()) {
109 <<
"the Service " << (*type2Maker_).find(*(intersection.begin()))->second.pset_->getParameter<std::string>(
"@service_type")
110 <<
" already has an instance of that type of Service";
121 for(IntersectionType::iterator itType = intersection.begin(), itTypeEnd = intersection.end();
124 Type2Maker::iterator itFound =
type2Maker_->find(*itType);
126 if(itFound->second.maker_->saveConfiguration()) {
127 itFound->second.pset_->addUntrackedParameter(
"@save_config",
true);
137 for(IntersectionType::iterator itType = intersection.begin(), itTypeEnd = intersection.end();
140 Type2Maker::iterator itFound =
type2Maker_->find(*itType);
141 if(itFound->second.maker_->processWideService()) {
144 if(itFound->second.maker_->saveConfiguration()) {
145 itFound->second.pset_->addUntrackedParameter(
"@save_config",
true);
149 LogInfo(
"Configuration") <<
"Warning: You have reconfigured service\n"
150 <<
"'" << type <<
"' in a subprocess.\n"
151 <<
"This service has already been configured.\n"
152 <<
"This particular service may not be reconfigured in a subprocess.\n"
153 <<
"The reconfiguration will be ignored.\n";
186 Type2Service::iterator itService =
type2Service_.find(*idIter);
192 itService->second.reset();
233 for(std::vector<ParameterSet>::iterator itParam = iConfiguration.begin(),
234 itParamEnd = iConfiguration.end();
235 itParam != itParamEnd;
239 if(0 == base.get()) {
241 <<
"could not find a service named "
242 << itParam->getParameter<std::string>(
"@service_type")
243 <<
". Please check spelling.";
248 <<
" the service " << itParam->getParameter<std::string>(
"@service_type")
249 <<
" provides the same service as "
250 << itFound->second.pset_->getParameter<std::string>(
"@service_type")
251 <<
"\n Please reconfigure job to only use one of these services.";
271 boost::shared_ptr<ServicesManager> shareThis(
this, NoOp());
286 Type2Maker::iterator itMaker =
type2Maker_->find(*idIter);
292 std::string serviceType = itMaker->second.pset_->getParameter<std::string>(
"@service_type");
293 std::auto_ptr<ParameterSetDescriptionFillerBase> filler(
298 filler->fill(descriptions);
302 toThrow <<
"\nService plugin name is \"" << serviceType <<
"\"\n";
303 toThrow.
append(iException);
307 descriptions.validate(*(itMaker->second.pset_), serviceType);
311 toThrow <<
"\nService plugin name is \"" << serviceType <<
"\"\n";
312 toThrow.
append(iException);
317 itMaker->second.add(*
this);
321 toThrow << itMaker->second.pset_->getParameter<std::string>(
"@service_type") <<
"\n";
322 toThrow.
append(iException);
Type2Service type2Service_
void fillListOfMakers(std::vector< ParameterSet > &)
void append(Exception const &another)
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
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 copySlotsFrom(ActivityRegistry &)
the copy the argument's slots to the our signals
std::vector< TypeIDBase > requestedCreationOrder_
ActivityRegistry registry_
ServicesManager(std::vector< ParameterSet > &iConfiguration)
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