CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ProductRegistryHelper.cc
Go to the documentation of this file.
1 /*----------------------------------------------------------------------
2 
3 ----------------------------------------------------------------------*/
4 
12 #include "TClass.h"
13 
14 namespace edm {
16 
18  return typeLabelList_;
19  }
20 
21  void
22  ProductRegistryHelper::addToRegistry(TypeLabelList::const_iterator const& iBegin,
23  TypeLabelList::const_iterator const& iEnd,
24  ModuleDescription const& iDesc,
25  ProductRegistry& iReg,
26  bool iIsListener) {
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  }
62 }
type
Definition: HCALResponse.h:21
std::list< TypeLabelItem > TypeLabelList
std::string const & processName() const
std::string const & moduleName() const
std::string const & moduleLabel() const
static TypeWithDict byName(std::string const &name)
Definition: TypeWithDict.cc:60
TypeLabelList & typeLabelList()
used by the fwk to register the list of products of this module
ParameterSetID const & parameterSetID() const
bool hasDictionary(std::type_info const &)
static void addToRegistry(TypeLabelList::const_iterator const &iBegin, TypeLabelList::const_iterator const &iEnd, ModuleDescription const &iDesc, ProductRegistry &iReg, bool iIsListener=false)
void addProduct(BranchDescription const &productdesc, bool iFromListener=false)
void insertBranchAlias(std::string const &alias)