CMS 3D CMS Logo

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.

References ~ProductRegistryHelper().

edm::ProductRegistryHelper::~ProductRegistryHelper ( )

Definition at line 15 of file ProductRegistryHelper.cc.

Referenced by ProductRegistryHelper().

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::checkClassDictionaries(), edm::checkDictionary(), edm::checkDictionaryOfWrappedType(), edm::BranchDescription::insertBranchAlias(), edm::ModuleDescription::moduleLabel(), edm::ModuleDescription::moduleName(), AlCaHLTBitMon_ParallelJobs::p, edm::ModuleDescription::parameterSetID(), edm::ModuleDescription::processName(), AlCaHLTBitMon_QueryRunRegistry::string, and edm::throwMissingDictionariesException().

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

26  {
27 
28  std::vector<std::string> missingDictionaries;
29  std::vector<std::string> producedTypes;
30 
31  for(TypeLabelList::const_iterator p = iBegin; p != iEnd; ++p) {
32 
33  if (!checkDictionary(missingDictionaries, p->typeID_)) {
34  checkDictionaryOfWrappedType(missingDictionaries, p->typeID_);
35  producedTypes.emplace_back(p->typeID_.className());
36  continue;
37  }
38 
39  TypeWithDict type(p->typeID_.typeInfo());
40  BranchDescription pdesc(p->branchType_,
41  iDesc.moduleLabel(),
42  iDesc.processName(),
43  p->typeID_.userClassName(),
44  p->typeID_.friendlyClassName(),
45  p->productInstanceName_,
46  iDesc.moduleName(),
47  iDesc.parameterSetID(),
48  type);
49 
50  if (pdesc.transient()) {
51  if (!checkDictionary(missingDictionaries, pdesc.wrappedName(), pdesc.wrappedType())) {
52  // It is should be impossible to get here, because the only way to
53  // make it transient is in the line that causes the wrapped dictionary
54  // to be created. Just to be safe I leave this check here ...
55  producedTypes.emplace_back(pdesc.className());
56  continue;
57  }
58  } else {
59  // also check constituents of wrapped types if it is not transient
60  if (!checkClassDictionaries(missingDictionaries, pdesc.wrappedName(), pdesc.wrappedType())) {
61  producedTypes.emplace_back(pdesc.className());
62  continue;
63  }
64  }
65  if (!p->branchAlias_.empty()) pdesc.insertBranchAlias(p->branchAlias_);
66  iReg.addProduct(pdesc, iIsListener);
67  }
68 
69  if (!missingDictionaries.empty()) {
70  std::string context("Calling ProductRegistryHelper::addToRegistry, checking dictionaries for produced types");
71  throwMissingDictionariesException(missingDictionaries, context, producedTypes);
72  }
73  }
type
Definition: HCALResponse.h:21
void throwMissingDictionariesException(std::vector< std::string > &missingDictionaries, std::string const &context)
bool checkDictionary(std::vector< std::string > &missingDictionaries, TypeID const &typeID)
bool checkClassDictionaries(std::vector< std::string > &missingDictionaries, TypeID const &typeID)
bool checkDictionaryOfWrappedType(std::vector< std::string > &missingDictionaries, TypeID const &unwrappedTypeID)
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(), edm::InputSource::luminosityBlockAuxiliary(), MuonProducer::MuonProducer(), hitTripletEDProducerT::ImplSeedingHitSets::produces(), hitTripletEDProducerT::ImplIntermediateHitTriplets::produces(), 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.

References MuonErrorMatrixAdjuster_cfi::instanceName.

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.

References MuonErrorMatrixAdjuster_cfi::instanceName.

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
template<BranchType B>
TypeLabelItem const& edm::ProductRegistryHelper::produces ( const TypeID id,
std::string const &  instanceName = std::string() 
)
inline
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::InputSource::luminosityBlockAuxiliary(), edm::ProducerBase::registerProducts(), edm::InputSource::registerProducts(), and edm::ProducerBase::registrationCallback().

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().