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 
13 #include "TClass.h"
14 
15 namespace edm {
17 
19  return typeLabelList_;
20  }
21 
22  void
23  ProductRegistryHelper::addToRegistry(TypeLabelList::const_iterator const& iBegin,
24  TypeLabelList::const_iterator const& iEnd,
25  ModuleDescription const& iDesc,
26  ProductRegistry& iReg,
27  bool iIsListener) {
29  for(TypeLabelList::const_iterator p = iBegin; p != iEnd; ++p) {
30  // This should load the dictionary if not already loaded.
31  TClass::GetClass(p->typeID_.typeInfo());
32  if(!hasDictionary(p->typeID_.typeInfo())) {
33  // a second attempt to load
34  edmplugin::PluginCapabilities::get()->tryToLoad(prefix + p->typeID_.userClassName());
35  }
36  if(!hasDictionary(p->typeID_.typeInfo())) {
38  << "No data dictionary found for class:\n\n"
39  << p->typeID_.className()
40  << "\nMost likely the dictionary was never generated,\n"
41  << "but it may be that it was generated in the wrong package.\n"
42  << "Please add (or move) the specification\n"
43  << "<class name=\"whatever\"/>\n"
44  << "to the appropriate classes_def.xml file.\n"
45  << "If the class is a template instance, you may need\n"
46  << "to define a dummy variable of this type in classes.h.\n"
47  << "Also, if this class has any transient members,\n"
48  << "you need to specify them in classes_def.xml.";
49  }
50  TypeWithDict type(p->typeID_.typeInfo());
51  BranchDescription pdesc(p->branchType_,
52  iDesc.moduleLabel(),
53  iDesc.processName(),
54  p->typeID_.userClassName(),
55  p->typeID_.friendlyClassName(),
56  p->productInstanceName_,
57  iDesc.moduleName(),
58  iDesc.parameterSetID(),
59  type);
60  if (!p->branchAlias_.empty()) pdesc.insertBranchAlias(p->branchAlias_);
61  iReg.addProduct(pdesc, iIsListener);
62  }//for
63  }
64 }
type
Definition: HCALResponse.h:21
std::list< TypeLabelItem > TypeLabelList
std::string const & processName() const
std::string const & moduleName() const
std::string const & dictionaryPlugInPrefix()
std::string const & moduleLabel() const
TypeLabelList & typeLabelList()
used by the fwk to register the list of products of this module
static PluginCapabilities * get()
bool tryToLoad(const std::string &iName)
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)