Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:28:52

0001 #ifndef FWCore_ParameterSet_ProcessDesc_h
0002 #define FWCore_ParameterSet_ProcessDesc_h
0003 
0004 #include <memory>
0005 #include <string>
0006 #include <vector>
0007 
0008 #include "FWCore/Utilities/interface/get_underlying_safe.h"
0009 
0010 namespace edm {
0011 
0012   class ParameterSet;
0013 
0014   class ProcessDesc {
0015   public:
0016     explicit ProcessDesc(std::shared_ptr<ParameterSet> pset);
0017     explicit ProcessDesc(std::unique_ptr<ParameterSet> pset);
0018 
0019     /// construct from the configuration language string
0020     explicit ProcessDesc(std::string const& config);
0021 
0022     ~ProcessDesc();
0023 
0024     /// get the parameter set
0025     std::shared_ptr<ParameterSet const> getProcessPSet() const { return get_underlying_safe(pset_); }
0026     std::shared_ptr<ParameterSet>& getProcessPSet() { return get_underlying_safe(pset_); }
0027 
0028     /// get the descriptions of the services
0029     auto const& getServicesPSets() const { return services_; }
0030     auto& getServicesPSets() { return services_; }
0031 
0032     void addService(ParameterSet& pset);
0033     /// add a service as an empty pset
0034     void addService(std::string const& service);
0035     /// add a service if it's not already there
0036     void addDefaultService(std::string const& service);
0037     /// add a service and replace it if it's already there
0038     void addForcedService(std::string const& service);
0039     /// add some default services and forced services
0040     void addServices(std::vector<std::string> const& defaultServices,
0041                      std::vector<std::string> const& forcedServices = std::vector<std::string>());
0042 
0043     std::string dump() const;
0044 
0045   private:
0046     edm::propagate_const<std::shared_ptr<ParameterSet>> pset_;
0047     std::vector<ParameterSet> services_;
0048   };
0049 }  // namespace edm
0050 
0051 #endif