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);
560 void Inspect(
TClass *cl,
const char *parent,
const char *
name,
const void *addr,
Bool_t isTransient)
override;
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();
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;
764 void Inspect(
TClass *cl,
const char *parent,
const char *
name,
const void *addr,
Bool_t isTransient)
override;
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;
913 void Inspect(
TClass *cl,
const char *parent,
const char *
name,
const void *addr,
Bool_t isTransient)
override;
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), fHasCustomStreamerMember(
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), fHasCustomStreamerMember(
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), fHasCustomStreamerMember(
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), fHasCustomStreamerMember(
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), fHasCustomStreamerMember(
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), fHasCustomStreamerMember(
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) {
1597 if (oldcl && oldcl !=
this) {
1603 while ( TNameMapNode* htmp =
static_cast<TNameMapNode*
> (next()) ) {
1604 if (resolvedThis != htmp->String())
continue;
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());
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;
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;
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) {
3070 normalizedName = cl->
GetName();
3071 checkTable = load && (normalizedName !=
name);
3074 if (!load)
return nullptr;
3100 TClass *loadedcl =
nullptr;
3122 if (!loadedcl && !ispair && !ispairbase) {
3125 auto underlyingTypeName = theDataType->GetTypeName();
3128 if (underlyingTypeDict){
3129 loadedcl = underlyingTypeDict();
3135 if (loadedcl)
return loadedcl;
3139 if (loadedcl)
return loadedcl;
3146 if (hint_pair_offset && hint_pair_size) {
3154 static const size_t slen = strlen(
"pair");
3155 static const char *associativeContainer[] = {
"map",
"unordered_map",
"multimap",
3156 "unordered_multimap",
"set",
"unordered_set",
"multiset",
"unordered_multiset" };
3157 for(
auto contname : associativeContainer) {
3158 std::string collname = contname;
3159 collname.append( normalizedName.c_str() + slen );
3166 cl =
p->GetValueClass();
3179 std::string::size_type posLess = normalizedName.find(
'<');
3180 if (posLess != std::string::npos) {
3187 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());
3189 if (normalizedName.length()) {
3199 auto ci =
gInterpreter->ClassInfo_Factory(normalizedName.c_str());
3201 auto method =
gInterpreter->MethodInfo_Factory(funcDecl);
3207 funcPtr(
nullptr, 0,
nullptr, &res);
3219 std::string alternative;
3220 gInterpreter->GetInterpreterTypeName(normalizedName.c_str(), alternative,
kTRUE);
3221 if (alternative.empty())
3223 const char *altname = alternative.c_str();
3224 if (strncmp(altname,
"std::", 5) == 0) {
3229 if (altname != normalizedName && strcmp(altname,
name) != 0) {
3256 if (!
gROOT->GetListOfClasses())
3264 if (cl && cl->
IsLoaded())
return cl;
3290 if (!load)
return nullptr;
3300 TIter next(
gROOT->GetListOfClassGenerators());
3312 if (!autoload_old) {
3319 cl =
GetClass(typeinfo, load, hint_pair_offset, hint_pair_size);
3325 if (hint_pair_offset) {
3330 free(demangled_name);
3354 if (!
gROOT->GetListOfClasses())
return nullptr;
3375 if (!load)
return nullptr;
3377 TClass *loadedcl =
nullptr;
3381 if (loadedcl)
return loadedcl;
3406 if (!
gROOT->GetListOfClasses())
return 0;
3411 if (iter.first == iter.second)
return false;
3412 std::vector<TClass*>::iterator vectIt = classes.begin();
3414 vectIt = classes.insert(vectIt, it->second);
3442 || datamember ==
nullptr)
return nullptr;
3445 const char *start_name = datamember;
3446 while (*start_name ==
'*') ++start_name;
3451 if (
const char *s = strchr(start_name,
'[')){
3481 if (strchr(
name,
'[')==
nullptr) {
3523 std::string givenName(
name);
3526 std::string::size_type firstBracket = givenName.find_first_of(
"[");
3527 if (firstBracket != std::string::npos) {
3529 std::string nameNoDim(givenName.substr(0, firstBracket));
3533 std::string objName(obj->
GetName());
3534 std::string::size_type pos = objName.find_first_of(
"[");
3536 if (pos != std::string::npos) {
3538 if (objName == nameNoDim) {
3547 std::ostringstream ptrname;
3548 ptrname <<
"*" << givenName;
3555 std::string::size_type firstDot = givenName.find_first_of(
".");
3556 if (firstDot == std::string::npos) {
3567 std::string::size_type lastDot = givenName.find_last_of(
".");
3568 std::ostringstream starname;
3569 starname << givenName.substr(0, lastDot) <<
".*" << givenName.substr(lastDot + 1);
3585 std::string::size_type bracket = starname.str().find_first_of(
"[");
3586 if (bracket != std::string::npos) {
3595 std::string firstDotName(givenName.substr(firstDot + 1));
3638 if (!
fBase.load()) {
3659 Fatal(
"GetListOfBases",
"gInterpreter not initialized");
3662 if (!
fBase.load()) {
3688 auto temp =
fEnums.load();
3690 if (requestListLoading) {
3705 if (!requestListLoading) {
3760 if (!(*data).IsLoaded())
3763 }
else if (load) (*data).Load();
3777 }
else if (!load &&
fData)
3818 if (
gDebug>0)
Info(
"GetListOfMethods",
"Header Parsing - Asking for all the methods of class %s: this can involve parsing.",
GetName());
3851 if (
gDebug>0)
Info(
"GetListOfAllPublicMethods",
"Header Parsing - Asking for all the methods of class %s: this can involve parsing.",
GetName());
3881 while ((baseClass = (
TBaseClass *) nextBase())) {
3889 while ((method = (
TMethod*)next())) {
3895 if (
m &&
m->GetNargs() == method->
GetNargs())
3920 return cl->IsLoaded();
3948 TIter nextMemb(ldm);
3959 TClass* dmTClass =
nullptr;
3979 for (
int i = 0; i < 2; i++) {
3995 if (
this == sCIString)
return;
4007 auto checkDicts = [&](
const string &clName){
4014 if (cl && !cl->HasDictionary()) {
4015 cl->GetMissingDictionariesWithRecursionCheck(
result, visited, recurse);
4019 const auto &elements = splitType.
fElements;
4020 const auto &templName = elements[0];
4023 if (templName ==
"pair") {
4031 if (templName ==
"unique_ptr" || templName ==
"array") {
4032 checkDicts(elements[1]);
4039 if (templName ==
"tuple") {
4042 const auto nTemplArgs = elements.size() - 1;
4044 for (
auto iTemplArg = 1U; iTemplArg < nTemplArgs; ++iTemplArg) {
4045 checkDicts(elements[iTemplArg]);
4091 if (
result.FindObject(
this))
return;
4094 if (
this == sCIString)
return;
4103 if (strncmp(
fName,
"unique_ptr<", 11) == 0 || strncmp(
fName,
"array<", 6) == 0 || strncmp(
fName,
"tuple<", 6) == 0) {
4156 while ((acl = (
TClass*)nextClass())) {
4157 if (acl == newcl)
continue;
4162 info->
Update(
this, newcl);
4174 Warning(
"ResetClassInfo(Long_t tagnum)",
"Call to deprecated interface (does nothing)");
4223 (*fUsingData).Unload();
4227 (*fMethod).Unload();
4261 if (options==
nullptr || options[0]==0)
return;
4263 if (strstr(options,
"streamerinfo")!=
nullptr) {
4267 std::map<std::string, TObjArray*>::iterator it;
4268 std::map<std::string, TObjArray*>::iterator end = (*fConversionStreamerInfo).end();
4269 for( it = (*fConversionStreamerInfo).begin(); it != end; ++it ) {
4270 it->second->ls(options);
4296 TClass *classPtr =
nullptr;
4297 TIter next(methodList);
4299 while ((method = (
TMethod*) next())) {
4301 if (classPtr != method->
GetClass()) {
4309 TIter nextarg(margsList);
4310 while ((methodArg = (
TMethodArg*)nextarg())) {
4360 if(
fMethod.compare_exchange_strong(expected, temp.get()) ) {
4396 m =
c->GetMethodAllAny(method);
4418 Fatal(
"GetMethod",
"gInterpreter not initialized");
4424 if (!decl)
return nullptr;
4431 "\nDid not find matching TMethod <%s> with \"%s\" %sfor %s",
4432 method,params,objectIsConst ?
"const " :
"",
GetName());
4442 return static_cast<TMethod *
>(method);
4446 if (
TFunction* method = base->FindClassOrBaseMethodWithId(declId))
4447 return static_cast<TMethod *
>(method);
4464 Fatal(
"GetMethodWithPrototype",
"gInterpreter not initialized");
4468 objectIsConst,
mode);
4470 if (!decl)
return nullptr;
4473 Error(
"GetMethodWithPrototype",
4474 "\nDid not find matching TMethod <%s> with \"%s\" %sfor %s",
4475 method,
proto,objectIsConst ?
"const " :
"",
GetName());
4490 if (faddr == (
Longptr_t)
m->InterfaceMethod())
4509 Fatal(
"GetClassMethod",
"gInterpreter not initialized");
4515 if (!decl)
return nullptr;
4535 Fatal(
"GetClassMethodWithPrototype",
"gInterpreter not initialized");
4542 if (!decl)
return nullptr;
4641 Error(
"GetStreamerInfo",
"class: %s, attempting to access a wrong version: %d",
GetName(), version);
4660 TMmallocDescTemp setreset;
4669 sinfo->
Build(silent);
4714 newname +=
"@@emulated";
4739 for (
Int_t i = -1; sinfo ==
nullptr && i < ninfos; ++i)
4752 Error(
"GetStreamerInfoAbstractEmulated",
"could not create TVirtualStreamerInfo");
4777 newname +=
"@@emulated";
4792 if (!sinfo && (checksum !=
fCheckSum)) {
4802 for (
Int_t i = -1; sinfo ==
nullptr && i < ninfos; ++i)
4815 Error(
"GetStreamerInfoAbstractEmulated",
"could not create TVirtualStreamerInfo");
4862 Error(
"IgnoreTObjectStreamer",
"Must be called before the creation of StreamerInfo");
4888 if (cl ==
this)
return kTRUE;
4898 if (!clbase)
return kFALSE;
4917 if (cl ==
this)
return obj;
4980 auto obj =
NewObject(defConstructor, quiet);
4981 if (obj.GetPtr() && obj.GetAllocator()) {
4985 return obj.GetPtr();