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);
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.";
274 boost::shared_ptr<ServicesManager> shareThis(
this, NoOp());
289 Type2Maker::iterator itMaker =
type2Maker_->find(*idIter);
296 std::auto_ptr<ParameterSetDescriptionFillerBase> filler(
299 filler->fill(descriptions);
303 descriptions.
validate(*(itMaker->second.pset_), serviceType);
313 std::ostringstream ost;
314 ost <<
"Validating configuration of service of type " << serviceType;
321 itMaker->second.add(*
this);
331 std::ostringstream ost;
332 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_
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_
std::string typeDemangle(char const *mangledName)
void addContext(std::string const &context)
ActivityRegistry registry_
ServicesManager(std::vector< ParameterSet > &iConfiguration)
volatile std::atomic< bool > shutdown_flag false
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