CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_9/src/FWCore/Framework/src/ProductRegistryHelper.cc

Go to the documentation of this file.
00001 /*----------------------------------------------------------------------
00002 
00003 ----------------------------------------------------------------------*/
00004 
00005 #include "FWCore/Framework/interface/ProductRegistryHelper.h"
00006 #include "FWCore/PluginManager/interface/PluginCapabilities.h"
00007 #include "DataFormats/Provenance/interface/ProductRegistry.h"
00008 #include "DataFormats/Provenance/interface/BranchDescription.h"
00009 #include "DataFormats/Provenance/interface/ModuleDescription.h"
00010 
00011 namespace edm {
00012   ProductRegistryHelper::~ProductRegistryHelper() { }
00013 
00014   ProductRegistryHelper::TypeLabelList & ProductRegistryHelper::typeLabelList() {
00015     return typeLabelList_;
00016   }
00017 
00018   void
00019   ProductRegistryHelper::addToRegistry(TypeLabelList::const_iterator const& iBegin,
00020                                        TypeLabelList::const_iterator const& iEnd,
00021                                        ModuleDescription const& iDesc,
00022                                        ProductRegistry& iReg,
00023                                        bool iIsListener) {
00024     std::string const prefix("LCGReflex/");
00025     Reflex::Type null;
00026     for(TypeLabelList::const_iterator p = iBegin; p != iEnd; ++p) {
00027       if(null == Reflex::Type::ByName(p->typeID_.userClassName()) ) {
00028         //attempt to load
00029         edmplugin::PluginCapabilities::get()->tryToLoad(prefix + p->typeID_.userClassName());
00030       }
00031       BranchDescription pdesc(p->branchType_,
00032                               iDesc.moduleLabel(),
00033                               iDesc.processName(),
00034                               p->typeID_.userClassName(),
00035                               p->typeID_.friendlyClassName(),
00036                               p->productInstanceName_,
00037                               iDesc.moduleName(),
00038                               iDesc.parameterSetID(),
00039                               p->typeID_);
00040       if (!p->branchAlias_.empty()) pdesc.branchAliases().insert(p->branchAlias_);
00041       iReg.addProduct(pdesc, iIsListener);
00042     }//for
00043   }
00044 }