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 dqmservices::DQMProtobufReader edm::PoolSource 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 18 of file ProductRegistryHelper.h.

Member Typedef Documentation

Definition at line 37 of file ProductRegistryHelper.h.

Constructor & Destructor Documentation

edm::ProductRegistryHelper::ProductRegistryHelper ( )
inline

Definition at line 21 of file ProductRegistryHelper.h.

edm::ProductRegistryHelper::~ProductRegistryHelper ( )

Definition at line 15 of file ProductRegistryHelper.cc.

15 { }

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

References edm::ProductRegistry::addProduct(), edm::TypeWithDict::byName(), edm::errors::DictionaryNotFound, Exception, edm::hasDictionary(), edm::BranchDescription::insertBranchAlias(), edm::ModuleDescription::moduleLabel(), edm::ModuleDescription::moduleName(), AlCaHLTBitMon_ParallelJobs::p, edm::ModuleDescription::parameterSetID(), and edm::ModuleDescription::processName().

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

26  {
27  for(TypeLabelList::const_iterator p = iBegin; p != iEnd; ++p) {
28  // This should load the dictionary if not already loaded.
29  TClass::GetClass(p->typeID_.typeInfo());
30  if(!hasDictionary(p->typeID_.typeInfo())) {
31  // a second attempt to load
32  TypeWithDict::byName(p->typeID_.userClassName());
33  }
34  if(!hasDictionary(p->typeID_.typeInfo())) {
36  << "No data dictionary found for class:\n\n"
37  << p->typeID_.className()
38  << "\nMost likely the dictionary was never generated,\n"
39  << "but it may be that it was generated in the wrong package.\n"
40  << "Please add (or move) the specification\n"
41  << "<class name=\"whatever\"/>\n"
42  << "to the appropriate classes_def.xml file.\n"
43  << "If the class is a template instance, you may need\n"
44  << "to define a dummy variable of this type in classes.h.\n"
45  << "Also, if this class has any transient members,\n"
46  << "you need to specify them in classes_def.xml.";
47  }
48  TypeWithDict type(p->typeID_.typeInfo());
49  BranchDescription pdesc(p->branchType_,
50  iDesc.moduleLabel(),
51  iDesc.processName(),
52  p->typeID_.userClassName(),
53  p->typeID_.friendlyClassName(),
54  p->productInstanceName_,
55  iDesc.moduleName(),
56  iDesc.parameterSetID(),
57  type);
58  if (!p->branchAlias_.empty()) pdesc.insertBranchAlias(p->branchAlias_);
59  iReg.addProduct(pdesc, iIsListener);
60  }//for
61  }
type
Definition: HCALResponse.h:21
static TypeWithDict byName(std::string const &name)
Definition: TypeWithDict.cc:60
bool hasDictionary(std::type_info const &)
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 58 of file ProductRegistryHelper.h.

References AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by GoodSeedProducer::GoodSeedProducer(), MuonProducer::MuonProducer(), PFCandidateMixer::PFCandidateMixer(), VariableNTupler::registerleaves(), and StringBasedNTupler::registerleaves().

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

Definition at line 63 of file ProductRegistryHelper.h.

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

Definition at line 68 of file ProductRegistryHelper.h.

References AlCaHLTBitMon_QueryRunRegistry::string.

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

Definition at line 73 of file ProductRegistryHelper.h.

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

Definition at line 79 of file ProductRegistryHelper.h.

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

Definition at line 84 of file ProductRegistryHelper.h.

References typeLabelList_.

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

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

Definition at line 17 of file ProductRegistryHelper.cc.

References typeLabelList_.

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

17  {
18  return typeLabelList_;
19  }

Member Data Documentation

TypeLabelList edm::ProductRegistryHelper::typeLabelList_
private

Definition at line 89 of file ProductRegistryHelper.h.

Referenced by produces(), and typeLabelList().