CMS 3D CMS Logo

ClassFiller.cc
Go to the documentation of this file.
7 
8 #include "TClass.h"
9 
10 #include <set>
11 #include <algorithm>
12 #include <iostream>
13 
14 namespace edm {
15 
16  bool loadCap(std::string const& name, std::vector<std::string>& missingDictionaries) {
17  FDEBUG(1) << "Loading dictionary for " << name << "\n";
18  TypeWithDict typeWithDict = TypeWithDict::byName(name);
19  return checkClassDictionaries(missingDictionaries, name, typeWithDict);
20  }
21 
23  FDEBUG(3) << "doing BuildRealData for " << name << "\n";
24  TClass* ttest = TClass::GetClass(name.c_str());
25  if (ttest != nullptr) {
26  ttest->BuildRealData();
27  } else {
29  << "Could not find TClass for " << name << "\n";
30  }
31  }
32  // ---------------------
33 
35  static bool done = false;
36  if (done == false) {
37  std::vector<std::string> missingDictionaries;
38  loadCap(std::string("edm::StreamedProduct"), missingDictionaries);
39  loadCap(std::string("std::vector<edm::StreamedProduct>"), missingDictionaries);
40  loadCap(std::string("edm::SendEvent"), missingDictionaries);
41  loadCap(std::string("std::vector<edm::BranchDescription>"), missingDictionaries);
42  loadCap(std::string("edm::SendJobHeader"), missingDictionaries);
43  if (!missingDictionaries.empty()) {
44  std::string context("Calling loadExtraClasses, checking dictionaries");
45  throwMissingDictionariesException(missingDictionaries, context);
46  }
47  }
48  done=true;
49  }
50 
51  namespace {
52  TClass* getRootClass(std::string const& name) {
53  TClass* tc = TClass::GetClass(name.c_str());
54 
55  if(tc == nullptr) {
56  throw edm::Exception(errors::Configuration,"getRootClass")
57  << "could not find TClass for " << name
58  << "\n";
59  }
60 
61  return tc;
62  }
63  }
64 
65  // ---------------------
66  TClass* getTClass(std::type_info const& ti) {
67  TypeID const type(ti);
68  return getRootClass(type.className());
69  }
70 }
type
Definition: HCALResponse.h:21
void throwMissingDictionariesException(std::vector< std::string > &missingDictionaries, std::string const &context)
void doBuildRealData(const std::string &name)
#define FDEBUG(lev)
Definition: DebugMacros.h:18
static TypeWithDict byName(std::string const &name)
Definition: TypeWithDict.cc:59
bool checkClassDictionaries(std::vector< std::string > &missingDictionaries, TypeID const &typeID)
bool loadCap(const std::string &name, std::vector< std::string > &missingDictionaries)
TClass * getTClass(const std::type_info &ti)
HLT enums.
std::string const & className() const
Definition: TypeID.cc:46
void loadExtraClasses()
Definition: ClassFiller.cc:34