CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Attributes
edm::ProductRegistryHelper Class Reference

#include <ProductRegistryHelper.h>

Inheritance diagram for edm::ProductRegistryHelper:
edm::InputSource edm::ProducerBase DQMRootSource edm::ConfigurableInputSource edm::DaqSource edm::EDInputSource edm::RawInputSource edm::StreamerInputSource edm::EDFilter edm::EDProducer

Classes

struct  TypeLabelItem
 

Public Types

typedef std::list< TypeLabelItemTypeLabelList
 

Public Member Functions

template<class ProductType >
TypeLabelItem const & produces ()
 declare what type of product will make and with which optional label More...
 
template<class ProductType >
TypeLabelItem const & produces (std::string const &instanceName)
 
template<typename ProductType , BranchType B>
TypeLabelItem const & produces ()
 
template<typename ProductType , BranchType B>
TypeLabelItem const & produces (std::string const &instanceName)
 
TypeLabelItem const & produces (const TypeID &id, std::string const &instanceName=std::string())
 
template<BranchType B>
TypeLabelItem const & produces (const TypeID &id, std::string const &instanceName=std::string())
 
 ProductRegistryHelper ()
 
TypeLabelListtypeLabelList ()
 used by the fwk to register the list of products of this module More...
 
 ~ProductRegistryHelper ()
 

Static Public Member Functions

static void addToRegistry (TypeLabelList::const_iterator const &iBegin, TypeLabelList::const_iterator const &iEnd, ModuleDescription const &iDesc, ProductRegistry &iReg, bool iIsListener=false)
 

Private Attributes

TypeLabelList typeLabelList_
 

Detailed Description

Definition at line 22 of file ProductRegistryHelper.h.

Member Typedef Documentation

Definition at line 41 of file ProductRegistryHelper.h.

Constructor & Destructor Documentation

edm::ProductRegistryHelper::ProductRegistryHelper ( )
inline

Definition at line 25 of file ProductRegistryHelper.h.

edm::ProductRegistryHelper::~ProductRegistryHelper ( )

Definition at line 12 of file ProductRegistryHelper.cc.

12 { }

Member Function Documentation

void edm::ProductRegistryHelper::addToRegistry ( TypeLabelList::const_iterator const &  iBegin,
TypeLabelList::const_iterator const &  iEnd,
ModuleDescription const &  iDesc,
ProductRegistry iReg,
bool  iIsListener = false 
)
static

Definition at line 19 of file ProductRegistryHelper.cc.

References edm::ProductRegistry::addProduct(), edm::BranchDescription::branchAliases(), edmplugin::PluginCapabilities::get(), edm::ModuleDescription::moduleLabel(), edm::ModuleDescription::moduleName(), AlCaHLTBitMon_ParallelJobs::p, edm::ModuleDescription::parameterSetID(), prof2calltree::prefix, edm::ModuleDescription::processName(), and edmplugin::PluginCapabilities::tryToLoad().

Referenced by edm::ProducerBase::registerProducts(), and edm::InputSource::registerProducts().

23  {
24  std::string const prefix("LCGReflex/");
25  Reflex::Type null;
26  for(TypeLabelList::const_iterator p = iBegin; p != iEnd; ++p) {
27  if(null == Reflex::Type::ByName(p->typeID_.userClassName()) ) {
28  //attempt to load
29  edmplugin::PluginCapabilities::get()->tryToLoad(prefix + p->typeID_.userClassName());
30  }
31  BranchDescription pdesc(p->branchType_,
32  iDesc.moduleLabel(),
33  iDesc.processName(),
34  p->typeID_.userClassName(),
35  p->typeID_.friendlyClassName(),
36  p->productInstanceName_,
37  iDesc.moduleName(),
38  iDesc.parameterSetID(),
39  p->typeID_);
40  if (!p->branchAlias_.empty()) pdesc.branchAliases().insert(p->branchAlias_);
41  iReg.addProduct(pdesc, iIsListener);
42  }//for
43  }
static PluginCapabilities * get()
bool tryToLoad(const std::string &iName)
template<class ProductType >
TypeLabelItem const& edm::ProductRegistryHelper::produces ( )
inline

declare what type of product will make and with which optional label

the statement

produces<ProductType>("optlabel");

should be added to the producer ctor for every product

Definition at line 62 of file ProductRegistryHelper.h.

Referenced by GoodSeedProducer::GoodSeedProducer(), and MuonProducer::MuonProducer().

62  {
63  return produces<ProductType, InEvent>(std::string());
64  }
template<class ProductType >
TypeLabelItem const& edm::ProductRegistryHelper::produces ( std::string const &  instanceName)
inline

Definition at line 67 of file ProductRegistryHelper.h.

67  {
68  return produces<ProductType, InEvent>(instanceName);
69  }
template<typename ProductType , BranchType B>
TypeLabelItem const& edm::ProductRegistryHelper::produces ( )
inline

Definition at line 72 of file ProductRegistryHelper.h.

72  {
73  return produces<ProductType, B>(std::string());
74  }
template<typename ProductType , BranchType B>
TypeLabelItem const& edm::ProductRegistryHelper::produces ( std::string const &  instanceName)
inline

Definition at line 77 of file ProductRegistryHelper.h.

77  {
78  TypeID tid(typeid(ProductType));
79  return produces<B>(tid,instanceName);
80  }
TypeLabelItem const& edm::ProductRegistryHelper::produces ( const TypeID id,
std::string const &  instanceName = std::string() 
)
inline

Definition at line 83 of file ProductRegistryHelper.h.

References errorMatrix2Lands_multiChannel::id.

83  {
84  return produces<InEvent>(id,instanceName);
85  }
template<BranchType B>
TypeLabelItem const& edm::ProductRegistryHelper::produces ( const TypeID id,
std::string const &  instanceName = std::string() 
)
inline

Definition at line 88 of file ProductRegistryHelper.h.

References typeLabelList_.

88  {
89  TypeLabelItem tli(B, id, instanceName);
90  typeLabelList_.push_back(tli);
91  return *typeLabelList_.rbegin();
92  }
ProductRegistryHelper::TypeLabelList & edm::ProductRegistryHelper::typeLabelList ( )

used by the fwk to register the list of products of this module

Definition at line 14 of file ProductRegistryHelper.cc.

References typeLabelList_.

Referenced by edm::ProducerBase::registerProducts(), and edm::InputSource::registerProducts().

14  {
15  return typeLabelList_;
16  }

Member Data Documentation

TypeLabelList edm::ProductRegistryHelper::typeLabelList_
private

Definition at line 94 of file ProductRegistryHelper.h.

Referenced by produces(), and typeLabelList().