107#define RTLD_DEFAULT ((void *)::GetModuleHandle(NULL))
108#define dlsym(library, function_name) ::GetProcAddress((HMODULE)library, function_name)
134 static constexpr const char kUndeterminedClassInfoName[] =
"<NOT YET DETERMINED FROM fClassInfo>";
136 class TMmallocDescTemp {
140 TMmallocDescTemp(
void *value = 0) :
161 TNameMapNode(
const char *typedf,
const char *orig) :
174 const static bool foundSymbol = dlsym(RTLD_DEFAULT,
"usedToIdentifyRootClingByDlSym");
197 auto strLen = strlen(
name);
198 if (strLen == 0)
return;
200 const char* endCharPtr = strchr(
name,
'<');
201 endCharPtr = !endCharPtr ? &
name[strLen] : endCharPtr;
203 const char* beginCharPtr = endCharPtr;
204 while (beginCharPtr!=
name){
205 if (*beginCharPtr==
':'){
211 beginCharPtr = beginCharPtr!=endCharPtr ? beginCharPtr :
name;
212 std::string
s(beginCharPtr, endCharPtr);
214 printf(
"TDeclNameRegistry::AddQualifiedName Adding key %s for class/namespace %s\n",
s.c_str(),
name);
216 fClassNamesSet.insert(
s);
226 found = fClassNamesSet.find(
name) != fClassNamesSet.end();
235 if (fVerbLevel > 1) {
236 printf(
"TDeclNameRegistry Destructor. List of %lu names:\n",
237 (
long unsigned int)fClassNamesSet.size());
238 for (
auto const & key: fClassNamesSet) {
239 printf(
" - %s\n", key.c_str());
270struct TClass__GetCallingNewRAII
277 fOldValue(fCurrentValue)
279 fCurrentValue = newvalue;
282 ~TClass__GetCallingNewRAII()
284 fCurrentValue = fOldValue;
304 std::pair<RepoCont_t::iterator, Bool_t> tmp =
fObjectVersionRepository.insert(RepoCont_t::value_type>(location, version));
306 Warning(where,
"Reregistering an object of class '%s' version %d at address %p",
what->GetName(), version, p);
310 Warning(where,
"Failed to reregister an object of class '%s' version %d at address %p",
what->GetName(), version, location);
323 RepoCont_t::iterator tmp = cur++;
324 if ((tmp->first == location) && (tmp->second ==
what->GetClassVersion())) {
340 size_t objsize =
what->Size();
341 long delta = (
char*)newadd - (
char*)oldadd;
345 RepoCont_t::iterator tmp = cur++;
346 if (oldadd <= tmp->
first && tmp->first < ( ((
char*)oldadd) + objsize) ) {
362#define R__USE_STD_MAP
363 class TMapTypeToTClass {
364#if defined R__USE_STD_MAP
368 typedef std::map<std::string,TClass*>
IdMap_t;
369 typedef IdMap_t::key_type key_type;
370 typedef IdMap_t::const_iterator const_iterator;
371 typedef IdMap_t::size_type size_type;
374 typedef TClass* mapped_type;
376 typedef IdMap_t::mapped_type mapped_type;
383 void Add(
const key_type &key, mapped_type &obj)
388 mapped_type
Find(
const key_type &key)
const
391 IdMap_t::const_iterator iter = fMap.find(key);
393 if (iter != fMap.end()) cl = iter->second;
396 void Remove(
const key_type &key) {
405#ifdef R__COMPLETE_MEM_TERMINATION
414 void Add(
const char *key,
TClass *&obj) {
416 fMap.Add(realkey, obj);
419 const TPair *
a = (
const TPair *)fMap.FindObject(key);
423 void Remove(
const char *key) {
425 TObject *actual = fMap.Remove(&realkey);
431 class TMapDeclIdToTClass {
434 typedef multimap<TDictionary::DeclId_t, TClass*>
DeclIdMap_t;
435 typedef DeclIdMap_t::key_type key_type;
436 typedef DeclIdMap_t::mapped_type mapped_type;
437 typedef DeclIdMap_t::const_iterator const_iterator;
438 typedef std::pair <const_iterator, const_iterator> equal_range;
439 typedef DeclIdMap_t::size_type size_type;
445 void Add(
const key_type &key, mapped_type obj)
448 std::pair<const key_type, mapped_type> pair = make_pair(key, obj);
451 size_type CountElementsWithKey(
const key_type &key)
453 return fMap.count(key);
455 equal_range
Find(
const key_type &key)
const
458 return fMap.equal_range(key);
460 void Remove(
const key_type &key) {
469#ifdef R__COMPLETE_MEM_TERMINATION
471 return &gIdMapObject;
480#ifdef R__COMPLETE_MEM_TERMINATION
482 return &gDeclIdMapObject;
497 gROOT->GetListOfClasses()->Add(cl);
511 if (!cl || !
id)
return;
523 gROOT->GetListOfClasses()->Remove(oldcl);
555 TDumpMembers(
bool noAddr): fNoAddr(noAddr) { }
572void TDumpMembers::Inspect(
TClass *cl,
const char *pname,
const char *mname,
const void *add,
Bool_t )
574 const Int_t kvalue = 30;
576 const Int_t ktitle = 50;
578 const Int_t ktitle = 42;
580 const Int_t kline = 1024;
588 const char *memberName;
589 const char *memberFullTypeName;
590 const char *memberTitle;
595 if (member->GetDataType()) {
596 memberDataType = (
EDataType)member->GetDataType()->GetType();
598 memberName = member->GetName();
599 memberFullTypeName = member->GetFullTypeName();
600 memberTitle = member->GetTitle();
601 isapointer = member->IsaPointer();
602 isbasic = member->IsBasic();
609 const char *cursor = mname;
610 while ( (*cursor)==
'*' ) ++cursor;
612 Ssiz_t pos = elname.Index(
"[");
613 if ( pos !=
kNPOS ) {
614 elname.Remove( pos );
617 if (!element)
return;
622 memberName = element->
GetName();
625 membertype =
gROOT->GetType(memberFullTypeName);
627 isbasic = membertype !=0;
634 if (strcmp(memberName,
"fDatime") == 0 && memberDataType ==
kUInt_t) {
638 if (strcmp(memberName,
"fBits") == 0 && memberDataType ==
kUInt_t) {
643 static TClassRef stdClass(
"std::string");
644 Bool_t isStdString = (dataClass == stdClass);
647 for (i = 0;i < kline; i++)
line[i] =
' ';
653 char *pointer = (
char*)add;
654 char **ppointer = (
char**)(pointer);
657 char **p3pointer = (
char**)(*ppointer);
664 }
else if (membertype) {
666 i = strlen(*ppointer);
667 if (kvalue+i > kline) i=kline-1-kvalue;
669 for (
Int_t j = 0; j < i; j++) {
670 if (!std::isprint((*ppointer)[j])) {
676 strncpy(
line + kvalue, *ppointer, i);
684 }
else if (!strcmp(memberFullTypeName,
"char*") ||
685 !strcmp(memberFullTypeName,
"const char*")) {
686 i = strlen(*ppointer);
687 if (kvalue+i >= kline) i=kline-1-kvalue;
689 for (
Int_t j = 0; j < i; j++) {
690 if (!std::isprint((*ppointer)[j])) {
696 strncpy(
line + kvalue, *ppointer, std::min( i, kline - kvalue));
706 }
else if (membertype) {
708 cdatime = (
UInt_t*)pointer;
710 snprintf(&
line[kvalue],kline-kvalue,
"%d/%d",cdate,ctime);
718 std::string *str = (std::string*)pointer;
720 }
else if (isTString) {
730 if (isdate ==
kFALSE && strcmp(memberFullTypeName,
"char*") && strcmp(memberFullTypeName,
"const char*")) {
731 i = strlen(&
line[0]);
line[i] =
' ';
732 assert(250 > ktitle);
733 strlcpy(&
line[ktitle],memberTitle,250-ktitle+1);
745 void *fRealDataObject;
749 TBuildRealData(
void *obj,
TClass *cl) {
751 fRealDataObject = obj;
762void TBuildRealData::Inspect(
TClass* cl,
const char* pname,
const char* mname,
const void* add,
Bool_t isTransient)
774 isTransientMember =
kTRUE;
781 if (cl != fRealDataClass) {
782 if (!fRealDataClass->InheritsFrom(cl)) {
783 Ssiz_t dot = rname.Index(
'.');
788 if (!fRealDataClass->GetDataMember(rname)) {
803 if (!fRealDataClass->GetBaseDataMember(rname)) {
818 fRealDataClass->GetListOfRealData()->Add(rd);
828 fRealDataClass->GetListOfRealData()->Add(rd);
873 void* addrForRecursion = 0;
874 if (GetObjectValidity() == kValidObjectGiven)
875 addrForRecursion =
const_cast<void*
>(add);
882 fRealDataClass->GetListOfRealData()->Add(rd);
899 fBrowser =
b; fCount = 0; }
900 virtual ~TAutoInspector() { }
903 virtual Bool_t IsTreatingNonAccessibleTypes() {
return kFALSE;}
909void TAutoInspector::Inspect(
TClass *cl,
const char *tit,
const char *
name,
910 const void *addr,
Bool_t )
912 if(tit && strchr(tit,
'.')) return ;
913 if (fCount && !fBrowser)
return;
920 int ln = strcspn(
name,
"[ ");
924 if (!classInfo)
return;
934 if ((found = (iname==mname)))
break;
946 if (mname ==
"G__virtualinfo")
return;
948 int size =
sizeof(
void*);
968 for(
int i=0; i<nmax; i++) {
970 char *ptr = (
char*)addr + i*size;
977 if (!fBrowser)
return;
985 bwname = actualClass->
GetName();
994 int l = strcspn(bwname.
Data(),
"[ ");
995 if (
l<bwname.
Length() && bwname[
l]==
'[') {
996 char cbuf[13];
snprintf(cbuf,13,
"[%02d]",i);
999 bwname = (
const char*)ts;
1005 fBrowser->Add(obj,clm,bwname);
1012 fBrowser->Add( obj, clm, bwname );
1018 int sz = proxy->
Size();
1020 char fmt[] = {
"#%09d"};
1021 fmt[3] =
'0'+(
int)
log10(
double(sz))+1;
1023 for (
int ii=0;ii<sz;ii++) {
1024 void *p = proxy->
At(ii);
1036 fBrowser->Add( p, actualCl, ts );
1075 TMmallocDescTemp setreset;
1092 fStreamerInfo(0), fConversionStreamerInfo(0), fRealData(0),
1093 fBase(0), fData(0), fUsingData(0), fEnums(0), fFuncTemplate(0), fMethod(0), fAllPubData(0),
1094 fAllPubMethod(0), fClassMenuList(0),
1095 fDeclFileName(
""), fImplFileName(
""), fDeclFileLine(0), fImplFileLine(0),
1096 fInstanceCount(0), fOnHeap(0),
1097 fCheckSum(0), fCollectionProxy(0), fClassVersion(0), fClassInfo(0),
1098 fTypeInfo(0), fShowMembers(0),
1099 fStreamer(0), fIsA(0), fGlobalIsA(0), fIsAMethod(0),
1100 fMerge(0), fResetAfterMerge(0), fNew(0), fNewArray(0), fDelete(0), fDeleteArray(0),
1101 fDestructor(0), fDirAutoAdd(0), fStreamerFunc(0), fConvStreamerFunc(0), fSizeof(-1),
1102 fCanSplit(-1), fIsSyntheticPair(
kFALSE), fProperty(0), fClassProperty(0), fHasRootPcmInfo(
kFALSE), fCanLoadClassInfo(
kFALSE),
1103 fIsOffsetStreamerSet(
kFALSE), fVersionUsed(
kFALSE), fRuntimeProperties(0), fOffsetStreamer(0), fStreamerType(
TClass::
kDefault),
1105 fCurrentInfo(0), fLastReadInfo(0), fRefProxy(0),
1106 fSchemaRules(0), fStreamerImpl(&
TClass::StreamerDefault)
1111 ::Fatal(
"TClass::TClass",
"ROOT system not initialized");
1114 TMmallocDescTemp setreset;
1121 ::Fatal(
"TClass::TClass",
"gInterpreter not initialized");
1125 ::Warning(
"TClass::TClass",
"no dictionary for class %s is available",
name);
1139 fStreamerInfo(0), fConversionStreamerInfo(0), fRealData(0),
1140 fBase(0), fData(0), fUsingData(0), fEnums(0), fFuncTemplate(0), fMethod(0), fAllPubData(0),
1141 fAllPubMethod(0), fClassMenuList(0),
1142 fDeclFileName(
""), fImplFileName(
""), fDeclFileLine(0), fImplFileLine(0),
1143 fInstanceCount(0), fOnHeap(0),
1144 fCheckSum(0), fCollectionProxy(0), fClassVersion(0), fClassInfo(0),
1145 fTypeInfo(0), fShowMembers(0),
1146 fStreamer(0), fIsA(0), fGlobalIsA(0), fIsAMethod(0),
1147 fMerge(0), fResetAfterMerge(0), fNew(0), fNewArray(0), fDelete(0), fDeleteArray(0),
1148 fDestructor(0), fDirAutoAdd(0), fStreamerFunc(0), fConvStreamerFunc(0), fSizeof(-1),
1149 fCanSplit(-1), fIsSyntheticPair(
kFALSE), fProperty(0), fClassProperty(0), fHasRootPcmInfo(
kFALSE), fCanLoadClassInfo(
kFALSE),
1150 fIsOffsetStreamerSet(
kFALSE), fVersionUsed(
kFALSE), fRuntimeProperties(0), fOffsetStreamer(0), fStreamerType(
TClass::
kDefault),
1152 fCurrentInfo(0), fLastReadInfo(0), fRefProxy(0),
1153 fSchemaRules(0), fStreamerImpl(&
TClass::StreamerDefault)
1156 Init(
name, cversion, 0, 0, 0, 0, -1, -1, 0, silent);
1166 fStreamerInfo(0), fConversionStreamerInfo(0), fRealData(0),
1167 fBase(0), fData(0), fUsingData(0), fEnums(0), fFuncTemplate(0), fMethod(0), fAllPubData(0),
1168 fAllPubMethod(0), fClassMenuList(0),
1169 fDeclFileName(
""), fImplFileName(
""), fDeclFileLine(0), fImplFileLine(0),
1170 fInstanceCount(0), fOnHeap(0),
1171 fCheckSum(0), fCollectionProxy(0), fClassVersion(0), fClassInfo(0),
1172 fTypeInfo(0), fShowMembers(0),
1173 fStreamer(0), fIsA(0), fGlobalIsA(0), fIsAMethod(0),
1174 fMerge(0), fResetAfterMerge(0), fNew(0), fNewArray(0), fDelete(0), fDeleteArray(0),
1175 fDestructor(0), fDirAutoAdd(0), fStreamerFunc(0), fConvStreamerFunc(0), fSizeof(-1),
1176 fCanSplit(-1), fIsSyntheticPair(
kFALSE), fProperty(0), fClassProperty(0), fHasRootPcmInfo(
kFALSE), fCanLoadClassInfo(
kFALSE),
1177 fIsOffsetStreamerSet(
kFALSE), fVersionUsed(
kFALSE), fRuntimeProperties(0), fOffsetStreamer(0), fStreamerType(
TClass::
kDefault),
1179 fCurrentInfo(0), fLastReadInfo(0), fRefProxy(0),
1180 fSchemaRules(0), fStreamerImpl(&
TClass::StreamerDefault)
1192 "A TClass entry cannot be initialized in a state different from kForwardDeclared or kEmulated.");
1193 Init(
name, cversion, 0, 0, 0, 0, -1, -1, 0, silent);
1210 fStreamerInfo(0), fConversionStreamerInfo(0), fRealData(0),
1211 fBase(0), fData(0), fUsingData(0), fEnums(0), fFuncTemplate(0), fMethod(0), fAllPubData(0),
1212 fAllPubMethod(0), fClassMenuList(0),
1213 fDeclFileName(
""), fImplFileName(
""), fDeclFileLine(0), fImplFileLine(0),
1214 fInstanceCount(0), fOnHeap(0),
1215 fCheckSum(0), fCollectionProxy(0), fClassVersion(0), fClassInfo(0),
1216 fTypeInfo(0), fShowMembers(0),
1217 fStreamer(0), fIsA(0), fGlobalIsA(0), fIsAMethod(0),
1218 fMerge(0), fResetAfterMerge(0), fNew(0), fNewArray(0), fDelete(0), fDeleteArray(0),
1219 fDestructor(0), fDirAutoAdd(0), fStreamerFunc(0), fConvStreamerFunc(0), fSizeof(-1),
1220 fCanSplit(-1), fIsSyntheticPair(
kFALSE), fProperty(0), fClassProperty(0), fHasRootPcmInfo(
kFALSE), fCanLoadClassInfo(
kFALSE),
1221 fIsOffsetStreamerSet(
kFALSE), fVersionUsed(
kFALSE), fRuntimeProperties(0), fOffsetStreamer(0), fStreamerType(
TClass::
kDefault),
1223 fCurrentInfo(0), fLastReadInfo(0), fRefProxy(0),
1224 fSchemaRules(0), fStreamerImpl(&
TClass::StreamerDefault)
1229 ::Fatal(
"TClass::TClass",
"ROOT system not initialized");
1235 ::Fatal(
"TClass::TClass",
"gInterpreter not initialized");
1237 if (!classInfo || !
gInterpreter->ClassInfo_IsValid(classInfo)) {
1244 Init(
fName, cversion, 0, 0, dfil, ifil, dl, il, classInfo, silent);
1260 fStreamerInfo(0), fConversionStreamerInfo(0), fRealData(0),
1261 fBase(0), fData(0), fUsingData(0), fEnums(0), fFuncTemplate(0), fMethod(0), fAllPubData(0),
1262 fAllPubMethod(0), fClassMenuList(0),
1263 fDeclFileName(
""), fImplFileName(
""), fDeclFileLine(0), fImplFileLine(0),
1264 fInstanceCount(0), fOnHeap(0),
1265 fCheckSum(0), fCollectionProxy(0), fClassVersion(0), fClassInfo(0),
1266 fTypeInfo(0), fShowMembers(0),
1267 fStreamer(0), fIsA(0), fGlobalIsA(0), fIsAMethod(0),
1268 fMerge(0), fResetAfterMerge(0), fNew(0), fNewArray(0), fDelete(0), fDeleteArray(0),
1269 fDestructor(0), fDirAutoAdd(0), fStreamerFunc(0), fConvStreamerFunc(0), fSizeof(-1),
1270 fCanSplit(-1), fIsSyntheticPair(
kFALSE), fProperty(0), fClassProperty(0), fHasRootPcmInfo(
kFALSE), fCanLoadClassInfo(
kFALSE),
1271 fIsOffsetStreamerSet(
kFALSE), fVersionUsed(
kFALSE), fRuntimeProperties(0), fOffsetStreamer(0), fStreamerType(
TClass::
kDefault),
1273 fCurrentInfo(0), fLastReadInfo(0), fRefProxy(0),
1274 fSchemaRules(0), fStreamerImpl(&
TClass::StreamerDefault)
1277 Init(
name,cversion, 0, 0, dfil, ifil, dl, il, 0, silent);
1286 const char *dfil,
const char *ifil,
Int_t dl,
Int_t il,
1290 fStreamerInfo(0), fConversionStreamerInfo(0), fRealData(0),
1291 fBase(0), fData(0), fUsingData(0), fEnums(0), fFuncTemplate(0), fMethod(0), fAllPubData(0),
1294 fDeclFileName(
""), fImplFileName(
""), fDeclFileLine(0), fImplFileLine(0),
1295 fInstanceCount(0), fOnHeap(0),
1296 fCheckSum(0), fCollectionProxy(0), fClassVersion(0), fClassInfo(0),
1297 fTypeInfo(0), fShowMembers(0),
1298 fStreamer(0), fIsA(0), fGlobalIsA(0), fIsAMethod(0),
1299 fMerge(0), fResetAfterMerge(0), fNew(0), fNewArray(0), fDelete(0), fDeleteArray(0),
1300 fDestructor(0), fDirAutoAdd(0), fStreamerFunc(0), fConvStreamerFunc(0), fSizeof(-1),
1301 fCanSplit(-1), fIsSyntheticPair(
kFALSE), fProperty(0), fClassProperty(0), fHasRootPcmInfo(
kFALSE), fCanLoadClassInfo(
kFALSE),
1302 fIsOffsetStreamerSet(
kFALSE), fVersionUsed(
kFALSE), fRuntimeProperties(0), fOffsetStreamer(0), fStreamerType(
TClass::
kDefault),
1303 fState(kHasTClassInit),
1304 fCurrentInfo(0), fLastReadInfo(0), fRefProxy(0),
1305 fSchemaRules(0), fStreamerImpl(&
TClass::StreamerDefault)
1309 Init(
name, cversion, &info, isa, dfil, ifil, dl, il, 0, silent);
1327 info->
Clear(
"build");
1351 const char *dfil,
const char *ifil,
Int_t dl,
Int_t il,
1352 ClassInfo_t *givenInfo,
1356 ::Fatal(
"TClass::TClass",
"ROOT system not initialized");
1358 ::Error(
"TClass::Init",
"The name parameter is invalid (null or empty)");
1399 TClass **persistentRef = 0;
1417 info->
Clear(
"build");
1435 (*fMethod).fClass =
this;
1447 ::Fatal(
"TClass::Init",
"gInterpreter not initialized");
1450 bool invalid = !
gInterpreter->ClassInfo_IsValid(givenInfo);
1451 bool notloaded = !
gInterpreter->ClassInfo_IsLoaded(givenInfo);
1452 auto property =
gInterpreter->ClassInfo_Property(givenInfo);
1454 if (invalid || (notloaded && (property &
kIsNamespace)) ||
1494 proto->FillTClass(
this);
1520 ::Error(
"TClass::Init",
"no interpreter information for class %s is available even though it has a TClass "
1521 "initialization routine.",
1539 if (!givenInfo && strchr (
name,
'<')) {
1551 if (resolvedThis !=
name) {
1575 if (resolvedThis !=
fName) {
1576 oldcl = (
TClass*)
gROOT->GetListOfClasses()->FindObject(resolvedThis);
1577 if (oldcl && oldcl !=
this) {
1583 while ( TNameMapNode* htmp =
static_cast<TNameMapNode*
> (next()) ) {
1584 if (resolvedThis != htmp->String())
continue;
1585 oldcl = (
TClass*)
gROOT->GetListOfClasses()->FindObject(htmp->fOrigName);
1586 if (oldcl && oldcl !=
this) {
1604 if (persistentRef) {
1611 if ( isStl || !strncmp(
GetName(),
"stdext::hash_",13) || !strncmp(
GetName(),
"__gnu_cxx::hash_",16) ) {
1622 }
else if (!silent) {
1623 Warning(
"Init",
"Collection proxy for %s was not properly initialized!",
GetName());
1648 while ( TNameMapNode* htmp =
static_cast<TNameMapNode*
> (next()) ) {
1649 if (resolvedThis == htmp->String() && htmp->fOrigName ==
GetName()) {
1675 (*fUsingData).Delete();
1720 std::map<std::string, TObjArray*>::iterator it;
1721 std::map<std::string, TObjArray*>::iterator end = (*fConversionStreamerInfo).end();
1722 for( it = (*fConversionStreamerInfo).begin(); it != end; ++it ) {
1732 Int_t ReadRulesContent(FILE *
f)
1744 while ((
c = fgetc(
f)) != EOF) {
1750 if (rule.Length() > 0) {
1802 static const char *suffix =
"class.rules";
1808 FILE *
f = fopen(sname,
"r");
1810 res = ReadRulesContent(
f);
1813 ::Error(
"TClass::ReadRules()",
"Cannot find rules file %s", sname.
Data());
1826 if (!filename || !filename[0]) {
1827 ::Error(
"TClass::ReadRules",
"no file name specified");
1831 FILE *
f = fopen(filename,
"r");
1833 ::Error(
"TClass::ReadRules",
"Failed to open %s\n",filename);
1836 Int_t count = ReadRulesContent(
f);
1889 ::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).",
1950 TAutoInspector insp(
b);
1951 obj->ShowMembers(insp);
1972 }
else if (actual !=
this) {
1973 return actual->
Browse(obj,
b);
1979 TAutoInspector insp(
b);
2022 isTransient =
kTRUE;
2027 TMmallocDescTemp setreset;
2038 static TClassRef clRefString(
"std::string");
2039 if (clRefString ==
this) {
2049 Error(
"BuildRealData",
"Inspection for %s not supported!",
GetName());
2055 TBuildRealData brd(pointer,
this);
2061 if ( isTransient ) {
2069 Error(
"BuildRealData",
"Cannot find any ShowMembers function for %s!",
GetName());
2084 c->BuildRealData(0, isTransient);
2104 Error(
"BuildEmulatedRealData",
"Missing StreamerInfo for %s",
GetName());
2170 TMmallocDescTemp setreset;
2197 if (strcmp(
GetName(),
"string") == 0) {
2205 gInterpreter->InspectMembers(insp, obj,
this, isTransient);
2209 sinfo->CallShowMembers(obj, insp, isTransient);
2224 return gInterpreter->InspectMembers(insp, obj,
this, isTransient);
2288 }
else if (!
c->CanSplitBaseAllow()) {
2332 static TClassRef stdStringClass(
"std::string");
2389 if (new_name == 0 || new_name[0]==
'\0' ||
fName == new_name) {
2390 Error(
"Clone",
"The name of the class must be changed when cloning a TClass object.");
2420 copy->
fName = new_name;
2475 if (!padsav || !opt.
Contains(
"same")) {
2478 gROOT->ProcessLine(
"new TCanvas(\"R__class\",\"class\",20,20,1000,750);");
2484 if (
gPad)
gPad->DrawClassObject(
this,option);
2486 if (padsav) padsav->
cd();
2527 if (
sizeof(
this) == 4)
2530 Printf(
"==> Dumping object at: 0x%016lx, name=%s, class=%s\n",prObj,tobj->
GetName(),
GetName());
2533 if (
sizeof(
this) == 4)
2534 Printf(
"==> Dumping object at: 0x%08lx, class=%s\n",prObj,
GetName());
2536 Printf(
"==> Dumping object at: 0x%016lx, class=%s\n",prObj,
GetName());
2539 TDumpMembers dm(noAddr);
2541 Info(
"Dump",
"No ShowMembers function, dumping disabled");
2551 static const UInt_t maxsize = 255;
2552 static char name[maxsize+2];
2556 for (
UInt_t i = 0; i < nch && icur < maxsize; ++i, ++icur) {
2557 if (
text[i] ==
'\"' ||
text[i] ==
'[' ||
text[i] ==
'~' ||
2560 text[i] ==
'?' ||
text[i] ==
'>') {
2590 if (
object==0)
return (
TClass*)
this;
2603 return realTObject->IsA();
2638 if (strcmp(
GetName(), classname) == 0)
return this;
2657 if (cl ==
this)
return this;
2669 if (cl ==
c)
return c;
2670 c1 =
c->GetBaseClass(cl);
2688 if (cl ==
this)
return 0;
2690 if (!
fBase.load()) {
2697 if (!sinfo)
return -1;
2703 for(
Int_t i=0; i<size; i++) {
2709 if (!baseclass)
return -1;
2711 if (subOffset == -2)
return -2;
2712 if (subOffset != -1)
return offset+subOffset;
2713 offset += baseclass->
Size();
2717 if (!baseclass)
return -1;
2719 if (subOffset == -2)
return -2;
2720 if (subOffset != -1)
return offset+subOffset;
2721 offset += baseclass->
Size();
2724 Error(
"GetBaseClassOffsetRecurse",
"Unexpected element type for base class: %s\n",element->IsA()->
GetName());
2736 if (
fBase.load() == 0)
2739 lnk =
fBase.load()->FirstLink();
2755 off =
c->GetBaseClassOffsetRecurse(cl);
2756 if (off == -2)
return -2;
2775 if (
this == toBase)
return 0;
2791 if(derived && base) {
2813 if (dm)
return this;
2821 TClass *cdm =
c->GetBaseDataMember(datamember);
2822 if (cdm)
return cdm;
2833 struct TClassLocalStorage {
2834 TClassLocalStorage() : fCollectionProxy(0), fStreamer(0) {};
2839 static TClassLocalStorage *GetStorage(
const TClass *cl)
2845 if (*thread_ptr==0) *thread_ptr =
new TExMap();
2852 local = (
ULong_t)
new TClassLocalStorage();
2855 return (TClassLocalStorage*)local;
2883 TClassLocalStorage *local = TClassLocalStorage::GetStorage(
this);
2886 return local->fCollectionProxy;
2897 TClassLocalStorage *local = TClassLocalStorage::GetStorage(
this);
2899 if (local->fStreamer==0) {
2901 const std::type_info &orig = (
typeid(*fStreamer) );
2902 if (!local->fStreamer) {
2903 Warning(
"GetStreamer",
"For %s, the TClassStreamer (%s) passed's call to Generate failed!",
GetName(),orig.name());
2905 const std::type_info © = (
typeid(*local->fStreamer) );
2906 if (strcmp(orig.name(),copy.name())!=0) {
2907 Warning(
"GetStreamer",
"For %s, the TClassStreamer passed does not properly implement the Generate method (%s vs %s)\n",
GetName(),orig.name(),copy.name());
2911 return local->fStreamer;
2957 if (strstr(
name,
"(anonymous)"))
return 0;
2958 if (strncmp(
name,
"class ",6)==0)
name += 6;
2959 if (strncmp(
name,
"struct ",7)==0)
name += 7;
2961 if (!
gROOT->GetListOfClasses())
return 0;
3016 if (!cl && !load)
return 0;
3018 TClass *loadedcl = (dict)();
3028 std::string normalizedName;
3037 if (normalizedName !=
name) {
3038 cl = (
TClass*)
gROOT->GetListOfClasses()->FindObject(normalizedName.c_str());
3049 normalizedName = cl->
GetName();
3050 checkTable = load && (normalizedName !=
name);
3053 if (!load)
return 0;
3090 if (!loadedcl && !ispair && !ispairbase) {
3091 if (
TDataType* theDataType =
gROOT->GetType(normalizedName.c_str())){
3093 auto underlyingTypeName = theDataType->GetTypeName();
3096 if (underlyingTypeDict){
3097 loadedcl = underlyingTypeDict();
3103 if (loadedcl)
return loadedcl;
3107 if (loadedcl)
return loadedcl;
3114 if (hint_pair_offset && hint_pair_size) {
3122 static const size_t slen = strlen(
"pair");
3123 static const char *associativeContainer[] = {
"map",
"unordered_map",
"multimap",
3124 "unordered_multimap",
"set",
"unordered_set",
"multiset",
"unordered_multiset" };
3125 for(
auto contname : associativeContainer) {
3126 std::string collname = contname;
3127 collname.append( normalizedName.c_str() + slen );
3134 cl = p->GetValueClass();
3147 std::string::size_type posLess = normalizedName.find(
'<');
3148 if (posLess != std::string::npos) {
3155 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());
3157 if (normalizedName.length()) {
3167 auto ci =
gInterpreter->ClassInfo_Factory(normalizedName.c_str());
3169 auto method =
gInterpreter->MethodInfo_Factory(funcDecl);
3175 funcPtr(0, 0,
nullptr, &res);
3187 std::string alternative;
3188 gInterpreter->GetInterpreterTypeName(normalizedName.c_str(), alternative,
kTRUE);
3189 if (alternative.empty())
3191 const char *altname = alternative.c_str();
3192 if (strncmp(altname,
"std::", 5) == 0) {
3197 if (altname != normalizedName && strcmp(altname,
name) != 0) {
3224 if (!
gROOT->GetListOfClasses())
3232 if (cl && cl->
IsLoaded())
return cl;
3239 cl =
GetIdMap()->Find(typeinfo.name());
3258 if (!load)
return 0;
3268 TIter next(
gROOT->GetListOfClassGenerators());
3280 if (!autoload_old) {
3287 cl =
GetClass(typeinfo, load, hint_pair_offset, hint_pair_size);
3293 if (hint_pair_offset) {
3298 free(demangled_name);
3322 if (!
gROOT->GetListOfClasses())
return 0;
3343 if (!load)
return 0;
3346 if (cl) loadedcl =
gROOT->LoadClass(cl->
GetName(),silent);
3347 else loadedcl =
gROOT->LoadClass(
name,silent);
3349 if (loadedcl)
return loadedcl;
3374 if (!
gROOT->GetListOfClasses())
return 0;
3378 DeclIdMap_t::equal_range iter = map->Find(
id);
3379 if (iter.first == iter.second)
return false;
3380 std::vector<TClass*>::iterator vectIt = classes.begin();
3381 for (DeclIdMap_t::const_iterator it = iter.first; it != iter.second; ++it)
3382 vectIt = classes.insert(vectIt, it->second);
3410 || datamember == 0)
return 0;
3413 const char *start_name = datamember;
3414 while (*start_name ==
'*') ++start_name;
3419 if (
const char *
s = strchr(start_name,
'[')){
3449 if (strchr(
name,
'[')==0) {
3491 std::string givenName(
name);
3494 std::string::size_type firstBracket = givenName.find_first_of(
"[");
3495 if (firstBracket != std::string::npos) {
3497 std::string nameNoDim(givenName.substr(0, firstBracket));
3501 std::string objName(obj->
GetName());
3502 std::string::size_type pos = objName.find_first_of(
"[");
3504 if (pos != std::string::npos) {
3506 if (objName == nameNoDim) {
3515 std::ostringstream ptrname;
3516 ptrname <<
"*" << givenName;
3523 std::string::size_type firstDot = givenName.find_first_of(
".");
3524 if (firstDot == std::string::npos) {
3535 std::string::size_type lastDot = givenName.find_last_of(
".");
3536 std::ostringstream starname;
3537 starname << givenName.substr(0, lastDot) <<
".*" << givenName.substr(lastDot + 1);
3553 std::string::size_type bracket = starname.str().find_first_of(
"[");
3554 if (bracket != std::string::npos) {
3563 std::string firstDotName(givenName.substr(firstDot + 1));
3606 if (!
fBase.load()) {
3627 Fatal(
"GetListOfBases",
"gInterpreter not initialized");
3630 if (!
fBase.load()) {
3656 auto temp =
fEnums.load();
3658 if (requestListLoading) {
3673 if (!requestListLoading) {
3728 if (!(*data).IsLoaded())
3731 }
else if (load) (*data).Load();
3742 auto data =
fData.load();
3743 if (data && data->IsLoaded())
3745 }
else if (!load &&
fData)
3786 if (
gDebug>0)
Info(
"GetListOfMethods",
"Header Parsing - Asking for all the methods of class %s: this can involve parsing.",
GetName());
3819 if (
gDebug>0)
Info(
"GetListOfAllPublicMethods",
"Header Parsing - Asking for all the methods of class %s: this can involve parsing.",
GetName());
3849 while ((baseClass = (
TBaseClass *) nextBase())) {
3857 while ((method = (
TMethod*)next())) {
3863 if (
m &&
m->GetNargs() == method->
GetNargs())
3888 return cl->IsLoaded();
3916 TIter nextMemb(ldm);
3947 for (
int i = 0; i < 2; i++) {
3963 if (
this == sCIString)
return;
3975 auto checkDicts = [&](
const string &clName){
3982 if (cl && !cl->HasDictionary()) {
3983 cl->GetMissingDictionariesWithRecursionCheck(result, visited, recurse);
3987 const auto &elements = splitType.
fElements;
3988 const auto &templName = elements[0];
3991 if (templName ==
"pair") {
3999 if (templName ==
"unique_ptr" || templName ==
"array") {
4000 checkDicts(elements[1]);
4007 if (templName ==
"tuple") {
4010 const auto nTemplArgs = elements.size() - 1;
4012 for (
auto iTemplArg = 1U; iTemplArg < nTemplArgs; ++iTemplArg) {
4013 checkDicts(elements[iTemplArg]);
4062 if (
this == sCIString)
return;
4119 while ((acl = (
TClass*)nextClass())) {
4120 if (acl == newcl)
continue;
4125 info->
Update(
this, newcl);
4137 Warning(
"ResetClassInfo(Long_t tagnum)",
"Call to deprecated interface (does nothing)");
4186 (*fUsingData).Unload();
4190 (*fMethod).Unload();
4224 if (options==0 || options[0]==0)
return;
4226 if (strstr(options,
"streamerinfo")!=0) {
4230 std::map<std::string, TObjArray*>::iterator it;
4231 std::map<std::string, TObjArray*>::iterator end = (*fConversionStreamerInfo).end();
4232 for( it = (*fConversionStreamerInfo).begin(); it != end; ++it ) {
4233 it->second->ls(options);
4260 TIter next(methodList);
4262 while ((method = (
TMethod*) next())) {
4264 if (classPtr != method->
GetClass()) {
4272 TIter nextarg(margsList);
4273 while ((methodArg = (
TMethodArg*)nextarg())) {
4323 if(
fMethod.compare_exchange_strong(expected, temp.get()) ) {
4359 m =
c->GetMethodAllAny(method);
4381 Fatal(
"GetMethod",
"gInterpreter not initialized");
4387 if (!decl)
return 0;
4394 "\nDid not find matching TMethod <%s> with \"%s\" %sfor %s",
4395 method,params,objectIsConst ?
"const " :
"",
GetName());
4405 return static_cast<TMethod *
>(method);
4409 if (
TFunction* method = base->FindClassOrBaseMethodWithId(declId))
4410 return static_cast<TMethod *
>(method);
4427 Fatal(
"GetMethodWithPrototype",
"gInterpreter not initialized");
4431 objectIsConst, mode);
4433 if (!decl)
return 0;
4436 Error(
"GetMethodWithPrototype",
4437 "\nDid not find matching TMethod <%s> with \"%s\" %sfor %s",
4438 method,
proto,objectIsConst ?
"const " :
"",
GetName());
4453 if (faddr == (
Long_t)
m->InterfaceMethod())
4472 Fatal(
"GetClassMethod",
"gInterpreter not initialized");
4478 if (!decl)
return 0;
4498 Fatal(
"GetClassMethodWithPrototype",
"gInterpreter not initialized");
4505 if (!decl)
return 0;
4604 Error(
"GetStreamerInfo",
"class: %s, attempting to access a wrong version: %d",
GetName(), version);
4623 TMmallocDescTemp setreset;
4632 sinfo->
Build(silent);
4677 newname +=
"@@emulated";
4702 for (
Int_t i = -1; sinfo == 0 && i < ninfos; ++i)
4715 Error(
"GetStreamerInfoAbstractEmulated",
"could not create TVirtualStreamerInfo");
4740 newname +=
"@@emulated";
4755 if (!sinfo && (checksum !=
fCheckSum)) {
4765 for (
Int_t i = -1; sinfo == 0 && i < ninfos; ++i)
4778 Error(
"GetStreamerInfoAbstractEmulated",
"could not create TVirtualStreamerInfo");
4825 Error(
"IgnoreTObjectStreamer",
"Must be called before the creation of StreamerInfo");
4851 if (cl ==
this)
return kTRUE;
4861 if (!clbase)
return kFALSE;
4880 if (cl ==
this)
return obj;
4887 return (
void*)((
Long_t)obj+off);
4889 return (
void*)((
Long_t)obj-off);
4943 auto obj =
NewObject(defConstructor, quiet);
4944 if (obj.GetPtr() && obj.GetAllocator()) {
4948 return obj.GetPtr();
4965 TClass__GetCallingNewRAII callingNew(defConstructor);
4970 Error(
"New",
"cannot create object of class %s",
GetName());
4982 TClass__GetCallingNewRAII callingNew(defConstructor);
4987 Error(
"New",
"cannot create object of class %s",
GetName());
4994 TClass__GetCallingNewRAII callingNew(defConstructor);
4999 Error(
"New",
"cannot create object of class %s",
GetName());
5027 TClass__GetCallingNewRAII callingNew(defConstructor);
5028 p = { sinfo->
New(), sinfo};
5038 Error(
"New",
"Failed to construct class '%s' using streamer info",
GetName());
5043 Fatal(
"New",
"This cannot happen!");
5056 auto obj =
NewObject(arena, defConstructor);
5057 if (obj.GetPtr() && obj.GetAllocator()) {
5061 return obj.GetPtr();
5079 TClass__GetCallingNewRAII callingNew(defConstructor);
5083 Error(
"New with placement",
"cannot create object of class %s version %d at address %p",
GetName(),
fClassVersion, arena);
5095 TClass__GetCallingNewRAII callingNew(defConstructor);
5099 Error(
"New with placement",
"cannot create object of class %s version %d at address %p",
GetName(),
fClassVersion, arena);
5106 TClass__GetCallingNewRAII callingNew(defConstructor);
5128 Error(
"New with placement",
"Cannot construct class '%s' version %d at address %p, no streamer info available!",
GetName(),
fClassVersion, arena);
5133 TClass__GetCallingNewRAII callingNew(defConstructor);
5134 p = { sinfo->
New(arena), sinfo };
5144 Error(
"New with placement",
"This cannot happen!");