40#if (defined(__linux) || defined(__APPLE__)) && defined(__i386__) && \
80 fInfo(nullptr), fInfoStack()
90 fInfo(nullptr), fInfoStack()
107 fInfo(nullptr), fInfoStack()
149 char *sw = (
char *)
x;
159 char *sw = (
char *)
x;
166 memcpy(
x, buf,
sizeof(
Long_t));
233 if (obj ==
nullptr) {
234 Error(
"TBufferFile::ReadStdString",
"The std::string address is nullptr but should not");
249 obj->resize(nbig,
'\0');
253 obj->resize(nwh,
'\0');
271 Int_t nbig = obj->length();
326 &&
"Byte count position is after the end of the buffer");
328 char *buf = (
char *)(
fBuffer + cntpos);
373 const char *
name = clss ? clss->
GetName() : classname ? classname : 0;
377 Error(
"CheckByteCount",
"object of class %s read too few bytes: %d instead of %d",
381 Error(
"CheckByteCount",
"object of class %s read too many bytes: %d instead of %d",
384 Warning(
"CheckByteCount",
"%s::Streamer() not in sync with data on file %s, fix Streamer()",
387 Warning(
"CheckByteCount",
"%s::Streamer() not in sync with data, fix Streamer()",
391 if ( ((
char *)endpos) >
fBufMax ) {
393 Error(
"CheckByteCount",
394 "Byte count probably corrupted around buffer position %d:\n\t%d for a possible maximum of %d",
446 if (!nbits) nbits = 12;
482 ptr[0] = (
Float_t)(aint/factor + minvalue);
501 temp.fIntValue = theExp;
502 temp.fIntValue <<= 23;
503 temp.fIntValue |= (theMan & ((1<<(nbits+1))-1)) <<(23-nbits);
504 if(1<<(nbits+1) & theMan) temp.fFloatValue = -temp.fFloatValue;
505 ptr[0] = temp.fFloatValue;
517 ptr[0] = (
Double_t)(aint/factor + minvalue);
536 temp.fIntValue = theExp;
537 temp.fIntValue <<= 23;
538 temp.fIntValue |= (theMan & ((1<<(nbits+1))-1)) <<(23-nbits);
539 if(1<<(nbits+1) & theMan) temp.fFloatValue = -temp.fFloatValue;
540 ptr[0] = (
Double_t)temp.fFloatValue;
614 if (!nbits) nbits = 12;
624 UShort_t theMan = ((1<<(nbits+1))-1) & (fIntValue>>(23-nbits-1));
627 if (theMan&1<<nbits) theMan = (1<<nbits) - 1;
628 if (fFloatValue < 0) theMan |= 1<<(nbits+1);
692 UShort_t theMan = ((1<<(nbits+1))-1) & (fIntValue>>(23-nbits-1)) ;
695 if (theMan&1<<nbits) theMan = (1<<nbits)-1 ;
696 if (fFloatValue < 0) theMan |= 1<<(nbits+1);
715 if (n <= 0 || n >
fBufSize)
return 0;
720 for (
int i = 0; i <
n; i++)
744 if (l <= 0 || l >
fBufSize)
return 0;
767 if (l <= 0 || l >
fBufSize)
return 0;
776 for (
int i = 0; i <
n; i++)
800 if (l <= 0 || l >
fBufSize)
return 0;
802 if (!ii) ii =
new Int_t[
n];
809 for (
int i = 0; i <
n; i++)
833 if (l <= 0 || l >
fBufSize)
return 0;
859 if (l <= 0 || l >
fBufSize)
return 0;
864 for (
int i = 0; i <
n; i++)
887 if (l <= 0 || l >
fBufSize)
return 0;
896 for (
int i = 0; i <
n; i++)
920 if (l <= 0 || l >
fBufSize)
return 0;
925 for (
int i = 0; i <
n; i++)
948 if (n <= 0 || 3*n >
fBufSize)
return 0;
970 if (n <= 0 || 3*n >
fBufSize)
return 0;
990 if (n <= 0 || n >
fBufSize)
return 0;
995 for (
int i = 0; i <
n; i++)
1018 if (l <= 0 || l >
fBufSize)
return 0;
1040 if (l <= 0 || l >
fBufSize)
return 0;
1049 for (
int i = 0; i <
n; i++)
1072 if (l <= 0 || l >
fBufSize)
return 0;
1081 for (
int i = 0; i <
n; i++)
1104 if (l <= 0 || l >
fBufSize)
return 0;
1129 if (l <= 0 || l >
fBufSize)
return 0;
1134 for (
int i = 0; i <
n; i++)
1156 if (n <= 0 || l >
fBufSize)
return 0;
1165 for (
int i = 0; i <
n; i++)
1188 if (n <= 0 || l >
fBufSize)
return 0;
1193 for (
int i = 0; i <
n; i++)
1215 if (n <= 0 || 3*n >
fBufSize)
return 0;
1236 if (n <= 0 || 3*n >
fBufSize)
return 0;
1250 if (n <= 0 || n >
fBufSize)
return;
1252 if (
sizeof(
Bool_t) > 1) {
1253 for (
int i = 0; i <
n; i++)
1267 if (n <= 0 || n >
fBufSize)
return;
1282 if (lenchar < 255) {
1288 if (len <= 0 || len >
fBufSize)
return;
1308 if (n <= 0 || l >
fBufSize)
return;
1315 for (
int i = 0; i <
n; i++)
1330 if (l <= 0 || l >
fBufSize)
return;
1337 for (
int i = 0; i <
n; i++)
1352 if (l <= 0 || l >
fBufSize)
return;
1368 if (l <= 0 || l >
fBufSize)
return;
1371 for (
int i = 0; i <
n; i++)
1385 if (l <= 0 || l >
fBufSize)
return;
1392 for (
int i = 0; i <
n; i++)
1407 if (l <= 0 || l >
fBufSize)
return;
1410 for (
int i = 0; i <
n; i++)
1424 if (n <= 0 || 3*n >
fBufSize)
return;
1430 for (
int j=0;j <
n; j++) {
1437 if (!nbits) nbits = 12;
1446 for (i = 0; i <
n; i++) {
1451 fIntValue |= (theMan & ((1<<(nbits+1))-1)) <<(23-nbits);
1452 if(1<<(nbits+1) & theMan) fFloatValue = -fFloatValue;
1464 if (n <= 0 || 3*n >
fBufSize)
return;
1467 for (
int j=0;j <
n; j++) {
1468 UInt_t aint; *
this >> aint; ptr[j] = (
Float_t)(aint/factor + minvalue);
1478 if (n <= 0 || 3*n >
fBufSize)
return;
1480 if (!nbits) nbits = 12;
1489 for (
Int_t i = 0; i <
n; i++) {
1494 fIntValue |= (theMan & ((1<<(nbits+1))-1)) <<(23-nbits);
1495 if(1<<(nbits+1) & theMan) fFloatValue = -fFloatValue;
1496 ptr[i] = fFloatValue;
1506 if (n <= 0 || 3*n >
fBufSize)
return;
1512 for (
int j=0;j <
n; j++) {
1522 for (i = 0; i <
n; i++) {
1535 for (i = 0; i <
n; i++) {
1540 fIntValue |= (theMan & ((1<<(nbits+1))-1)) <<(23-nbits);
1541 if (1<<(nbits+1) & theMan) fFloatValue = -fFloatValue;
1554 if (n <= 0 || 3*n >
fBufSize)
return;
1557 for (
int j=0;j <
n; j++) {
1558 UInt_t aint; *
this >> aint;
d[j] = (
Double_t)(aint/factor + minvalue);
1568 if (n <= 0 || 3*n >
fBufSize)
return;
1573 for (
Int_t i = 0; i <
n; i++) {
1586 for (
Int_t i = 0; i <
n; i++) {
1591 fIntValue |= (theMan & ((1<<(nbits+1))-1)) <<(23-nbits);
1592 if (1<<(nbits+1) & theMan) fFloatValue = -fFloatValue;
1608 (*streamer)(*
this,start,0);
1612 int objectSize = cl->
Size();
1613 char *obj = (
char*)start;
1614 char *end = obj +
n*objectSize;
1616 for(; obj<end; obj+=objectSize) ((
TClass*)cl)->
Streamer(obj,*
this, onFileClass);
1634 for (
Int_t j=0;j<
n;j++) {
1635 if (!start[j]) start[j] = cl->
New();
1639 (*streamer)(*
this,(
void*)start,0);
1645 for (
Int_t j=0; j<
n; j++){
1647 void *old = start[j];
1649 if (old && old!=start[j] &&
1674 for (
Int_t j=0; j<
n; j++){
1675 if (!start[j]) start[j] = ((
TClass*)cl)->New();
1676 ((
TClass*)cl)->Streamer(start[j],*
this,onFileClass);
1698 if (
sizeof(
Bool_t) > 1) {
1699 for (
int i = 0; i <
n; i++)
1748 for (
int i = 0; i <
n; i++)
1778 for (
int i = 0; i <
n; i++)
1842 for (
int i = 0; i <
n; i++)
1871 for (
int i = 0; i <
n; i++)
1897 for (
int i = 0; i <
n; i++)
1954 const Int_t maxElements = (std::numeric_limits<Int_t>::max() -
Length())/dataWidth;
1955 if (n < 0 || n > maxElements)
1957 Fatal(
"WriteFastArray",
"Not enough space left in the buffer (1GB limit). %lld elements is greater than the max left of %d",
n, maxElements);
1964 if (
sizeof(
Bool_t) > 1) {
1965 for (
int i = 0; i <
n; i++)
1982 const Int_t maxElements = (std::numeric_limits<Int_t>::max() -
Length())/dataWidth;
1983 if (n < 0 || n > maxElements)
1985 Fatal(
"WriteFastArray",
"Not enough space left in the buffer (1GB limit). %lld elements is greater than the max left of %d",
n, maxElements);
2005 const Int_t maxElements = (std::numeric_limits<Int_t>::max() -
Length())/dataWidth;
2006 if (n < 0 || n > maxElements)
2008 Fatal(
"WriteFastArray",
"Not enough space left in the buffer (1GB limit). %lld elements is greater than the max left of %d",
n, maxElements);
2035 const Int_t maxElements = (std::numeric_limits<Int_t>::max() -
Length())/dataWidth;
2036 if (n < 0 || n > maxElements)
2038 Fatal(
"WriteFastArray",
"Not enough space left in the buffer (1GB limit). %lld elements is greater than the max left of %d",
n, maxElements);
2050 for (
int i = 0; i <
n; i++)
2067 constexpr Int_t dataWidth = 4;
2068 const Int_t maxElements = (std::numeric_limits<Int_t>::max() -
Length())/dataWidth;
2069 if (n < 0 || n > maxElements)
2071 Fatal(
"WriteFastArray",
"Not enough space left in the buffer (1GB limit). %lld elements is greater than the max left of %d",
n, maxElements);
2083 for (
int i = 0; i <
n; i++)
2100 constexpr Int_t dataWidth = 8;
2101 const Int_t maxElements = (std::numeric_limits<Int_t>::max() -
Length())/dataWidth;
2102 if (n < 0 || n > maxElements)
2104 Fatal(
"WriteFastArray",
"Not enough space left in the buffer (1GB limit). %lld elements is greater than the max left of %d",
n, maxElements);
2124 constexpr Int_t dataWidth = 8;
2125 const Int_t maxElements = (std::numeric_limits<Int_t>::max() -
Length())/dataWidth;
2126 if (n < 0 || n > maxElements)
2128 Fatal(
"WriteFastArray",
"Not enough space left in the buffer (1GB limit). %lld elements is greater than the max left of %d",
n, maxElements);
2147 const Int_t maxElements = (std::numeric_limits<Int_t>::max() -
Length())/dataWidth;
2148 if (n < 0 || n > maxElements)
2150 Fatal(
"WriteFastArray",
"Not enough space left in the buffer (1GB limit). %lld elements is greater than the max left of %d",
n, maxElements);
2158 for (
int i = 0; i <
n; i++)
2175 const Int_t maxElements = (std::numeric_limits<Int_t>::max() -
Length())/dataWidth;
2176 if (n < 0 || n > maxElements)
2178 Fatal(
"WriteFastArray",
"Not enough space left in the buffer (1GB limit). %lld elements is greater than the max left of %d",
n, maxElements);
2190 for (
int i = 0; i <
n; i++)
2208 const Int_t maxElements = (std::numeric_limits<Int_t>::max() -
Length())/dataWidth;
2209 if (n < 0 || n > maxElements)
2211 Fatal(
"WriteFastArray",
"Not enough space left in the buffer (1GB limit). %lld elements is greater than the max left of %d",
n, maxElements);
2219 for (
int i = 0; i <
n; i++)
2237 const Int_t maxElements = (std::numeric_limits<Int_t>::max() -
Length())/dataWidth;
2238 if (n < 0 || n > maxElements)
2240 Fatal(
"WriteFastArray",
"Not enough space left in the buffer (1GB limit). %lld elements is greater than the max left of %d",
n, maxElements);
2254 for (
int j = 0; j <
n; j++) {
2264 if (!nbits) nbits = 12;
2273 for (i = 0; i <
n; i++) {
2276 UShort_t theMan = ((1<<(nbits+1))-1) & (fIntValue>>(23-nbits-1));
2279 if (theMan&1<<nbits) theMan = (1<<nbits) - 1;
2280 if (fFloatValue < 0) theMan |= 1<<(nbits+1);
2297 const Int_t maxElements = (std::numeric_limits<Int_t>::max() -
Length())/dataWidth;
2298 if (n < 0 || n > maxElements)
2300 Fatal(
"WriteFastArray",
"Not enough space left in the buffer (1GB limit). %lld elements is greater than the max left of %d",
n, maxElements);
2314 for (
int j = 0; j <
n; j++) {
2327 for (i = 0; i <
n; i++) {
2339 for (i = 0; i <
n; i++) {
2342 UShort_t theMan = ((1<<(nbits+1))-1) & (fIntValue>>(23-nbits-1));
2345 if(theMan&1<<nbits) theMan = (1<<nbits) - 1;
2346 if (fFloatValue < 0) theMan |= 1<<(nbits+1);
2363 (*streamer)(*
this, start, 0);
2367 char *obj = (
char*)start;
2371 Fatal(
"WriteFastArray",
"Negative number of elements %lld",
n);
2377 ((
TClass*)cl)->Streamer(obj,*
this);
2397 (*streamer)(*
this,(
void*)start,0);
2400 if (
n < 0)
return -1;
2407 for (
Int_t j=0;j<
n;j++) {
2409 if (!strInfo && !start[j]) {
2424 for (
Int_t j=0;j<
n;j++) {
2425 if (!start[j]) start[j] = ((
TClass*)cl)->New();
2426 ((
TClass*)cl)->Streamer(start[j],*
this);
2484 TClass *clOnfile =
nullptr;
2485 Int_t baseOffset = 0;
2486 if (clRef && (clRef!=(
TClass*)(-1)) && clCast) {
2489 if (baseOffset == -1) {
2496 Error(
"ReadObject",
"got object of wrong class! requested %s but got %s",
2505 Info(
"ReadObjectAny",
"Using Converter StreamerInfo from %s to %s",clRef->
GetName(),clCast->
GetName());
2507 clRef =
const_cast<TClass*
>(clCast);
2512 Error(
"ReadObject",
"trying to read an emulated class (%s) to store in a compiled pointer (%s)",
2524 if (obj == (
void*) -1) obj =
nullptr;
2527 return (obj + baseOffset);
2532 if (clRef == (
TClass*) -1) {
2550 Error(
"ReadObject",
"object tag too large, I/O buffer corrupted");
2558 if (clRef && (clRef!=(
TClass*)(-1)) && clCast) {
2561 if (baseOffset == -1) {
2562 Error(
"ReadObject",
"Got object of wrong class (Got %s while expecting %s)",
2580 obj = (
char*)clRef->
New();
2582 Error(
"ReadObject",
"could not create object of class %s",
2595 clRef->
Streamer( obj, *
this, clOnfile );
2600 return obj+baseOffset;
2617 if (!actualObjectStart) {
2645 Warning(
"WriteObjectAny",
"since %s has no public constructor\n"
2646 "\twhich can be called without argument, objects of this class\n"
2647 "\tcan not be read with the current library. You will need to\n"
2648 "\tadd a default constructor before attempting to read it.",
2676 ((
TClass*)actualClass)->Streamer((
void*)actualObjectStart,*
this);
2696 if (fBufCur < fBuffer || fBufCur >
fBufMax) {
2701 UInt_t bcnt, tag, startpos = 0;
2714 if (objTag) *objTag = tag;
2737 UInt_t clTag = (tag & ~kClassMask);
2744 Error(
"ReadClass",
"illegal class tag=%d (0<tag<=%d), I/O buffer corrupted",
2759 Error(
"ReadClass",
"The on-file class is \"%s\" which is not compatible with the requested class: \"%s\"",
2765 if (objTag) *objTag = (bcnt & ~kByteCountMask);
2768 if (!cl) cl = (
TClass*)-1;
2844 Error(
"SkipVersion",
"Could not find the StreamerInfo with a checksum of %d for the class \"%s\" in %s.",
2847 Error(
"SkipVersion",
"Could not find the StreamerInfo with a checksum of %d for the class \"%s\" (buffer with no parent)",
2867 Error(
"SkipVersion",
"Could not find the StreamerInfo with a checksum of %d for the class \"%s\" in %s.",
2873 Error(
"SkipVersion",
"Class %s not known to file %s.",
2915 if (bcnt) *bcnt = (
v.cnt & ~kByteCountMask);
2923 && (
v.cnt &&
v.cnt >= 6)
2930 return vinfo->TStreamerInfo::GetClassVersion();
2940 Error(
"ReadVersion",
"Could not find the StreamerInfo with a checksum of 0x%x for the class \"%s\" in %s.",
2943 Error(
"ReadVersion",
"Could not find the StreamerInfo with a checksum of 0x%x for the class \"%s\" (buffer with no parent)",
2954 if (
v.cnt &&
v.cnt >= 6)
2971 Error(
"ReadVersion",
"Could not find the StreamerInfo with a checksum of 0x%x for the class \"%s\" in %s.",
2977 Error(
"ReadVersion",
"Class %s not known to file %s.",
3021 if (bcnt) *bcnt = (
v.cnt & ~kByteCountMask);
3049 return vinfo->TStreamerInfo::GetClassVersion();
3089 Error(
"ReadVersion",
"Class %s not known to file %s.",
3112 if (version<=1 && cl->IsForeign()) {
3117 Error(
"WriteVersion",
"version number cannot be larger than %hd)",
3142 if (version<=1 && cl->IsForeign()) {
3143 Error(
"WriteVersionMemberWise",
"Member-wise streaming of foreign collection not yet implemented!");
3148 Error(
"WriteVersionMemberWise",
"version number cannot be larger than %hd)",
3167 else Warning(
"StreamObject",
"No TClass for the type %s is available, the object was not read.", typeinfo.name());
3177 else Warning(
"StreamObject",
"No TClass for the type %s is available, the object was not read.", className);
3185 ((
TClass*)cl)->Streamer(obj, *
this, (
TClass*)onFileClass );
3238 Warning(
"CheckObject",
"reference to unavailable class %s,"
3239 " pointers of this type will be 0", cl->
GetName());
3241 Warning(
"CheckObject",
"reference to an unavailable class,"
3242 " pointers of that type will be 0");
3247 }
else if (cli == -1) {
3268 Warning(
"CheckObject",
"reference to object of unavailable class %s, offset=%d"
3269 " pointer will be 0", cl ? cl->
GetName() :
"TObject",
offset);
3275 }
else if (cli == -1) {
3295 if (max == 0)
return 0;
3312 if (max == 0)
return;
3335 while (nr < max-1) {
3355 WriteBuf(s, (strlen(s)+1)*
sizeof(
char));
3415 Error(
"ReadClassBuffer",
3416 "Could not find the right streamer info to convert %s version %d into a %s, object skipped at offset %d",
3430 auto ninfos = infos->
GetSize();
3431 if (version < -1 || version >= ninfos) {
3432 Error(
"ReadClassBuffer",
"class: %s, attempting to access a wrong version: %d, object skipped at offset %d",
3438 if (sinfo ==
nullptr) {
3447 if (sinfo ==
nullptr) {
3449 const_cast<TClass*
>(cl)->BuildRealData(pointer);
3453 const_cast<TClass*
>(cl)->RegisterStreamerInfo(sinfo);
3454 if (
gDebug > 0)
Info(
"ReadClassBuffer",
"Creating StreamerInfo for class: %s, version: %d", cl->
GetName(), version);
3456 }
else if (version==0) {
3463 Error(
"ReadClassBuffer",
"Could not find the StreamerInfo for version %d of the class %s, object skipped at offset %d",
3475 const_cast<TClass*
>(cl)->BuildRealData(pointer);
3524 Error(
"ReadClassBuffer",
3525 "Could not find the right streamer info to convert %s version %d into a %s, object skipped at offset %d",
3548 if (version < -1 || version >= infocapacity) {
3549 Error(
"ReadClassBuffer",
"class: %s, attempting to access a wrong version: %d, object skipped at offset %d",
3561 const_cast<TClass*
>(cl)->BuildRealData(pointer);
3571 if (sinfo ==
nullptr) {
3584 auto ninfos = infos->
GetSize();
3585 if (!(version < -1 || version >= ninfos)) {
3589 const_cast<TClass *
>(cl)->BuildRealData(pointer);
3592 const_cast<TClass *
>(cl)->RegisterStreamerInfo(sinfo);
3594 Info(
"ReadClassBuffer",
"Creating StreamerInfo for class: %s, version: %d",
3598 sinfo->
Clear(
"build");
3604 }
else if (version==0) {
3611 Error(
"ReadClassBuffer",
"Could not find the StreamerInfo for version %d of the class %s, object skipped at offset %d",
3622 if (sinfo->TStreamerInfo::IsRecovered()) R__c=0;
3627 if (
gDebug > 2)
Info(
"ReadClassBuffer",
"For class: %s has read %d bytes", cl->
GetName(), R__c);
3643 if (sinfo ==
nullptr) {
3647 if (sinfo ==
nullptr)
3649 if (sinfo ==
nullptr) {
3650 const_cast<TClass*
>(cl)->BuildRealData(pointer);
3652 const_cast<TClass*
>(cl)->SetCurrentStreamerInfo(sinfo);
3653 const_cast<TClass*
>(cl)->RegisterStreamerInfo(sinfo);
3661 const_cast<TClass*
>(cl)->BuildRealData(pointer);
3688 TStreamerInfoActions::ActionContainer_t::const_iterator end = sequence.
fActions.end();
3689 for(TStreamerInfoActions::ActionContainer_t::const_iterator iter = sequence.
fActions.begin();
3692 (*iter).PrintDebug(*
this,obj);
3698 TStreamerInfoActions::ActionContainer_t::const_iterator end = sequence.
fActions.end();
3699 for(TStreamerInfoActions::ActionContainer_t::const_iterator iter = sequence.
fActions.begin();
3717 TStreamerInfoActions::ActionContainer_t::const_iterator end = sequence.
fActions.end();
3718 for(TStreamerInfoActions::ActionContainer_t::const_iterator iter = sequence.
fActions.begin();
3721 if (!start_collection || start_collection == end_collection)
3722 (*iter).PrintDebug(*
this,
nullptr);
3724 (*iter).PrintDebug(*
this, *(
char**)start_collection);
3725 (*iter)(*
this, start_collection, end_collection);
3730 TStreamerInfoActions::ActionContainer_t::const_iterator end = sequence.
fActions.end();
3731 for(TStreamerInfoActions::ActionContainer_t::const_iterator iter = sequence.
fActions.begin();
3734 (*iter)(*
this,start_collection,end_collection);
3752 void *arr0 = start_collection ? loopconfig->
GetFirstAddress(start_collection,end_collection) : 0;
3754 TStreamerInfoActions::ActionContainer_t::const_iterator end = sequence.
fActions.end();
3755 for(TStreamerInfoActions::ActionContainer_t::const_iterator iter = sequence.
fActions.begin();
3758 (*iter).PrintDebug(*
this,arr0);
3759 (*iter)(*
this,start_collection,end_collection,loopconfig);
3764 TStreamerInfoActions::ActionContainer_t::const_iterator end = sequence.
fActions.end();
3765 for(TStreamerInfoActions::ActionContainer_t::const_iterator iter = sequence.
fActions.begin();
3768 (*iter)(*
this,start_collection,end_collection,loopconfig);
void * bswapcpy16(void *to, const void *from, size_t n)
void * bswapcpy32(void *to, const void *from, size_t n)
void frombuf(char *&buf, Bool_t *x)
void tobuf(char *&buf, Bool_t x)
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
unsigned long long ULong64_t
const UInt_t kMaxMapCount
const UInt_t kNewClassTag
static void frombufOld(char *&buf, Long_t *x)
Handle old file formats.
const Version_t kMaxVersion
static bool Class_Has_StreamerInfo(const TClass *cl)
Thread-safe check on StreamerInfos of a TClass.
const Version_t kByteCountVMask
const UInt_t kByteCountMask
#define R__ASSERT(e)
Checks condition e and reports a fatal error if it's false.
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 data
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 mode
R__EXTERN TVirtualMutex * gInterpreterMutex
char *(* ReAllocCharFun_t)(char *, size_t, size_t)
#define R__LOCKGUARD(mutex)
#define R__WRITE_LOCKGUARD(mutex)
#define R__READ_LOCKGUARD(mutex)
Bool_t HasRuleWithSourceClass(const TString &source) const
Return True if we have any rule whose source class is 'source'.
The concrete implementation of TBuffer for writing/reading to/from a ROOT file or socket.
void WriteFastArrayFloat16(const Float_t *f, Long64_t n, TStreamerElement *ele=nullptr) override
Write array of n floats (as truncated float) into the I/O buffer.
void ReadWithFactor(Float_t *ptr, Double_t factor, Double_t minvalue) override
Read a Float16_t from the buffer when the factor and minimum value have been specified see comments a...
void WriteBuf(const void *buf, Int_t max) override
Write max bytes from buf into the I/O buffer.
void WriteFastArray(const Bool_t *b, Long64_t n) override
Write array of n bools into the I/O buffer.
TObject * ReadObject(const TClass *cl) override
Read object from I/O buffer.
void ReadDouble32(Double_t *d, TStreamerElement *ele=nullptr) override
Read a Double32_t from the buffer, see comments about Double32_t encoding at TBufferFile::WriteDouble...
Int_t ReadStaticArrayFloat16(Float_t *f, TStreamerElement *ele=nullptr) override
Read array of floats (written as truncated float) from the I/O buffer.
void DecrementLevel(TVirtualStreamerInfo *) override
Decrement level.
Version_t ReadVersion(UInt_t *start=nullptr, UInt_t *bcnt=nullptr, const TClass *cl=nullptr) override
Read class version from I/O buffer.
Version_t ReadVersionNoCheckSum(UInt_t *start=nullptr, UInt_t *bcnt=nullptr) override
Read class version from I/O buffer, when the caller knows for sure that there is no checksum written/...
void SetByteCount(UInt_t cntpos, Bool_t packInVersion=kFALSE) override
Set byte count at position cntpos in the buffer.
~TBufferFile() override
Delete an I/O buffer object.
void ReadWithNbits(Float_t *ptr, Int_t nbits) override
Read a Float16_t from the buffer when the number of bits is specified (explicitly or not) see comment...
void WriteObjectClass(const void *actualObjStart, const TClass *actualClass, Bool_t cacheReuse) override
Write object to I/O buffer.
void ReadTString(TString &s) override
Read TString from TBuffer.
void ReadCharStar(char *&s) override
Read char* from TBuffer.
void StreamObject(void *obj, const std::type_info &typeinfo, const TClass *onFileClass=nullptr) override
Stream an object given its C++ typeinfo information.
UInt_t WriteVersion(const TClass *cl, Bool_t useBcnt=kFALSE) override
Write class version to I/O buffer.
Int_t ReadBuf(void *buf, Int_t max) override
Read max bytes from the I/O buffer into buf.
void WriteString(const char *s) override
Write string to I/O buffer.
char * ReadString(char *s, Int_t max) override
Read string from I/O buffer.
void WriteArray(const Bool_t *b, Int_t n) override
Write array of n bools into the I/O buffer.
void ReadFastArray(Bool_t *b, Int_t n) override
Read array of n bools from the I/O buffer.
void ReadFastArrayString(Char_t *c, Int_t n) override
Read array of n characters from the I/O buffer.
Int_t ReadArray(Bool_t *&b) override
Read array of bools from the I/O buffer.
Int_t ApplySequence(const TStreamerInfoActions::TActionSequence &sequence, void *object) override
Read one collection of objects from the buffer using the StreamerInfoLoopAction.
void * ReadObjectAny(const TClass *cast) override
Read object from I/O buffer.
void SkipObjectAny() override
Skip any kind of object from buffer.
Int_t ReadStaticArrayDouble32(Double_t *d, TStreamerElement *ele=nullptr) override
Read array of doubles (written as float) from the I/O buffer.
TClass * ReadClass(const TClass *cl=nullptr, UInt_t *objTag=nullptr) override
Read class definition from I/O buffer.
Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class) override
Deserialize information from a buffer into an object.
void SkipVersion(const TClass *cl=nullptr) override
Skip class version from I/O buffer.
void ReadFloat16(Float_t *f, TStreamerElement *ele=nullptr) override
Read a Float16_t from the buffer, see comments about Float16_t encoding at TBufferFile::WriteFloat16(...
void Streamer(TBuffer &) override
Stream an object of class TObject.
void WriteFastArrayDouble32(const Double_t *d, Long64_t n, TStreamerElement *ele=nullptr) override
Write array of n doubles (as float) into the I/O buffer.
void WriteFastArrayString(const Char_t *c, Long64_t n) override
Write array of n characters into the I/O buffer.
Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss, const char *classname)
Check byte count with current buffer position.
void WriteCharStar(char *s) override
Write char* into TBuffer.
Int_t ApplySequenceVecPtr(const TStreamerInfoActions::TActionSequence &sequence, void *start_collection, void *end_collection) override
Read one collection of objects from the buffer using the StreamerInfoLoopAction.
void WriteStdString(const std::string *s) override
Write std::string to TBuffer.
Int_t WriteClassBuffer(const TClass *cl, void *pointer) override
Function called by the Streamer functions to serialize object at p to buffer b.
void WriteClass(const TClass *cl) override
Write class description to I/O buffer.
void ReadFastArrayDouble32(Double_t *d, Int_t n, TStreamerElement *ele=nullptr) override
Read array of n doubles (written as float) from the I/O buffer.
UInt_t WriteVersionMemberWise(const TClass *cl, Bool_t useBcnt=kFALSE) override
Write class version to I/O buffer after setting the kStreamedMemberWise bit in the version number.
void CheckCount(UInt_t offset) override
Check if offset is not too large (< kMaxMapCount) when writing.
Int_t ReadArrayFloat16(Float_t *&f, TStreamerElement *ele=nullptr) override
Read array of floats (written as truncated float) from the I/O buffer.
void ReadFastArrayFloat16(Float_t *f, Int_t n, TStreamerElement *ele=nullptr) override
Read array of n floats (written as truncated float) from the I/O buffer.
void ReadStdString(std::string *s) override
Read std::string from TBuffer.
void WriteFloat16(Float_t *f, TStreamerElement *ele=nullptr) override
Write a Float16_t to the buffer.
Int_t ReadStaticArray(Bool_t *b) override
Read array of bools from the I/O buffer.
void WriteTString(const TString &s) override
Write TString to TBuffer.
UInt_t CheckObject(UInt_t offset, const TClass *cl, Bool_t readClass=kFALSE)
Check for object in the read map.
InfoList_t fInfoStack
Stack of pointers to the TStreamerInfos.
void WriteDouble32(Double_t *d, TStreamerElement *ele=nullptr) override
Write a Double32_t to the buffer.
void ReadLong(Long_t &l) override
Read Long from TBuffer.
void ReadFastArrayWithNbits(Float_t *ptr, Int_t n, Int_t nbits) override
Read array of n floats (written as truncated float) from the I/O buffer.
void IncrementLevel(TVirtualStreamerInfo *info) override
Increment level.
Int_t ReadArrayDouble32(Double_t *&d, TStreamerElement *ele=nullptr) override
Read array of doubles (written as float) from the I/O buffer.
void WriteArrayDouble32(const Double_t *d, Int_t n, TStreamerElement *ele=nullptr) override
Write array of n doubles (as float) into the I/O buffer.
void WriteArrayFloat16(const Float_t *f, Int_t n, TStreamerElement *ele=nullptr) override
Write array of n floats (as truncated float) into the I/O buffer.
void ReadFastArrayWithFactor(Float_t *ptr, Int_t n, Double_t factor, Double_t minvalue) override
Read array of n floats (written as truncated float) from the I/O buffer.
Version_t ReadVersionForMemberWise(const TClass *cl=nullptr) override
Read class version from I/O buffer.
TStreamerInfo * fInfo
Pointer to TStreamerInfo object writing/reading the buffer.
Int_t ReadClassEmulated(const TClass *cl, void *object, const TClass *onfile_class) override
Read emulated class.
Direct subclass of TBuffer, implements common methods for TBufferFile and TBufferText classes.
void InitMap() override
Create the fMap container and initialize them with the null object.
void ForceWriteInfo(TVirtualStreamerInfo *info, Bool_t force) override
force writing the TStreamerInfo to the file
TExMap * fMap
Map containing object,offset pairs for reading/writing.
void MapObject(const TObject *obj, UInt_t offset=1) override
Add object to the fMap container.
TExMap * fClassMap
Map containing object,class pairs for reading.
Int_t fDisplacement
Value to be added to the map offsets.
static R__ALWAYS_INLINE ULong_t Void_Hash(const void *ptr)
Return hash value for provided object.
Int_t fMapCount
Number of objects or classes in map.
void TagStreamerInfo(TVirtualStreamerInfo *info) override
Mark the classindex of the current file as using this TStreamerInfo.
Int_t WriteObjectAny(const void *obj, const TClass *ptrClass, Bool_t cacheReuse=kTRUE) override
Write object to I/O buffer.
TObject * GetParent() const
Return pointer to parent of this buffer.
void AutoExpand(Int_t size_needed)
Automatically calculate a new size and expand the buffer to fit at least size_needed.
void SetBufferOffset(Int_t offset=0)
TClass instances represent classes, structs and namespaces in the ROOT type system.
UInt_t GetCheckSum(ECheckSum code=kCurrentCheckSum) const
Call GetCheckSum with validity check.
void Streamer(void *obj, TBuffer &b, const TClass *onfile_class=nullptr) const
void * New(ENewType defConstructor=kClassNew, Bool_t quiet=kFALSE) const
Return a pointer to a newly allocated object of this class.
static TClass * Load(TBuffer &b)
Load class description from I/O buffer and return class object.
TVirtualStreamerInfo * GetCurrentStreamerInfo()
void SetLastReadInfo(TVirtualStreamerInfo *info)
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...
TVirtualStreamerInfo * GetLastReadInfo() const
Int_t Size() const
Return size of object of this class.
const ROOT::Detail::TSchemaRuleSet * GetSchemaRules() const
Return the set of the schema rules if any.
void Store(TBuffer &b) const
Store class description on I/O buffer.
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 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,...
Bool_t InheritsFrom(const char *cl) const override
Return kTRUE if this class inherits from a class with name "classname".
Int_t GetBaseClassOffset(const TClass *toBase, void *address=nullptr, bool isDerivedObject=true)
Long_t Property() const override
Returns the properties of the TClass as a bit field stored as a Long_t value.
Bool_t HasDefaultConstructor(Bool_t testio=kFALSE) const
Return true if we have access to a constructor usable for I/O.
TVirtualStreamerInfo * GetConversionStreamerInfo(const char *onfile_classname, Int_t version) const
Return a Conversion StreamerInfo from the class 'classname' for version number 'version' to this clas...
TVirtualStreamerInfo * FindStreamerInfo(TObjArray *arr, UInt_t checksum) const
Find the TVirtualStreamerInfo in the StreamerInfos corresponding to checksum.
Version_t GetClassVersion() const
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.
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
void Remove(ULong64_t hash, Long64_t key)
Remove entry with specified key from the TExMap.
void Add(ULong64_t hash, Long64_t key, Long64_t value)
Add an (key,value) pair to the table. The key should be unique.
Long64_t GetValue(ULong64_t hash, Long64_t key)
Return the value belonging to specified key and hash value.
void AddAt(UInt_t slot, ULong64_t hash, Long64_t key, Long64_t value)
Add an (key,value) pair to the table.
A ROOT file is an on-disk file, usually with extension .root, that stores objects in a file-system-li...
TObject * FindObject(const char *name) const override
Find an object in this list using its name.
virtual void SetOnFileClass(const TClass *cl)
const char * GetName() const override
Returns name of object.
TObject * At(Int_t idx) const override
TObject * UncheckedAt(Int_t i) const
Int_t GetLast() const override
Return index of last object in array.
Mother of all ROOT objects.
virtual const char * GetName() const
Returns name of object.
virtual void Streamer(TBuffer &)
Stream an object of class TObject.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
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 void Info(const char *method, const char *msgfmt,...) const
Issue info message.
Double_t GetFactor() const
TLoopConfiguration * fLoopConfig
If this is a bundle of memberwise streaming action, this configures the looping.
ActionContainer_t fActions
Base class of the Configurations for the member wise looping routines.
virtual void * GetFirstAddress(void *start, const void *end) const =0
Describes a persistent version of a class.
Int_t GetClassVersion() const override
void BuildEmulated(TFile *file) override
Create an Emulation TStreamerInfo object.
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 * GetReadObjectWiseActions()
void SetClassVersion(Int_t vers) override
void Clear(Option_t *="") override
If opt contains 'built', reset this StreamerInfo as if Build or BuildOld was never called on it (usef...
UInt_t GetCheckSum() const override
TStreamerInfoActions::TActionSequence * GetWriteObjectWiseActions()
Ssiz_t Clobber(Ssiz_t nc)
Clear string and make sure it has a capacity of nc.
Abstract Interface class describing Streamer information for one class.
Int_t IsRecovered() const
Bool_t IsCompiled() const
static Bool_t CanDelete()
static function returning true if ReadBuffer can delete object
R__EXTERN TVirtualRWMutex * gCoreMutex
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.