90 for(
Int_t ind = last-1; ind >= at; --ind) {
91 arr->
AddAt( arr->
At(ind), ind+1);
99 Int_t offset = objs.size();
102 for(
Int_t ind = last-1; ind >= at; --ind) {
103 arr->
AddAt( arr->
At(ind), ind+offset);
105 for(
size_t ins = 0; ins < objs.size(); ++ins) {
106 arr->
AddAt(objs[ins], at+ins);
115 while (at<last && arr->At(at) != oldobj) {
127 while (at<last && arr->At(at) != oldobj) {
237 struct TPreventRecursiveBuildGuard {
238 TPreventRecursiveBuildGuard(
TStreamerInfo* info): fInfo(info) {
242 ~TPreventRecursiveBuildGuard() {
273 TPreventRecursiveBuildGuard buildGuard(
this);
299 ROOT::TSchemaRuleSet::TMatches rules;
324 Error(
"Build()",
"Cannot stream virtual base %s of class %s",
328 const char* bname = base->
GetName();
329 const char* btitle = base->
GetTitle();
331 if (!strcmp(bname,
"string")) {
339 Error(
"Build",
"The class \"%s\" is compiled and its base class \"%s\" is a collection and we do not have a dictionary for it, we will not be able to read or write this base class.",
GetName(),bname);
353 Warning(
"Build",
"%s: base class %s has no streamer or dictionary it will not be saved",
GetName(), clm->
GetName());
369 if (!clm->
IsLoaded() && !(isCollection || isString)) {
372 Warning(
"Build",
"%s: base class %s has no streamer or dictionary it will not be saved",
GetName(), clm->
GetName());
388 std::string typeNameBuf;
389 std::string trueTypeNameBuf;
407 const char* dmName = dm->
GetName();
408 const char* dmTitle = dm->
GetTitle();
414 std::array<Int_t, 5> maxIndices;
424 while(typeNameBuf.back() ==
'*') typeNameBuf.pop_back();
425 dmFull = trueTypeNameBuf.c_str();
426 dmType = typeNameBuf.c_str();
433 trueTypeNameBuf = typeNameBuf;
434 while(typeNameBuf.back() ==
'*') typeNameBuf.pop_back();
435 dmFull = dmType = typeNameBuf.c_str();
436 dt =
gROOT->GetType(dmType);
449 const char* rbracket = ::strchr(dmTitle,
']');
450 if (lbracket && rbracket) {
454 Error(
"Build",
"%s, discarding: %s %s, illegal %s\n",
GetName(), dmFull, dmName, dmTitle);
460 if (!dtCounter || !isInteger) {
461 Error(
"Build",
"%s, discarding: %s %s, illegal [%s] (must be Int_t)\n",
GetName(), dmFull, dmName, counterName);
469 Error(
"Build",
"%s, discarding: %s %s, illegal [%s] must be placed before \n",
GetName(), dmFull, dmName, counterName);
479 if (!dmCounter && (strstr(dmFull,
"char*") || strstr(dmFull,
"Char_t*"))) {
481 dsize =
sizeof(
char*);
484 Error(
"Build",
"%s, unknown type: %s %s",
GetName(), dmFull, dmName);
486 }
else if (dmIsPtr && (dtype !=
kCharStar)) {
491 if ((
fName ==
"TString") || (
fName ==
"TClass")) {
494 Error(
"Build",
"%s, discarding: %s %s, no [dimension]\n",
GetName(), dmFull, dmName);
508 static const char* full_string_name =
"basic_string<char,char_traits<char>,allocator<char> >";
509 if (!strcmp(dmType,
"string") || !strcmp(dmType,
"std::string") || !strcmp(dmType, full_string_name)) {
513 if (proxy) element =
new TStreamerSTL(dmName, dmTitle, offset, dmFull, *proxy, dmIsPtr);
514 else element =
new TStreamerSTL(dmName, dmTitle, offset, dmFull, dmFull, dmIsPtr);
517 auto printErrorMsg = [&](
const char* category)
519 Error(
"Build",
"The class \"%s\" is %s and for its data member \"%s\" we do not have a dictionary for the collection \"%s\". Because of this, we will not be able to read or write this data member.",
GetName(), category, dmName, dmType);
523 printErrorMsg(
"compiled");
529 printErrorMsg(
"interpreted");
538 Error(
"Build",
"%s, unknown type: %s %s\n",
GetName(), dmFull, dmName);
556 Error(
"Build",
"%s: %s has no streamer or dictionary, data member %s will not be saved",
GetName(), dmFull, dmName);
567 Warning(
"Build",
"%s: %s has no streamer or dictionary, data member \"%s\" will not be saved",
GetName(), dmFull, dmName);
579 for (
Int_t i = 0; i < ndim; ++i) {
581 if (isStdArray) maxIndex = maxIndices[i];
601 if ( !wasCompiled && (rules && rules.HasRuleWithSource( element->
GetName(),
kTRUE )) ) {
602 needAllocClass =
kTRUE;
611 && rules && !rules.HasRuleWithTarget( element->
GetName(),
kTRUE ) )
640 if (needAllocClass) {
714 Bool_t isstl = element && strcmp(
"This",element->
GetName())==0;
716 if (element->
GetTitle()[0] ==
'<') {
721 if (content[
c] ==
'<') ++level;
722 else if (content[
c] ==
'>') --level;
733 "Update the collection proxy of the class \"%s\" \n"
734 "\tto be similar to \"%s\".",
739 The class %s had a collection proxy when written but it is not an STL\n \
740 collection and we did not record the type of the content of the collection.\n \
741 We will claim the content is a bool (i.e. no data will be read).",
772 ::Warning(
"TClass::TClass",
"no dictionary for class %s is available",
GetName());
779 Bool_t isstl = element && strcmp(
"This",element->
GetName())==0;
781 if (element->
GetTitle()[0] ==
'<') {
786 if (content[
c] ==
'<') ++level;
787 else if (content[
c] ==
'>') --level;
798 "Update the collection proxy of the class \"%s\" \n"
799 "\tto be similar to \"%s\".",
804 The class %s had a collection proxy when written but it is not an STL\n \
805 collection and we did not record the type of the content of the collection.\n \
806 We will claim the content is a bool (i.e. no data will be read).",
828 searchOnChecksum =
kFALSE;
834 searchOnChecksum =
kTRUE;
841 searchOnChecksum =
kFALSE;
847 searchOnChecksum =
kTRUE;
857 searchOnChecksum =
kFALSE;
863 searchOnChecksum =
kTRUE;
874 if (!searchOnChecksum) {
880 for (
Int_t i = -1; i < ninfos; ++i) {
897 while ((slot < ninfos) && (array->
UncheckedAt(slot) != 0)) {
943#ifdef TEST_FOR_BACKWARD_COMPATIBILITY_ABSTRACT_CLASSES
1004 for (
Int_t i = 0; i < nel; ++i) {
1022 if (oldIsNonVersioned) {
1025 The class %s transitioned from not having a specified class version\n\
1026 to having a specified class version (the current class version is %d).\n\
1027 However too many different non-versioned layouts of the class have been\n\
1028 loaded so far. This prevent the proper reading of objects written with\n\
1029 the class layout version %d, in particular from the file:\n\
1031 To work around this issue, load fewer 'old' files in the same ROOT session.",
1035 The class %s transitioned from not having a specified class version\n\
1036 to having a specified class version (the current class version is %d).\n\
1037 However too many different non-versioned layouts of the class have been\n\
1038 loaded so far. This prevent the proper reading of objects written with\n\
1039 the class layout version %d.\n\
1040 To work around this issue, load fewer 'old' files in the same ROOT session.",
1047 The StreamerInfo for version %d of class %s read from the file %s\n\
1048 has a different checksum than the previously loaded StreamerInfo.\n\
1049 Reading objects of type %s from the file %s \n\
1050 (and potentially other files) might not work correctly.\n\
1051 Most likely the version number of the class was not properly\n\
1052 updated [See ClassDef(%s,%d)].",
1056 The StreamerInfo from %s does not match existing one (%s:%d)\n\
1057 The existing one has not been used yet and will be discarded.\n\
1058 Reading the file %s will work properly, however writing object of\n\
1059 type %s will not work properly. Most likely the version number\n\
1060 of the class was not properly updated [See ClassDef(%s,%d)].",
1066 The StreamerInfo for version %d of class %s\n\
1067 has a different checksum than the previously loaded StreamerInfo.\n\
1068 Reading objects of type %s\n\
1069 (and potentially other files) might not work correctly.\n\
1070 Most likely the version number of the class was not properly\n\
1071 updated [See ClassDef(%s,%d)].",
1075 The StreamerInfo from %s does not match existing one (%s:%d)\n\
1076 The existing one has not been used yet and will be discarded.\n\
1077 Reading should work properly, however writing object of\n\
1078 type %s will not work properly. Most likely the version number\n\
1079 of the class was not properly updated [See ClassDef(%s,%d)].",
1111#ifdef TEST_FOR_BACKWARD_COMPATIBILITY_ABSTRACT_CLASSES
1147 The StreamerInfo of class %s read from file %s\n\
1148 has the same version (=%d) as the active class but a different checksum.\n\
1149 You should update the version to ClassDef(%s,%d).\n\
1150 Do not try to write objects with the current class definition,\n\
1154 The StreamerInfo of class %s \n\
1155 has the same version (=%d) as the active class but a different checksum.\n\
1156 You should update the version to ClassDef(%s,%d).\n\
1157 Do not try to write objects with the current class definition,\n\
1165 Fatal(
"BuildCheck",
"\n\
1166 The StreamerInfo of unversioned class %s \n\
1167 has the same version (=%d) as the active class but an old checksum.\n\
1199 fNumber = maininfo->GetNumber();
1232 for (
Int_t i=0;i < ndata;i++) {
1234 if (!element)
break;
1241 if (ty <=
kULong)
continue;
1245 {
for (
int j=ndata-1;j>=i;j--) {elements->
AddAtAndExpand(elements->
At(j),j+1);}}
1246 elements->
AddAt(bt,i);
1268 Warning(
"BuildFor",
"The build of %s streamer info for %s has been requested, but no matching conversion rules were specified",
GetName(), in_memory_cl->
GetName() );
1286 if (oldClass == 0 || newClass == 0)
return kFALSE;
1291 const char *oldname = oldClass->
GetName();
1292 for (
UInt_t i = oldlen, done =
false, nest = 0; (i>0) && !done ; --i) {
1293 switch (oldClass->
GetName()[i-1]) {
1294 case '>' : ++nest;
break;
1295 case '<' :
if (nest==0)
return kFALSE;
1297 case ':' :
if (nest == 0) oldname= &(oldClass->
GetName()[i]); done =
kTRUE;
break;
1300 oldlen = strlen(oldname);
1301 if (!(strlen(newClass->
GetName()) > strlen(oldClass->
GetName()))) {
1305 const char* newEnd = & (newClass->
GetName()[newlen-oldlen]);
1307 if (0 != strcmp(newEnd, oldname)) {
1335 Error(
"ImportStreamerInfo",
"Unable to clone the StreamerInfo for %s.",(*next)->GetName());
1381 if (oldContent == newContent) {
1382 contentMatch =
kTRUE;
1383 }
else if (newContent) {
1386 if (oldFlatContent == newFlatContent) {
1387 contentMatch =
kTRUE;
1393 contentMatch = (newContent==0);
1397 if ((oldContent==0 && oldProxy->
GetType() == newProxy->
GetType())
1474 TClass *FindAlternate(
TClass *context,
const std::string &i_name, std::string& newName)
1480 std::string
name(i_name);
1482 if (
name.compare(0,6,
"const ")==0) {
1488 while(
name[
name.length()-nstars-1]==
'*') {
1493 name.erase(
name.length()-nstars,nstars);
1496 std::string alternate(context->
GetName());
1497 alternate.append(
"::");
1498 alternate.append(
name);
1502 newName.append(altcl->
GetName());
1503 newName.append(suffix);
1507 size_t ctxt_cursor = strlen(context->
GetName());
1508 for (
size_t level = 0; ctxt_cursor != 0; --ctxt_cursor) {
1509 switch (context->
GetName()[ctxt_cursor]) {
1510 case '<': --level;
break;
1511 case '>': ++level;
break;
1512 case ':':
if (level == 0) {
1516 alternate.append(context->
GetName(),ctxt_cursor+1);
1517 alternate.append(
name);
1520 newName.append(altcl->
GetName());
1521 newName.append(suffix);
1561 TClass *firstNewCl =
f ?
f->GetClass() : 0;
1562 TClass *secondNewCl =
s ?
s->GetClass() : 0;
1567 if ((firstNewCl && !firstOldCl) || (secondNewCl && !secondOldCl))
1569 std::vector<std::string> inside;
1573 TClass *firstAltCl = firstOldCl;
1574 TClass *secondAltCl = secondOldCl;
1575 std::string firstNewName;
1576 std::string secondNewName;
1577 if (firstNewCl && !firstOldCl) {
1578 firstAltCl = FindAlternate(context, inside[1], firstNewName);
1579 }
else if (firstAltCl) {
1580 firstNewName = firstAltCl->
GetName();
1582 firstNewName = inside[1];
1584 if (secondNewCl && !secondOldCl) {
1585 secondAltCl = FindAlternate(context, inside[2], secondNewName);
1586 }
else if (secondAltCl) {
1587 secondNewName = secondAltCl->
GetName();
1589 secondNewName = inside[2];
1591 if ((firstNewCl && firstAltCl != firstOldCl) ||
1592 (secondNewCl && secondAltCl != secondOldCl) ) {
1595 std::string alternate = inside[0];
1596 alternate.append(
"<");
1597 alternate.append(firstNewName);
1598 alternate.append(
",");
1599 alternate.append(secondNewName);
1603 if (alternate[alternate.length()-1]==
'>') {
1604 alternate.append(
" ");
1606 alternate.append(
">");
1619 std::vector<std::string> inside;
1624 std::string newName;
1625 TClass *altcl = FindAlternate(context, inside[1], newName);
1628 std::string alternate = inside[0];
1629 alternate.append(
"<");
1630 alternate.append(newName);
1634 if (alternate[alternate.length()-1]==
'>') {
1635 alternate.append(
" ");
1637 alternate.append(
">");
1645 struct TBuildOldGuard {
1671 TBuildOldGuard buildOldGuard(
this);
1674 printf(
"\n====>Rebuilding TStreamerInfo for class: %s, version: %d\n",
GetName(),
fClassVersion);
1718 constexpr size_t kSizeOfPtr =
sizeof(
void*);
1745 ROOT::TSchemaRuleSet::TMatches rules;
1751 Int_t virtualInfoLocAlloc = 0;
1776#if defined(PROPER_IMPLEMEMANTION_OF_BASE_CLASS_RENAMING)
1799 Error(
"BuildOld",
"Could not find base class: %s for %s and could not find any matching rename rule\n", base->
GetName(),
GetName());
1809 Error(
"BuildOld",
"Could not find base class: %s for %s, renaming rule was found but is malformed\n", base->
GetName(),
GetName());
1819 else if( !baseclass ) {
1822 Warning(
"BuildOld",
"Missing base class: %s skipped", base->
GetName());
1824 baseclass =
new TClass(element->
GetName(), 1, 0, 0, -1, -1);
1825 element->
Update(0, baseclass);
1835 if (baseOffset < 0) {
1847 if (!baserule.empty()) {
1858 element->
Init(
this);
1870 if (infobase) baseclass = infobase->
GetClass();
1876 if (infobase && infobase->
fComp == 0) {
1898 if (baseOffset < 0) {
1903 offset += baseclass->
Size();
1910 Int_t baseOffset = -1;
1918 if (strchr(bc->
GetName(),
'<') || !strcmp(bc->
GetName(),
"string")) {
1921 if (bcName == elName) {
1936 Error(
"BuildOld",
"The class \"%s\" is compiled and its base class \"%s\" is a collection and we do not have a dictionary for it, we will not be able to read or write this base class.",
GetName(),bc->
GetName());
1949 if (newInfo ==
this) {
1950 baseOffset = offset;
1952 }
else if (newInfo) {
1956 const char *newElName = newElement->
GetName();
1957 if (newElement->
IsBase() && (strchr(newElName,
'<') || !strcmp(newElName,
"string")) ) {
1960 if (bcName == elName) {
1966 Error(
"BuildOld",
"Could not find STL base class: %s for %s\n", element->
GetName(),
GetName());
1970 asize = newElement->
GetSize();
1973 if (baseOffset == -1) {
1984 if (baseOffset < 0) {
1990 element->
Init(
this);
2005 std::string typeNameBuf;
2006 const char* dmType =
nullptr;
2010 std::array<Int_t, 5> maxIndices;
2021 element->
Init(
this);
2035 element->
Init(
this);
2044 dmType = typeNameBuf.c_str();
2051 dmType = typeNameBuf.c_str();
2052 dt =
gROOT->GetType(dmType);
2059 if (dmClassName.
Index(
"const ")==0) dmClassName.
Remove(0,6);
2064 Error(
"BuildOld",
"The class \"%s\" is compiled and for its data member \"%s\", we do not have a dictionary for the collection \"%s\", we will not be able to read or write this data member.",
GetName(),dm->
GetName(),elemDm->
GetName());
2081 element->
Init(
this);
2100 auto theType = isStdArray ? dt : dm->
GetDataType();
2112 if ((newType ==
::kChar_t) && dmIsPtr && !isArray && !hasCount) {
2114 }
else if (dmIsPtr) {
2116 }
else if (isArray) {
2120 if (newType == -1) {
2127 if (newInfo && (newInfo !=
this)) {
2130 if (newClass == 0) {
2131 newType = newElems ? newElems->
GetType() : -1;
2155 }
else if (element->
GetType() != newType) {
2168 if (oldClass == newClass.
GetClass()) {
2170 }
else if (ClassWasMovedToNamespace(oldClass, newClass.
GetClass())) {
2172 if (0 != (oldv = ImportStreamerInfo(oldClass, newClass.
GetClass()))) {
2173 Warning(
"BuildOld",
"Can not properly load the TStreamerInfo from %s into %s due to a conflict for the class version %d", oldClass->
GetName(), newClass->
GetName(), oldv);
2181 if (ContainerMatchTClonesArray(newClass.
GetClass())) {
2204 TClass *oldFixedClass = FixCollectionV5(
GetClass(),oldClass,newClass);
2205 if (oldFixedClass && oldFixedClass != oldClass) {
2206 element->
Update(oldClass,oldFixedClass);
2207 oldClass = oldFixedClass;
2210 if (CollectionMatch(oldClass, newClass)) {
2223 if (
ms &&
ms->IsValid()) {
2225 switch( element->
GetType() ) {
2251 }
else if (CollectionMatchFloat16(oldClass,newClass)) {
2253 }
else if (CollectionMatchDouble32(oldClass,newClass)) {
2255 }
else if (CollectionMatchLong64(oldClass,newClass)) {
2258 }
else if (CollectionMatchULong64(oldClass,newClass)) {
2271 }
else if(oldClass &&
2288 if (strncmp(dm->
GetTitle(),
"->",2)==0) {
2321 if ((!dmIsPtr || newType==
kSTLp) && (isStdArray ? ndim : dm->
GetArrayDim()) > 0) {
2326 if (newInfo && (newInfo !=
this)) {
2329 newType = newElems->
GetType();
2360 if (newType != -1) {
2368 cannotConvert =
kTRUE;
2372 printf(
"%s We have no clue\n", dm->
GetName());
2373 cannotConvert =
kTRUE;
2376 if (newType != -1) {
2380 cannotConvert =
kTRUE;
2384 cannotConvert =
kTRUE;
2388 if (cannotConvert) {
2411 strcmp(element->
GetName(),
"This") == 0 &&
2417 asize =
sizeof(std::vector<int>);
2423 if ((offset % kSizeOfPtr) != 0) {
2424 offset = offset - (offset % kSizeOfPtr) + kSizeOfPtr;
2430 if (!wasCompiled && rules) {
2431 if (rules.HasRuleWithSource( element->
GetName(),
kTRUE ) ) {
2433 if (allocClass == 0) {
2441 allocClass = infoalloc->
GetClass();
2447 && !rules.HasRuleWithTarget( element->
GetName(),
kTRUE ) ) {
2469 }
else if (rules.HasRuleWithTarget( element->
GetName(),
kTRUE ) ) {
2481 }
else if (rules && rules.HasRuleWithTarget( element->
GetName(),
kTRUE ) ) {
2517 for (iel = 0; iel < narr; ++iel) {
2520 tai[kel++] = element;
2522 arr[jel++] = element;
2525 for (kel = 0; jel < narr;) {
2526 arr[jel++] = tai[kel++];
2533 if (!wasCompiled && allocClass) {
2590 TMemberInfo(
TClass *parent) : fParent(parent) {};
2592 void SetDataType(
Int_t datatype) {
2593 fDataType = datatype;
2599 void SetClassName(
const char *
name) {
2602 void SetComment(
const char *title) {
2603 const char *left = strstr(title,
"[");
2605 const char *right = strstr(left,
"]");
2608 fComment.
Append(left,right-left);
2626 if (fName != other.fName)
return kTRUE;
2629 if (fDataType != other.fDataType) {
2630 if ( (fDataType == 4 && other.fDataType == 16)
2631 || (fDataType == 16 && other.fDataType == 4) ) {
2633 }
else if ( (fDataType == 14 && other.fDataType == 17)
2634 || (fDataType == 17 && other.fDataType == 14) ) {
2636 }
else if ( (fDataType == 3 && other.fDataType == 6)
2637 ||(fDataType == 6 && other.fDataType == 3) ){
2646 }
else if (fClassName != other.fClassName) {
2647 if ( (fClassName ==
"long" && (other.fClassName ==
"long long" || other.fClassName ==
"Long64_t"))
2648 || ( (fClassName ==
"long long" || fClassName ==
"Long64_t") && other.fClassName ==
"long") ) {
2650 }
else if ( (fClassName ==
"unsigned long" && (other.fClassName ==
"unsigned long long" || other.fClassName ==
"ULong64_t"))
2651 || ( (fClassName ==
"unsigned long long" || fClassName ==
"ULong64_t") && other.fClassName ==
"unsigned long") ) {
2656 if (
name != othername) {
2659 if (!CollectionMatch(cl,otherCl)) {
2660 TClass *oldFixedClass = FixCollectionV5(fParent,cl,otherCl);
2661 if (!oldFixedClass || !CollectionMatch(oldFixedClass,otherCl)) {
2670 return fComment != other.fComment;
2692 char* eaddr = ((
char*)obj) + element->
GetOffset();
2711 if (ecl && (
fClass!=ecl )) {
2730 char* eaddr = ((
char*)obj) + element->
GetOffset();
2747 if (newname && newname[0] &&
fName != newname) {
2750 for(
Int_t i = 0; i < ndata; ++i) {
2783 R__ASSERT( (cl==0 || info==0) && (cl!=0 || info!=0) );
2816 if (el && el->
IsBase()) {
2831 if (infoel && infoel->
IsBase()) {
2832 otherClass = infoel->
GetName();
2843 if (localClass != otherClass) {
2847 "The in-memory layout version %d for class '%s' has a base class (%s) that the on-file layout version %d does not have.",
2849 }
else if (otherClass.
Length()==0) {
2851 "The on-file layout version %d for class '%s' has a base class (%s) that the in-memory layout version %d does not have",
2855 "One base class of the on-file layout version %d and of the in memory layout version %d for '%s' is different: '%s' vs '%s'",
2859 if (!complete)
return kFALSE;
2860 result = result &&
kFALSE;
2864 if (!localBase)
continue;
2867 if (!otherBaseClass)
continue;
2870 msg.
Form(
" The StreamerInfo of class %s read from %s%s\n"
2871 " has the same version (=%d) as the active class but a different checksum.\n"
2872 " You should update the version to ClassDef(%s,%d).\n"
2873 " The objects on this file might not be readable because:\n"
2874 " The in-memory layout version %d for class '%s' has a base class (%s) with version %d but the on-file layout version %d recorded the version number %d for this base class (%s).",
2883 if (!localBaseInfo) {
2887 const TList *list =
file->GetStreamerInfoCache();
2890 if (!localBaseInfo) {
2892 msg.
Form(
" The StreamerInfo of the base class %s (of class %s) read from %s%s\n"
2893 " refers to a checksum (%x) that can not be found neither in memory nor in the file.\n",
2907 msg.
Form(
" The StreamerInfo of class %s read from %s%s\n"
2908 " has the same version (=%d) as the active class but a different checksum.\n"
2909 " You should update the version to ClassDef(%s,%d).\n"
2910 " The objects on this file might not be readable because:\n"
2911 " The in-memory layout version %d for class '%s' has a base class (%s) with checksum %x but the on-file layout version %d recorded the checksum value %x for this base class (%s).",
2921 if (!localBase || !otherBase)
continue;
2927 msg.
Form(
" The StreamerInfo of class %s read from %s%s\n"
2928 " has the same version (=%d) as the active class but a different checksum.\n"
2929 " You should update the version to ClassDef(%s,%d).\n"
2930 " The objects on this file might not be readable because:\n"
2931 " The in-memory layout version %d for class '%s' has a base class (%s) with version %d but the on-file layout version %d recorded the version number %d for this base class (%s).",
2941 if (localBaseInfo == otherBaseInfo ||
2947 msg.
Form(
" The StreamerInfo of class %s read from %s%s\n"
2948 " has the same version (=%d) as the active class but a different checksum.\n"
2949 " You should update the version to ClassDef(%s,%d).\n"
2950 " The objects on this file might not be readable because:\n"
2951 " The in-memory layout version %d for class '%s' has a base class (%s) with checksum %x but the on-file layout version %d recorded the checksum value %x for this base class (%s).",
2959 if (!result && !complete) {
2968 TMemberInfo other(cl ? cl : info->
GetClass());
2979 local.SetName( el->
GetName() );
2981 local.SetComment( el->
GetTitle() );
2982 local.SetDataType( el->
GetType() );
2990 other.SetName( tdm->
GetName() );
2992 other.SetComment( tdm->
GetTitle() );
3019 other.SetName( infoel->
GetName() );
3021 other.SetComment( infoel->
GetTitle() );
3022 other.SetDataType( infoel->
GetType() );
3031 Warning(
"CompareContent",
"The following data member of\nthe in-memory layout version %d of class '%s' is missing from \nthe on-file layout version %d:\n"
3034 ,other.fClassName.Data(),other.fName.Data(),other.fComment.Data());
3036 }
else if (other.fName.Length()==0) {
3037 Warning(
"CompareContent",
"The following data member of\nthe in-memory layout version %d of class '%s' is missing from \nthe on-file layout version %d:\n"
3040 ,local.fClassName.Data(),local.fName.Data(),local.fComment.Data());
3042 Warning(
"CompareContent",
"The following data member of\nthe on-file layout version %d of class '%s' differs from \nthe in-memory layout version %d:\n"
3047 ,local.fClassName.Data(),local.fName.Data(),local.fComment.Data()
3048 ,other.fClassName.Data(),other.fName.Data(),other.fComment.Data());
3051 result = result &&
kFALSE;
3052 if (!complete)
return result;
3076 constexpr size_t kSizeOfPtr =
sizeof(
void*);
3077 if ((
fSize % kSizeOfPtr) != 0) {
3114 static TClassRef string_classref(
"string");
3115 if (
fClass == string_classref) {
3174 if (allocator)
return allocator->
GetClass();
3224 for (
int i=0; i<il; i++)
id =
id*3+
name[i];
3236 for (
int i=0; i<il; i++)
id =
id*3+
name[i];
3247 if (el->
IsBase())
continue;
3262 for (i=0; i<il; i++)
id =
id*3+
name[i];
3284 type.ReplaceAll(
"ULong64_t",
"unsigned long long");
3285 type.ReplaceAll(
"Long64_t",
"long long");
3286 type.ReplaceAll(
"signed char",
"char");
3287 type.ReplaceAll(
"<signed char",
"<char");
3288 type.ReplaceAll(
",signed char",
",char");
3289 if (
type==
"signed char")
type =
"char";
3293 for (i=0; i<il; i++)
id =
id*3+
type[i];
3308 const char *right = strstr(left,
"]");
3311 while (left != right) {
3355 constexpr auto auto_ptr_len =
str_length(
"auto_ptr<");
3356 constexpr auto unique_ptr_len =
str_length(
"unique_ptr<");
3360 return ((strncmp(
name,
"auto_ptr<", auto_ptr_len) == 0)
3361 || (strncmp(
name,
"unique_ptr<", unique_ptr_len) == 0));
3374 if (atstart) { fprintf(
file,
" : "); atstart =
kFALSE; }
3375 else fprintf(
file,
" , ");
3376 fprintf(
file,
"%s(const_cast<%s &>( rhs ))\n", element->
GetName(),protoname.
Data());
3379 if (atstart) { fprintf(
file,
" : "); atstart =
kFALSE; }
3380 else fprintf(
file,
" , ");
3382 fprintf(
file,
"%s(const_cast<%s &>( rhs ).%s.release() )\n",element->
GetName(),protoname.
Data(),element->
GetName());
3384 fprintf(
file,
"%s(const_cast<%s &>( rhs ).%s)\n",element->
GetName(),protoname.
Data(),element->
GetName());
3389 fprintf(
file,
"{\n");
3390 fprintf(
file,
" // This is NOT a copy constructor. This is actually a move constructor (for stl container's sake).\n");
3391 fprintf(
file,
" // Use at your own risk!\n");
3392 fprintf(
file,
" (void)rhs; // avoid warning about unused parameter\n");
3400 if (!defMod) { fprintf(
file,
" %s &modrhs = const_cast<%s &>( rhs );\n",protoname.
Data(),protoname.
Data()); defMod =
kTRUE; };
3401 const char *ename = element->
GetName();
3402 const char *colon2 = strstr(ename,
"::");
3403 if (colon2) ename = colon2+2;
3405 fprintf(
file,
" modrhs.%s = 0;\n",ename);
3407 fprintf(
file,
" memset(modrhs.%s,0,%d);\n",ename,element->
GetSize());
3410 const char *ename = element->
GetName();
3413 fprintf(
file,
" %s &modrhs = const_cast<%s &>( rhs );\n",protoname.
Data(),protoname.
Data()); defMod =
kTRUE;
3415 fprintf(
file,
" modrhs.%s = 0;\n",ename);
3418 fprintf(
file,
" %s &modrhs = const_cast<%s &>( rhs );\n",protoname.
Data(),protoname.
Data()); defMod =
kTRUE;
3420 fprintf(
file,
" modrhs.%s = 0;\n",ename);
3424 fprintf(
file,
" for (Int_t i=0;i<%d;i++) %s[i] = rhs.%s[i];\n",element->
GetArrayLength(),ename,ename);
3428 fprintf(
file,
"[0]");
3430 fprintf(
file,
"))[i] = (&(rhs.%s",ename);
3432 fprintf(
file,
"[0]");
3434 fprintf(
file,
"))[i];\n");
3437 if (!defMod) { fprintf(
file,
" %s &modrhs = const_cast<%s &>( rhs );\n",protoname.
Data(),protoname.
Data()); defMod =
kTRUE; };
3438 fprintf(
file,
" modrhs.%s = 0;\n",ename);
3441 fprintf(
file,
" %s &modrhs = const_cast<%s &>( rhs );\n",protoname.
Data(),protoname.
Data()); defMod =
kTRUE;
3445 std::string method_name =
"clear";
3447 method_name =
"reset";
3450 fprintf(
file,
" modrhs.%s();\n", method_name.c_str());
3452 fprintf(
file,
" modrhs.%s.%s();\n",ename, method_name.c_str());
3470 const char *ename = element->
GetName();
3471 const char *colon2 = strstr(ename,
"::");
3472 if (colon2) ename = colon2+2;
3475 fprintf(
file,
" %s = 0;\n",ename);
3477 fprintf(
file,
" memset(%s,0,%d);\n",ename,element->
GetSize());
3481 fprintf(
file,
" delete %s; %s = 0;\n",ename,ename);
3483 fprintf(
file,
" for (Int_t i=0;i<%d;i++) delete %s[i]; memset(%s,0,%d);\n",element->
GetArrayLength(),ename,ename,element->
GetSize());
3488 const char *ename = element->
GetName();
3490 fprintf(
file,
" %s = 0;\n",ename);
3492 fprintf(
file,
" delete [] %s; %s = 0;\n",ename,ename);
3496 const char *ename = element->
GetName();
3498 fprintf(
file,
" %s = 0;\n",ename);
3500 fprintf(
file,
" delete %s; %s = 0;\n",ename,ename);
3502 fprintf(
file,
" delete [] %s; %s = 0;\n",ename,ename);
3506 const char *ename = element->
GetName();
3507 const char *prefix =
"";
3510 }
else if ( element->
IsBase() ) {
3519 fprintf(
file,
" std::for_each( (%s %s).rbegin(), (%s %s).rend(), DeleteObjectFunctor() );\n",prefix,ename,prefix,ename);
3527 std::vector<std::string> inside;
3530 if (inside[1][inside[1].size()-1]==
'*' || inside[2][inside[2].size()-1]==
'*') {
3531 fprintf(
file,
" std::for_each( (%s %s).rbegin(), (%s %s).rend(), DeleteObjectFunctor() );\n",prefix,ename,prefix,ename);
3537 fprintf(
file,
" delete %s; %s = 0;\n",ename,ename);
3554 const char *clname =
GetName();
3556 if (strchr(clname,
':')) {
3558 Int_t len = strlen(clname);
3559 const char *
name = clname;
3562 for (
Int_t cur = 0; cur < len; ++cur) {
3563 switch (clname[cur]) {
3570 if (nest == 0) { cur = len;
continue; }
3574 if (nest == 0 && clname[cur+1] ==
':') {
3577 name = clname + cur + 2;
3584 template_protoname.
Append(clname,pr_pos);
3588 const char *where = strstr(clname,
"<");
3589 isTemplate = where != 0;
3591 template_protoname.
Append(clname,where-clname);
3595 if (needGenericTemplate && isTemplate) {
3597 fprintf(fp,
"#ifndef %s_h\n", templateName.
Data());
3598 fprintf(fp,
"#define %s_h\n", templateName.
Data());
3609 if (!element->
IsBase())
continue;
3611 const char *ename = element->
GetName();
3612 if (nbase == 1) fprintf(fp,
" : public %s",ename);
3613 else fprintf(fp,
" , public %s",ename);
3618 if (subClasses && subClasses->
GetEntries()) {
3619 Bool_t needheader =
true;
3621 TIter subnext(subClasses);
3626 if (subinfo->
GetName()[len+1]==
':' && strstr(subinfo->
GetName()+len+2,
":")==0) {
3628 fprintf(fp,
"\npublic:\n");
3629 fprintf(fp,
"// Nested classes forward declaration.\n");
3633 UInt_t sub_numberOfClasses = 0;
3634 UInt_t sub_numberOfNamespaces;
3642 for (
UInt_t i = 0;i < sub_numberOfClasses;++i) {
3643 fprintf(fp,
"}; // end of class.\n");
3645 if (sub_numberOfNamespaces > 0) {
3646 Error(
"GenerateDeclaration",
"Nested classes %s thought to be inside a namespace inside the class %s",subinfo->
GetName(),
GetName());
3653 fprintf(fp,
"\npublic:\n");
3654 fprintf(fp,
"// Nested classes declaration.\n");
3657 if (subClasses && subClasses->
GetEntries()) {
3663 if (subinfo->
GetName()[len+1]==
':' && strstr(subinfo->
GetName()+len+2,
":")==0) {
3670 fprintf(fp,
"\npublic:\n");
3671 fprintf(fp,
"// Data Members.\n");
3684 if (element->
IsBase())
continue;
3685 const char *ename = element->
GetName();
3715 }
else if (strncmp(enamebasic.
Data(),
"auto_ptr<", strlen(
"auto_ptr<")) == 0) {
3719 lt = enamebasic.
Length();
3723 if (lt>=ltype) ltype = lt+1;
3725 for (is = 3+lt; is < (3+ltype); ++is)
line +=
' ';
3730 if (ld>=ldata) ldata = ld+1;
3731 for (is = 3+ltype+ld; is < (3+ltype+ldata); ++is)
line +=
' ';
3735 fprintf(fp,
"%s\n",
line.Data());
3738 if (needGenericTemplate && isTemplate) {
3740 fprintf(fp,
"\n %s() {\n",protoname.
Data());
3743 fprintf(fp,
" %s(%s && ) = default;\n",protoname.
Data(),protoname.
Data());
3744 fprintf(fp,
" %s(const %s & rhs )\n",protoname.
Data(),protoname.
Data());
3747 fprintf(fp,
" virtual ~%s() {\n",protoname.
Data());
3749 fprintf(fp,
" }\n\n");
3753 fprintf(fp,
"\n %s();\n",protoname.
Data());
3754 fprintf(fp,
" %s(%s && ) = default;\n",protoname.
Data(),protoname.
Data());
3755 fprintf(fp,
" %s(const %s & );\n",protoname.
Data(),protoname.
Data());
3756 fprintf(fp,
" virtual ~%s();\n\n",protoname.
Data());
3760 fprintf(sfp,
"#ifndef %s_cxx\n",guard.
Data());
3761 fprintf(sfp,
"#define %s_cxx\n",guard.
Data());
3762 fprintf(sfp,
"%s::%s() {\n",
GetName(),protoname.
Data());
3766 fprintf(sfp,
"%s::%s(const %s & rhs)\n",
GetName(),protoname.
Data(),protoname.
Data());
3770 fprintf(sfp,
"%s::~%s() {\n",
GetName(),protoname.
Data());
3773 fprintf(sfp,
"#endif // %s_cxx\n\n",guard.
Data());
3781 fprintf(fp,
" ClassDef(%s,%d); // Generated by MakeProject.\n",protoname.
Data(),0);
3783 fprintf(fp,
" ClassDef(%s,%d); // Generated by MakeProject.\n",protoname.
Data(),
fClassVersion + 1);
3788 for(
UInt_t i=0;i<numberOfNamespaces;++i) {
3789 fprintf(fp,
"} // namespace\n");
3792 if (needGenericTemplate && isTemplate) {
3793 fprintf(fp,
"#endif // generic template declaration\n");
3802 if (inclist[0]==0) {
3808 const char *clname =
GetName();
3809 if (strchr(clname,
'<')) {
3824 const char *ename = element->
GetName();
3825 const char *colon2 = strstr(ename,
"::");
3826 if (colon2) ename = colon2+2;
3833 if (ltype < lt) ltype = lt;
3834 if (ldata < ld) ldata = ld;
3838 incRiostream =
kTRUE;
3844 if (!include[0])
continue;
3846 Bool_t greater = (include[0]==
'<');
3849 if (strncmp(include,
"include/",8)==0) {
3852 if (strncmp(include,
"include\\",9)==0) {
3855 if (strncmp(element->
GetTypeName(),
"pair<",strlen(
"pair<"))==0) {
3857 }
else if (strncmp(element->
GetTypeName(),
"auto_ptr<",strlen(
"auto_ptr<"))==0) {
3860 TString incName( include, strlen(include)-1 );
3881 if (strncmp(
GetName(),
"pair<",strlen(
"pair<"))==0)
return 0;
3882 if (strncmp(
GetName(),
"auto_ptr<",strlen(
"auto_ptr<"))==0)
return 0;
3893 for(
UInt_t i=len; i>0; --i) {
3895 case '>': ++nest;
if (scope==0) { isTemplate =
kTRUE; }
break;
3896 case '<': --nest;
break;
3898 if (nest==0 &&
GetName()[i-1]==
':') {
3901 cl =
gROOT->GetClass(nsname);
3905 }
else if (cl == 0 && extrainfos != 0) {
3920 if (
gDebug) printf(
"generating code for class %s\n",
GetName());
3926 filename.
Form(
"%s/%s.h",dirname,headername.
Data());
3928 FILE *fp = fopen(filename.
Data(),
"w");
3930 Error(
"MakeProject",
"Cannot open output file:%s\n",filename.
Data());
3935 FILE *allfp = fopen(filename.
Data(),
"a");
3937 Error(
"MakeProject",
"Cannot open output file:%s\n",filename.
Data());
3941 fprintf(allfp,
"#include \"%s.h\"\n", headername.
Data());
3944 char *inclist =
new char[50000];
3949 fprintf(fp,
"//////////////////////////////////////////////////////////\n");
3950 fprintf(fp,
"// This class has been generated by TFile::MakeProject\n");
3951 fprintf(fp,
"// (%s by ROOT version %s)\n",td.
AsString(),
gROOT->GetVersion());
3952 fprintf(fp,
"// from the StreamerInfo in file %s\n",
gDirectory->GetFile()->GetName());
3953 fprintf(fp,
"//////////////////////////////////////////////////////////\n");
3956 fprintf(fp,
"#ifndef %s_h\n",headername.
Data());
3957 fprintf(fp,
"#define %s_h\n",headername.
Data());
3964 TIter subnext(subClasses);
3973 FILE *sfp = fopen( sourcename.
Data(),
"a" );
3977 Error(
"GenerateHeaderFile",
"Could not open %s for appending",sourcename.
Data());
3981 fprintf(fp,
"#endif\n");
3985 if (sfp) fclose(sfp);
3996 char dmbracket[256];
4010 char *rdmc = (
char*)rdm->
GetName();
4013 if (dm->
IsaPointer() && rdmc[0] ==
'*') rdmc++;
4016 if (strcmp(rdmc,dm->
GetName()) == 0) {
4028 if (strstr(rdm->
GetName(),dmbracket)) {
4042 if (elementName == 0)
return 0;
4104 Int_t base_offset = 0;
4105 Int_t local_offset = 0;
4111 if (!base_cl || !base_element) {
4114 base_offset = base_element->
GetOffset();
4117 offset = base_offset + local_offset;
4132 Int_t local_offset = 0;
4141 offset = base_offset + local_offset;
4189 ::Obsolete(
"TStreamerInfo::GetStreamerElementReal",
"v5-34-20",
"v6-00-02");
4191 if (i < 0 || i >=
fNdata)
return 0;
4192 if (j < 0)
return 0;
4197 for (
Int_t ise=0;ise < nelems;ise++) {
4199 if (ise+j >= nelems)
return 0;
4208template <
typename T>
4230#if defined(_MSC_VER) && (_MSC_VER <= 1200)
4252#if defined(_MSC_VER) && (_MSC_VER <= 1200)
4258#define READ_ARRAY(TYPE_t) \
4260 Int_t sub_instance, index; \
4261 Int_t instance = k; \
4263 index = instance / len; \
4264 sub_instance = instance % len; \
4269 TYPE_t **val =(TYPE_t**)(ladd); \
4270 return T((val[sub_instance])[index]); \
4288#if defined(_MSC_VER) && (_MSC_VER <= 1200)
4312template <
typename T>
4321 if (i < 0)
return 0;
4325 if (atype ==
kSTL) {
4327 if (newClass == 0) {
4339 if (j >= nc)
return 0;
4340 char *element_ptr = (
char*)proxy->
At(j);
4341 return GetTypedValueAux<T>(atype,element_ptr,0,1);
4345 return GetTypedValueAux<T>(atype,ladd,j,len);
4354template <
typename T>
4361 if (j >= nc)
return 0;
4376template <
typename T>
4380 if (j >= nc)
return 0;
4382 char *pointer = (
char*)cont->
At(j);
4395template <
typename T>
4400 if (j >= nc)
return 0;
4402 char **ptr = (
char**)cont->
At(j);
4403 char *pointer = *ptr;
4414 if (rules.empty())
return;
4419 for(
auto rule : rules) {
4420 if( rule->IsRenameRule() || rule->IsAliasRule() )