CMS 3D CMS Logo

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

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // Package:     Framework
00004 // Class  :     ModuleFactory
00005 // 
00006 // Implementation:
00007 //     <Notes on implementation>
00008 //
00009 // Author:      Chris Jones
00010 // Created:     Wed May 25 19:27:44 EDT 2005
00011 // $Id: ModuleFactory.cc,v 1.7 2012/06/06 15:51:21 wdd Exp $
00012 //
00013 
00014 // system include files
00015 
00016 // user include files
00017 #include "FWCore/Framework/interface/ModuleFactory.h"
00018 #include "FWCore/Framework/interface/EventSetupProvider.h"
00019 #include "FWCore/Framework/src/EventSetupsController.h"
00020 
00021 //
00022 // constants, enums and typedefs
00023 //
00024 namespace edm {
00025    namespace eventsetup {
00026 
00027 //
00028 // static member functions
00029 //
00030       std::string ModuleMakerTraits::name() { return "CMS EDM Framework ESModule"; }
00031       void ModuleMakerTraits::addTo(EventSetupProvider& iProvider,
00032                                     boost::shared_ptr<DataProxyProvider> iComponent,
00033                                     ParameterSet const&,
00034                                     bool) 
00035       {
00036          iProvider.add(iComponent);
00037       }
00038 
00039       void ModuleMakerTraits::replaceExisting(EventSetupProvider& iProvider, boost::shared_ptr<DataProxyProvider> iComponent) 
00040       {
00041          iProvider.replaceExisting(iComponent);
00042       }
00043 
00044       boost::shared_ptr<ModuleMakerTraits::base_type>
00045       ModuleMakerTraits::getComponentAndRegisterProcess(EventSetupsController& esController,
00046                                                         ParameterSet const& iConfiguration) {
00047          return esController.getESProducerAndRegisterProcess(iConfiguration, esController.indexOfNextProcess());
00048       }
00049 
00050       void ModuleMakerTraits::putComponent(EventSetupsController& esController,
00051                                            ParameterSet const& iConfiguration,
00052                                            boost::shared_ptr<base_type> const& component) {
00053          esController.putESProducer(iConfiguration, component, esController.indexOfNextProcess());
00054       }
00055    }
00056 }
00057 COMPONENTFACTORY_GET(edm::eventsetup::ModuleMakerTraits);