CMS 3D CMS Logo

Classes | Public Member Functions | Private Member Functions | Private Attributes

edm::ProcessConfiguration Class Reference

#include <ProcessConfiguration.h>

List of all members.

Classes

struct  Transients

Public Member Functions

ProcessConfigurationID id () const
void initializeTransients () const
bool isParameterSetValid () const
ParameterSetID const & parameterSetID () const
PassID const & passID () const
 ProcessConfiguration ()
 ProcessConfiguration (std::string const &procName, ReleaseVersion const &relVersion, PassID const &pass)
 ProcessConfiguration (std::string const &procName, ParameterSetID const &pSetID, ReleaseVersion const &relVersion, PassID const &pass)
std::string const & processName () const
void reduce ()
ReleaseVersion const & releaseVersion () const
void setParameterSetID (ParameterSetID const &pSetID)

Private Member Functions

bool & isCurrentProcess () const
ProcessConfigurationIDpcid () const

Private Attributes

ParameterSetID parameterSetID_
PassID passID_
std::string processName_
ReleaseVersion releaseVersion_
Transients transient_

Detailed Description

Definition at line 13 of file ProcessConfiguration.h.


Constructor & Destructor Documentation

edm::ProcessConfiguration::ProcessConfiguration ( )

Definition at line 17 of file ProcessConfiguration.cc.

edm::ProcessConfiguration::ProcessConfiguration ( std::string const &  procName,
ReleaseVersion const &  relVersion,
PassID const &  pass 
)

Definition at line 29 of file ProcessConfiguration.cc.

References isCurrentProcess().

                                            :
      processName_(procName),
      parameterSetID_(),
      releaseVersion_(relVersion),
      passID_(pass) { isCurrentProcess() = true; }
edm::ProcessConfiguration::ProcessConfiguration ( std::string const &  procName,
ParameterSetID const &  pSetID,
ReleaseVersion const &  relVersion,
PassID const &  pass 
)

Definition at line 19 of file ProcessConfiguration.cc.

                                            :
      processName_(procName),
      parameterSetID_(pSetID),
      releaseVersion_(relVersion),
      passID_(pass) { }

Member Function Documentation

ProcessConfigurationID edm::ProcessConfiguration::id ( void  ) const

Definition at line 54 of file ProcessConfiguration.cc.

References cms::Digest::digest(), pcid(), AlCaHLTBitMon_QueryRunRegistry::string, edm::Hash< I >::swap(), and tmp.

Referenced by edm::fillProductRegistryTransients(), edm::Provenance::processConfigurationID(), and edm::ModuleDescription::processConfigurationID().

                                 {
    if(pcid().isValid()) {
      return pcid();
    }
    // This implementation is ripe for optimization.
    std::ostringstream oss;
    oss << *this;
    std::string stringrep = oss.str();
    cms::Digest md5alg(stringrep);
    ProcessConfigurationID tmp(md5alg.digest().toString());
    pcid().swap(tmp);
    return pcid();
  }
void edm::ProcessConfiguration::initializeTransients ( ) const [inline]
bool& edm::ProcessConfiguration::isCurrentProcess ( ) const [inline, private]
bool edm::ProcessConfiguration::isParameterSetValid ( ) const [inline]

Definition at line 27 of file ProcessConfiguration.h.

References edm::Hash< I >::isValid(), and parameterSetID_.

{return parameterSetID_.isValid();}
ParameterSetID const & edm::ProcessConfiguration::parameterSetID ( ) const

Definition at line 39 of file ProcessConfiguration.cc.

References Exception, isCurrentProcess(), edm::errors::LogicError, and parameterSetID_.

Referenced by edm::fillProductRegistryTransients(), edm::Event::getProcessParameterSet(), edm::ModuleDescription::mainParameterSetID(), edm::operator<(), edm::operator<<(), and edm::operator==().

                                             {
    if (parameterSetID_ == ParameterSetID() && isCurrentProcess()) {     
      throw edm::Exception(errors::LogicError)   
        << "Illegal attempt to access the process top level parameter set ID\n"          
        << "from the ProcessConfiguration before that parameter\n"       
        << "set has been frozen and registered.  The parameter set\n"    
        << "can be changed during module validation, which occurs\n"     
        << "concurrently with module construction.  The ID of the\n"     
        << "ProcessConfiguration itself also depends on that parameter\n"        
        << "set ID.  It is illegal to access either before they are frozen.\n";          
    }
    return parameterSetID_;
  }
PassID const& edm::ProcessConfiguration::passID ( ) const [inline]

Definition at line 29 of file ProcessConfiguration.h.

References passID_.

Referenced by edm::operator<(), edm::operator<<(), edm::operator==(), and edm::ModuleDescription::passID().

{return passID_;}
ProcessConfigurationID& edm::ProcessConfiguration::pcid ( ) const [inline, private]

Definition at line 50 of file ProcessConfiguration.h.

References edm::ProcessConfiguration::Transients::pcid_, and transient_.

Referenced by id(), and reduce().

{return transient_.pcid_;}
std::string const& edm::ProcessConfiguration::processName ( ) const [inline]
void edm::ProcessConfiguration::reduce ( )

Definition at line 75 of file ProcessConfiguration.cc.

References pcid(), and releaseVersion_.

                               {
    // Skip to the part of the release version just after
    // the first two numbers and erase the rest of it.
    std::string::iterator iter = releaseVersion_.begin();
    std::string::iterator iEnd = releaseVersion_.end();
    while(iter != iEnd && isdigit(*iter) == 0) ++iter;
    while(iter != iEnd && isdigit(*iter) != 0) ++iter;
    while(iter != iEnd && isdigit(*iter) == 0) ++iter;
    while(iter != iEnd && isdigit(*iter) != 0) ++iter;
    if (iter == iEnd) return;
    pcid() = ProcessConfigurationID();
    releaseVersion_.erase(iter,iEnd);
  }
ReleaseVersion const& edm::ProcessConfiguration::releaseVersion ( ) const [inline]
void edm::ProcessConfiguration::setParameterSetID ( ParameterSetID const &  pSetID)

Definition at line 69 of file ProcessConfiguration.cc.

References parameterSetID_.

                                                                      {
    assert(parameterSetID_ == ParameterSetID());
    parameterSetID_ = pSetID;
  }

Member Data Documentation

Definition at line 54 of file ProcessConfiguration.h.

Referenced by isParameterSetValid(), parameterSetID(), and setParameterSetID().

Definition at line 56 of file ProcessConfiguration.h.

Referenced by passID().

Definition at line 53 of file ProcessConfiguration.h.

Referenced by processName().

Definition at line 55 of file ProcessConfiguration.h.

Referenced by reduce(), and releaseVersion().

Definition at line 57 of file ProcessConfiguration.h.

Referenced by initializeTransients(), isCurrentProcess(), and pcid().