CMS 3D CMS Logo

ProcessDesc.cc
Go to the documentation of this file.
4 
5 namespace edm {
6 
7  ProcessDesc::ProcessDesc(std::shared_ptr<ParameterSet> pset) :
8  pset_(pset), services_(pset_->popVParameterSet(std::string("services"))) {
9  }
10 
12  pset_(new ParameterSet),
13  services_{} {
14  throw Exception(errors::Configuration,"Old config strings no longer accepted");
15  }
16 
18  }
19 
21  // The standard services should be initialized first.
22  services_.insert(services_.begin(), pset);
23  }
24 
26  ParameterSet newpset;
27  newpset.addParameter<std::string>("@service_type", service);
28  addService(newpset);
29  }
30 
32  for(auto it = services_.begin(), itEnd = services_.end(); it != itEnd; ++it) {
33  std::string name = it->getParameter<std::string>("@service_type");
34  if (name == service) {
35  // Use the configured service. Don't add a default.
36  // However, the service needs to be moved to the front because it is a standard service.
37  ParameterSet pset = *it;
38  services_.erase(it);
39  addService(pset);
40  return;
41  }
42  }
43  addService(service);
44  }
45 
47  for(auto it = services_.begin(), itEnd = services_.end(); it != itEnd; ++it) {
48  std::string name = it->getParameter<std::string>("@service_type");
49  if (name == service) {
50  // Remove the configured service before adding the default.
51  services_.erase(it);
52  break;
53  }
54  }
55  addService(service);
56  }
57 
58  void ProcessDesc::addServices(std::vector<std::string> const& defaultServices,
59  std::vector<std::string> const& forcedServices) {
60  // Add the default services to services_.
61  for(auto const& service: defaultServices) {
63  }
64  // Add the forced services to services_.
65  for(auto const& service : forcedServices) {
67  }
68  }
69 
71  std::string out = pset_->dump();
72  for (auto const& service : services_) {
73  out += service.dump();
74  }
75  return out;
76  }
77 } // namespace edm
void addDefaultService(std::string const &service)
add a service if it&#39;s not already there
Definition: ProcessDesc.cc:31
edm::propagate_const< std::shared_ptr< ParameterSet > > pset_
Definition: ProcessDesc.h:45
void addServices(std::vector< std::string > const &defaultServices, std::vector< std::string > const &forcedServices=std::vector< std::string >())
add some default services and forced services
Definition: ProcessDesc.cc:58
void addService(ParameterSet &pset)
Definition: ProcessDesc.cc:20
void addParameter(std::string const &name, T const &value)
Definition: ParameterSet.h:144
void addForcedService(std::string const &service)
add a service and replace it if it&#39;s already there
Definition: ProcessDesc.cc:46
HLT enums.
std::string dump() const
Definition: ProcessDesc.cc:70
ProcessDesc(std::shared_ptr< ParameterSet > pset)
Definition: ProcessDesc.cc:7
std::vector< ParameterSet > services_
Definition: ProcessDesc.h:46