CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ClassFiller.cc
Go to the documentation of this file.
8 
9 
10 #include "TClass.h"
11 
12 #include <string>
13 #include <set>
14 #include <algorithm>
15 #include <iostream>
16 
17 namespace edm {
18  void loadType(TypeID const& type) {
19  checkClassDictionaries(type, true);
20  if (!missingTypes().empty()) {
22  missingTypes().clear();
23  for_all(missing, loadType);
24  }
25  }
26 
27  void loadCap(std::string const& name) {
28  FDEBUG(1) << "Loading dictionary for " << name << "\n";
30  TClass* cl = TClass::GetClass(name.c_str());
31  loadType(TypeID(*cl->GetTypeInfo()));
32  }
33 
35  FDEBUG(3) << "doing BuildRealData for " << name << "\n";
36  TClass* ttest = TClass::GetClass(name.c_str());
37  if (ttest != 0) {
38  ttest->BuildRealData();
39  } else {
41  << "Could not find TClass for " << name << "\n";
42  }
43  }
44  // ---------------------
45 
47  static bool done = false;
48  if (done == false) {
49  loadCap(std::string("edm::StreamedProduct"));
50  loadCap(std::string("std::vector<edm::StreamedProduct>"));
51  loadCap(std::string("edm::SendEvent"));
52  loadCap(std::string("std::vector<edm::BranchDescription>"));
53  loadCap(std::string("edm::SendJobHeader"));
54  }
55  done=true;
56  }
57 
58  namespace {
59  TClass* getRootClass(std::string const& name) {
60  TClass* tc = TClass::GetClass(name.c_str());
61 
62  // get ROOT TClass for this product
63  // CINT::Type* cint_type = CINT::Type::get(typ_ref);
64  // tc_ = cint_type->rootClass();
65  // TClass* tc = TClass::GetClass(typeid(se));
66  // tc_ = TClass::GetClass("edm::SendEvent");
67 
68  if(tc == 0) {
69  throw edm::Exception(errors::Configuration,"getRootClass")
70  << "could not find TClass for " << name
71  << "\n";
72  }
73 
74  return tc;
75  }
76  }
77 
78  // ---------------------
79  TClass* getTClass(std::type_info const& ti) {
80  TypeID const type(ti);
81  return getRootClass(type.className());
82  }
83 }
type
Definition: HCALResponse.h:21
dictionary missing
Definition: combine.py:4
void loadType(TypeID const &type)
Definition: ClassFiller.cc:18
void checkClassDictionaries(TypeID const &type, bool recursive=true)
void doBuildRealData(const std::string &name)
Definition: ClassFiller.cc:34
std::string const & dictionaryPlugInPrefix()
#define FDEBUG(lev)
Definition: DebugMacros.h:18
TClass * getTClass(const std::type_info &ti)
Definition: ClassFiller.cc:79
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:16
std::set< TypeID > TypeSet
static PluginCapabilities * get()
TypeSet & missingTypes()
std::string const & className() const
Definition: TypeID.cc:46
void load(const std::string &iName)
void loadExtraClasses()
Definition: ClassFiller.cc:46
void loadCap(const std::string &name)
Definition: ClassFiller.cc:27