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 = strlen(
name);
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);
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;
614 while ( (*cursor)==
'*' ) ++cursor;
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) {
647 Bool_t isTString = (dataClass == TString::Class());
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);
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);
908 fBrowser =
b; fCount = 0; }
911 virtual void Inspect(
TClass *cl,
const char *parent,
const char *
name,
const void *addr,
Bool_t isTransient);
919 const void *addr,
Bool_t )
921 if(tit && strchr(tit,
'.')) return ;
922 if (fCount && !fBrowser)
return;
929 int ln = strcspn(
name,
"[ ");
933 if (!classInfo)
return;
943 if ((found = (iname==mname)))
break;
955 if (mname ==
"G__virtualinfo")
return;
957 int size =
sizeof(
void*);
977 for(
int i=0; i<nmax; i++) {
979 char *ptr = (
char*)addr + i*
size;
986 if (!fBrowser)
return;
994 bwname = actualClass->
GetName();
1001 strcmp(bwname.
Data(),actualClass->
GetName())==0) {
1003 int l = strcspn(bwname.
Data(),
"[ ");
1004 if (
l<bwname.
Length() && bwname[
l]==
'[') {
1005 char cbuf[13];
snprintf(cbuf,13,
"[%02d]",i);
1008 bwname = (
const char*)ts;
1012 if (proxy==
nullptr) {
1014 fBrowser->Add(obj,clm,bwname);
1019 if (valueCl==
nullptr) {
1021 fBrowser->Add( obj, clm, bwname );
1025 TClass *actualCl =
nullptr;
1027 int sz = proxy->
Size();
1029 char fmt[] = {
"#%09d"};
1030 fmt[3] =
'0'+(
int)log10(
double(sz))+1;
1032 for (
int ii=0;ii<sz;ii++) {
1033 void *p = proxy->
At(ii);
1045 fBrowser->Add( p, actualCl, ts );
1087 TMmallocDescTemp setreset;
1103 fPersistentRef(nullptr),
1104 fStreamerInfo(nullptr), fConversionStreamerInfo(nullptr), fRealData(nullptr),
1105 fBase(nullptr), fData(nullptr), fUsingData(nullptr), fEnums(nullptr), fFuncTemplate(nullptr), fMethod(nullptr), fAllPubData(nullptr),
1106 fAllPubMethod(nullptr), fClassMenuList(nullptr),
1107 fDeclFileName(
""), fImplFileName(
""), fDeclFileLine(0), fImplFileLine(0),
1108 fInstanceCount(0), fOnHeap(0),
1109 fCheckSum(0), fCollectionProxy(nullptr), fClassVersion(0), fClassInfo(nullptr),
1110 fTypeInfo(nullptr), fShowMembers(nullptr),
1111 fStreamer(nullptr), fIsA(nullptr), fGlobalIsA(nullptr), fIsAMethod(nullptr),
1112 fMerge(nullptr), fResetAfterMerge(nullptr), fNew(nullptr), fNewArray(nullptr), fDelete(nullptr), fDeleteArray(nullptr),
1113 fDestructor(nullptr), fDirAutoAdd(nullptr), fStreamerFunc(nullptr), fConvStreamerFunc(nullptr), fSizeof(-1),
1114 fCanSplit(-1), fIsSyntheticPair(
kFALSE), fProperty(0), fClassProperty(0), fHasRootPcmInfo(
kFALSE), fCanLoadClassInfo(
kFALSE),
1115 fIsOffsetStreamerSet(
kFALSE), fVersionUsed(
kFALSE), fRuntimeProperties(0), fOffsetStreamer(0), fStreamerType(
TClass::
kDefault),
1117 fCurrentInfo(nullptr), fLastReadInfo(nullptr), fRefProxy(nullptr),
1118 fSchemaRules(nullptr), fStreamerImpl(&
TClass::StreamerDefault)
1123 ::Fatal(
"TClass::TClass",
"ROOT system not initialized");
1126 TMmallocDescTemp setreset;
1133 ::Fatal(
"TClass::TClass",
"gInterpreter not initialized");
1137 ::Warning(
"TClass::TClass",
"no dictionary for class %s is available",
name);
1151 fPersistentRef(nullptr),
1152 fStreamerInfo(nullptr), fConversionStreamerInfo(nullptr), fRealData(nullptr),
1153 fBase(nullptr), fData(nullptr), fUsingData(nullptr), fEnums(nullptr), fFuncTemplate(nullptr), fMethod(nullptr), fAllPubData(nullptr),
1154 fAllPubMethod(nullptr), fClassMenuList(nullptr),
1155 fDeclFileName(
""), fImplFileName(
""), fDeclFileLine(0), fImplFileLine(0),
1156 fInstanceCount(0), fOnHeap(0),
1157 fCheckSum(0), fCollectionProxy(nullptr), fClassVersion(0), fClassInfo(nullptr),
1158 fTypeInfo(nullptr), fShowMembers(nullptr),
1159 fStreamer(nullptr), fIsA(nullptr), fGlobalIsA(nullptr), fIsAMethod(nullptr),
1160 fMerge(nullptr), fResetAfterMerge(nullptr), fNew(nullptr), fNewArray(nullptr), fDelete(nullptr), fDeleteArray(nullptr),
1161 fDestructor(nullptr), fDirAutoAdd(nullptr), fStreamerFunc(nullptr), fConvStreamerFunc(nullptr), fSizeof(-1),
1162 fCanSplit(-1), fIsSyntheticPair(
kFALSE), fProperty(0), fClassProperty(0), fHasRootPcmInfo(
kFALSE), fCanLoadClassInfo(
kFALSE),
1163 fIsOffsetStreamerSet(
kFALSE), fVersionUsed(
kFALSE), fRuntimeProperties(0), fOffsetStreamer(0), fStreamerType(
TClass::
kDefault),
1165 fCurrentInfo(nullptr), fLastReadInfo(nullptr), fRefProxy(nullptr),
1166 fSchemaRules(nullptr), fStreamerImpl(&
TClass::StreamerDefault)
1169 Init(
name, cversion,
nullptr,
nullptr,
nullptr,
nullptr, -1, -1,
nullptr, silent);
1179 fPersistentRef(nullptr),
1180 fStreamerInfo(nullptr), fConversionStreamerInfo(nullptr), fRealData(nullptr),
1181 fBase(nullptr), fData(nullptr), fUsingData(nullptr), fEnums(nullptr), fFuncTemplate(nullptr), fMethod(nullptr), fAllPubData(nullptr),
1182 fAllPubMethod(nullptr), fClassMenuList(nullptr),
1183 fDeclFileName(
""), fImplFileName(
""), fDeclFileLine(0), fImplFileLine(0),
1184 fInstanceCount(0), fOnHeap(0),
1185 fCheckSum(0), fCollectionProxy(nullptr), fClassVersion(0), fClassInfo(nullptr),
1186 fTypeInfo(nullptr), fShowMembers(nullptr),
1187 fStreamer(nullptr), fIsA(nullptr), fGlobalIsA(nullptr), fIsAMethod(nullptr),
1188 fMerge(nullptr), fResetAfterMerge(nullptr), fNew(nullptr), fNewArray(nullptr), fDelete(nullptr), fDeleteArray(nullptr),
1189 fDestructor(nullptr), fDirAutoAdd(nullptr), fStreamerFunc(nullptr), fConvStreamerFunc(nullptr), fSizeof(-1),
1190 fCanSplit(-1), fIsSyntheticPair(
kFALSE), fProperty(0), fClassProperty(0), fHasRootPcmInfo(
kFALSE), fCanLoadClassInfo(
kFALSE),
1191 fIsOffsetStreamerSet(
kFALSE), fVersionUsed(
kFALSE), fRuntimeProperties(0), fOffsetStreamer(0), fStreamerType(
TClass::
kDefault),
1193 fCurrentInfo(nullptr), fLastReadInfo(nullptr), fRefProxy(nullptr),
1194 fSchemaRules(nullptr), fStreamerImpl(&
TClass::StreamerDefault)
1206 "A TClass entry cannot be initialized in a state different from kForwardDeclared or kEmulated.");
1207 Init(
name, cversion,
nullptr,
nullptr,
nullptr,
nullptr, -1, -1,
nullptr, silent);
1225 fPersistentRef(nullptr),
1226 fStreamerInfo(nullptr), fConversionStreamerInfo(nullptr), fRealData(nullptr),
1227 fBase(nullptr), fData(nullptr), fUsingData(nullptr), fEnums(nullptr), fFuncTemplate(nullptr), fMethod(nullptr), fAllPubData(nullptr),
1228 fAllPubMethod(nullptr), fClassMenuList(nullptr),
1229 fDeclFileName(
""), fImplFileName(
""), fDeclFileLine(0), fImplFileLine(0),
1230 fInstanceCount(0), fOnHeap(0),
1231 fCheckSum(0), fCollectionProxy(nullptr), fClassVersion(0), fClassInfo(nullptr),
1232 fTypeInfo(nullptr), fShowMembers(nullptr),
1233 fStreamer(nullptr), fIsA(nullptr), fGlobalIsA(nullptr), fIsAMethod(nullptr),
1234 fMerge(nullptr), fResetAfterMerge(nullptr), fNew(nullptr), fNewArray(nullptr), fDelete(nullptr), fDeleteArray(nullptr),
1235 fDestructor(nullptr), fDirAutoAdd(nullptr), fStreamerFunc(nullptr), fConvStreamerFunc(nullptr), fSizeof(-1),
1236 fCanSplit(-1), fIsSyntheticPair(
kFALSE), fProperty(0), fClassProperty(0), fHasRootPcmInfo(
kFALSE), fCanLoadClassInfo(
kFALSE),
1237 fIsOffsetStreamerSet(
kFALSE), fVersionUsed(
kFALSE), fRuntimeProperties(0), fOffsetStreamer(0), fStreamerType(
TClass::
kDefault),
1239 fCurrentInfo(nullptr), fLastReadInfo(nullptr), fRefProxy(nullptr),
1240 fSchemaRules(nullptr), fStreamerImpl(&
TClass::StreamerDefault)
1245 ::Fatal(
"TClass::TClass",
"ROOT system not initialized");
1251 ::Fatal(
"TClass::TClass",
"gInterpreter not initialized");
1253 if (!classInfo || !
gInterpreter->ClassInfo_IsValid(classInfo)) {
1260 Init(
fName, cversion,
nullptr,
nullptr, dfil, ifil, dl, il, classInfo, silent);
1276 fPersistentRef(nullptr),
1277 fStreamerInfo(nullptr), fConversionStreamerInfo(nullptr), fRealData(nullptr),
1278 fBase(nullptr), fData(nullptr), fUsingData(nullptr), fEnums(nullptr), fFuncTemplate(nullptr), fMethod(nullptr), fAllPubData(nullptr),
1279 fAllPubMethod(nullptr), fClassMenuList(nullptr),
1280 fDeclFileName(
""), fImplFileName(
""), fDeclFileLine(0), fImplFileLine(0),
1281 fInstanceCount(0), fOnHeap(0),
1282 fCheckSum(0), fCollectionProxy(nullptr), fClassVersion(0), fClassInfo(nullptr),
1283 fTypeInfo(nullptr), fShowMembers(nullptr),
1284 fStreamer(nullptr), fIsA(nullptr), fGlobalIsA(nullptr), fIsAMethod(nullptr),
1285 fMerge(nullptr), fResetAfterMerge(nullptr), fNew(nullptr), fNewArray(nullptr), fDelete(nullptr), fDeleteArray(nullptr),
1286 fDestructor(nullptr), fDirAutoAdd(nullptr), fStreamerFunc(nullptr), fConvStreamerFunc(nullptr), fSizeof(-1),
1287 fCanSplit(-1), fIsSyntheticPair(
kFALSE), fProperty(0), fClassProperty(0), fHasRootPcmInfo(
kFALSE), fCanLoadClassInfo(
kFALSE),
1288 fIsOffsetStreamerSet(
kFALSE), fVersionUsed(
kFALSE), fRuntimeProperties(0), fOffsetStreamer(0), fStreamerType(
TClass::
kDefault),
1290 fCurrentInfo(nullptr), fLastReadInfo(nullptr), fRefProxy(nullptr),
1291 fSchemaRules(nullptr), fStreamerImpl(&
TClass::StreamerDefault)
1294 Init(
name,cversion,
nullptr,
nullptr, dfil, ifil, dl, il,
nullptr, silent);
1304 const char *dfil,
const char *ifil,
Int_t dl,
Int_t il,
1307 fPersistentRef(nullptr),
1308 fStreamerInfo(nullptr), fConversionStreamerInfo(nullptr), fRealData(nullptr),
1309 fBase(nullptr), fData(nullptr), fUsingData(nullptr), fEnums(nullptr), fFuncTemplate(nullptr), fMethod(nullptr), fAllPubData(nullptr),
1310 fAllPubMethod(nullptr),
1311 fClassMenuList(nullptr),
1312 fDeclFileName(
""), fImplFileName(
""), fDeclFileLine(0), fImplFileLine(0),
1313 fInstanceCount(0), fOnHeap(0),
1314 fCheckSum(0), fCollectionProxy(nullptr), fClassVersion(0), fClassInfo(nullptr),
1315 fTypeInfo(nullptr), fShowMembers(nullptr),
1316 fStreamer(nullptr), fIsA(nullptr), fGlobalIsA(nullptr), fIsAMethod(nullptr),
1317 fMerge(nullptr), fResetAfterMerge(nullptr), fNew(nullptr), fNewArray(nullptr), fDelete(nullptr), fDeleteArray(nullptr),
1318 fDestructor(nullptr), fDirAutoAdd(nullptr), fStreamerFunc(nullptr), fConvStreamerFunc(nullptr), fSizeof(-1),
1319 fCanSplit(-1), fIsSyntheticPair(
kFALSE), fProperty(0), fClassProperty(0), fHasRootPcmInfo(
kFALSE), fCanLoadClassInfo(
kFALSE),
1320 fIsOffsetStreamerSet(
kFALSE), fVersionUsed(
kFALSE), fRuntimeProperties(0), fOffsetStreamer(0), fStreamerType(
TClass::
kDefault),
1321 fState(kHasTClassInit),
1322 fCurrentInfo(nullptr), fLastReadInfo(nullptr), fRefProxy(nullptr),
1323 fSchemaRules(nullptr), fStreamerImpl(&
TClass::StreamerDefault)
1327 Init(
name, cversion, &info, isa, dfil, ifil, dl, il,
nullptr, silent);
1345 info->
Clear(
"build");
1369 const char *dfil,
const char *ifil,
Int_t dl,
Int_t il,
1370 ClassInfo_t *givenInfo,
1374 ::Fatal(
"TClass::TClass",
"ROOT system not initialized");
1376 ::Error(
"TClass::Init",
"The name parameter is invalid (null or empty)");
1417 TClass **persistentRef =
nullptr;
1435 info->
Clear(
"build");
1453 (*fMethod).
fClass =
this;
1465 ::Fatal(
"TClass::Init",
"gInterpreter not initialized");
1468 bool invalid = !
gInterpreter->ClassInfo_IsValid(givenInfo);
1469 bool notloaded = !
gInterpreter->ClassInfo_IsLoaded(givenInfo);
1470 auto property =
gInterpreter->ClassInfo_Property(givenInfo);
1472 if (invalid || (notloaded && (property &
kIsNamespace)) ||
1512 proto->FillTClass(
this);
1538 ::Error(
"TClass::Init",
"no interpreter information for class %s is available even though it has a TClass "
1539 "initialization routine.",
1557 if (!givenInfo && strchr (
name,
'<')) {
1569 if (resolvedThis !=
name) {
1593 if (resolvedThis !=
fName) {
1595 if (oldcl && oldcl !=
this) {
1601 while ( TNameMapNode* htmp =
static_cast<TNameMapNode*
> (next()) ) {
1602 if (resolvedThis != htmp->String())
continue;
1604 if (oldcl && oldcl !=
this) {
1622 if (persistentRef) {
1629 if ( isStl || !strncmp(
GetName(),
"stdext::hash_",13) || !strncmp(
GetName(),
"__gnu_cxx::hash_",16) ) {
1640 }
else if (!silent) {
1641 Warning(
"Init",
"Collection proxy for %s was not properly initialized!",
GetName());
1666 while ( TNameMapNode* htmp =
static_cast<TNameMapNode*
> (next()) ) {
1667 if (resolvedThis == htmp->String() && htmp->fOrigName ==
GetName()) {
1693 (*fUsingData).Delete();
1738 std::map<std::string, TObjArray*>::iterator it;
1739 std::map<std::string, TObjArray*>::iterator end = (*fConversionStreamerInfo).end();
1740 for( it = (*fConversionStreamerInfo).begin(); it != end; ++it ) {
1750 Int_t ReadRulesContent(FILE *
f)
1762 while ((
c = fgetc(
f)) != EOF) {
1768 if (rule.Length() > 0) {
1820 static const char *suffix =
"class.rules";
1826 FILE *
f = fopen(sname,
"r");
1828 res = ReadRulesContent(
f);
1831 ::Error(
"TClass::ReadRules()",
"Cannot find rules file %s", sname.
Data());
1844 if (!filename || !filename[0]) {
1845 ::Error(
"TClass::ReadRules",
"no file name specified");
1849 FILE *
f = fopen(filename,
"r");
1851 ::Error(
"TClass::ReadRules",
"Failed to open %s\n",filename);
1854 Int_t count = ReadRulesContent(
f);
1907 ::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).",
1969 obj->ShowMembers(insp);
1990 }
else if (actual !=
this) {
1991 return actual->
Browse(obj,
b);
2040 isTransient =
kTRUE;
2045 TMmallocDescTemp setreset;
2056 static TClassRef clRefString(
"std::string");
2057 if (clRefString ==
this) {
2067 Error(
"BuildRealData",
"Inspection for %s not supported!",
GetName());
2079 if ( isTransient ) {
2087 Error(
"BuildRealData",
"Cannot find any ShowMembers function for %s!",
GetName());
2122 Error(
"BuildEmulatedRealData",
"Missing StreamerInfo for %s",
GetName());
2188 TMmallocDescTemp setreset;
2215 if (strcmp(
GetName(),
"string") == 0) {
2223 gInterpreter->InspectMembers(insp, obj,
this, isTransient);
2227 sinfo->CallShowMembers(obj, insp, isTransient);
2242 return gInterpreter->InspectMembers(insp, obj,
this, isTransient);
2261 if (
this == TClonesArray::Class()) {
fCanSplit = 1;
return kTRUE; }
2275 if (element->IsA() == TStreamerBase::Class()) {
2306 }
else if (!
c->CanSplitBaseAllow()) {
2331 if (
this == TObject::Class()) { This->
fCanSplit = 1;
return kTRUE; }
2350 static TClassRef stdStringClass(
"std::string");
2351 if (valueClass==TString::Class() || valueClass==stdStringClass)
2407 if (new_name ==
nullptr || new_name[0]==
'\0' ||
fName == new_name) {
2408 Error(
"Clone",
"The name of the class must be changed when cloning a TClass object.");
2438 copy->
fName = new_name;
2493 if (!padsav || !opt.
Contains(
"same")) {
2496 gROOT->ProcessLine(
"new TCanvas(\"R__class\",\"class\",20,20,1000,750);");
2504 if (padsav) padsav->
cd();
2545 if (
sizeof(
this) == 4)
2548 Printf(
"==> Dumping object at: 0x%016lx, name=%s, class=%s\n",prObj,tobj->
GetName(),
GetName());
2551 if (
sizeof(
this) == 4)
2552 Printf(
"==> Dumping object at: 0x%08lx, class=%s\n",prObj,
GetName());
2554 Printf(
"==> Dumping object at: 0x%016lx, class=%s\n",prObj,
GetName());
2559 Info(
"Dump",
"No ShowMembers function, dumping disabled");
2569 static const UInt_t maxsize = 255;
2570 static char name[maxsize+2];
2574 for (
UInt_t i = 0; i < nch && icur < maxsize; ++i, ++icur) {
2575 if (
text[i] ==
'\"' ||
text[i] ==
'[' ||
text[i] ==
'~' ||
2578 text[i] ==
'?' ||
text[i] ==
'>') {
2608 if (
object==
nullptr)
return (
TClass*)
this;
2621 return realTObject->IsA();
2656 if (strcmp(
GetName(), classname) == 0)
return this;
2665 else return nullptr;
2675 if (cl ==
this)
return this;
2687 if (cl ==
c)
return c;
2706 if (cl ==
this)
return 0;
2708 if (!
fBase.load()) {
2715 if (!sinfo)
return -1;
2724 if (element->IsA() == TStreamerBase::Class()) {
2727 if (!baseclass)
return -1;
2729 if (subOffset == -2)
return -2;
2730 if (subOffset != -1)
return offset+subOffset;
2731 offset += baseclass->
Size();
2732 }
else if (element->IsA() == TStreamerSTL::Class()) {
2735 if (!baseclass)
return -1;
2737 if (subOffset == -2)
return -2;
2738 if (subOffset != -1)
return offset+subOffset;
2739 offset += baseclass->
Size();
2742 Error(
"GetBaseClassOffsetRecurse",
"Unexpected element type for base class: %s\n",element->IsA()->
GetName());
2754 if (
fBase.load() ==
nullptr)
2757 lnk =
fBase.load()->FirstLink();
2773 off =
c->GetBaseClassOffsetRecurse(cl);
2774 if (off == -2)
return -2;
2793 if (
this == toBase)
return 0;
2809 if(derived && base) {
2831 if (dm)
return this;
2840 if (cdm)
return cdm;
2851 struct TClassLocalStorage {
2852 TClassLocalStorage() : fCollectionProxy(nullptr), fStreamer(nullptr) {};
2857 static TClassLocalStorage *GetStorage(
const TClass *cl)
2863 if (*thread_ptr==
nullptr) *thread_ptr =
new TExMap();
2870 local = (
ULongptr_t)
new TClassLocalStorage();
2873 return (TClassLocalStorage*)local;
2901 TClassLocalStorage *local = TClassLocalStorage::GetStorage(
this);
2904 return local->fCollectionProxy;
2915 TClassLocalStorage *local = TClassLocalStorage::GetStorage(
this);
2917 if (local->fStreamer==
nullptr) {
2919 const std::type_info &orig = (
typeid(*fStreamer) );
2920 if (!local->fStreamer) {
2921 Warning(
"GetStreamer",
"For %s, the TClassStreamer (%s) passed's call to Generate failed!",
GetName(),orig.name());
2923 const std::type_info © = (
typeid(*local->fStreamer) );
2924 if (strcmp(orig.name(),copy.name())!=0) {
2925 Warning(
"GetStreamer",
"For %s, the TClassStreamer passed does not properly implement the Generate method (%s vs %s)\n",
GetName(),orig.name(),copy.name());
2929 return local->fStreamer;
2973 if (!
name || !
name[0])
return nullptr;
2975 if (strstr(
name,
"(anonymous)"))
return nullptr;
2976 if (strncmp(
name,
"class ",6)==0)
name += 6;
2977 if (strncmp(
name,
"struct ",7)==0)
name += 7;
2979 if (!
gROOT->GetListOfClasses())
return nullptr;
3034 if (!cl && !load)
return nullptr;
3036 TClass *loadedcl = (dict)();
3046 std::string normalizedName;
3055 if (normalizedName !=
name) {
3067 normalizedName = cl->
GetName();
3068 checkTable = load && (normalizedName !=
name);
3071 if (!load)
return nullptr;
3097 TClass *loadedcl =
nullptr;
3108 if (!loadedcl && !ispair && !ispairbase) {
3111 auto underlyingTypeName = theDataType->GetTypeName();
3114 if (underlyingTypeDict){
3115 loadedcl = underlyingTypeDict();
3121 if (loadedcl)
return loadedcl;
3125 if (loadedcl)
return loadedcl;
3132 if (hint_pair_offset && hint_pair_size) {
3140 static const size_t slen = strlen(
"pair");
3141 static const char *associativeContainer[] = {
"map",
"unordered_map",
"multimap",
3142 "unordered_multimap",
"set",
"unordered_set",
"multiset",
"unordered_multiset" };
3143 for(
auto contname : associativeContainer) {
3144 std::string collname = contname;
3145 collname.append( normalizedName.c_str() + slen );
3152 cl = p->GetValueClass();
3165 std::string::size_type posLess = normalizedName.find(
'<');
3166 if (posLess != std::string::npos) {
3173 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());
3175 if (normalizedName.length()) {
3185 auto ci =
gInterpreter->ClassInfo_Factory(normalizedName.c_str());
3187 auto method =
gInterpreter->MethodInfo_Factory(funcDecl);
3193 funcPtr(
nullptr, 0,
nullptr, &res);
3205 std::string alternative;
3206 gInterpreter->GetInterpreterTypeName(normalizedName.c_str(), alternative,
kTRUE);
3207 if (alternative.empty())
3209 const char *altname = alternative.c_str();
3210 if (strncmp(altname,
"std::", 5) == 0) {
3215 if (altname != normalizedName && strcmp(altname,
name) != 0) {
3242 if (!
gROOT->GetListOfClasses())
3250 if (cl && cl->
IsLoaded())
return cl;
3276 if (!load)
return nullptr;
3286 TIter next(
gROOT->GetListOfClassGenerators());
3298 if (!autoload_old) {
3305 cl =
GetClass(typeinfo, load, hint_pair_offset, hint_pair_size);
3311 if (hint_pair_offset) {
3316 free(demangled_name);
3340 if (!
gROOT->GetListOfClasses())
return nullptr;
3361 if (!load)
return nullptr;
3363 TClass *loadedcl =
nullptr;
3367 if (loadedcl)
return loadedcl;
3392 if (!
gROOT->GetListOfClasses())
return 0;
3397 if (iter.first == iter.second)
return false;
3398 std::vector<TClass*>::iterator vectIt = classes.begin();
3400 vectIt = classes.insert(vectIt, it->second);
3428 || datamember ==
nullptr)
return nullptr;
3431 const char *start_name = datamember;
3432 while (*start_name ==
'*') ++start_name;
3437 if (
const char *s = strchr(start_name,
'[')){
3438 UInt_t len = s-start_name;
3467 if (strchr(
name,
'[')==
nullptr) {
3509 std::string givenName(
name);
3512 std::string::size_type firstBracket = givenName.find_first_of(
"[");
3513 if (firstBracket != std::string::npos) {
3515 std::string nameNoDim(givenName.substr(0, firstBracket));
3519 std::string objName(obj->
GetName());
3520 std::string::size_type pos = objName.find_first_of(
"[");
3522 if (pos != std::string::npos) {
3524 if (objName == nameNoDim) {
3533 std::ostringstream ptrname;
3534 ptrname <<
"*" << givenName;
3541 std::string::size_type firstDot = givenName.find_first_of(
".");
3542 if (firstDot == std::string::npos) {
3553 std::string::size_type lastDot = givenName.find_last_of(
".");
3554 std::ostringstream starname;
3555 starname << givenName.substr(0, lastDot) <<
".*" << givenName.substr(lastDot + 1);
3571 std::string::size_type bracket = starname.str().find_first_of(
"[");
3572 if (bracket != std::string::npos) {
3581 std::string firstDotName(givenName.substr(firstDot + 1));
3624 if (!
fBase.load()) {
3645 Fatal(
"GetListOfBases",
"gInterpreter not initialized");
3648 if (!
fBase.load()) {
3674 auto temp =
fEnums.load();
3676 if (requestListLoading) {
3681 }
else if ( temp->IsA() == TListOfEnumsWithLock::Class() ) {
3691 if (!requestListLoading) {
3746 if (!(*data).IsLoaded())
3749 }
else if (load) (*data).Load();
3760 auto data =
fData.load();
3761 if (data && data->IsLoaded())
3763 }
else if (!load &&
fData)
3804 if (
gDebug>0)
Info(
"GetListOfMethods",
"Header Parsing - Asking for all the methods of class %s: this can involve parsing.",
GetName());
3837 if (
gDebug>0)
Info(
"GetListOfAllPublicMethods",
"Header Parsing - Asking for all the methods of class %s: this can involve parsing.",
GetName());
3867 while ((baseClass = (
TBaseClass *) nextBase())) {
3875 while ((method = (
TMethod*)next())) {
3881 if (
m &&
m->GetNargs() == method->
GetNargs())
3906 return cl->IsLoaded();
3934 TIter nextMemb(ldm);
3945 TClass* dmTClass =
nullptr;
3965 for (
int i = 0; i < 2; i++) {
3981 if (
this == sCIString)
return;
3993 auto checkDicts = [&](
const string &clName){
4000 if (cl && !cl->HasDictionary()) {
4001 cl->GetMissingDictionariesWithRecursionCheck(result, visited, recurse);
4005 const auto &elements = splitType.
fElements;
4006 const auto &templName = elements[0];
4009 if (templName ==
"pair") {
4017 if (templName ==
"unique_ptr" || templName ==
"array") {
4018 checkDicts(elements[1]);
4025 if (templName ==
"tuple") {
4028 const auto nTemplArgs = elements.size() - 1;
4030 for (
auto iTemplArg = 1U; iTemplArg < nTemplArgs; ++iTemplArg) {
4031 checkDicts(elements[iTemplArg]);
4080 if (
this == sCIString)
return;
4089 if (strncmp(
fName,
"unique_ptr<", 11) == 0 || strncmp(
fName,
"array<", 6) == 0 || strncmp(
fName,
"tuple<", 6) == 0) {
4142 while ((acl = (
TClass*)nextClass())) {
4143 if (acl == newcl)
continue;
4148 info->
Update(
this, newcl);
4160 Warning(
"ResetClassInfo(Long_t tagnum)",
"Call to deprecated interface (does nothing)");
4209 (*fUsingData).Unload();
4213 (*fMethod).Unload();
4247 if (options==
nullptr || options[0]==0)
return;
4249 if (strstr(options,
"streamerinfo")!=
nullptr) {
4253 std::map<std::string, TObjArray*>::iterator it;
4254 std::map<std::string, TObjArray*>::iterator end = (*fConversionStreamerInfo).end();
4255 for( it = (*fConversionStreamerInfo).begin(); it != end; ++it ) {
4256 it->second->ls(options);
4282 TClass *classPtr =
nullptr;
4283 TIter next(methodList);
4285 while ((method = (
TMethod*) next())) {
4287 if (classPtr != method->
GetClass()) {
4295 TIter nextarg(margsList);
4296 while ((methodArg = (
TMethodArg*)nextarg())) {
4346 if(
fMethod.compare_exchange_strong(expected, temp.get()) ) {
4404 Fatal(
"GetMethod",
"gInterpreter not initialized");
4410 if (!decl)
return nullptr;
4417 "\nDid not find matching TMethod <%s> with \"%s\" %sfor %s",
4418 method,params,objectIsConst ?
"const " :
"",
GetName());
4428 return static_cast<TMethod *
>(method);
4432 if (
TFunction* method = base->FindClassOrBaseMethodWithId(declId))
4433 return static_cast<TMethod *
>(method);
4450 Fatal(
"GetMethodWithPrototype",
"gInterpreter not initialized");
4454 objectIsConst, mode);
4456 if (!decl)
return nullptr;
4459 Error(
"GetMethodWithPrototype",
4460 "\nDid not find matching TMethod <%s> with \"%s\" %sfor %s",
4461 method,
proto,objectIsConst ?
"const " :
"",
GetName());
4476 if (faddr == (
Longptr_t)
m->InterfaceMethod())
4495 Fatal(
"GetClassMethod",
"gInterpreter not initialized");
4501 if (!decl)
return nullptr;
4521 Fatal(
"GetClassMethodWithPrototype",
"gInterpreter not initialized");
4528 if (!decl)
return nullptr;
4627 Error(
"GetStreamerInfo",
"class: %s, attempting to access a wrong version: %d",
GetName(), version);
4646 TMmallocDescTemp setreset;
4655 sinfo->
Build(silent);
4700 newname +=
"@@emulated";
4725 for (
Int_t i = -1; sinfo ==
nullptr && i < ninfos; ++i)
4738 Error(
"GetStreamerInfoAbstractEmulated",
"could not create TVirtualStreamerInfo");
4763 newname +=
"@@emulated";
4778 if (!sinfo && (checksum !=
fCheckSum)) {
4788 for (
Int_t i = -1; sinfo ==
nullptr && i < ninfos; ++i)
4801 Error(
"GetStreamerInfoAbstractEmulated",
"could not create TVirtualStreamerInfo");
4848 Error(
"IgnoreTObjectStreamer",
"Must be called before the creation of StreamerInfo");
4874 if (cl ==
this)
return kTRUE;
4882 if (element->IsA() == TStreamerBase::Class()) {
4884 if (!clbase)
return kFALSE;
4903 if (cl ==
this)
return obj;
4966 auto obj =
NewObject(defConstructor, quiet);
4967 if (obj.GetPtr() && obj.GetAllocator()) {
4971 return obj.GetPtr();
4993 Error(
"New",
"cannot create object of class %s",
GetName());
5010 Error(
"New",
"cannot create object of class %s",
GetName());
5022 Error(
"New",
"cannot create object of class %s",
GetName());
5051 p = { sinfo->
New(), sinfo};