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