36 TBaseClass::TBaseClass(BaseClassInfo_t *info, TClass *cl) :
37 TDictionary(), fInfo(info), fClass(cl), fDelta(INT_MAX),
38 fProperty(-1), fSTLType(-1)
40 if (fInfo) SetName(gCling->BaseClassInfo_FullName(fInfo));
46 TBaseClass::~TBaseClass()
48 gCling->BaseClassInfo_Delete(fInfo);
54 void TBaseClass::Browse(TBrowser *b)
56 TClass *c = GetClassPointer();
63 TClass *TBaseClass::GetClassPointer(Bool_t load)
66 if (fInfo) fClassPtr = TClass::GetClass(gCling->BaseClassInfo_ClassInfo(fInfo),load);
67 else fClassPtr = TClass::GetClass(fName, load);
75 Int_t TBaseClass::GetDelta()
79 if (fDelta == INT_MAX) {
80 R__LOCKGUARD(gInterpreterMutex);
81 if (Property() & kIsVirtualBase)
84 fDelta = (Int_t)gCling->BaseClassInfo_Offset(fInfo);
92 const char *TBaseClass::GetTitle()
const
94 TClass *c = ((TBaseClass *)
this)->GetClassPointer();
95 return c ? c->GetTitle() :
"";
101 ROOT::ESTLType TBaseClass::IsSTLContainer()
110 const char *type = gCling->BaseClassInfo_TmpltName(fInfo);
111 if (!type) fSTLType = ROOT::kNotSTL;
112 else if (!strcmp(type,
"vector")) fSTLType = ROOT::kSTLvector;
113 else if (!strcmp(type,
"list")) fSTLType = ROOT::kSTLlist;
114 else if (!strcmp(type,
"forward_list")) fSTLType = ROOT::kSTLforwardlist;
115 else if (!strcmp(type,
"deque")) fSTLType = ROOT::kSTLdeque;
116 else if (!strcmp(type,
"map")) fSTLType = ROOT::kSTLmap;
117 else if (!strcmp(type,
"multimap")) fSTLType = ROOT::kSTLmultimap;
118 else if (!strcmp(type,
"set")) fSTLType = ROOT::kSTLset;
119 else if (!strcmp(type,
"multiset")) fSTLType = ROOT::kSTLmultiset;
120 else if (!strcmp(type,
"unordered_set")) fSTLType = ROOT::kSTLunorderedset;
121 else if (!strcmp(type,
"unordered_multiset")) fSTLType = ROOT::kSTLunorderedmultiset;
122 else if (!strcmp(type,
"unordered_map")) fSTLType = ROOT::kSTLunorderedmap;
123 else if (!strcmp(type,
"unordered_multimap")) fSTLType = ROOT::kSTLunorderedmultimap;
124 else fSTLType = ROOT::kNotSTL;
127 if (fSTLType == -2)
return ROOT::kNotSTL;
128 return (ROOT::ESTLType) fSTLType;
134 Long_t TBaseClass::Property()
const
136 if (fProperty == -1 && fInfo) {
137 R__LOCKGUARD(gInterpreterMutex);
138 fProperty = gCling->BaseClassInfo_Property(fInfo);
147 void TBaseClass::Streamer(TBuffer& b) {
149 b.ReadClassBuffer(Class(),
this);
156 b.WriteClassBuffer(Class(),
this);