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::DQMProtobufReader edm::EDInputSource edm::ProducerSourceBase edm::RawInputSource edm::EDFilter edm::EDProducer edm::global::EDFilterBase edm::global::EDProducerBase edm::one::EDFilterBase edm::one::EDProducerBase edm::stream::EDFilterBase edm::stream::EDProducerBase

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 19 of file ProductRegistryHelper.h.

Member Typedef Documentation

Definition at line 38 of file ProductRegistryHelper.h.

Constructor & Destructor Documentation

edm::ProductRegistryHelper::ProductRegistryHelper ( )
inline

Definition at line 22 of file ProductRegistryHelper.h.

edm::ProductRegistryHelper::~ProductRegistryHelper ( )

Definition at line 14 of file ProductRegistryHelper.cc.

14 { }

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 21 of file ProductRegistryHelper.cc.

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

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

25  {
27  for(TypeLabelList::const_iterator p = iBegin; p != iEnd; ++p) {
28  TypeWithDict type(p->typeID_.typeInfo());
29  if(!type.hasDictionary()) {
30  //attempt to load
31  edmplugin::PluginCapabilities::get()->tryToLoad(prefix + p->typeID_.userClassName());
32  }
33  BranchDescription pdesc(p->branchType_,
34  iDesc.moduleLabel(),
35  iDesc.processName(),
36  p->typeID_.userClassName(),
37  p->typeID_.friendlyClassName(),
38  p->productInstanceName_,
39  iDesc.moduleName(),
40  iDesc.parameterSetID(),
41  type);
42  if (!p->branchAlias_.empty()) pdesc.insertBranchAlias(p->branchAlias_);
43  iReg.addProduct(pdesc, iIsListener);
44  }//for
45  }
type
Definition: HCALResponse.h:21
std::string const & dictionaryPlugInPrefix()
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 59 of file ProductRegistryHelper.h.

References AlCaHLTBitMon_QueryRunRegistry::string.

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

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

Definition at line 64 of file ProductRegistryHelper.h.

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

Definition at line 69 of file ProductRegistryHelper.h.

References AlCaHLTBitMon_QueryRunRegistry::string.

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

Definition at line 74 of file ProductRegistryHelper.h.

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

Definition at line 80 of file ProductRegistryHelper.h.

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

Definition at line 85 of file ProductRegistryHelper.h.

References typeLabelList_.

85  {
86  typeLabelList_.emplace_back(B, id, instanceName);
87  return *typeLabelList_.rbegin();
88  }
ProductRegistryHelper::TypeLabelList & edm::ProductRegistryHelper::typeLabelList ( )

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

Definition at line 16 of file ProductRegistryHelper.cc.

References typeLabelList_.

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

16  {
17  return typeLabelList_;
18  }

Member Data Documentation

TypeLabelList edm::ProductRegistryHelper::typeLabelList_
private

Definition at line 90 of file ProductRegistryHelper.h.

Referenced by produces(), and typeLabelList().