ProcessDesc

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
#ifndef FWCore_ParameterSet_ProcessDesc_h
#define FWCore_ParameterSet_ProcessDesc_h

#include <memory>
#include <string>
#include <vector>

#include "FWCore/Utilities/interface/get_underlying_safe.h"

namespace edm {

  class ParameterSet;

  class ProcessDesc {
  public:
    explicit ProcessDesc(std::shared_ptr<ParameterSet> pset);
    explicit ProcessDesc(std::unique_ptr<ParameterSet> pset);

    /// construct from the configuration language string
    explicit ProcessDesc(std::string const& config);

    ~ProcessDesc();

    /// get the parameter set
    std::shared_ptr<ParameterSet const> getProcessPSet() const { return get_underlying_safe(pset_); }
    std::shared_ptr<ParameterSet>& getProcessPSet() { return get_underlying_safe(pset_); }

    /// get the descriptions of the services
    auto const& getServicesPSets() const { return services_; }
    auto& getServicesPSets() { return services_; }

    void addService(ParameterSet& pset);
    /// add a service as an empty pset
    void addService(std::string const& service);
    /// add a service if it's not already there
    void addDefaultService(std::string const& service);
    /// add a service and replace it if it's already there
    void addForcedService(std::string const& service);
    /// add some default services and forced services
    void addServices(std::vector<std::string> const& defaultServices,
                     std::vector<std::string> const& forcedServices = std::vector<std::string>());

    std::string dump() const;

  private:
    edm::propagate_const<std::shared_ptr<ParameterSet>> pset_;
    std::vector<ParameterSet> services_;
  };
}  // namespace edm

#endif