109#define RTLD_DEFAULT ((void *)::GetModuleHandle(NULL))
110#define dlsym(library, function_name) ::GetProcAddress((HMODULE)library, function_name)
136 static constexpr const char kUndeterminedClassInfoName[] =
"<NOT YET DETERMINED FROM fClassInfo>";
138 class TMmallocDescTemp {
142 TMmallocDescTemp(
void *
value =
nullptr) :
163 TNameMapNode(
const char *typedf,
const char *orig) :
176 const static bool foundSymbol = dlsym(RTLD_DEFAULT,
"usedToIdentifyRootClingByDlSym");
199 auto strLen =
name ? strlen(
name) : 0;
200 if (strLen == 0)
return;
202 const char* endCharPtr = strchr(
name,
'<');
203 endCharPtr = !endCharPtr ? &
name[strLen] : endCharPtr;
205 const char* beginCharPtr = endCharPtr;
206 while (beginCharPtr!=
name){
207 if (*beginCharPtr==
':'){
213 beginCharPtr = beginCharPtr!=endCharPtr ? beginCharPtr :
name;
214 std::string
s(beginCharPtr, endCharPtr);
216 printf(
"TDeclNameRegistry::AddQualifiedName Adding key %s for class/namespace %s\n",
s.c_str(),
name);
218 fClassNamesSet.insert(
s);
228 found = fClassNamesSet.find(
name) != fClassNamesSet.end();
237 if (fVerbLevel > 1) {
238 printf(
"TDeclNameRegistry Destructor. List of %lu names:\n",
239 (
long unsigned int)fClassNamesSet.size());
240 for (
auto const & key: fClassNamesSet) {
241 printf(
" - %s\n", key.c_str());
279 fOldValue(fCurrentValue)
281 fCurrentValue = newvalue;
286 fCurrentValue = fOldValue;
306 std::pair<RepoCont_t::iterator, Bool_t> tmp =
fObjectVersionRepository.insert(RepoCont_t::value_type>(location, version));
308 Warning(where,
"Reregistering an object of class '%s' version %d at address %p",
what->GetName(), version,
p);
312 Warning(where,
"Failed to reregister an object of class '%s' version %d at address %p",
what->GetName(), version, location);
325 RepoCont_t::iterator tmp = cur++;
326 if ((tmp->first == location) && (tmp->second ==
what->GetClassVersion())) {
342 size_t objsize =
what->Size();
343 long delta = (
char*)newadd - (
char*)oldadd;
347 RepoCont_t::iterator tmp = cur++;
348 if (oldadd <= tmp->
first && tmp->first < ( ((
char*)oldadd) + objsize) ) {
364#define R__USE_STD_MAP
366#if defined R__USE_STD_MAP
370 typedef std::map<std::string,TClass*>
IdMap_t;
395 if (iter != fMap.end()) cl = iter->second;
407#ifdef R__COMPLETE_MEM_TERMINATION
416 void Add(
const char *key,
TClass *&obj) {
418 fMap.
Add(realkey, obj);
421 const TPair *
a = (
const TPair *)fMap.FindObject(key);
425 void Remove(
const char *key) {
450 std::pair<const key_type, mapped_type> pair = make_pair(key, obj);
455 return fMap.count(key);
471#ifdef R__COMPLETE_MEM_TERMINATION
473 return &gIdMapObject;
482#ifdef R__COMPLETE_MEM_TERMINATION
484 return &gDeclIdMapObject;
499 gROOT->GetListOfClasses()->Add(cl);
513 if (!cl || !
id)
return;
525 gROOT->GetListOfClasses()->Remove(oldcl);
576 const Int_t kvalue = 30;
578 const Int_t ktitle = 50;
580 const Int_t ktitle = 42;
582 const Int_t kline = 1024;
585 UInt_t *cdatime =
nullptr;
590 const char *memberName;
591 const char *memberFullTypeName;
592 const char *memberTitle;
598 if (member->GetDataType()) {
599 memberDataType = (
EDataType)member->GetDataType()->GetType();
601 memberName = member->GetName();
602 memberFullTypeName = member->GetFullTypeName();
603 memberTitle = member->GetTitle();
604 isapointer = member->IsaPointer();
605 isbasic = member->IsBasic();
607 isarray = member->GetArrayDim();
613 const char *
cursor = mname;
617 if ( pos !=
kNPOS ) {
621 if (!element)
return;
626 memberName = element->
GetName();
629 membertype =
gROOT->GetType(memberFullTypeName);
631 isbasic = membertype !=
nullptr;
639 if (strcmp(memberName,
"fDatime") == 0 && memberDataType ==
kUInt_t) {
643 if (strcmp(memberName,
"fBits") == 0 && memberDataType ==
kUInt_t) {
648 static TClassRef stdClass(
"std::string");
649 Bool_t isStdString = (dataClass == stdClass);
652 for (i = 0;i < kline; i++)
line[i] =
' ';
658 char *pointer = (
char*)add;
659 char **ppointer = (
char**)(pointer);
662 char **p3pointer = (
char**)(*ppointer);
667 snprintf(&
line[kvalue],kline-kvalue,
"->%zx ", (
size_t)p3pointer);
669 }
else if (membertype) {
671 i = strlen(*ppointer);
672 if (kvalue+i > kline) i=kline-1-kvalue;
674 for (
Int_t j = 0; j < i; j++) {
675 if (!std::isprint((*ppointer)[j])) {
681 strncpy(
line + kvalue, *ppointer, i);
689 }
else if (!strcmp(memberFullTypeName,
"char*") ||
690 !strcmp(memberFullTypeName,
"const char*")) {
691 i = strlen(*ppointer);
692 if (kvalue+i >= kline) i=kline-1-kvalue;
694 for (
Int_t j = 0; j < i; j++) {
695 if (!std::isprint((*ppointer)[j])) {
701 strncpy(
line + kvalue, *ppointer, std::min( i, kline - kvalue));
708 snprintf(&
line[kvalue],kline-kvalue,
"->%zx ", (
size_t)p3pointer);
711 }
else if (membertype) {
713 cdatime = (
UInt_t*)pointer;
715 snprintf(&
line[kvalue],kline-kvalue,
"%d/%d",cdate,ctime);
723 std::string *str = (std::string*)pointer;
725 }
else if (isTString) {
730 snprintf(&
line[kvalue],kline-kvalue,
"->%zx ", (
size_t)pointer);
735 if (isdate ==
kFALSE && strcmp(memberFullTypeName,
"char*") && strcmp(memberFullTypeName,
"const char*")) {
736 i = strlen(&
line[0]);
line[i] =
' ';
737 assert(250 > ktitle);
738 strlcpy(&
line[ktitle],memberTitle,250-ktitle+1);
742 strncat(
line,
" ...", kline-strlen(
line)-1);
760 fRealDataObject = obj;
783 isTransientMember =
kTRUE;
790 if (cl != fRealDataClass) {
791 if (!fRealDataClass->InheritsFrom(cl)) {
797 if (!fRealDataClass->GetDataMember(rname)) {
812 if (!fRealDataClass->GetBaseDataMember(rname)) {
827 fRealDataClass->GetListOfRealData()->Add(rd);
837 fRealDataClass->GetListOfRealData()->Add(rd);
882 void* addrForRecursion =
nullptr;
883 if (GetObjectValidity() == kValidObjectGiven)
884 addrForRecursion =
const_cast<void*
>(add);
891 fRealDataClass->GetListOfRealData()->Add(rd);
909 fBrowser =
b; fCount = 0;
921 const void *addr,
Bool_t )
923 if(tit && strchr(tit,
'.')) return ;
924 if (fCount && !fBrowser)
return;
931 int ln = strcspn(
name,
"[ ");
935 if (!classInfo)
return;
945 if ((found = (iname==mname)))
break;
957 if (mname ==
"G__virtualinfo")
return;
959 int size =
sizeof(
void*);
979 for(
int i=0; i<nmax; i++) {
981 char *ptr = (
char*)addr + i*
size;
988 if (!fBrowser)
return;
996 bwname = actualClass->
GetName();
1003 strcmp(bwname.
Data(),actualClass->
GetName())==0) {
1005 int l = strcspn(bwname.
Data(),
"[ ");
1006 if (
l<bwname.
Length() && bwname[
l]==
'[') {
1007 char cbuf[13];
snprintf(cbuf,13,
"[%02d]",i);
1010 bwname = (
const char*)ts;
1014 if (proxy==
nullptr) {
1016 fBrowser->Add(obj,clm,bwname);
1021 if (valueCl==
nullptr) {
1023 fBrowser->Add( obj, clm, bwname );
1027 TClass *actualCl =
nullptr;
1029 int sz = proxy->
Size();
1031 char fmt[] = {
"#%09d"};
1032 fmt[3] =
'0'+(
int)
log10(
double(sz))+1;
1034 for (
int ii=0;ii<sz;ii++) {
1035 void *
p = proxy->
At(ii);
1047 fBrowser->Add(
p, actualCl, ts );
1089 TMmallocDescTemp setreset;
1105 fPersistentRef(nullptr),
1106 fStreamerInfo(nullptr), fConversionStreamerInfo(nullptr), fRealData(nullptr),
1107 fBase(nullptr), fData(nullptr), fUsingData(nullptr), fEnums(nullptr), fFuncTemplate(nullptr), fMethod(nullptr), fAllPubData(nullptr),
1108 fAllPubMethod(nullptr), fClassMenuList(nullptr),
1109 fDeclFileName(
""), fImplFileName(
""), fDeclFileLine(0), fImplFileLine(0),
1110 fInstanceCount(0), fOnHeap(0),
1111 fCheckSum(0), fCollectionProxy(nullptr), fClassVersion(0), fClassInfo(nullptr),
1112 fTypeInfo(nullptr), fShowMembers(nullptr),
1113 fStreamer(nullptr), fIsA(nullptr), fGlobalIsA(nullptr), fIsAMethod(nullptr),
1114 fMerge(nullptr), fResetAfterMerge(nullptr), fNew(nullptr), fNewArray(nullptr), fDelete(nullptr), fDeleteArray(nullptr),
1115 fDestructor(nullptr), fDirAutoAdd(nullptr), fStreamerFunc(nullptr), fConvStreamerFunc(nullptr), fSizeof(-1),
1116 fCanSplit(-1), fIsSyntheticPair(
kFALSE), fProperty(0), fClassProperty(0), fHasRootPcmInfo(
kFALSE), fCanLoadClassInfo(
kFALSE),
1117 fIsOffsetStreamerSet(
kFALSE), fVersionUsed(
kFALSE), fRuntimeProperties(0), fOffsetStreamer(0), fStreamerType(
TClass::
kDefault),
1119 fCurrentInfo(nullptr), fLastReadInfo(nullptr), fRefProxy(nullptr),
1120 fSchemaRules(nullptr), fStreamerImpl(&
TClass::StreamerDefault)
1125 ::Fatal(
"TClass::TClass",
"ROOT system not initialized");
1128 TMmallocDescTemp setreset;
1135 ::Fatal(
"TClass::TClass",
"gInterpreter not initialized");
1139 ::Warning(
"TClass::TClass",
"no dictionary for class %s is available",
name);
1153 fPersistentRef(nullptr),
1154 fStreamerInfo(nullptr), fConversionStreamerInfo(nullptr), fRealData(nullptr),
1155 fBase(nullptr), fData(nullptr), fUsingData(nullptr), fEnums(nullptr), fFuncTemplate(nullptr), fMethod(nullptr), fAllPubData(nullptr),
1156 fAllPubMethod(nullptr), fClassMenuList(nullptr),
1157 fDeclFileName(
""), fImplFileName(
""), fDeclFileLine(0), fImplFileLine(0),
1158 fInstanceCount(0), fOnHeap(0),
1159 fCheckSum(0), fCollectionProxy(nullptr), fClassVersion(0), fClassInfo(nullptr),
1160 fTypeInfo(nullptr), fShowMembers(nullptr),
1161 fStreamer(nullptr), fIsA(nullptr), fGlobalIsA(nullptr), fIsAMethod(nullptr),
1162 fMerge(nullptr), fResetAfterMerge(nullptr), fNew(nullptr), fNewArray(nullptr), fDelete(nullptr), fDeleteArray(nullptr),
1163 fDestructor(nullptr), fDirAutoAdd(nullptr), fStreamerFunc(nullptr), fConvStreamerFunc(nullptr), fSizeof(-1),
1164 fCanSplit(-1), fIsSyntheticPair(
kFALSE), fProperty(0), fClassProperty(0), fHasRootPcmInfo(
kFALSE), fCanLoadClassInfo(
kFALSE),
1165 fIsOffsetStreamerSet(
kFALSE), fVersionUsed(
kFALSE), fRuntimeProperties(0), fOffsetStreamer(0), fStreamerType(
TClass::
kDefault),
1167 fCurrentInfo(nullptr), fLastReadInfo(nullptr), fRefProxy(nullptr),
1168 fSchemaRules(nullptr), fStreamerImpl(&
TClass::StreamerDefault)
1171 Init(
name, cversion,
nullptr,
nullptr,
nullptr,
nullptr, -1, -1,
nullptr, silent);
1181 fPersistentRef(nullptr),
1182 fStreamerInfo(nullptr), fConversionStreamerInfo(nullptr), fRealData(nullptr),
1183 fBase(nullptr), fData(nullptr), fUsingData(nullptr), fEnums(nullptr), fFuncTemplate(nullptr), fMethod(nullptr), fAllPubData(nullptr),
1184 fAllPubMethod(nullptr), fClassMenuList(nullptr),
1185 fDeclFileName(
""), fImplFileName(
""), fDeclFileLine(0), fImplFileLine(0),
1186 fInstanceCount(0), fOnHeap(0),
1187 fCheckSum(0), fCollectionProxy(nullptr), fClassVersion(0), fClassInfo(nullptr),
1188 fTypeInfo(nullptr), fShowMembers(nullptr),
1189 fStreamer(nullptr), fIsA(nullptr), fGlobalIsA(nullptr), fIsAMethod(nullptr),
1190 fMerge(nullptr), fResetAfterMerge(nullptr), fNew(nullptr), fNewArray(nullptr), fDelete(nullptr), fDeleteArray(nullptr),
1191 fDestructor(nullptr), fDirAutoAdd(nullptr), fStreamerFunc(nullptr), fConvStreamerFunc(nullptr), fSizeof(-1),
1192 fCanSplit(-1), fIsSyntheticPair(
kFALSE), fProperty(0), fClassProperty(0), fHasRootPcmInfo(
kFALSE), fCanLoadClassInfo(
kFALSE),
1193 fIsOffsetStreamerSet(
kFALSE), fVersionUsed(
kFALSE), fRuntimeProperties(0), fOffsetStreamer(0), fStreamerType(
TClass::
kDefault),
1195 fCurrentInfo(nullptr), fLastReadInfo(nullptr), fRefProxy(nullptr),
1196 fSchemaRules(nullptr), fStreamerImpl(&
TClass::StreamerDefault)
1208 "A TClass entry cannot be initialized in a state different from kForwardDeclared or kEmulated.");
1209 Init(
name, cversion,
nullptr,
nullptr,
nullptr,
nullptr, -1, -1,
nullptr, silent);
1227 fPersistentRef(nullptr),
1228 fStreamerInfo(nullptr), fConversionStreamerInfo(nullptr), fRealData(nullptr),
1229 fBase(nullptr), fData(nullptr), fUsingData(nullptr), fEnums(nullptr), fFuncTemplate(nullptr), fMethod(nullptr), fAllPubData(nullptr),
1230 fAllPubMethod(nullptr), fClassMenuList(nullptr),
1231 fDeclFileName(
""), fImplFileName(
""), fDeclFileLine(0), fImplFileLine(0),
1232 fInstanceCount(0), fOnHeap(0),
1233 fCheckSum(0), fCollectionProxy(nullptr), fClassVersion(0), fClassInfo(nullptr),
1234 fTypeInfo(nullptr), fShowMembers(nullptr),
1235 fStreamer(nullptr), fIsA(nullptr), fGlobalIsA(nullptr), fIsAMethod(nullptr),
1236 fMerge(nullptr), fResetAfterMerge(nullptr), fNew(nullptr), fNewArray(nullptr), fDelete(nullptr), fDeleteArray(nullptr),
1237 fDestructor(nullptr), fDirAutoAdd(nullptr), fStreamerFunc(nullptr), fConvStreamerFunc(nullptr), fSizeof(-1),
1238 fCanSplit(-1), fIsSyntheticPair(
kFALSE), fProperty(0), fClassProperty(0), fHasRootPcmInfo(
kFALSE), fCanLoadClassInfo(
kFALSE),
1239 fIsOffsetStreamerSet(
kFALSE), fVersionUsed(
kFALSE), fRuntimeProperties(0), fOffsetStreamer(0), fStreamerType(
TClass::
kDefault),
1241 fCurrentInfo(nullptr), fLastReadInfo(nullptr), fRefProxy(nullptr),
1242 fSchemaRules(nullptr), fStreamerImpl(&
TClass::StreamerDefault)
1247 ::Fatal(
"TClass::TClass",
"ROOT system not initialized");
1253 ::Fatal(
"TClass::TClass",
"gInterpreter not initialized");
1255 if (!classInfo || !
gInterpreter->ClassInfo_IsValid(classInfo)) {
1262 Init(
fName, cversion,
nullptr,
nullptr, dfil, ifil, dl, il, classInfo, silent);
1278 fPersistentRef(nullptr),
1279 fStreamerInfo(nullptr), fConversionStreamerInfo(nullptr), fRealData(nullptr),
1280 fBase(nullptr), fData(nullptr), fUsingData(nullptr), fEnums(nullptr), fFuncTemplate(nullptr), fMethod(nullptr), fAllPubData(nullptr),
1281 fAllPubMethod(nullptr), fClassMenuList(nullptr),
1282 fDeclFileName(
""), fImplFileName(
""), fDeclFileLine(0), fImplFileLine(0),
1283 fInstanceCount(0), fOnHeap(0),
1284 fCheckSum(0), fCollectionProxy(nullptr), fClassVersion(0), fClassInfo(nullptr),
1285 fTypeInfo(nullptr), fShowMembers(nullptr),
1286 fStreamer(nullptr), fIsA(nullptr), fGlobalIsA(nullptr), fIsAMethod(nullptr),
1287 fMerge(nullptr), fResetAfterMerge(nullptr), fNew(nullptr), fNewArray(nullptr), fDelete(nullptr), fDeleteArray(nullptr),
1288 fDestructor(nullptr), fDirAutoAdd(nullptr), fStreamerFunc(nullptr), fConvStreamerFunc(nullptr), fSizeof(-1),
1289 fCanSplit(-1), fIsSyntheticPair(
kFALSE), fProperty(0), fClassProperty(0), fHasRootPcmInfo(
kFALSE), fCanLoadClassInfo(
kFALSE),
1290 fIsOffsetStreamerSet(
kFALSE), fVersionUsed(
kFALSE), fRuntimeProperties(0), fOffsetStreamer(0), fStreamerType(
TClass::
kDefault),
1292 fCurrentInfo(nullptr), fLastReadInfo(nullptr), fRefProxy(nullptr),
1293 fSchemaRules(nullptr), fStreamerImpl(&
TClass::StreamerDefault)
1296 Init(
name,cversion,
nullptr,
nullptr, dfil, ifil, dl, il,
nullptr, silent);
1306 const char *dfil,
const char *ifil,
Int_t dl,
Int_t il,
1309 fPersistentRef(nullptr),
1310 fStreamerInfo(nullptr), fConversionStreamerInfo(nullptr), fRealData(nullptr),
1311 fBase(nullptr), fData(nullptr), fUsingData(nullptr), fEnums(nullptr), fFuncTemplate(nullptr), fMethod(nullptr), fAllPubData(nullptr),
1312 fAllPubMethod(nullptr),
1313 fClassMenuList(nullptr),
1314 fDeclFileName(
""), fImplFileName(
""), fDeclFileLine(0), fImplFileLine(0),
1315 fInstanceCount(0), fOnHeap(0),
1316 fCheckSum(0), fCollectionProxy(nullptr), fClassVersion(0), fClassInfo(nullptr),
1317 fTypeInfo(nullptr), fShowMembers(nullptr),
1318 fStreamer(nullptr), fIsA(nullptr), fGlobalIsA(nullptr), fIsAMethod(nullptr),
1319 fMerge(nullptr), fResetAfterMerge(nullptr), fNew(nullptr), fNewArray(nullptr), fDelete(nullptr), fDeleteArray(nullptr),
1320 fDestructor(nullptr), fDirAutoAdd(nullptr), fStreamerFunc(nullptr), fConvStreamerFunc(nullptr), fSizeof(-1),
1321 fCanSplit(-1), fIsSyntheticPair(
kFALSE), fProperty(0), fClassProperty(0), fHasRootPcmInfo(
kFALSE), fCanLoadClassInfo(
kFALSE),
1322 fIsOffsetStreamerSet(
kFALSE), fVersionUsed(
kFALSE), fRuntimeProperties(0), fOffsetStreamer(0), fStreamerType(
TClass::
kDefault),
1323 fState(kHasTClassInit),
1324 fCurrentInfo(nullptr), fLastReadInfo(nullptr), fRefProxy(nullptr),
1325 fSchemaRules(nullptr), fStreamerImpl(&
TClass::StreamerDefault)
1329 Init(
name, cversion, &info, isa, dfil, ifil, dl, il,
nullptr, silent);
1347 info->
Clear(
"build");
1371 const char *dfil,
const char *ifil,
Int_t dl,
Int_t il,
1372 ClassInfo_t *givenInfo,
1376 ::Fatal(
"TClass::TClass",
"ROOT system not initialized");
1378 ::Error(
"TClass::Init",
"The name parameter is invalid (null or empty)");
1419 TClass **persistentRef =
nullptr;
1437 info->
Clear(
"build");
1455 (*fMethod).fClass =
this;
1467 ::Fatal(
"TClass::Init",
"gInterpreter not initialized");
1470 bool invalid = !
gInterpreter->ClassInfo_IsValid(givenInfo);
1471 bool notloaded = !
gInterpreter->ClassInfo_IsLoaded(givenInfo);
1472 auto property =
gInterpreter->ClassInfo_Property(givenInfo);
1514 proto->FillTClass(
this);
1540 ::Error(
"TClass::Init",
"no interpreter information for class %s is available even though it has a TClass "
1541 "initialization routine.",
1559 if (!givenInfo && strchr (
name,
'<')) {
1571 if (resolvedThis !=
name) {
1595 if (resolvedThis !=
fName) {
1596 oldcl = (
TClass*)
gROOT->GetListOfClasses()->FindObject(resolvedThis);
1597 if (oldcl && oldcl !=
this) {
1603 while ( TNameMapNode* htmp =
static_cast<TNameMapNode*
> (next()) ) {
1604 if (resolvedThis != htmp->String())
continue;
1605 oldcl = (
TClass*)
gROOT->GetListOfClasses()->FindObject(htmp->fOrigName);
1606 if (oldcl && oldcl !=
this) {
1624 if (persistentRef) {
1631 if ( isStl || !strncmp(
GetName(),
"stdext::hash_",13) || !strncmp(
GetName(),
"__gnu_cxx::hash_",16) ) {
1642 }
else if (!silent) {
1643 Warning(
"Init",
"Collection proxy for %s was not properly initialized!",
GetName());
1668 while ( TNameMapNode* htmp =
static_cast<TNameMapNode*
> (next()) ) {
1669 if (resolvedThis == htmp->String() && htmp->fOrigName ==
GetName()) {
1695 (*fUsingData).Delete();
1740 std::map<std::string, TObjArray*>::iterator it;
1741 std::map<std::string, TObjArray*>::iterator end = (*fConversionStreamerInfo).end();
1742 for( it = (*fConversionStreamerInfo).begin(); it != end; ++it ) {
1752 Int_t ReadRulesContent(FILE *
f)
1764 while ((
c = fgetc(
f)) != EOF) {
1770 if (rule.Length() > 0) {
1822 static const char *suffix =
"class.rules";
1828 FILE *
f = fopen(sname,
"r");
1830 res = ReadRulesContent(
f);
1833 ::Error(
"TClass::ReadRules()",
"Cannot find rules file %s", sname.
Data());
1847 ::Error(
"TClass::ReadRules",
"no file name specified");
1856 Int_t count = ReadRulesContent(
f);
1909 ::Warning(
"TClass::AddRule",
"The rule for class: \"%s\": version, \"%s\" and data members: \"%s\" has been skipped because it conflicts with one of the other rules (%s).",
1971 obj->ShowMembers(insp);
1992 }
else if (actual !=
this) {
1993 return actual->
Browse(obj,
b);
2042 isTransient =
kTRUE;
2047 TMmallocDescTemp setreset;
2058 static TClassRef clRefString(
"std::string");
2059 if (clRefString ==
this) {
2069 Error(
"BuildRealData",
"Inspection for %s not supported!",
GetName());
2081 if ( isTransient ) {
2089 Error(
"BuildRealData",
"Cannot find any ShowMembers function for %s!",
GetName());
2104 c->BuildRealData(
nullptr, isTransient);
2124 Error(
"BuildEmulatedRealData",
"Missing StreamerInfo for %s",
GetName());
2190 TMmallocDescTemp setreset;
2217 if (strcmp(
GetName(),
"string") == 0) {
2225 gInterpreter->InspectMembers(insp, obj,
this, isTransient);
2229 sinfo->CallShowMembers(obj, insp, isTransient);
2244 return gInterpreter->InspectMembers(insp, obj,
this, isTransient);
2307 }
else if (!
c->CanSplitBaseAllow()) {
2351 static TClassRef stdStringClass(
"std::string");
2408 if (new_name ==
nullptr || new_name[0]==
'\0' ||
fName == new_name) {
2409 Error(
"Clone",
"The name of the class must be changed when cloning a TClass object.");
2439 copy->
fName = new_name;
2498 gROOT->ProcessLine(
"new TCanvas(\"R__class\",\"class\",20,20,1000,750);");
2546 if (
sizeof(
this) == 4)
2549 Printf(
"==> Dumping object at: 0x%016lx, name=%s, class=%s\n",prObj,tobj->
GetName(),
GetName());
2552 if (
sizeof(
this) == 4)
2553 Printf(
"==> Dumping object at: 0x%08lx, class=%s\n",prObj,
GetName());
2555 Printf(
"==> Dumping object at: 0x%016lx, class=%s\n",prObj,
GetName());
2560 Info(
"Dump",
"No ShowMembers function, dumping disabled");
2570 static const UInt_t maxsize = 255;
2571 static char name[maxsize+2];
2575 for (
UInt_t i = 0; i < nch && icur < maxsize; ++i, ++icur) {
2576 if (
text[i] ==
'\"' ||
text[i] ==
'[' ||
text[i] ==
'~' ||
2579 text[i] ==
'?' ||
text[i] ==
'>') {
2623 return realTObject->
IsA();
2658 if (strcmp(
GetName(), classname) == 0)
return this;
2667 else return nullptr;
2677 if (cl ==
this)
return this;
2689 if (cl ==
c)
return c;
2690 c1 =
c->GetBaseClass(cl);
2708 if (cl ==
this)
return 0;
2710 if (!
fBase.load()) {
2717 if (!sinfo)
return -1;
2729 if (!baseclass)
return -1;
2731 if (subOffset == -2)
return -2;
2732 if (subOffset != -1)
return offset+subOffset;
2737 if (!baseclass)
return -1;
2739 if (subOffset == -2)
return -2;
2740 if (subOffset != -1)
return offset+subOffset;
2744 Error(
"GetBaseClassOffsetRecurse",
"Unexpected element type for base class: %s\n",element->
IsA()->
GetName());
2756 if (
fBase.load() ==
nullptr)
2759 lnk =
fBase.load()->FirstLink();
2775 off =
c->GetBaseClassOffsetRecurse(cl);
2776 if (off == -2)
return -2;
2795 if (
this == toBase)
return 0;
2811 if(derived && base) {
2833 if (dm)
return this;
2841 TClass *cdm =
c->GetBaseDataMember(datamember);
2842 if (cdm)
return cdm;
2853 struct TClassLocalStorage {
2854 TClassLocalStorage() : fCollectionProxy(nullptr), fStreamer(nullptr) {};
2859 static TClassLocalStorage *GetStorage(
const TClass *cl)
2865 if (*thread_ptr==
nullptr) *thread_ptr =
new TExMap();
2872 local = (
ULongptr_t)
new TClassLocalStorage();
2875 return (TClassLocalStorage*)local;
2903 TClassLocalStorage *local = TClassLocalStorage::GetStorage(
this);
2906 return local->fCollectionProxy;
2917 TClassLocalStorage *local = TClassLocalStorage::GetStorage(
this);
2919 if (local->fStreamer==
nullptr) {
2921 const std::type_info &orig = (
typeid(*fStreamer) );
2922 if (!local->fStreamer) {
2923 Warning(
"GetStreamer",
"For %s, the TClassStreamer (%s) passed's call to Generate failed!",
GetName(),orig.name());
2925 const std::type_info © = (
typeid(*local->fStreamer) );
2926 if (strcmp(orig.name(),copy.name())!=0) {
2927 Warning(
"GetStreamer",
"For %s, the TClassStreamer passed does not properly implement the Generate method (%s vs %s)\n",
GetName(),orig.name(),copy.name());
2931 return local->fStreamer;
2975 if (!
name || !
name[0])
return nullptr;
2977 if (strstr(
name,
"(anonymous)"))
return nullptr;
2978 if (strstr(
name,
"(unnamed)"))
return nullptr;
2979 if (strncmp(
name,
"class ",6)==0)
name += 6;
2980 if (strncmp(
name,
"struct ",7)==0)
name += 7;
2982 if (!
gROOT->GetListOfClasses())
return nullptr;
3037 if (!cl && !load)
return nullptr;
3039 TClass *loadedcl = (dict)();
3049 std::string normalizedName;
3058 if (normalizedName !=
name) {
3059 cl = (
TClass*)
gROOT->GetListOfClasses()->FindObject(normalizedName.c_str());
3070 normalizedName = cl->
GetName();
3071 checkTable = load && (normalizedName !=
name);
3074 if (!load)
return nullptr;
3100 TClass *loadedcl =
nullptr;
3111 if (!loadedcl && !ispair && !ispairbase) {
3112 if (
TDataType* theDataType =
gROOT->GetType(normalizedName.c_str())){
3114 auto underlyingTypeName = theDataType->GetTypeName();
3117 if (underlyingTypeDict){
3118 loadedcl = underlyingTypeDict();
3124 if (loadedcl)
return loadedcl;
3128 if (loadedcl)
return loadedcl;
3135 if (hint_pair_offset && hint_pair_size) {
3143 static const size_t slen = strlen(
"pair");
3144 static const char *associativeContainer[] = {
"map",
"unordered_map",
"multimap",
3145 "unordered_multimap",
"set",
"unordered_set",
"multiset",
"unordered_multiset" };
3146 for(
auto contname : associativeContainer) {
3147 std::string collname = contname;
3148 collname.append( normalizedName.c_str() + slen );
3155 cl =
p->GetValueClass();
3168 std::string::size_type posLess = normalizedName.find(
'<');
3169 if (posLess != std::string::npos) {
3176 printf(
"TClass::GetClass: Header Parsing - The representation of %s was not found in the type system. A lookup in the interpreter is about to be tried: this can cause parsing. This can be avoided selecting %s in the linkdef/selection file.\n",normalizedName.c_str(), normalizedName.c_str());
3178 if (normalizedName.length()) {
3188 auto ci =
gInterpreter->ClassInfo_Factory(normalizedName.c_str());
3190 auto method =
gInterpreter->MethodInfo_Factory(funcDecl);
3196 funcPtr(
nullptr, 0,
nullptr, &res);
3208 std::string alternative;
3209 gInterpreter->GetInterpreterTypeName(normalizedName.c_str(), alternative,
kTRUE);
3210 if (alternative.empty())
3212 const char *altname = alternative.c_str();
3213 if (strncmp(altname,
"std::", 5) == 0) {
3218 if (altname != normalizedName && strcmp(altname,
name) != 0) {
3245 if (!
gROOT->GetListOfClasses())
3253 if (cl && cl->
IsLoaded())
return cl;
3279 if (!load)
return nullptr;
3289 TIter next(
gROOT->GetListOfClassGenerators());
3301 if (!autoload_old) {
3308 cl =
GetClass(typeinfo, load, hint_pair_offset, hint_pair_size);
3314 if (hint_pair_offset) {
3319 free(demangled_name);
3343 if (!
gROOT->GetListOfClasses())
return nullptr;
3364 if (!load)
return nullptr;
3366 TClass *loadedcl =
nullptr;
3367 if (cl) loadedcl =
gROOT->LoadClass(cl->
GetName(),silent);
3368 else loadedcl =
gROOT->LoadClass(
name,silent);
3370 if (loadedcl)
return loadedcl;
3395 if (!
gROOT->GetListOfClasses())
return 0;
3400 if (iter.first == iter.second)
return false;
3401 std::vector<TClass*>::iterator vectIt = classes.begin();
3403 vectIt = classes.insert(vectIt, it->second);
3431 || datamember ==
nullptr)
return nullptr;
3434 const char *start_name = datamember;
3435 while (*start_name ==
'*') ++start_name;
3440 if (
const char *
s = strchr(start_name,
'[')){
3470 if (strchr(
name,
'[')==
nullptr) {
3512 std::string givenName(
name);
3515 std::string::size_type firstBracket = givenName.find_first_of(
"[");
3516 if (firstBracket != std::string::npos) {
3518 std::string nameNoDim(givenName.substr(0, firstBracket));
3522 std::string objName(obj->
GetName());
3523 std::string::size_type pos = objName.find_first_of(
"[");
3525 if (pos != std::string::npos) {
3527 if (objName == nameNoDim) {
3536 std::ostringstream ptrname;
3537 ptrname <<
"*" << givenName;
3544 std::string::size_type firstDot = givenName.find_first_of(
".");
3545 if (firstDot == std::string::npos) {
3556 std::string::size_type lastDot = givenName.find_last_of(
".");
3557 std::ostringstream starname;
3558 starname << givenName.substr(0, lastDot) <<
".*" << givenName.substr(lastDot + 1);
3574 std::string::size_type bracket = starname.str().find_first_of(
"[");
3575 if (bracket != std::string::npos) {
3584 std::string firstDotName(givenName.substr(firstDot + 1));
3627 if (!
fBase.load()) {
3648 Fatal(
"GetListOfBases",
"gInterpreter not initialized");
3651 if (!
fBase.load()) {
3677 auto temp =
fEnums.load();
3679 if (requestListLoading) {
3694 if (!requestListLoading) {
3749 if (!(*data).IsLoaded())
3752 }
else if (load) (*data).Load();
3766 }
else if (!load &&
fData)
3807 if (
gDebug>0)
Info(
"GetListOfMethods",
"Header Parsing - Asking for all the methods of class %s: this can involve parsing.",
GetName());
3840 if (
gDebug>0)
Info(
"GetListOfAllPublicMethods",
"Header Parsing - Asking for all the methods of class %s: this can involve parsing.",
GetName());
3870 while ((baseClass = (
TBaseClass *) nextBase())) {
3878 while ((method = (
TMethod*)next())) {
3884 if (
m &&
m->GetNargs() == method->
GetNargs())
3909 return cl->IsLoaded();
3937 TIter nextMemb(ldm);
3948 TClass* dmTClass =
nullptr;
3968 for (
int i = 0; i < 2; i++) {
3984 if (
this == sCIString)
return;
3996 auto checkDicts = [&](
const string &clName){
4003 if (cl && !cl->HasDictionary()) {
4004 cl->GetMissingDictionariesWithRecursionCheck(
result, visited, recurse);
4008 const auto &elements = splitType.
fElements;
4009 const auto &templName = elements[0];
4012 if (templName ==
"pair") {
4020 if (templName ==
"unique_ptr" || templName ==
"array") {
4021 checkDicts(elements[1]);
4028 if (templName ==
"tuple") {
4031 const auto nTemplArgs = elements.size() - 1;
4033 for (
auto iTemplArg = 1U; iTemplArg < nTemplArgs; ++iTemplArg) {
4034 checkDicts(elements[iTemplArg]);
4080 if (
result.FindObject(
this))
return;
4083 if (
this == sCIString)
return;
4092 if (strncmp(
fName,
"unique_ptr<", 11) == 0 || strncmp(
fName,
"array<", 6) == 0 || strncmp(
fName,
"tuple<", 6) == 0) {
4145 while ((acl = (
TClass*)nextClass())) {
4146 if (acl == newcl)
continue;
4151 info->
Update(
this, newcl);
4163 Warning(
"ResetClassInfo(Long_t tagnum)",
"Call to deprecated interface (does nothing)");
4212 (*fUsingData).Unload();
4216 (*fMethod).Unload();
4250 if (options==
nullptr || options[0]==0)
return;
4252 if (strstr(options,
"streamerinfo")!=
nullptr) {
4256 std::map<std::string, TObjArray*>::iterator it;
4257 std::map<std::string, TObjArray*>::iterator end = (*fConversionStreamerInfo).end();
4258 for( it = (*fConversionStreamerInfo).begin(); it != end; ++it ) {
4259 it->second->ls(options);
4285 TClass *classPtr =
nullptr;
4286 TIter next(methodList);
4288 while ((method = (
TMethod*) next())) {
4290 if (classPtr != method->
GetClass()) {
4298 TIter nextarg(margsList);
4299 while ((methodArg = (
TMethodArg*)nextarg())) {
4349 if(
fMethod.compare_exchange_strong(expected, temp.get()) ) {
4385 m =
c->GetMethodAllAny(method);
4407 Fatal(
"GetMethod",
"gInterpreter not initialized");
4413 if (!decl)
return nullptr;
4420 "\nDid not find matching TMethod <%s> with \"%s\" %sfor %s",
4421 method,params,objectIsConst ?
"const " :
"",
GetName());
4431 return static_cast<TMethod *
>(method);
4435 if (
TFunction* method = base->FindClassOrBaseMethodWithId(declId))
4436 return static_cast<TMethod *
>(method);
4453 Fatal(
"GetMethodWithPrototype",
"gInterpreter not initialized");
4457 objectIsConst,
mode);
4459 if (!decl)
return nullptr;
4462 Error(
"GetMethodWithPrototype",
4463 "\nDid not find matching TMethod <%s> with \"%s\" %sfor %s",
4464 method,
proto,objectIsConst ?
"const " :
"",
GetName());
4479 if (faddr == (
Longptr_t)
m->InterfaceMethod())
4498 Fatal(
"GetClassMethod",
"gInterpreter not initialized");
4504 if (!decl)
return nullptr;
4524 Fatal(
"GetClassMethodWithPrototype",
"gInterpreter not initialized");
4531 if (!decl)
return nullptr;
4630 Error(
"GetStreamerInfo",
"class: %s, attempting to access a wrong version: %d",
GetName(), version);
4649 TMmallocDescTemp setreset;
4658 sinfo->
Build(silent);
4703 newname +=
"@@emulated";
4728 for (
Int_t i = -1; sinfo ==
nullptr && i < ninfos; ++i)
4741 Error(
"GetStreamerInfoAbstractEmulated",
"could not create TVirtualStreamerInfo");
4766 newname +=
"@@emulated";
4781 if (!sinfo && (checksum !=
fCheckSum)) {
4791 for (
Int_t i = -1; sinfo ==
nullptr && i < ninfos; ++i)
4804 Error(
"GetStreamerInfoAbstractEmulated",
"could not create TVirtualStreamerInfo");
4851 Error(
"IgnoreTObjectStreamer",
"Must be called before the creation of StreamerInfo");
4877 if (cl ==
this)
return kTRUE;
4887 if (!clbase)
return kFALSE;
4906 if (cl ==
this)
return obj;
4969 auto obj =
NewObject(defConstructor, quiet);
4970 if (obj.GetPtr() && obj.GetAllocator()) {
4974 return obj.GetPtr();
4996 Error(
"New",
"cannot create object of class %s",
GetName());