92 for(
Int_t ind = last-1; ind >= at; --ind) {
93 arr->
AddAt( arr->
At(ind), ind+1);
104 for(
Int_t ind = last-1; ind >= at; --ind) {
107 for(
size_t ins = 0; ins < objs.size(); ++ins) {
108 arr->
AddAt(objs[ins], at+ins);
117 while (at<last && arr->At(at) != oldobj) {
129 while (at<last && arr->At(at) != oldobj) {
244 struct TPreventRecursiveBuildGuard {
245 TPreventRecursiveBuildGuard(
TStreamerInfo* info): fInfo(info) {
249 ~TPreventRecursiveBuildGuard() {
280 TPreventRecursiveBuildGuard buildGuard(
this);
299 if (strncmp(
GetName(),
"ROOT::VecOps::RVec<", 19) == 0) {
300 Warning(
"Build",
"Due to some major, backward-incompatible improvements planned for ROOT::RVec, direct I/O of "
301 "ROOT::RVec objects will break between v6.24 and v6.26. Please use std::vectors instead. See "
302 "the release notes of v6.24 for more information.");
313 ROOT::TSchemaRuleSet::TMatches rules;
339 Error(
"Build()",
"Cannot stream virtual base %s of class %s",
343 const char* bname = base->
GetName();
344 const char* btitle = base->
GetTitle();
346 if (!strcmp(bname,
"string")) {
355 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);
369 Warning(
"Build",
"%s: base class %s has no streamer or dictionary it will not be saved",
GetName(), clm->
GetName());
385 if (!isTransient && !clm->
IsLoaded() && !(isCollection || isString)) {
388 Warning(
"Build",
"%s: base class %s has no streamer or dictionary it will not be saved",
GetName(), clm->
GetName());
404 std::string typeNameBuf;
405 std::string trueTypeNameBuf;
426 const char* dmName = dm->
GetName();
427 const char* dmTitle = dm->
GetTitle();
433 std::array<Int_t, 5> maxIndices;
440 if (trueTypeNameBuf.back() ==
'*') {
442 typeNameBuf.pop_back();
443 while(typeNameBuf.back() ==
'*') typeNameBuf.pop_back();
445 dmFull = trueTypeNameBuf.c_str();
446 dmType = typeNameBuf.c_str();
453 trueTypeNameBuf = typeNameBuf;
454 while(typeNameBuf.back() ==
'*') typeNameBuf.pop_back();
455 dmFull = dmType = typeNameBuf.c_str();
469 const char* rbracket = ::strchr(dmTitle,
']');
470 if (lbracket && rbracket) {
475 Error(
"Build",
"%s, discarding: %s %s, illegal %s\n",
GetName(), dmFull, dmName, dmTitle);
481 if (!dtCounter || !isInteger) {
483 Error(
"Build",
"%s, discarding: %s %s, illegal [%s] (must be Int_t)\n",
GetName(), dmFull, dmName, counterName);
492 Error(
"Build",
"%s, discarding: %s %s, illegal [%s] must be placed before \n",
GetName(), dmFull, dmName, counterName);
502 if (!dmCounter && (strstr(dmFull,
"char*") || strstr(dmFull,
"Char_t*"))) {
504 dsize =
sizeof(
char*);
508 Error(
"Build",
"%s, unknown type: %s %s",
GetName(), dmFull, dmName);
510 }
else if (dmIsPtr && (dtype !=
kCharStar)) {
515 if ((
fName ==
"TString") || (
fName ==
"TClass")) {
519 Error(
"Build",
"%s, discarding: %s %s, no [dimension]\n",
GetName(), dmFull, dmName);
533 static const char* full_string_name =
"basic_string<char,char_traits<char>,allocator<char> >";
534 if (!strcmp(dmType,
"string") || !strcmp(dmType,
"std::string") || !strcmp(dmType, full_string_name)) {
544 auto printErrorMsg = [&](
const char* category)
547 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);
551 printErrorMsg(
"compiled");
557 printErrorMsg(
"interpreted");
567 Error(
"Build",
"%s, unknown type: %s %s\n",
GetName(), dmFull, dmName);
585 Error(
"Build",
"%s: %s has no streamer or dictionary, data member %s will not be saved",
597 Warning(
"Build",
"%s: %s has no streamer or dictionary, data member \"%s\" will not be saved",
610 for (
Int_t i = 0; i < ndim; ++i) {
612 if (isStdArray) maxIndex = maxIndices[i];
634 if ( !wasCompiled && (rules && rules.HasRuleWithSource( element->
GetName(),
kTRUE )) ) {
635 needAllocClass =
kTRUE;
644 && rules && !rules.HasRuleWithTarget( element->
GetName(),
kTRUE ) )
673 if (needAllocClass) {
747 Bool_t isstl = element && strcmp(
"This",element->
GetName())==0;
749 if (element->
GetTitle()[0] ==
'<') {
754 if (content[
c] ==
'<') ++level;
755 else if (content[
c] ==
'>') --level;
766 "Update the collection proxy of the class \"%s\" \n"
767 "\tto be similar to \"%s\".",
772 The class %s had a collection proxy when written but it is not an STL\n \
773 collection and we did not record the type of the content of the collection.\n \
774 We will claim the content is a bool (i.e. no data will be read).",
808 ::Warning(
"TClass::TClass",
"no dictionary for class %s is available",
GetName());
815 Bool_t isstl = element && strcmp(
"This",element->
GetName())==0;
817 if (element->
GetTitle()[0] ==
'<') {
822 if (content[
c] ==
'<') ++level;
823 else if (content[
c] ==
'>') --level;
834 "Update the collection proxy of the class \"%s\" \n"
835 "\tto be similar to \"%s\".",
840 The class %s had a collection proxy when written but it is not an STL\n \
841 collection and we did not record the type of the content of the collection.\n \
842 We will claim the content is a bool (i.e. no data will be read).",
864 searchOnChecksum =
kFALSE;
870 searchOnChecksum =
kTRUE;
877 searchOnChecksum =
kFALSE;
883 searchOnChecksum =
kTRUE;
893 searchOnChecksum =
kFALSE;
899 searchOnChecksum =
kTRUE;
910 if (!searchOnChecksum) {
916 for (
Int_t i = -1; i < ninfos; ++i) {
933 while ((slot < ninfos) && (array->
UncheckedAt(slot) != 0)) {
979#ifdef TEST_FOR_BACKWARD_COMPATIBILITY_ABSTRACT_CLASSES
1040 for (
Int_t i = 0; i < nel; ++i) {
1058 if (oldIsNonVersioned) {
1061 The class %s transitioned from not having a specified class version\n\
1062 to having a specified class version (the current class version is %d).\n\
1063 However too many different non-versioned layouts of the class have been\n\
1064 loaded so far. This prevent the proper reading of objects written with\n\
1065 the class layout version %d, in particular from the file:\n\
1067 To work around this issue, load fewer 'old' files in the same ROOT session.",
1071 The class %s transitioned from not having a specified class version\n\
1072 to having a specified class version (the current class version is %d).\n\
1073 However too many different non-versioned layouts of the class have been\n\
1074 loaded so far. This prevent the proper reading of objects written with\n\
1075 the class layout version %d.\n\
1076 To work around this issue, load fewer 'old' files in the same ROOT session.",
1083 The StreamerInfo for version %d of class %s read from the file %s\n\
1084 has a different checksum than the previously loaded StreamerInfo.\n\
1085 Reading objects of type %s from the file %s \n\
1086 (and potentially other files) might not work correctly.\n\
1087 Most likely the version number of the class was not properly\n\
1088 updated [See ClassDef(%s,%d)].",
1092 The StreamerInfo from %s does not match existing one (%s:%d)\n\
1093 The existing one has not been used yet and will be discarded.\n\
1094 Reading the file %s will work properly, however writing object of\n\
1095 type %s will not work properly. Most likely the version number\n\
1096 of the class was not properly updated [See ClassDef(%s,%d)].",
1102 The StreamerInfo for version %d of class %s\n\
1103 has a different checksum than the previously loaded StreamerInfo.\n\
1104 Reading objects of type %s\n\
1105 (and potentially other files) might not work correctly.\n\
1106 Most likely the version number of the class was not properly\n\
1107 updated [See ClassDef(%s,%d)].",
1111 The StreamerInfo does not match existing one (%s:%d)\n\
1112 The existing one has not been used yet and will be discarded.\n\
1113 Reading should work properly, however writing object of\n\
1114 type %s will not work properly. Most likely the version number\n\
1115 of the class was not properly updated [See ClassDef(%s,%d)].",
1147#ifdef TEST_FOR_BACKWARD_COMPATIBILITY_ABSTRACT_CLASSES
1183 The StreamerInfo of class %s read from file %s\n\
1184 has the same version (=%d) as the active class but a different checksum.\n\
1185 You should update the version to ClassDef(%s,%d).\n\
1186 Do not try to write objects with the current class definition,\n\
1190 The StreamerInfo of class %s \n\
1191 has the same version (=%d) as the active class but a different checksum.\n\
1192 You should update the version to ClassDef(%s,%d).\n\
1193 Do not try to write objects with the current class definition,\n\
1201 Fatal(
"BuildCheck",
"\n\
1202 The StreamerInfo of unversioned class %s \n\
1203 has the same version (=%d) as the active class but an old checksum.\n\
1235 fNumber = maininfo->GetNumber();
1268 for (
Int_t i=0;i < ndata;i++) {
1270 if (!element)
break;
1277 if (ty <=
kULong)
continue;
1281 {
for (
int j=ndata-1;j>=i;j--) {elements->
AddAtAndExpand(elements->
At(j),j+1);}}
1282 elements->
AddAt(bt,i);
1304 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() );
1322 if (oldClass == 0 || newClass == 0)
return kFALSE;
1327 const char *oldname = oldClass->
GetName();
1328 for (
UInt_t i = oldlen, done =
false, nest = 0; (i>0) && !done ; --i) {
1329 switch (oldClass->
GetName()[i-1]) {
1330 case '>' : ++nest;
break;
1331 case '<' :
if (nest==0)
return kFALSE;
1333 case ':' :
if (nest == 0) oldname= &(oldClass->
GetName()[i]); done =
kTRUE;
break;
1336 oldlen = strlen(oldname);
1337 if (!(strlen(newClass->
GetName()) > strlen(oldClass->
GetName()))) {
1341 const char* newEnd = & (newClass->
GetName()[newlen-oldlen]);
1343 if (0 != strcmp(newEnd, oldname)) {
1371 Error(
"ImportStreamerInfo",
"Unable to clone the StreamerInfo for %s.",(*next)->GetName());
1417 if (oldContent == newContent) {
1418 contentMatch =
kTRUE;
1419 }
else if (newContent) {
1422 if (oldFlatContent == newFlatContent) {
1423 contentMatch =
kTRUE;
1429 contentMatch = (newContent==0);
1433 if ((oldContent==0 && oldProxy->
GetType() == newProxy->
GetType())
1510 TClass *FindAlternate(
TClass *context,
const std::string &i_name, std::string& newName)
1516 std::string
name(i_name);
1518 if (
name.compare(0,6,
"const ")==0) {
1524 while(
name[
name.length()-nstars-1]==
'*') {
1529 name.erase(
name.length()-nstars,nstars);
1532 std::string alternate(context->
GetName());
1533 alternate.append(
"::");
1534 alternate.append(
name);
1538 newName.append(altcl->
GetName());
1539 newName.append(suffix);
1543 size_t ctxt_cursor = strlen(context->
GetName());
1544 for (
size_t level = 0; ctxt_cursor != 0; --ctxt_cursor) {
1545 switch (context->
GetName()[ctxt_cursor]) {
1546 case '<': --level;
break;
1547 case '>': ++level;
break;
1548 case ':':
if (level == 0) {
1552 alternate.append(context->
GetName(),ctxt_cursor+1);
1553 alternate.append(
name);
1556 newName.append(altcl->
GetName());
1557 newName.append(suffix);
1608 if ((firstNewCl && !firstOldCl) || (secondNewCl && !secondOldCl))
1610 std::vector<std::string> inside;
1614 TClass *firstAltCl = firstOldCl;
1615 TClass *secondAltCl = secondOldCl;
1616 std::string firstNewName;
1617 std::string secondNewName;
1618 if (!info && !firstOldCl) {
1621 if (!info && !secondOldCl) {
1624 if (firstNewCl && !firstOldCl) {
1625 firstAltCl = FindAlternate(context, inside[1], firstNewName);
1626 }
else if (firstAltCl) {
1627 firstNewName = firstAltCl->
GetName();
1629 firstNewName = inside[1];
1631 if (secondNewCl && !secondOldCl) {
1632 secondAltCl = FindAlternate(context, inside[2], secondNewName);
1633 }
else if (secondAltCl) {
1634 secondNewName = secondAltCl->
GetName();
1636 secondNewName = inside[2];
1638 if ((firstNewCl && firstAltCl != firstOldCl) ||
1639 (secondNewCl && secondAltCl != secondOldCl) ) {
1642 std::string alternate = inside[0];
1643 alternate.append(
"<");
1644 alternate.append(firstNewName);
1645 alternate.append(
",");
1646 alternate.append(secondNewName);
1650 if (alternate[alternate.length()-1]==
'>') {
1651 alternate.append(
" ");
1653 alternate.append(
">");
1666 std::vector<std::string> inside;
1671 std::string newName;
1672 TClass *altcl = FindAlternate(context, inside[1], newName);
1675 std::string alternate = inside[0];
1676 alternate.append(
"<");
1677 alternate.append(newName);
1681 if (alternate[alternate.length()-1]==
'>') {
1682 alternate.append(
" ");
1684 alternate.append(
">");
1692 struct TBuildOldGuard {
1718 TBuildOldGuard buildOldGuard(
this);
1721 printf(
"\n====>Rebuilding TStreamerInfo for class: %s, version: %d\n",
GetName(),
fClassVersion);
1765 constexpr size_t kSizeOfPtr =
sizeof(
void*);
1792 ROOT::TSchemaRuleSet::TMatches rules;
1798 Int_t virtualInfoLocAlloc = 0;
1823#if defined(PROPER_IMPLEMEMANTION_OF_BASE_CLASS_RENAMING)
1846 Error(
"BuildOld",
"Could not find base class: %s for %s and could not find any matching rename rule\n", base->
GetName(),
GetName());
1856 Error(
"BuildOld",
"Could not find base class: %s for %s, renaming rule was found but is malformed\n", base->
GetName(),
GetName());
1866 else if( !baseclass ) {
1869 Warning(
"BuildOld",
"Missing base class: %s skipped", base->
GetName());
1871 baseclass =
new TClass(element->
GetName(), 1, 0, 0, -1, -1);
1872 element->
Update(0, baseclass);
1882 if (baseOffset < 0) {
1894 if (!baserule.empty()) {
1905 element->
Init(
this);
1917 if (infobase) baseclass = infobase->
GetClass();
1923 if (infobase && infobase->
fComp == 0) {
1945 if (baseOffset < 0) {
1957 Int_t baseOffset = -1;
1965 if (strchr(bc->
GetName(),
'<') || !strcmp(bc->
GetName(),
"string")) {
1968 if (bcName == elName) {
1983 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());
1996 if (newInfo ==
this) {
1999 }
else if (newInfo) {
2003 const char *newElName = newElement->
GetName();
2004 if (newElement->
IsBase() && (strchr(newElName,
'<') || !strcmp(newElName,
"string")) ) {
2007 if (bcName == elName) {
2013 Error(
"BuildOld",
"Could not find STL base class: %s for %s\n", element->
GetName(),
GetName());
2017 asize = newElement->
GetSize();
2020 if (baseOffset == -1) {
2031 if (baseOffset < 0) {
2037 element->
Init(
this);
2052 std::string typeNameBuf;
2053 const char* dmType =
nullptr;
2057 std::array<Int_t, 5> maxIndices;
2068 element->
Init(
this);
2082 element->
Init(
this);
2090 if (typeNameBuf.back() ==
'*') {
2092 typeNameBuf.pop_back();
2093 while(typeNameBuf.back() ==
'*') typeNameBuf.pop_back();
2095 dmType = typeNameBuf.c_str();
2102 dmType = typeNameBuf.c_str();
2110 if (dmClassName.
Index(
"const ")==0) dmClassName.
Remove(0,6);
2115 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());
2132 element->
Init(
this);
2145 element->
Init(
this);
2146 if (pattern && pattern !=
this && pattern->IsBuilt()) {
2147 int pair_element_offset =
kMissing;
2148 pattern->GetStreamerElement(element->
GetName(), pair_element_offset);
2149 if (pair_element_offset !=
kMissing) {
2150 element->
SetOffset(pair_element_offset);
2153 }
else if (strcmp(element->
GetName(),
"fData") == 0 && strncmp(
GetName(),
"ROOT::VecOps::RVec", 18) == 0) {
2154 Error(
"BuildCheck",
"Reading RVecs that were written directly to file before ROOT v6.24 is not "
2155 "supported, the program will likely crash.");
2157 element->
Init(
this);
2169 auto theType = isStdArray ? dt : dm->
GetDataType();
2181 if ((newType ==
::kChar_t) && dmIsPtr && !isArray && !hasCount) {
2183 }
else if (dmIsPtr) {
2185 }
else if (isArray) {
2189 if (newType == -1) {
2196 if (newInfo && (newInfo !=
this)) {
2199 if (newClass == 0) {
2200 newType = newElems ? newElems->
GetType() : -1;
2224 }
else if (element->
GetType() != newType) {
2237 if (oldClass == newClass.
GetClass()) {
2239 }
else if (ClassWasMovedToNamespace(oldClass, newClass.
GetClass())) {
2241 if (0 != (oldv = ImportStreamerInfo(oldClass, newClass.
GetClass()))) {
2242 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);
2250 if (ContainerMatchTClonesArray(newClass.
GetClass())) {
2273 TClass *oldFixedClass = FixCollectionV5(
GetClass(),oldClass,newClass);
2274 if (oldFixedClass && oldFixedClass != oldClass) {
2275 element->
Update(oldClass,oldFixedClass);
2276 oldClass = oldFixedClass;
2279 if (CollectionMatch(oldClass, newClass)) {
2294 switch( element->
GetType() ) {
2320 }
else if (CollectionMatchFloat16(oldClass,newClass)) {
2322 }
else if (CollectionMatchDouble32(oldClass,newClass)) {
2324 }
else if (CollectionMatchLong64(oldClass,newClass)) {
2327 }
else if (CollectionMatchULong64(oldClass,newClass)) {
2340 }
else if(oldClass &&
2357 if (strncmp(dm->
GetTitle(),
"->",2)==0) {
2390 if ((!dmIsPtr || newType==
kSTLp) && (isStdArray ? ndim : dm->
GetArrayDim()) > 0) {
2395 if (newInfo && (newInfo !=
this)) {
2398 newType = newElems->
GetType();
2429 if (newType != -1) {
2437 cannotConvert =
kTRUE;
2441 printf(
"%s We have no clue\n", dm->
GetName());
2442 cannotConvert =
kTRUE;
2445 if (newType != -1) {
2449 cannotConvert =
kTRUE;
2453 cannotConvert =
kTRUE;
2457 if (cannotConvert) {
2480 strcmp(element->
GetName(),
"This") == 0 &&
2486 asize =
sizeof(std::vector<int>);
2492 if ((
offset % kSizeOfPtr) != 0) {
2499 if (!wasCompiled && rules) {
2500 if (rules.HasRuleWithSource( element->
GetName(),
kTRUE ) ) {
2502 if (allocClass == 0) {
2510 allocClass = infoalloc->
GetClass();
2516 && !rules.HasRuleWithTarget( element->
GetName(),
kTRUE ) ) {
2538 }
else if (rules.HasRuleWithTarget( element->
GetName(),
kTRUE ) ) {
2550 }
else if (rules && rules.HasRuleWithTarget( element->
GetName(),
kTRUE ) ) {
2586 for (iel = 0; iel < narr; ++iel) {
2589 tai[kel++] = element;
2591 arr[jel++] = element;
2594 for (kel = 0; jel < narr;) {
2595 arr[jel++] = tai[kel++];
2602 if (!wasCompiled && allocClass) {
2640 element->SetOffset(0);
2666 TMemberInfo(
TClass *parent) : fParent(parent) {};
2668 void SetDataType(
Int_t datatype) {
2669 fDataType = datatype;
2675 void SetClassName(
const char *
name) {
2678 void SetComment(
const char *title) {
2679 const char *left = strstr(title,
"[");
2681 const char *right = strstr(left,
"]");
2684 fComment.
Append(left,right-left);
2702 if (fName != other.fName)
return kTRUE;
2705 if (fDataType != other.fDataType) {
2706 if ( (fDataType == 4 && other.fDataType == 16)
2707 || (fDataType == 16 && other.fDataType == 4) ) {
2709 }
else if ( (fDataType == 14 && other.fDataType == 17)
2710 || (fDataType == 17 && other.fDataType == 14) ) {
2712 }
else if ( (fDataType == 3 && other.fDataType == 6)
2713 ||(fDataType == 6 && other.fDataType == 3) ){
2722 }
else if (fClassName != other.fClassName) {
2723 if ( (fClassName ==
"long" && (other.fClassName ==
"long long" || other.fClassName ==
"Long64_t"))
2724 || ( (fClassName ==
"long long" || fClassName ==
"Long64_t") && other.fClassName ==
"long") ) {
2726 }
else if ( (fClassName ==
"unsigned long" && (other.fClassName ==
"unsigned long long" || other.fClassName ==
"ULong64_t"))
2727 || ( (fClassName ==
"unsigned long long" || fClassName ==
"ULong64_t") && other.fClassName ==
"unsigned long") ) {
2732 if (
name != othername) {
2735 if (!CollectionMatch(cl,otherCl)) {
2736 TClass *oldFixedClass = FixCollectionV5(fParent,cl,otherCl);
2737 if (!oldFixedClass || !CollectionMatch(oldFixedClass,otherCl)) {
2746 return fComment != other.fComment;
2768 char* eaddr = ((
char*)obj) + element->
GetOffset();
2787 if (ecl && (
fClass!=ecl )) {
2806 char* eaddr = ((
char*)obj) + element->
GetOffset();
2823 if (newname && newname[0] &&
fName != newname) {
2826 for(
Int_t i = 0; i < ndata; ++i) {
2859 R__ASSERT( (cl==0 || info==0) && (cl!=0 || info!=0) );
2892 if (el && el->
IsBase()) {
2907 if (infoel && infoel->
IsBase()) {
2908 otherClass = infoel->
GetName();
2919 if (localClass != otherClass) {
2923 "The in-memory layout version %d for class '%s' has a base class (%s) that the on-file layout version %d does not have.",
2925 }
else if (otherClass.
Length()==0) {
2927 "The on-file layout version %d for class '%s' has a base class (%s) that the in-memory layout version %d does not have",
2931 "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'",
2935 if (!complete)
return kFALSE;
2940 if (!localBase)
continue;
2943 if (!otherBaseClass)
continue;
2946 msg.
Form(
" The StreamerInfo of class %s read from %s%s\n"
2947 " has the same version (=%d) as the active class but a different checksum.\n"
2948 " You should update the version to ClassDef(%s,%d).\n"
2949 " The objects on this file might not be readable because:\n"
2950 " 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).",
2959 if (!localBaseInfo) {
2966 if (!localBaseInfo) {
2968 msg.
Form(
" The StreamerInfo of the base class %s (of class %s) read from %s%s\n"
2969 " refers to a checksum (%x) that can not be found neither in memory nor in the file.\n",
2971 file ?
"file " :
"", file ? file->
GetName() :
"",
2983 msg.
Form(
" The StreamerInfo of class %s read from %s%s\n"
2984 " has the same version (=%d) as the active class but a different checksum.\n"
2985 " You should update the version to ClassDef(%s,%d).\n"
2986 " The objects on this file might not be readable because:\n"
2987 " 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).",
2997 if (!localBase || !otherBase)
continue;
3003 msg.
Form(
" The StreamerInfo of class %s read from %s%s\n"
3004 " has the same version (=%d) as the active class but a different checksum.\n"
3005 " You should update the version to ClassDef(%s,%d).\n"
3006 " The objects on this file might not be readable because:\n"
3007 " 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).",
3017 if (localBaseInfo == otherBaseInfo ||
3023 msg.
Form(
" The StreamerInfo of class %s read from %s%s\n"
3024 " has the same version (=%d) as the active class but a different checksum.\n"
3025 " You should update the version to ClassDef(%s,%d).\n"
3026 " The objects on this file might not be readable because:\n"
3027 " 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).",
3035 if (!
result && !complete) {
3044 TMemberInfo other(cl ? cl : info->
GetClass());
3053 local.SetName( el->
GetName() );
3055 local.SetComment( el->
GetTitle() );
3056 local.SetDataType( el->
GetType() );
3064 other.SetName( tdm->
GetName() );
3066 other.SetComment( tdm->
GetTitle() );
3093 other.SetName( infoel->
GetName() );
3095 other.SetComment( infoel->
GetTitle() );
3096 other.SetDataType( infoel->
GetType() );
3105 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"
3108 ,other.fClassName.Data(),other.fName.Data(),other.fComment.Data());
3110 }
else if (other.fName.Length()==0) {
3111 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"
3114 ,local.fClassName.Data(),local.fName.Data(),local.fComment.Data());
3116 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"
3121 ,local.fClassName.Data(),local.fName.Data(),local.fComment.Data()
3122 ,other.fClassName.Data(),other.fName.Data(),other.fComment.Data());
3126 if (!complete)
return result;
3156 constexpr size_t kSizeOfPtr =
sizeof(
void*);
3193 auto recurseIntoContent = [file, force](
TClass *contentClass)
3201 si = contentClass->GetCurrentStreamerInfo();
3203 si = contentClass->GetStreamerInfo();
3212 static TClassRef string_classref(
"string");
3213 if (
fClass == string_classref) {
3228 recurseIntoContent(valueClass);
3244 recurseIntoContent(cl);
3263 if (allocator)
return allocator->
GetClass();
3313 for (
int i=0; i<il; i++)
id =
id*3+
name[i];
3325 for (
int i=0; i<il; i++)
id =
id*3+
name[i];
3336 if (el->
IsBase())
continue;
3351 for (i=0; i<il; i++)
id =
id*3+
name[i];
3373 type.ReplaceAll(
"ULong64_t",
"unsigned long long");
3374 type.ReplaceAll(
"Long64_t",
"long long");
3375 type.ReplaceAll(
"signed char",
"char");
3376 type.ReplaceAll(
"<signed char",
"<char");
3377 type.ReplaceAll(
",signed char",
",char");
3378 if (
type==
"signed char")
type =
"char";
3382 for (i=0; i<il; i++)
id =
id*3+
type[i];
3397 const char *right = strstr(left,
"]");
3400 while (left != right) {
3423 fprintf(file,
" %s = 0;\n",element->
GetName());
3425 fprintf(file,
" memset(%s,0,%d);\n",element->
GetName(),element->
GetSize());
3429 fprintf(file,
" %s = 0;\n",element->
GetName());
3444 constexpr auto auto_ptr_len =
str_length(
"auto_ptr<");
3445 constexpr auto unique_ptr_len =
str_length(
"unique_ptr<");
3449 return ((strncmp(
name,
"auto_ptr<", auto_ptr_len) == 0)
3450 || (strncmp(
name,
"unique_ptr<", unique_ptr_len) == 0));
3466 if (!defMod) { fprintf(file,
" %s &modrhs = const_cast<%s &>( rhs );\n",protoname.
Data(),protoname.
Data()); defMod =
kTRUE; };
3467 const char *ename = element->
GetName();
3468 const char *colon2 = strstr(ename,
"::");
3469 if (colon2) ename = colon2+2;
3471 fprintf(file,
" modrhs.%s = 0;\n",ename);
3473 fprintf(file,
" memset(modrhs.%s,0,%d);\n",ename,element->
GetSize());
3476 const char *ename = element->
GetName();
3479 fprintf(file,
" %s &modrhs = const_cast<%s &>( rhs );\n",protoname.
Data(),protoname.
Data()); defMod =
kTRUE;
3481 fprintf(file,
" modrhs.%s = 0;\n",ename);
3484 fprintf(file,
" %s &modrhs = const_cast<%s &>( rhs );\n",protoname.
Data(),protoname.
Data()); defMod =
kTRUE;
3486 fprintf(file,
" modrhs.%s = 0;\n",ename);
3490 fprintf(file,
" for (Int_t i=0;i<%d;i++) %s[i] = rhs.%s[i];\n",element->
GetArrayLength(),ename,ename);
3492 fprintf(file,
" for (Int_t i=0;i<%d;i++) reinterpret_cast<%s *>(%s", element->
GetArrayLength(), element->
GetTypeName(), ename);
3493 fprintf(file,
")[i] = reinterpret_cast<%s const *>(rhs.%s)[i];\n", element->
GetTypeName(), ename);
3496 if (!defMod) { fprintf(file,
" %s &modrhs = const_cast<%s &>( rhs );\n",protoname.
Data(),protoname.
Data()); defMod =
kTRUE; };
3497 fprintf(file,
" modrhs.%s = 0;\n",ename);
3500 fprintf(file,
" %s &modrhs = const_cast<%s &>( rhs );\n",protoname.
Data(),protoname.
Data()); defMod =
kTRUE;
3504 std::string method_name =
"clear";
3506 method_name =
"reset";
3509 fprintf(file,
" modrhs.%s();\n", method_name.c_str());
3511 fprintf(file,
" modrhs.%s.%s();\n",ename, method_name.c_str());
3528 if (atstart) { fprintf(file,
" : "); atstart =
kFALSE; }
3529 else fprintf(file,
" , ");
3530 fprintf(file,
"%s(const_cast<%s &>( rhs ))\n", element->
GetName(),protoname.
Data());
3533 if (atstart) { fprintf(file,
" : "); atstart =
kFALSE; }
3534 else fprintf(file,
" , ");
3536 fprintf(file,
"%s(const_cast<%s &>( rhs ).%s.release() )\n",element->
GetName(),protoname.
Data(),element->
GetName());
3538 fprintf(file,
"%s(const_cast<%s &>( rhs ).%s)\n",element->
GetName(),protoname.
Data(),element->
GetName());
3543 fprintf(file,
"{\n");
3544 fprintf(file,
" // This is NOT a copy constructor. This is actually a move constructor (for stl container's sake).\n");
3545 fprintf(file,
" // Use at your own risk!\n");
3546 fprintf(file,
" (void)rhs; // avoid warning about unused parameter\n");
3556 fprintf(file,
"{\n");
3557 fprintf(file,
" // This is NOT a copy operator=. This is actually a move operator= (for stl container's sake).\n");
3558 fprintf(file,
" // Use at your own risk!\n");
3559 fprintf(file,
" (void)rhs; // avoid warning about unused parameter\n");
3565 fprintf(file,
" %s::operator=(const_cast<%s &>( rhs ));\n", element->
GetName(),protoname.
Data());
3569 fprintf(file,
" %s = std::move((const_cast<%s &>( rhs ).%s));\n",element->
GetName(),protoname.
Data(),element->
GetName());
3571 fprintf(file,
" %s = (const_cast<%s &>( rhs ).%s);\n",element->
GetName(),protoname.
Data(),element->
GetName());
3579 fprintf(file,
" return *this;\n");
3593 const char *ename = element->
GetName();
3594 const char *colon2 = strstr(ename,
"::");
3595 if (colon2) ename = colon2+2;
3598 fprintf(file,
" %s = 0;\n",ename);
3600 fprintf(file,
" memset(%s,0,%d);\n",ename,element->
GetSize());
3604 fprintf(file,
" delete %s; %s = 0;\n",ename,ename);
3606 fprintf(file,
" for (Int_t i=0;i<%d;i++) delete %s[i]; memset(%s,0,%d);\n",element->
GetArrayLength(),ename,ename,element->
GetSize());
3611 const char *ename = element->
GetName();
3613 fprintf(file,
" %s = 0;\n",ename);
3615 fprintf(file,
" delete [] %s; %s = 0;\n",ename,ename);
3619 const char *ename = element->
GetName();
3621 fprintf(file,
" %s = 0;\n",ename);
3623 fprintf(file,
" delete %s; %s = 0;\n",ename,ename);
3625 fprintf(file,
" delete [] %s; %s = 0;\n",ename,ename);
3629 const char *ename = element->
GetName();
3630 const char *prefix =
"";
3633 }
else if ( element->
IsBase() ) {
3642 fprintf(file,
" std::for_each( (%s %s).rbegin(), (%s %s).rend(), DeleteObjectFunctor() );\n",prefix,ename,prefix,ename);
3650 std::vector<std::string> inside;
3653 if ((!inside[1].empty() && inside[1][inside[1].
size()-1]==
'*')
3654 || (!inside[2].empty() && inside[2][inside[2].
size()-1]==
'*')) {
3655 fprintf(file,
" std::for_each( (%s %s).rbegin(), (%s %s).rend(), DeleteObjectFunctor() );\n",prefix,ename,prefix,ename);
3661 fprintf(file,
" delete %s; %s = 0;\n",ename,ename);
3678 const char *clname =
GetName();
3680 if (strchr(clname,
':')) {
3683 const char *
name = clname;
3686 for (
Int_t cur = 0; cur <
len; ++cur) {
3687 switch (clname[cur]) {
3694 if (nest == 0) { cur =
len;
continue; }
3698 if (nest == 0 && clname[cur+1] ==
':') {
3701 name = clname + cur + 2;
3708 template_protoname.
Append(clname,pr_pos);
3712 const char *where = strstr(clname,
"<");
3713 isTemplate = where != 0;
3715 template_protoname.
Append(clname,where-clname);
3719 if (needGenericTemplate && isTemplate) {
3721 fprintf(fp,
"#ifndef %s_h\n", templateName.
Data());
3722 fprintf(fp,
"#define %s_h\n", templateName.
Data());
3733 if (!element->
IsBase())
continue;
3735 const char *ename = element->
GetName();
3736 if (nbase == 1) fprintf(fp,
" : public %s",ename);
3737 else fprintf(fp,
" , public %s",ename);
3742 if (subClasses && subClasses->
GetEntries()) {
3743 Bool_t needheader =
true;
3745 TIter subnext(subClasses);
3752 fprintf(fp,
"\npublic:\n");
3753 fprintf(fp,
"// Nested classes forward declaration.\n");
3757 UInt_t sub_numberOfClasses = 0;
3758 UInt_t sub_numberOfNamespaces;
3766 for (
UInt_t i = 0;i < sub_numberOfClasses;++i) {
3767 fprintf(fp,
"}; // end of class.\n");
3769 if (sub_numberOfNamespaces > 0) {
3770 Error(
"GenerateDeclaration",
"Nested classes %s thought to be inside a namespace inside the class %s",subinfo->
GetName(),
GetName());
3777 fprintf(fp,
"\npublic:\n");
3778 fprintf(fp,
"// Nested classes declaration.\n");
3781 if (subClasses && subClasses->
GetEntries()) {
3794 fprintf(fp,
"\npublic:\n");
3795 fprintf(fp,
"// Data Members.\n");
3808 if (element->
IsBase())
continue;
3809 const char *ename = element->
GetName();
3839 }
else if (strncmp(enamebasic.
Data(),
"auto_ptr<", std::char_traits<char>::length(
"auto_ptr<")) == 0) {
3843 lt = enamebasic.
Length();
3847 if (lt>=ltype) ltype = lt+1;
3849 for (is = 3+lt; is < (3+ltype); ++is)
line +=
' ';
3854 if (ld>=ldata) ldata = ld+1;
3855 for (is = 3+ltype+ld; is < (3+ltype+ldata); ++is)
line +=
' ';
3859 fprintf(fp,
"%s\n",
line.Data());
3862 if (needGenericTemplate && isTemplate) {
3864 fprintf(fp,
"\n %s() {\n",protoname.
Data());
3867 fprintf(fp,
" %s(%s && ) = default;\n",protoname.
Data(),protoname.
Data());
3868 fprintf(fp,
" %s &operator=(const %s & rhs)\n ",protoname.
Data(),protoname.
Data());
3871 fprintf(fp,
" %s(const %s & rhs )\n ",protoname.
Data(),protoname.
Data());
3874 fprintf(fp,
" virtual ~%s() {\n ",protoname.
Data());
3876 fprintf(fp,
" }\n\n");
3880 fprintf(fp,
"\n %s();\n",protoname.
Data());
3881 fprintf(fp,
" %s(%s && ) = default;\n",protoname.
Data(),protoname.
Data());
3882 fprintf(fp,
" %s &operator=(const %s & );\n",protoname.
Data(),protoname.
Data());
3883 fprintf(fp,
" %s(const %s & );\n",protoname.
Data(),protoname.
Data());
3884 fprintf(fp,
" virtual ~%s();\n\n",protoname.
Data());
3888 fprintf(sfp,
"#ifndef %s_cxx\n",guard.
Data());
3889 fprintf(sfp,
"#define %s_cxx\n",guard.
Data());
3890 fprintf(sfp,
"%s::%s() {\n",
GetName(),protoname.
Data());
3894 fprintf(sfp,
"%s &%s::operator=(const %s & rhs)\n",
GetName(),
GetName(),protoname.
Data());
3898 fprintf(sfp,
"%s::%s(const %s & rhs)\n",
GetName(),protoname.
Data(),protoname.
Data());
3902 fprintf(sfp,
"%s::~%s() {\n",
GetName(),protoname.
Data());
3905 fprintf(sfp,
"#endif // %s_cxx\n\n",guard.
Data());
3913 fprintf(fp,
" ClassDef(%s,%d); // Generated by MakeProject.\n",protoname.
Data(),0);
3915 fprintf(fp,
" ClassDef(%s,%d); // Generated by MakeProject.\n",protoname.
Data(),
fClassVersion + 1);
3920 for(
UInt_t i=0;i<numberOfNamespaces;++i) {
3921 fprintf(fp,
"} // namespace\n");
3924 if (needGenericTemplate && isTemplate) {
3925 fprintf(fp,
"#endif // generic template declaration\n");
3934 if (inclist[0]==0) {
3940 const char *clname =
GetName();
3941 if (strchr(clname,
'<')) {
3956 const char *ename = element->
GetName();
3957 const char *colon2 = strstr(ename,
"::");
3958 if (colon2) ename = colon2+2;
3965 if (ltype < lt) ltype = lt;
3966 if (ldata < ld) ldata = ld;
3970 incRiostream =
kTRUE;
3976 if (!include[0])
continue;
3978 Bool_t greater = (include[0]==
'<');
3981 if (strncmp(include,
"include/",8)==0) {
3984 if (strncmp(include,
"include\\",9)==0) {
3989 }
else if (strncmp(element->
GetTypeName(),
"auto_ptr<",std::char_traits<char>::length(
"auto_ptr<"))==0) {
3992 TString incName( include, strlen(include)-1 );
4014 if (strncmp(
GetName(),
"auto_ptr<",std::char_traits<char>::length(
"auto_ptr<"))==0)
return 0;
4027 case '>': ++nest;
if (scope==0) { isTemplate =
kTRUE; }
break;
4028 case '<': --nest;
break;
4030 if (nest==0 &&
GetName()[i-1]==
':') {
4037 }
else if (cl == 0 && extrainfos != 0) {
4052 if (
gDebug) printf(
"generating code for class %s\n",
GetName());
4060 FILE *fp = fopen(
filename.Data(),
"w");
4062 Error(
"MakeProject",
"Cannot open output file:%s\n",
filename.Data());
4067 FILE *allfp = fopen(
filename.Data(),
"a");
4069 Error(
"MakeProject",
"Cannot open output file:%s\n",
filename.Data());
4073 fprintf(allfp,
"#include \"%s.h\"\n", headername.
Data());
4076 char *inclist =
new char[50000];
4081 fprintf(fp,
"//////////////////////////////////////////////////////////\n");
4082 fprintf(fp,
"// This class has been generated by TFile::MakeProject\n");
4083 fprintf(fp,
"// (%s by ROOT version %s)\n",td.
AsString(),
gROOT->GetVersion());
4084 fprintf(fp,
"// from the StreamerInfo in file %s\n",
gDirectory->GetFile()->GetName());
4085 fprintf(fp,
"//////////////////////////////////////////////////////////\n");
4088 fprintf(fp,
"#ifndef %s_h\n",headername.
Data());
4089 fprintf(fp,
"#define %s_h\n",headername.
Data());
4095 TIter subnext(subClasses);
4104 FILE *sfp = fopen( sourcename.
Data(),
"a" );
4108 Error(
"GenerateHeaderFile",
"Could not open %s for appending",sourcename.
Data());
4112 fprintf(fp,
"#endif\n");
4116 if (sfp) fclose(sfp);
4127 char dmbracket[256];
4141 char *rdmc = (
char*)rdm->
GetName();
4144 if (dm->
IsaPointer() && rdmc[0] ==
'*') rdmc++;
4147 if (strcmp(rdmc,dm->
GetName()) == 0) {
4159 if (strstr(rdm->
GetName(),dmbracket)) {
4173 if (elementName == 0)
return 0;
4235 Int_t base_offset = 0;
4236 Int_t local_offset = 0;
4242 if (!base_cl || !base_element) {
4245 base_offset = base_element->
GetOffset();
4248 offset = base_offset + local_offset;
4263 Int_t local_offset = 0;
4272 offset = base_offset + local_offset;
4320 ::Obsolete(
"TStreamerInfo::GetStreamerElementReal",
"v5-34-20",
"v6-00-02");
4322 if (i < 0 || i >=
fNdata)
return 0;
4323 if (j < 0)
return 0;
4328 for (
Int_t ise=0;ise < nelems;ise++) {
4330 if (ise+j >= nelems)
return 0;
4339template <
typename T>
4361#if defined(_MSC_VER) && (_MSC_VER <= 1200)
4383#if defined(_MSC_VER) && (_MSC_VER <= 1200)
4389#define READ_ARRAY(TYPE_t) \
4391 Int_t sub_instance, index; \
4392 Int_t instance = k; \
4394 index = instance / len; \
4395 sub_instance = instance % len; \
4400 TYPE_t **val =(TYPE_t**)(ladd); \
4401 return T((val[sub_instance])[index]); \
4419#if defined(_MSC_VER) && (_MSC_VER <= 1200)
4443template <
typename T>
4452 if (i < 0)
return 0;
4456 if (atype ==
kSTL) {
4458 if (newClass == 0) {
4470 if (j >= nc)
return 0;
4471 char *element_ptr = (
char*)proxy->
At(j);
4472 return GetTypedValueAux<T>(atype,element_ptr,0,1);
4476 return GetTypedValueAux<T>(atype,ladd,j,
len);
4485template <
typename T>
4492 if (j >= nc)
return 0;
4507template <
typename T>
4511 if (j >= nc)
return 0;
4513 char *pointer = (
char*)cont->
At(j);
4526template <
typename T>
4531 if (j >= nc)
return 0;
4533 char **ptr = (
char**)cont->
At(j);
4534 char *pointer = *ptr;
4545 if (rules.empty())
return;
4550 for(
auto rule : rules) {
4551 if( rule->IsRenameRule() || rule->IsAliasRule() )
4556 if ( rule->HasTarget( element->
GetName() ) ) {
4559 if ( rule->GetAttributes()[0] != 0 ) {
4562 if (
attr.Contains(
"owner")) {
4563 if (
attr.Contains(
"notowner")) {
4577 const TObjArray *sources = rule->GetSource();
4589 rule->AsString(ruleStr);
4590 Warning(
"InsertArtificialElements",
"For class %s in StreamerInfo %d is missing the source data member %s when trying to apply the rule:\n %s",
4598 if (!rule)
continue;
4601 std::vector<TStreamerArtificial*> toAdd;
4603 if (rule->GetTarget()==0) {
4611 newel->
SetReadFunc( rule->GetReadFunctionPointer() );
4613 toAdd.push_back(newel);
4615 toAdd.reserve(rule->GetTarget()->GetEntriesFast());
4626 newel->
SetReadFunc( rule->GetReadFunctionPointer() );
4628 toAdd.push_back(newel);
4633 for(
Int_t other = 1; other < rule->GetTarget()->GetEntriesFast(); ++other) {
4634 objstr = (
TObjString*)(rule->GetTarget()->At(other));
4636 newName = objstr->
String();
4643 toAdd.push_back(newel);
4650 TIter s_iter(rule->GetSource());
4655 if (loc == -1 || (i+1)>loc) {
4672 for(
auto &el : toAdd) {
4705 while ((obj = next()))
4708 if (strstr(
option,
"full") != 0) {
4714 if (sequenceType.
Length()) {
4716 sequenceType +=
"]";
4718 Printf(
" i=%2d, %-15s type=%3d, offset=%3d, len=%d, method=%ld%s",
4720 sequenceType.
Data());
4734 if (sequenceType.
Length() != 0) {
4735 sequenceType +=
',';
4737 sequenceType +=
"optimized";
4739 if (sequenceType.
Length()) {
4741 sequenceType +=
"]";
4743 Printf(
" i=%2d, %-15s type=%3d, offset=%3d, len=%d, method=%ld%s",
4745 sequenceType.
Data());
4746 if (optimized && wantOrig) {
4751 if (sequenceType.
Length()) {
4753 sequenceType +=
"]";
4755 Printf(
" j=%2d, %-15s type=%3d, offset=%3d, len=%d, method=%ld%s",
4757 sequenceType.
Data());
4775 char*
p = (
char*) obj;
4814 char**
r = (
char**) eaddr;
4829 void**
r = (
void**) eaddr;
4836 const char* title = element->
GetTitle();
4837 const char* bracket1 = strrchr(title,
'(');
4838 const char* bracket2 = strrchr(title,
')');
4839 if (bracket1 && bracket2 && (bracket2 != (bracket1 + 1))) {
4840 Int_t len = bracket2 - (bracket1 + 1);
4841 char* clonesClass =
new char[
len+1];
4842 clonesClass[0] =
'\0';
4843 strncat(clonesClass, bracket1 + 1,
len);
4844 void**
r = (
void**) eaddr;
4846 delete[] clonesClass;
4849 void**
r = (
void**) eaddr;
4860 if (einfo) einfo->
New(eaddr);
4878 if (strcmp(element->
GetName(),
"This")==0 &&
4923 Error(
"NewArray",
"TClass pointer is null!");
4929 char*
p = (
char*) ary;
4941 char* dataBegin = (
char*) &
r[2];
4945 for (
Long_t cnt = 0; cnt < nElements; ++cnt) {
4954#define DeleteBasicPointer(addr,element,name) \
4956 name **f = (name**)(addr); \
4957 int n = element->GetArrayLength() ? element->GetArrayLength() : 1;\
4958 for(int j=0;j<n;j++) { \
4973 char *
p = (
char*)obj;
4977 for (
Int_t elenum = nelements - 1; elenum >= 0; --elenum) {
5016 void**
r = (
void**) eaddr;
5017 for (
Int_t j =
len - 1; j >= 0; --j) {
5031 void**
r = (
void**) eaddr;
5032 for (
Int_t j =
len - 1; j >= 0; --j) {
5040 if (etype ==
kBase) {
5055 if (etype ==
kSTL) {
5059 if (strcmp(ele->
GetName(),
"This")==0) {
5083 char*
r = eaddr + (
size * (
len - 1));
5105 if (obj == 0)
return;
5107 char*
p = (
char*) obj;
5113 if (allocator !=
this) {
5131 if (ary == 0)
return;
5138 char* memBegin = (
char*) &
r[-2];
5140 char*
p = ((
char*) ary) + ((arrayLen - 1) *
size);
5141 for (
Long_t cnt = 0; cnt < arrayLen; ++cnt,
p -=
size) {
5165 printf(
" %-15s = ",
name);
5178 const static TClassRef stringClass(
"string");
5179 if (
fClass == stringClass) {
5180 std::string *st = (std::string*)(pointer);
5181 printf(
"%s\n",st->c_str());
5184 printf(
"%s\n",st->
Data());
5186 printf(
"(%s*)0x%zx\n",
GetName(),(
size_t)pointer);
5197 if (aleng > lenmax) aleng = lenmax;
5208 if (!clones) {printf(
" %-15s = \n",
name);
return;}
5209 printf(
" %-15s = ",
name);
5211 if (nc > lenmax) nc = lenmax;
5216 if (aleng > lenmax) aleng = lenmax;
5218 for (
Int_t k=0;k < nc;k++) {
5220 char *ladd = pointer+
offset;
5223 if (k < nc-1) printf(
", ");
5233 if (!cont) {printf(
" %-15s = \n",
name);
return;}
5234 printf(
" %-15s = ",
name);
5236 if (nc > lenmax) nc = lenmax;
5241 if (aleng > lenmax) aleng = lenmax;
5243 for (
Int_t k=0;k < nc;k++) {
5244 char *pointer = (
char*)cont->
At(k);
5245 char *ladd = pointer+
offset;
5248 if (k < nc-1) printf(
", ");
5299 for (
Int_t i = 0; i < nobjects; i++) {
5302 if ( el->
IsA() == basic ) {
5322 (*fElements)[i] = rel;
5357 for (
Int_t i = 0; i < nobjects; i++) {
5363 }
else if (el != 0) {
5384 static std::atomic<Bool_t> onlyonce(
kFALSE);
5386 if (onlyonce.compare_exchange_strong(expected,
kTRUE)) {
5387 Warning(
"TagFile",
"This function is deprecated, use TBuffer::TagStreamerInfo instead");
5391 if (fNumber < 0 || fNumber >= nindex) {
5392 Error(
"TagFile",
"StreamerInfo: %s number: %d out of range[0,%d] in file: %s",
5408#define DOLOOP for (k = 0, pointer = arr[0]; k < narr; pointer = arr[++k])
5411 static void PrintCR(
int j,
Int_t aleng,
UInt_t ltype)
5413 if (j == aleng-1) printf(
"\n");
5416 if (j%ltype == ltype-1) printf(
"\n ");
5441 case kInt: {
Int_t *val = (
Int_t* )ladd; printf(
"%d" ,*val);
break;}
5456 case kOffsetL +
kBool: {
Bool_t *val = (
Bool_t* )ladd;
for(j=0;j<aleng;j++) { printf(
"%c " ,(
char)val[j]); PrintCR(j,aleng,20); }
break;}
5457 case kOffsetL +
kChar: {
Char_t *val = (
Char_t* )ladd;
for(j=0;j<aleng;j++) { printf(
"%c " ,val[j]); PrintCR(j,aleng,20); }
break;}
5459 case kOffsetL +
kInt: {
Int_t *val = (
Int_t* )ladd;
for(j=0;j<aleng;j++) { printf(
"%d " ,val[j]); PrintCR(j,aleng,10); }
break;}
5460 case kOffsetL +
kLong: {
Long_t *val = (
Long_t* )ladd;
for(j=0;j<aleng;j++) { printf(
"%ld ",val[j]); PrintCR(j,aleng, 5); }
break;}
5468 case kOffsetL +
kUInt: {
UInt_t *val = (
UInt_t* )ladd;
for(j=0;j<aleng;j++) { printf(
"%u " ,val[j]); PrintCR(j,aleng, 5); }
break;}
5471 case kOffsetL +
kBits: {
UInt_t *val = (
UInt_t* )ladd;
for(j=0;j<aleng;j++) { printf(
"%d " ,val[j]); PrintCR(j,aleng, 5); }
break;}
5474 case kOffsetP +
kBool: {
Bool_t **val = (
Bool_t** )ladd;
for(j=0;j<*count;j++) { printf(
"%d " ,(*val)[j]); PrintCR(j,aleng,20); }
break;}
5475 case kOffsetP +
kChar: {
Char_t **val = (
Char_t** )ladd;
for(j=0;j<*count;j++) { printf(
"%d " ,(*val)[j]); PrintCR(j,aleng,20); }
break;}
5476 case kOffsetP +
kShort: {
Short_t **val = (
Short_t** )ladd;
for(j=0;j<*count;j++) { printf(
"%d " ,(*val)[j]); PrintCR(j,aleng,10); }
break;}
5477 case kOffsetP +
kInt: {
Int_t **val = (
Int_t** )ladd;
for(j=0;j<*count;j++) { printf(
"%d " ,(*val)[j]); PrintCR(j,aleng,10); }
break;}
5478 case kOffsetP +
kLong: {
Long_t **val = (
Long_t** )ladd;
for(j=0;j<*count;j++) { printf(
"%ld ",(*val)[j]); PrintCR(j,aleng, 5); }
break;}
5480 case kOffsetP +
kFloat: {
Float_t **val = (
Float_t** )ladd;
for(j=0;j<*count;j++) { printf(
"%f " ,(*val)[j]); PrintCR(j,aleng, 5); }
break;}
5484 case kOffsetP +
kUChar: {
UChar_t **val = (
UChar_t** )ladd;
for(j=0;j<*count;j++) { printf(
"%u " ,(*val)[j]); PrintCR(j,aleng,20); }
break;}
5486 case kOffsetP +
kUInt: {
UInt_t **val = (
UInt_t** )ladd;
for(j=0;j<*count;j++) { printf(
"%u " ,(*val)[j]); PrintCR(j,aleng, 5); }
break;}
5487 case kOffsetP +
kULong: {
ULong_t **val = (
ULong_t** )ladd;
for(j=0;j<*count;j++) { printf(
"%lu ",(*val)[j]); PrintCR(j,aleng, 5); }
break;}
5494 char **val = (
char**)ladd;
5495 if (*val) printf(
"%s",*val);
5502 printf(
"(%s*)%zx",el ? el->
GetClass()->
GetName() :
"unknown_type",(size_t)(*obj));
5510 printf(
"(%s*)%zx",el ? el->
GetClass()->
GetName() :
"unknown_type",(size_t)(*obj));
5524 printf(
"%s",st->
Data());
5542 printf(
"(%s*)0x%zx",el ? el->
GetClass()->
GetName() :
"unknown_type",(size_t)(*obj));
5550 printf(
"(%s*)0x%zx",el ? el->
GetClass()->
GetName() :
"unknown_type",(size_t)(*obj));
5557 printf(
"printing kAny case (%d)",atype);
5571 printf(
"printing kBase case (%d)",atype);
5581 printf(
"printing kStreamer case (%d)",atype);
5596 printf(
"printing kStreamLoop case (%d)",atype);
5613 if (ladd && aElement->
GetClass() == stringClass) {
5614 std::string *st = (std::string*)(ladd);
5615 printf(
"%s",st->c_str());
5620 printf(
"(unknown_type*)0x%zx",(
size_t)(ladd));
5636 element->
Update(oldcl,newcl);
5702 const char *dmTitle =
"Emulation";
5705 if (dt && dt->
GetType() > 0 ) {
5711 Error(
"Pair Emulation Building",
"%s is not yet supported in pair emulation",
5721 static const char *full_string_name =
"basic_string<char,char_traits<char>,allocator<char> >";
5722 if (strcmp(dmType,
"string") == 0 || strcmp(dmType,
"std::string") == 0 || strcmp(dmType,full_string_name)==0 ) {
5726 return new TStreamerSTL(dmName,dmTitle,
offset,dmFull.c_str(),dmFull.c_str(),dmIsPtr);
5732 auto dtype = enumdesc->GetUnderlyingType();
5736 el->SetSize(datatype->Size());
5738 el->SetSize(
sizeof(
int));
5776 if (hint_pair_offset && hint_pair_offset >= hint_pair_size) {
5777 const char *msg =
"problematic";
5778 if (hint_pair_offset == hint_pair_size)
5780 else if (hint_pair_offset > hint_pair_size) {
5781 if (hint_pair_size == 0)
5782 msg =
"not specified";
5786 Error(
"GenerateInfoForPair",
5787 "Called with inconsistent offset and size. For \"std::pair<%s,%s>\" the requested offset is %ld but the size is %s (%ld)",
5788 firstname.c_str(), secondname.c_str(), (
long)hint_pair_offset, msg, (
long)hint_pair_offset);
5792 std::string pname =
"pair<" + firstname +
"," + secondname;
5793 pname += (pname[pname.length()-1]==
'>') ?
" >" :
">";
5803 Int_t sp =
sizeof(
void *);
5810 if (hint_pair_offset)
5811 size = hint_pair_offset;
5827 if (hint_pair_size) {
5841 const static int pairlen = std::char_traits<char>::length(
"pair<");
5842 if (pairclassname.compare(0, pairlen,
"pair<") != 0) {
5844 Error(
"GenerateInfoForPair",
"The class name passed is not a pair: %s", pairclassname.c_str());
5848 std::vector<std::string> inside;
5853 Error(
"GenerateInfoForPair",
"Could not find the pair arguments in %s", pairclassname.c_str());
5857 return GenerateInfoForPair(inside[1], inside[2], silent, hint_pair_offset, hint_pair_size);
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
unsigned long long ULong64_t
const Bool_t kIterBackward
Bool_t operator!=(const TDatime &d1, const TDatime &d2)
#define R__ASSERT(e)
Checks condition e and reports a fatal error if it's false.
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
Int_t gErrorIgnoreLevel
Error handling routines.
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void input
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h offset
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize id
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t UChar_t len
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t attr
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t src
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
R__EXTERN TVirtualMutex * gInterpreterMutex
static void R__WriteMoveConstructorBody(FILE *file, const TString &protoname, TIter &next)
Write down the body of the 'move' constructor.
static TStreamerElement * R__CreateEmulatedElement(const char *dmName, const std::string &dmFull, Int_t offset, bool silent)
static void R__TObjArray_InsertAt(TObjArray *arr, TObject *obj, Int_t at)
static void R__TObjArray_InsertAfter(TObjArray *arr, TObject *newobj, TObject *oldobj)
static bool R__IsUniquePtr(TStreamerElement *element)
Return true if the element is auto_ptr or unique_ptr.
#define READ_ARRAY(TYPE_t)
static void R__WriteConstructorBody(FILE *file, TIter &next)
#define DeleteBasicPointer(addr, element, name)
static constexpr int str_length(const char *str)
static void R__WriteMoveBodyPointersArrays(FILE *file, const TString &protoname, TIter &next)
Write down the pointers and arrays part of the body of the 'move' constructor.
static void R__TObjArray_InsertBefore(TObjArray *arr, TObject *newobj, TObject *oldobj)
static void R__WriteOddOperatorEqualBody(FILE *file, const TString &protoname, TIter &next)
Write down the body of the 'move' constructor.
static void R__WriteDestructorBody(FILE *file, TIter &next)
void Printf(const char *fmt,...)
Formats a string in a circular formatting buffer and prints the string.
R__EXTERN TSystem * gSystem
#define R__LOCKGUARD(mutex)
const TMatches FindRules(const TString &source) const
Return all the rules that are about the given 'source' class.
Bool_t HasRuleWithSourceClass(const TString &source) const
Return True if we have any rule whose source class is 'source'.
const TObjArray * GetTarget() const
Get the target data members of this rule (i.e. the in memory data member).
Array of chars or bytes (8 bits per element).
Each class (see TClass) has a linked list of its base class(es).
Int_t GetDelta()
Get offset from "this" to part of base class.
ROOT::ESTLType IsSTLContainer()
Return which type (if any) of STL container the data member is.
TClass * GetClassPointer(Bool_t load=kTRUE)
Get pointer to the base class TClass.
const char * GetTitle() const override
Get base class description (comment).
Buffer base class used for serializing objects.
virtual Version_t ReadVersion(UInt_t *start=nullptr, UInt_t *bcnt=nullptr, const TClass *cl=nullptr)=0
virtual void ClassBegin(const TClass *, Version_t=-1)=0
virtual void SetByteCount(UInt_t cntpos, Bool_t packInVersion=kFALSE)=0
TObject * GetParent() const
Return pointer to parent of this buffer.
virtual Int_t WriteObjectAny(const void *obj, const TClass *ptrClass, Bool_t cacheReuse=kTRUE)=0
virtual void ClassEnd(const TClass *)=0
virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss)=0
virtual void ClassMember(const char *, const char *=nullptr, Int_t=-1, Int_t=-1)=0
virtual Int_t GetVersionOwner() const =0
void SetBufferOffset(Int_t offset=0)
virtual UInt_t WriteVersion(const TClass *cl, Bool_t useBcnt=kFALSE)=0
TClassRef is used to implement a permanent reference to a TClass object.
TClass * GetClass() const
static DictFuncPtr_t GetDict(const char *cname)
Given the class name returns the Dictionary() function of a class (uses hash of name).
TClass instances represent classes, structs and namespaces in the ROOT type system.
UInt_t GetCheckSum(ECheckSum code=kCurrentCheckSum) const
Call GetCheckSum with validity check.
Bool_t IsSyntheticPair() const
TDataMember * GetDataMember(const char *datamember) const
Return pointer to datamember object with name "datamember".
ROOT::ESTLType GetCollectionType() const
Return the 'type' of the STL the TClass is representing.
void RemoveStreamerInfo(Int_t slot)
Remove and delete the StreamerInfo in the given slot.
TVirtualStreamerInfo * GetStreamerInfoAbstractEmulated(Int_t version=0) const
For the case where the requestor class is emulated and this class is abstract, returns a pointer to t...
void * New(ENewType defConstructor=kClassNew, Bool_t quiet=kFALSE) const
Return a pointer to a newly allocated object of this class.
Bool_t HasDataMemberInfo() const
void CopyCollectionProxy(const TVirtualCollectionProxy &)
Replaces the collection proxy for this class.
Bool_t fIsSyntheticPair
Indicates whether this class can be split or not. Values are -1, 0, 1, 2.
void Destructor(void *obj, Bool_t dtorOnly=kFALSE)
Explicitly call destructor for object.
void RegisterStreamerInfo(TVirtualStreamerInfo *info)
Register the StreamerInfo in the given slot, change the State of the TClass as appropriate.
Bool_t CallShowMembers(const void *obj, TMemberInspector &insp, Bool_t isTransient=kFALSE) const
Call ShowMembers() on the obj of this class type, passing insp and parent.
TVirtualStreamerInfo * GetCurrentStreamerInfo()
void IgnoreTObjectStreamer(Bool_t ignore=kTRUE)
When the class kIgnoreTObjectStreamer bit is set, the automatically generated Streamer will not call ...
TClassStreamer * GetStreamer() const
Return the Streamer Class allowing streaming (if any).
TClass * GetBaseClass(const char *classname)
Return pointer to the base class "classname".
Longptr_t GetDataMemberOffset(const char *membername) const
return offset for member name.
Bool_t MatchLegacyCheckSum(UInt_t checksum) const
Return true if the checksum passed as argument is one of the checksum value produced by the older che...
Bool_t HasInterpreterInfo() const
void BuildRealData(void *pointer=nullptr, Bool_t isTransient=kFALSE)
Build a full list of persistent data members.
TList * GetListOfDataMembers(Bool_t load=kTRUE)
Return list containing the TDataMembers of a class.
TList * GetListOfRealData() const
Int_t Size() const
Return size of object of this class.
Bool_t CanIgnoreTObjectStreamer()
const ROOT::Detail::TSchemaRuleSet * GetSchemaRules() const
Return the set of the schema rules if any.
TList * GetListOfBases()
Return list containing the TBaseClass(es) of a class.
const TObjArray * GetStreamerInfos() const
Bool_t IsLoaded() const
Return true if the shared library of this class is currently in the a process's memory.
Bool_t IsTObject() const
Return kTRUE is the class inherits from TObject.
Bool_t IsForeign() const
Return kTRUE is the class is Foreign (the class does not have a Streamer method).
TVirtualStreamerInfo * GetStreamerInfo(Int_t version=0, Bool_t isTransient=kFALSE) const
returns a pointer to the TVirtualStreamerInfo object for version If the object does not exist,...
Int_t GetBaseClassOffset(const TClass *toBase, void *address=nullptr, bool isDerivedObject=true)
TVirtualCollectionProxy * GetCollectionProxy() const
Return the proxy describing the collection (if any).
Int_t GetClassSize() const
Long_t Property() const override
Returns the properties of the TClass as a bit field stored as a Long_t value.
Bool_t IsVersioned() const
void SetClassSize(Int_t sizof)
TVirtualStreamerInfo * FindStreamerInfo(TObjArray *arr, UInt_t checksum) const
Find the TVirtualStreamerInfo in the StreamerInfos corresponding to checksum.
TVirtualStreamerInfo * FindStreamerInfoAbstractEmulated(UInt_t checksum) const
For the case where the requestor class is emulated and this class is abstract, returns a pointer to t...
Version_t GetClassVersion() const
TRealData * GetRealData(const char *name) const
Return pointer to TRealData element with name "name".
static TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE)
Static method returning pointer to TClass of the specified class name.
An array of clone (identical) objects.
static TVirtualCollectionProxy * GenEmulatedProxy(const char *class_name, Bool_t silent)
Generate emulated collection proxy for a given class.
static TClassStreamer * GenEmulatedClassStreamer(const char *class_name, Bool_t silent)
Generate emulated class streamer for a given collection class.
static Proxy_t * GenExplicitProxy(const ::ROOT::TCollectionProxyInfo &info, TClass *cl)
Generate proxy from static functions.
static TClassStreamer * GenExplicitClassStreamer(const ::ROOT::TCollectionProxyInfo &info, TClass *cl)
Generate class streamer from static functions.
virtual Int_t GetEntries() const
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
Small helper to read a TBuffer containing a TClonesArray into any valid collection.
All ROOT classes may have RTTI (run time type identification) support added.
Int_t GetMaxIndex(Int_t dim) const
Return maximum index for array dimension "dim".
const char * GetTrueTypeName() const
Get the desugared type name of this data member, including const and volatile qualifiers.
Bool_t IsPersistent() const
Long_t Property() const override
Get property description word. For meaning of bits see EProperty.
Int_t GetArrayDim() const
Return number of array dimensions.
Int_t GetUnitSize() const
Get the sizeof the underlying type of the data member (i.e.
Bool_t IsBasic() const
Return true if data member is a basic type, e.g. char, int, long...
Int_t IsSTLContainer()
The return type is defined in TDictionary (kVector, kList, etc.)
Bool_t IsaPointer() const
Return true if data member is a pointer.
TDataType * GetDataType() const
Longptr_t GetOffset() const
Get offset from "this".
const char * GetTypeName() const
Get the decayed type name of this data member, removing const and volatile qualifiers,...
const char * GetArrayIndex() const
If the data member is pointer and has a valid array size in its comments GetArrayIndex returns a stri...
const char * GetFullTypeName() const
Get the concrete type name of this data member, including const and volatile qualifiers.
TClass * GetClass() const
Basic data type descriptor (datatype information is obtained from CINT).
TString GetTypeName()
Get basic type of typedef, e,g.: "class TDirectory*" -> "TDirectory".
static TDataType * GetDataType(EDataType type)
Given a EDataType type, get the TDataType* that represents it.
Int_t Size() const
Get size of basic typedef'ed type.
This class stores the date and time with a precision of one second in an unsigned 32 bit word (950130...
const char * AsString() const
Return the date & time as a string (ctime() format).
static TEnum * GetEnum(const std::type_info &ti, ESearchAction sa=kALoadAndInterpLookup)
A ROOT file is an on-disk file, usually with extension .root, that stores objects in a file-system-li...
const TList * GetStreamerInfoCache()
Returns the cached list of StreamerInfos used in this file.
TArrayC * GetClassIndex() const
TObject * FindObject(const char *name) const override
Find an object in this list using its name.
static TString GetHeaderName(const char *name, const TList *extrainfos, Bool_t includeNested=kFALSE)
Return the header name containing the description of name.
static UInt_t GenerateForwardDeclaration(FILE *fp, const char *clname, char *inclist, Bool_t implementEmptyClass, Bool_t needGenericTemplate, const TList *extrainfos)
Insert a (complete) forward declaration for the class 'clname'.
static void AddInclude(FILE *fp, const char *header, Bool_t system, char *inclist)
Add an include statement, if it has not already been added.
static UInt_t GenerateIncludeForTemplate(FILE *fp, const char *clname, char *inclist, Bool_t forward, const TList *extrainfos)
Add to the header file, the #include needed for the argument of this template.
static void GeneratePostDeclaration(FILE *fp, const TVirtualStreamerInfo *info, char *inclist)
Add to the header file anything that need to appear after the class declaration (this includes some #...
static UInt_t GenerateClassPrefix(FILE *fp, const char *clname, Bool_t top, TString &protoname, UInt_t *numberOfClasses, Int_t implementEmptyClass=kFALSE, Bool_t needGenericTemplate=kFALSE)
Write the start of the class (forward) declaration.
static TString UpdateAssociativeToVector(const char *name)
Abstract base class for accessing the data-members of a class.
const char * GetParent() const
virtual void Inspect(TClass *cl, const char *parent, const char *name, const void *addr)
void InspectMember(const T &obj, const char *name, Bool_t isTransient)
The TNamed class is the base class for all named ROOT classes.
TObject * Clone(const char *newname="") const override
Make a clone of an object using the Streamer facility.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
const char * GetName() const override
Returns name of object.
void Streamer(TBuffer &) override
Stream an object of class TObject.
const char * GetTitle() const override
Returns title of object.
virtual void SetName(const char *name)
Set the name of the TNamed.
Int_t GetEntriesFast() const
void AddAt(TObject *obj, Int_t idx) override
Add object at position ids.
TObject * Last() const override
Return the object in the last filled slot. Returns 0 if no entries.
virtual void AddAtAndExpand(TObject *obj, Int_t idx)
Add object at position idx.
virtual void Compress()
Remove empty slots from array.
Int_t GetEntries() const override
Return the number of objects in array (i.e.
void Delete(Option_t *option="") override
Remove all objects from the array AND delete all heap based objects.
TObject * At(Int_t idx) const override
void AddLast(TObject *obj) override
Add object in the next empty slot in the array.
TObject * UncheckedAt(Int_t i) const
Bool_t IsEmpty() const override
TObject * FindObject(const char *name) const override
Find an object in this collection using its name.
Int_t GetLast() const override
Return index of last object in array.
void Add(TObject *obj) override
Collectable string class.
Mother of all ROOT objects.
friend class TClonesArray
virtual const char * GetName() const
Returns name of object.
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual TObject * FindObject(const char *name) const
Must be redefined in derived classes.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual void Fatal(const char *method, const char *msgfmt,...) const
Issue fatal error message.
virtual const char * GetTitle() const
Returns title of object.
virtual TClass * IsA() const
virtual void ls(Option_t *option="") const
The ls function lists the contents of a class on stdout.
@ kCanDelete
if object in a list can be deleted
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
void Obsolete(const char *method, const char *asOfVers, const char *removedFromVers) const
Use this method to declare a method obsolete.
The TRealData class manages the effective list of all data members for a given class.
const char * GetName() const override
Returns name of object.
TDataMember * GetDataMember() const
TMemberStreamer * GetStreamer() const
Return the associate streamer object.
Long_t GetThisOffset() const
void SetReadFunc(ROOT::TSchemaRule::ReadFuncPtr_t val)
void SetReadRawFunc(ROOT::TSchemaRule::ReadRawFuncPtr_t val)
void SetErrorMessage(const char *msg)
void SetNewBaseClass(TClass *cl)
TVirtualStreamerInfo * GetBaseStreamerInfo() const
TClass * GetClassPointer() const override
Returns a pointer to the TClass of this element.
void SetCountClass(const char *clname)
void Init(TVirtualStreamerInfo *obj=nullptr) override
Setup the element.
const char * GetCountClass() const
virtual void SetSize(Int_t dsize)
virtual Int_t GetSize() const
Returns size of this element in bytes.
virtual const char * GetInclude() const
virtual void Init(TVirtualStreamerInfo *obj=nullptr)
Initliaze the element.
virtual const char * GetFullName() const
Return element name including dimensions, if any Note that this function stores the name into a stati...
virtual TClass * GetClassPointer() const
Returns a pointer to the TClass of this element.
virtual void SetArrayDim(Int_t dim)
Set number of array dimensions.
Int_t GetArrayDim() const
TClass * GetNewClass() const
Int_t GetArrayLength() const
virtual void SetStreamer(TMemberStreamer *streamer)
set pointer to Streamer function for this element
virtual Bool_t IsTransient() const
Return kTRUE if the element represent an entity that is not written to the disk (transient members,...
Int_t GetMaxIndex(Int_t i) const
virtual Bool_t IsaPointer() const
virtual void Update(const TClass *oldClass, TClass *newClass)
function called by the TClass constructor when replacing an emulated class by the real class
const char * GetTypeName() const
TClass * GetClass() const
TClass * IsA() const override
virtual void SetType(Int_t dtype)
virtual void SetNewClass(TClass *cl)
virtual void SetTypeName(const char *name)
const char * GetTypeNameBasic() const
Return type name of this element in case the type name is not a standard basic type,...
virtual Bool_t IsBase() const
Return kTRUE if the element represent a base class.
virtual void SetOffset(Int_t offset)
virtual void SetNewType(Int_t dtype)
virtual void SetMaxIndex(Int_t dim, Int_t max)
set maximum index for array with dimension dim
virtual Bool_t HasCounter() const
void GetSequenceType(TString &type) const
Fill type with the string representation of sequence information including 'cached',...
ActionContainer_t fActions
void Update(const TClass *oldcl, TClass *newcl)
Update the TClass pointer cached in this object.
TClass * fClass
Not Owned.
TStreamerElement * fElem
Not Owned.
Describes a persistent version of a class.
Int_t fNVirtualInfoLoc
! Number of virtual info location to update.
Int_t fOnFileClassVersion
!Class version identifier as stored on file.
Int_t GetSize() const override
Return total size of all persistent elements of the class (with offsets).
Int_t GetClassVersion() const override
void Destructor(void *p, Bool_t dtorOnly=kFALSE) override
Emulated destructor for this class.
TVirtualStreamerInfo * GenerateInfoForPair(const std::string &pairclassname, bool silent, size_t hint_pair_offset, size_t hint_pair_size) override
Generate the TClass and TStreamerInfo for the requested pair.
TClassStreamer * GenExplicitClassStreamer(const ::ROOT::Detail::TCollectionProxyInfo &info, TClass *cl) override
Generate class streamer from static functions.
TVirtualCollectionProxy * GenEmulatedProxy(const char *class_name, Bool_t silent) override
Generate emulated collection proxy for a given class.
Int_t fNfulldata
!number of elements
TCompInfo * fComp
![fNslots with less than fElements->GetEntries()*1.5 used] Compiled info
TVirtualCollectionProxy * GenExplicitProxy(const ::ROOT::Detail::TCollectionProxyInfo &info, TClass *cl) override
Generate proxy from static functions.
T GetTypedValue(char *pointer, Int_t i, Int_t j, Int_t len) const
Return value of element i in object at pointer.
TStreamerInfoActions::TActionSequence * fWriteMemberWiseVecPtr
! List of write action resulting from the compilation for use in member wise streaming.
TClassStreamer * GenEmulatedClassStreamer(const char *class_name, Bool_t silent) override
Generate emulated class streamer for a given collection class.
Int_t GenerateHeaderFile(const char *dirname, const TList *subClasses=nullptr, const TList *extrainfos=nullptr) override
Generate header file for the class described by this TStreamerInfo the function is called by TFile::M...
TStreamerInfoActions::TActionSequence * fReadText
! List of text read action resulting from the compilation, used for JSON.
Int_t GetNumber() const override
void ls(Option_t *option="") const override
List the TStreamerElement list and also the precomputed tables if option contains the string "incOrig...
TCompInfo ** fCompFull
![fElements->GetEntries()]
TObjArray * fElements
Array of TStreamerElements.
void InsertArtificialElements(std::vector< const ROOT::TSchemaRule * > &rules)
Insert new members as expressed in the array of TSchemaRule(s).
Int_t GetOnFileClassVersion() const override
Int_t GetOffset(const char *) const override
Return the offset of the data member as indicated by this StreamerInfo.
void PrintValue(const char *name, char *pointer, Int_t i, Int_t len, Int_t lenmax=1000) const
print value of element i in object at pointer The function may be called in two ways: -method1 len < ...
Int_t GetDataMemberOffset(TDataMember *dm, TMemberStreamer *&streamer) const
Compute data member offset.
TObject * Clone(const char *newname="") const override
Make a clone of an object using the Streamer facility.
T GetTypedValueSTLP(TVirtualCollectionProxy *cont, Int_t i, Int_t j, Int_t k, Int_t eoffset) const
Return value of element i in object number j in a TClonesArray and eventually element k in a sub-arra...
T GetTypedValueSTL(TVirtualCollectionProxy *cont, Int_t i, Int_t j, Int_t k, Int_t eoffset) const
Return value of element i in object number j in a TClonesArray and eventually element k in a sub-arra...
void BuildEmulated(TFile *file) override
Create an Emulation TStreamerInfo object.
void DeleteArray(void *p, Bool_t dtorOnly=kFALSE) override
Destroy an array of emulated objects, with optional delete.
Bool_t BuildFor(const TClass *cl) override
Check if we can build this for foreign class - do we have some rules to do that.
void Build(Bool_t isTransient=kFALSE) override
Build the I/O data structure for the current class version.
void BuildOld() override
rebuild the TStreamerInfo structure
TStreamerInfoActions::TActionSequence * fReadMemberWise
! List of read action resulting from the compilation for use in member wise streaming.
Int_t GetType(Int_t id) const
Int_t fClassVersion
Class version identifier.
Int_t fNdata
!number of optimized elements
void * New(void *obj=nullptr) override
An emulated object is created at address obj, if obj is null we allocate memory for the object.
TStreamerInfo()
Status bits See TVirtualStreamerInfo::EStatusBits for the values.
TStreamerInfoActions::TActionSequence * fReadMemberWiseVecPtr
! List of read action resulting from the compilation for use in member wise streaming.
TStreamerInfoActions::TActionSequence * fReadObjectWise
! List of read action resulting from the compilation.
TClass * GetActualClass(const void *obj) const override
Assuming that obj points to (the part of) an object that is of the type described by this streamerInf...
TStreamerElement * GetStreamerElementReal(Int_t i, Int_t j) const
Obsolete: this routine is obsolete and should not longer be used.
TClass * IsA() const override
TClass * fClass
!pointer to class
Bool_t MatchLegacyCheckSum(UInt_t checksum) const
Return true if the checksum passed as argument is one of the checksum value produced by the older che...
~TStreamerInfo() override
TStreamerInfo dtor.
TCompInfo ** fCompOpt
![fNdata]
void TagFile(TFile *fFile) override
Mark the classindex of the current file as using this TStreamerInfo.
Int_t GetNewType(Int_t id) const
void SetClass(TClass *cl) override
Replace the TClass this streamerInfo is pointing to (belongs to)
UInt_t fCheckSum
Checksum of original class.
void Streamer(TBuffer &) override
Stream an object of class TStreamerInfo.
Int_t GetSizeElements() const
Return total size of all persistent elements of the class use GetSize if you want to get the real siz...
TClass * GetClass() const override
static std::atomic< Int_t > fgCount
Number of TStreamerInfo instances.
T GetTypedValueClones(TClonesArray *clones, Int_t i, Int_t j, Int_t k, Int_t eoffset) const
UInt_t GenerateIncludes(FILE *fp, char *inclist, const TList *extrainfos)
Add to the header file, the #include need for this class.
void ComputeSize()
Compute total size of all persistent elements of the class.
Int_t fNumber
!Unique identifier
void PrintValueSTL(const char *name, TVirtualCollectionProxy *cont, Int_t i, Int_t eoffset, Int_t lenmax=1000) const
Print value of element i in a TClonesArray.
TStreamerInfoActions::TActionSequence * fWriteObjectWise
! List of write action resulting from the compilation.
void CallShowMembers(const void *obj, TMemberInspector &insp, Bool_t isTransient) const override
Emulated a call ShowMembers() on the obj of this class type, passing insp and parent.
void Clear(Option_t *="") override
If opt contains 'built', reset this StreamerInfo as if Build or BuildOld was never called on it (usef...
TObjArray * GetElements() const override
Int_t fSize
!size of the persistent class
static T GetTypedValueAux(Int_t type, void *ladd, int k, Int_t len)
Get the value from inside a collection.
void GenerateDeclaration(FILE *fp, FILE *sfp, const TList *subClasses, Bool_t top=kTRUE)
Write the Declaration of class.
static void PrintValueAux(char *ladd, Int_t atype, TStreamerElement *aElement, Int_t aleng, Int_t *count)
print value of element in object at pointer, type atype, leng aleng or *count The function may be cal...
void * NewArray(Long_t nElements, void *ary=nullptr) override
An array of emulated objects is created at address ary, if ary is null, we allocate memory for the ar...
TStreamerElement * GetStreamerElement(const char *datamember, Int_t &offset) const override
Return the StreamerElement of "datamember" inside our class or any of its base classes.
UInt_t GetCheckSum() const override
void Compile() override
loop on the TStreamerElement list regroup members with same type Store predigested information into l...
void BuildCheck(TFile *file=nullptr, Bool_t load=kTRUE) override
Check if built and consistent with the class dictionary.
Bool_t CompareContent(TClass *cl, TVirtualStreamerInfo *info, Bool_t warn, Bool_t complete, TFile *file) override
Return True if the current StreamerInfo in cl or info is equivalent to this TStreamerInfo.
TStreamerInfoActions::TActionSequence * fWriteMemberWise
! List of write action resulting from the compilation for use in member wise streaming.
Int_t fNslots
!total number of slots in fComp.
void ForceWriteInfo(TFile *file, Bool_t force=kFALSE) override
Recursively mark streamer infos for writing to a file.
Version_t fOldVersion
! Version of the TStreamerInfo object read from the file
void DestructorImpl(void *p, Bool_t dtorOnly)
Internal part of the destructor.
TStreamerInfoActions::TActionSequence * fWriteText
! List of text write action resulting for the compilation, used for JSON.
ULong_t * fVirtualInfoLoc
![fNVirtualInfoLoc] Location of the pointer to the TStreamerInfo inside the object (when emulated)
void Update(const TClass *oldClass, TClass *newClass) override
function called by the TClass constructor when replacing an emulated class by the real class
void PrintValueClones(const char *name, TClonesArray *clones, Int_t i, Int_t eoffset, Int_t lenmax=1000) const
Print value of element i in a TClonesArray.
void Init(TVirtualStreamerInfo *obj=nullptr) override
Setup the element.
void SetCountClass(const char *clname)
const char * GetCountClass() const
TClass * GetClassPointer() const override
Returns a pointer to the TClass of this element.
Bool_t IsBase() const override
Return kTRUE if the element represent a base class.
void ToLower()
Change string to lower-case.
TSubString Strip(EStripType s=kTrailing, char c=' ') const
Return a substring of self stripped at beginning and/or end.
void Clear()
Clear string without changing its capacity.
const char * Data() const
TString & Prepend(const char *cs)
TString & Remove(Ssiz_t pos)
TString & Append(const char *cs)
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
virtual const char * BaseName(const char *pathname)
Base name of a file name. Base name of /user/root is root.
RAII helper class that ensures that PushProxy() / PopProxy() are called when entering / leaving a C++...
Defines a common interface to inspect/change the contents of an object that represents a collection.
virtual Int_t GetProperties() const
Return miscallenous properties of the proxy (see TVirtualCollectionProxy::EProperty)
virtual void Destructor(void *p, Bool_t dtorOnly=kFALSE) const
Execute the container destructor.
virtual EDataType GetType() const =0
If the value type is a fundamental data type, return its type (see enumeration EDataType).
@ kCustomAlloc
The collection has a custom allocator.
virtual void Clear(const char *opt="")=0
Clear the container.
virtual void * New() const
Construct a new container object and return its address.
virtual TClass * GetValueClass() const =0
If the value type is a user-defined class, return a pointer to the TClass representing the value type...
virtual void * At(UInt_t idx)=0
Return the address of the value at index idx
virtual Int_t GetCollectionType() const =0
Return the type of the proxied collection (see enumeration TClassEdit::ESTLType)
virtual UInt_t Size() const =0
Return the current number of elements in the container.
virtual Bool_t HasPointers() const =0
Return true if the content is of type 'pointer to'.
Abstract Interface class describing Streamer information for one class.
Bool_t fIsBuilt
true if the StreamerInfo has been optimized
virtual void ForceWriteInfo(TFile *file, Bool_t force=kFALSE)=0
Bool_t IsCompiled() const
std::atomic< Bool_t > fIsCompiled
true if the StreamerInfo has been 'built' (i.e. has all the StreamerElements it should have)
static const char * GetElementCounterStart(const char *dmTitle)
Given a comment/title declaring an array counter, for example:
EReadWrite
EReadWrite Enumerator.
@ kUChar
Equal to TDataType's kchar.
@ kUnsupportedConversion
Type corresponding to a 'missing' data member (with kMissing offset)
@ kNeedObjectForVirtualBaseClass
static TStreamerBasicType * GetElementCounter(const char *countName, TClass *cl)
Get pointer to a TStreamerBasicType in TClass *cl static function.
virtual TObjArray * GetElements() const =0
virtual void * New(void *obj=nullptr)=0
virtual void Destructor(void *p, Bool_t dtorOnly=kFALSE)=0
virtual Bool_t CompareContent(TClass *cl, TVirtualStreamerInfo *info, Bool_t warn, Bool_t complete, TFile *file)=0
virtual Int_t GetClassVersion() const =0
virtual TClass * GetClass() const =0
void ResetClassVersion(TClass *, const char *, Short_t)
Global function to update the version number.
std::string ResolveTypedef(const char *tname, bool resolveAll=false)
bool IsStdArray(std::string_view name)
bool IsStdClass(const char *type)
return true if the class belongs to the std namespace
bool IsStdPair(std::string_view name)
std::string GetLong64_Name(const char *original)
Replace 'long long' and 'unsigned long long' by 'Long64_t' and 'ULong64_t'.
ROOT::ESTLType IsSTLCont(std::string_view type)
type : type name: vector<list<classA,allocator>,allocator> result: 0 : not stl container code of cont...
std::string ShortType(const char *typeDesc, int mode)
Return the absolute type of typeDesc.
bool GetStdArrayProperties(const char *typeName, std::string &typeNameBuf, std::array< int, 5 > &maxIndices, int &ndim)
std::string GetNameForIO(const std::string &templateInstanceName, TClassEdit::EModType mode=TClassEdit::kNone, bool *hasChanged=nullptr)
int GetSplit(const char *type, std::vector< std::string > &output, int &nestedLoc, EModType mode=TClassEdit::kNone)
Stores in output (after emptying it) the split type.
bool IsSTLBitset(const char *type)
Return true is the name is std::bitset<number> or bitset<number>