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;
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);
Type2Service type2Service_
T getParameter(std::string const &) const
MakerHolder(std::shared_ptr< ServiceMakerBase > iMaker, ParameterSet &iPSet, ActivityRegistry &)
void fillListOfMakers(std::vector< ParameterSet > &)
def create(alignables, pedeDump, additionalData, outputFile, config)
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
Log< level::Info, false > LogInfo
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_
bool add(ServicesManager &) const
edm::propagate_const< std::shared_ptr< ServicesManager > > associatedManager_
auto wrap(F iFunc) -> decltype(iFunc())
void connect(ActivityRegistry &iOther)
causes our ActivityRegistry's signals to be forwarded to iOther
void connect(ActivityRegistry &iOther)
forwards our signals to slots connected to iOther