CMS 3D CMS Logo

Public Member Functions | Private Attributes

edm::ProcessDesc Class Reference

#include <ProcessDesc.h>

List of all members.

Public Member Functions

void addDefaultService (std::string const &service)
 add a service if it's not already there
void addForcedService (std::string const &service)
 add a service and replace it if it's already there
void addService (ParameterSet &pset)
void addService (std::string const &service)
 add a service as an empty pset
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
std::string dump () const
boost::shared_ptr< ParameterSetgetProcessPSet () const
 get the parameter set
boost::shared_ptr< std::vector
< ParameterSet > > 
getServicesPSets () const
 get the descriptions of the services
 ProcessDesc (std::string const &config)
 construct from the configuration language string
 ProcessDesc (boost::shared_ptr< ParameterSet > pset)
 ~ProcessDesc ()

Private Attributes

boost::shared_ptr< ParameterSetpset_
boost::shared_ptr< std::vector
< ParameterSet > > 
services_

Detailed Description

Definition at line 12 of file ProcessDesc.h.


Constructor & Destructor Documentation

edm::ProcessDesc::ProcessDesc ( boost::shared_ptr< ParameterSet pset) [explicit]

Definition at line 8 of file ProcessDesc.cc.

                                                             :
      pset_(pset), services_(pset_->popVParameterSet(std::string("services")).release()) {
  }
edm::ProcessDesc::ProcessDesc ( std::string const &  config) [explicit]

construct from the configuration language string

Definition at line 12 of file ProcessDesc.cc.

References edm::errors::Configuration, and Exception.

                                           :
      pset_(new ParameterSet),
      services_(new std::vector<ParameterSet>()) {
    throw Exception(errors::Configuration,"Old config strings no longer accepted");
  }
edm::ProcessDesc::~ProcessDesc ( )

Definition at line 18 of file ProcessDesc.cc.

                            {
  }

Member Function Documentation

void edm::ProcessDesc::addDefaultService ( std::string const &  service)

add a service if it's not already there

Definition at line 42 of file ProcessDesc.cc.

References addService(), mergeVDriftHistosByStation::name, and services_.

Referenced by addServices().

                                                              {
    typedef std::vector<ParameterSet>::iterator Iter;
    for(Iter it = services_->begin(), itEnd = services_->end(); it != itEnd; ++it) {
      std::string name = it->getParameter<std::string>("@service_type");
      if (name == service) {
        // Use the configured service.  Don't add a default.
        // However, the service needs to be moved to the front because it is a standard service.
        ParameterSet pset = *it;
        services_->erase(it);
        addService(pset);
        return;
      }
    }
    addService(service);
  }
void edm::ProcessDesc::addForcedService ( std::string const &  service)

add a service and replace it if it's already there

Definition at line 58 of file ProcessDesc.cc.

References addService(), mergeVDriftHistosByStation::name, and services_.

Referenced by addServices().

                                                             {
    typedef std::vector<ParameterSet>::iterator Iter;
    for(Iter it = services_->begin(), itEnd = services_->end(); it != itEnd; ++it) {
      std::string name = it->getParameter<std::string>("@service_type");
      if (name == service) {
        // Remove the configured service before adding the default.
        services_->erase(it);
        break;
      }
    }
    addService(service);
  }
void edm::ProcessDesc::addService ( ParameterSet pset)

Definition at line 31 of file ProcessDesc.cc.

References services_.

Referenced by addDefaultService(), addForcedService(), and addService().

                                                 {
    // The standard services should be initialized first.
    services_->insert(services_->begin(), pset);
  }
void edm::ProcessDesc::addService ( std::string const &  service)

add a service as an empty pset

Definition at line 36 of file ProcessDesc.cc.

References edm::ParameterSet::addParameter(), and addService().

                                                       {
    ParameterSet newpset;
    newpset.addParameter<std::string>("@service_type", service);
    addService(newpset);
  }
void edm::ProcessDesc::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 at line 71 of file ProcessDesc.cc.

References addDefaultService(), addForcedService(), and i.

                                                                            {
    // Add the default services to services_.
    for(std::vector<std::string>::const_iterator i = defaultServices.begin(), iEnd = defaultServices.end();
         i != iEnd; ++i) {
      addDefaultService(*i);
    }
    // Add the forced services to services_.
    for(std::vector<std::string>::const_iterator i = forcedServices.begin(), iEnd = forcedServices.end();
         i != iEnd; ++i) {
      addForcedService(*i);
    }
  }
std::string edm::ProcessDesc::dump ( void  ) const

Definition at line 85 of file ProcessDesc.cc.

References dbtoconf::out, pset_, and services_.

                                    {
    std::string out = pset_->dump();
    for (std::vector<ParameterSet>::const_iterator it = services_->begin(), itEnd = services_->end(); it != itEnd; ++it) {
      out += it->dump();
    }
    return out;
  }
boost::shared_ptr< ParameterSet > edm::ProcessDesc::getProcessPSet ( ) const

get the parameter set

Definition at line 22 of file ProcessDesc.cc.

References pset_.

                                    {
    return pset_;
  }
boost::shared_ptr< std::vector< ParameterSet > > edm::ProcessDesc::getServicesPSets ( ) const

get the descriptions of the services

Definition at line 27 of file ProcessDesc.cc.

References services_.

                                      {
    return services_;
  }

Member Data Documentation

boost::shared_ptr<ParameterSet> edm::ProcessDesc::pset_ [private]

Definition at line 41 of file ProcessDesc.h.

Referenced by dump(), and getProcessPSet().

boost::shared_ptr<std::vector<ParameterSet> > edm::ProcessDesc::services_ [private]

Definition at line 42 of file ProcessDesc.h.

Referenced by addDefaultService(), addForcedService(), addService(), dump(), and getServicesPSets().