CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_1/src/FWCore/Framework/src/SourceFactory.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // Package:     Framework
00004 // Class  :     SourceFactory
00005 // 
00006 // Implementation:
00007 //     <Notes on implementation>
00008 //
00009 // Author:      Chris Jones
00010 // Created:     Wed May 25 19:27:37 EDT 2005
00011 // $Id: SourceFactory.cc,v 1.8 2012/06/06 15:51:21 wdd Exp $
00012 //
00013 
00014 // system include files
00015 
00016 // user include files
00017 #include "FWCore/Framework/interface/SourceFactory.h"
00018 #include "FWCore/Framework/src/EventSetupsController.h"
00019 #include "FWCore/Utilities/interface/EDMException.h"
00020 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00021 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00022 
00023 //
00024 // static member functions
00025 //
00026 namespace edm {
00027    namespace eventsetup {
00028 
00029       std::string SourceMakerTraits::name() { return "CMS EDM Framework ESSource"; }
00030 
00031       void 
00032       SourceMakerTraits::replaceExisting(EventSetupProvider& iProvider, boost::shared_ptr<EventSetupRecordIntervalFinder> iComponent) {
00033          throw edm::Exception(edm::errors::LogicError)
00034             << "SourceMakerTraits::replaceExisting\n"
00035             << "This function is not implemented and should never be called.\n"
00036             << "Please report this to a Framework Developer\n";
00037       }
00038 
00039       boost::shared_ptr<SourceMakerTraits::base_type>
00040       SourceMakerTraits::getComponentAndRegisterProcess(EventSetupsController& esController,
00041                                                         ParameterSet const& iConfiguration) {
00042          return esController.getESSourceAndRegisterProcess(iConfiguration, esController.indexOfNextProcess());
00043       }
00044 
00045       void SourceMakerTraits::putComponent(EventSetupsController& esController,
00046                                            ParameterSet const& iConfiguration,
00047                                            boost::shared_ptr<base_type> const& component) {
00048          esController.putESSource(iConfiguration, component, esController.indexOfNextProcess());
00049       }
00050 
00051       void SourceMakerTraits::logInfoWhenSharing(ParameterSet const& iConfiguration) {
00052 
00053          std::string edmtype = iConfiguration.getParameter<std::string>("@module_edm_type");
00054          std::string modtype = iConfiguration.getParameter<std::string>("@module_type");
00055          std::string label = iConfiguration.getParameter<std::string>("@module_label");
00056          edm::LogVerbatim("EventSetupSharing") << "Sharing " << edmtype << ": class=" << modtype << " label='" << label << "'";
00057       }
00058    }
00059 }
00060 
00061 COMPONENTFACTORY_GET(edm::eventsetup::SourceMakerTraits);