CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch9/src/FWCore/Framework/interface/ModuleFactory.h

Go to the documentation of this file.
00001 #ifndef FWCore_Framework_ModuleFactory_h
00002 #define FWCore_Framework_ModuleFactory_h
00003 // -*- C++ -*-
00004 //
00005 // Package:     Framework
00006 // Class  :     ModuleFactory
00007 // 
00016 //
00017 // Author:      Chris Jones
00018 // Created:     Wed May 25 18:01:31 EDT 2005
00019 //
00020 
00021 // system include files
00022 #include <string>
00023 #include "boost/shared_ptr.hpp"
00024 
00025 // user include files
00026 #include "FWCore/Framework/interface/ComponentFactory.h"
00027 #include "FWCore/ParameterSet/interface/ParameterSetDescriptionFillerPluginFactory.h"
00028 
00029 // forward declarations
00030 namespace edm {
00031    namespace eventsetup {
00032       class DataProxyProvider;
00033 
00034       struct ModuleMakerTraits {
00035          typedef DataProxyProvider base_type;
00036         
00037          static std::string name();
00038          static void addTo(EventSetupProvider& iProvider, boost::shared_ptr<DataProxyProvider> iComponent) ;
00039       };
00040       template< class TType>
00041          struct ModuleMaker : public ComponentMaker<edm::eventsetup::ModuleMakerTraits,TType> {};
00042       
00043       typedef  ComponentFactory<ModuleMakerTraits> ModuleFactory ;
00044       typedef edmplugin::PluginFactory<edm::eventsetup::ComponentMakerBase<ModuleMakerTraits>* ()> ModulePluginFactory;
00045    }
00046 }
00047 
00048 #define DEFINE_FWK_EVENTSETUP_MODULE(type) \
00049 DEFINE_EDM_PLUGIN (edm::eventsetup::ModulePluginFactory,edm::eventsetup::ModuleMaker<type>,#type); \
00050 DEFINE_DESC_FILLER_FOR_ESPRODUCERS(type)
00051 
00052 #endif
00053