43 #if (defined(__linux) || defined(__APPLE__)) && defined(__i386__) && \
94 fDisplacement(0),fPidOffset(0), fMap(0), fClassMap(0),
95 fInfo(0), fInfoStack()
111 fDisplacement(0),fPidOffset(0), fMap(0), fClassMap(0),
112 fInfo(0), fInfoStack()
133 TBuffer(mode,bufsiz,buf,adopt,reallocfunc),
134 fDisplacement(0),fPidOffset(0), fMap(0), fClassMap(0),
135 fInfo(0), fInfoStack()
173 if (number < 0 || number >= nindex) {
174 Error(
"TagStreamerInfo",
"StreamerInfo: %s number: %d out of range[0,%d] in file: %s",
178 if (cindex->
fArray[number] == 0) {
180 cindex->
fArray[number] = 1;
216 char *sw = (
char *)x;
226 char *sw = (
char *)x;
233 memcpy(x, buf,
sizeof(
Long_t));
301 Error(
"TBufferFile::ReadStdString",
"The std::string address is nullptr but should not");
316 obj->resize(nbig,
'\0');
320 obj->resize(nwh,
'\0');
338 Int_t nbig = obj->length();
390 char *buf = (
char *)(
fBuffer + cntpos);
435 const char *
name = clss ? clss->
GetName() : classname ? classname : 0;
439 Error(
"CheckByteCount",
"object of class %s read too few bytes: %d instead of %d",
440 name,bcnt+offset,bcnt);
443 Error(
"CheckByteCount",
"object of class %s read too many bytes: %d instead of %d",
444 name,bcnt+offset,bcnt);
446 Warning(
"CheckByteCount",
"%s::Streamer() not in sync with data on file %s, fix Streamer()",
449 Warning(
"CheckByteCount",
"%s::Streamer() not in sync with data, fix Streamer()",
453 if ( ((
char *)endpos) >
fBufMax ) {
455 Error(
"CheckByteCount",
456 "Byte count probably corrupted around buffer position %d:\n\t%d for a possible maximum of %d",
457 startpos, bcnt, offset);
508 if (!nbits) nbits = 12;
544 ptr[0] = (
Float_t)(aint/factor + minvalue);
563 temp.fIntValue = theExp;
564 temp.fIntValue <<= 23;
565 temp.fIntValue |= (theMan & ((1<<(nbits+1))-1)) <<(23-nbits);
566 if(1<<(nbits+1) & theMan) temp.fFloatValue = -temp.fFloatValue;
567 ptr[0] = temp.fFloatValue;
579 ptr[0] = (
Double_t)(aint/factor + minvalue);
598 temp.fIntValue = theExp;
599 temp.fIntValue <<= 23;
600 temp.fIntValue |= (theMan & ((1<<(nbits+1))-1)) <<(23-nbits);
601 if(1<<(nbits+1) & theMan) temp.fFloatValue = -temp.fFloatValue;
602 ptr[0] = (
Double_t)temp.fFloatValue;
668 if (x < xmin) x =
xmin;
669 if (x > xmax) x =
xmax;
675 if (!nbits) nbits = 12;
685 UShort_t theMan = ((1<<(nbits+1))-1) & (fIntValue>>(23-nbits-1));
688 if (theMan&1<<nbits) theMan = (1<<nbits) - 1;
689 if (fFloatValue < 0) theMan |= 1<<(nbits+1);
732 if (x < xmin) x =
xmin;
733 if (x > xmax) x =
xmax;
753 UShort_t theMan = ((1<<(nbits+1))-1) & (fIntValue>>(23-nbits-1)) ;
756 if (theMan&1<<nbits) theMan = (1<<nbits)-1 ;
757 if (fFloatValue < 0) theMan |= 1<<(nbits+1);
776 if (n <= 0 || n >
fBufSize)
return 0;
781 for (
int i = 0; i <
n; i++)
805 if (l <= 0 || l >
fBufSize)
return 0;
828 if (l <= 0 || l >
fBufSize)
return 0;
837 for (
int i = 0; i <
n; i++)
861 if (l <= 0 || l >
fBufSize)
return 0;
863 if (!ii) ii =
new Int_t[
n];
870 for (
int i = 0; i <
n; i++)
894 if (l <= 0 || l >
fBufSize)
return 0;
920 if (l <= 0 || l >
fBufSize)
return 0;
925 for (
int i = 0; i <
n; i++)
948 if (l <= 0 || l >
fBufSize)
return 0;
957 for (
int i = 0; i <
n; i++)
981 if (l <= 0 || l >
fBufSize)
return 0;
986 for (
int i = 0; i <
n; i++)
1009 if (n <= 0 || 3*n >
fBufSize)
return 0;
1031 if (n <= 0 || 3*n >
fBufSize)
return 0;
1051 if (n <= 0 || n >
fBufSize)
return 0;
1055 if (
sizeof(
Bool_t) > 1) {
1056 for (
int i = 0; i <
n; i++)
1079 if (l <= 0 || l >
fBufSize)
return 0;
1101 if (l <= 0 || l >
fBufSize)
return 0;
1106 # ifdef USE_BSWAPCPY
1110 for (
int i = 0; i <
n; i++)
1133 if (l <= 0 || l >
fBufSize)
return 0;
1138 # ifdef USE_BSWAPCPY
1142 for (
int i = 0; i <
n; i++)
1165 if (l <= 0 || l >
fBufSize)
return 0;
1190 if (l <= 0 || l >
fBufSize)
return 0;
1195 for (
int i = 0; i <
n; i++)
1217 if (n <= 0 || l >
fBufSize)
return 0;
1222 # ifdef USE_BSWAPCPY
1226 for (
int i = 0; i <
n; i++)
1249 if (n <= 0 || l >
fBufSize)
return 0;
1254 for (
int i = 0; i <
n; i++)
1276 if (n <= 0 || 3*n >
fBufSize)
return 0;
1297 if (n <= 0 || 3*n >
fBufSize)
return 0;
1311 if (n <= 0 || n >
fBufSize)
return;
1313 if (
sizeof(
Bool_t) > 1) {
1314 for (
int i = 0; i <
n; i++)
1328 if (n <= 0 || n >
fBufSize)
return;
1343 if (lenchar < 255) {
1349 if (len <= 0 || len >
fBufSize)
return;
1351 if (len >= n) len = n-1;
1369 if (n <= 0 || l >
fBufSize)
return;
1372 # ifdef USE_BSWAPCPY
1376 for (
int i = 0; i <
n; i++)
1391 if (l <= 0 || l >
fBufSize)
return;
1394 # ifdef USE_BSWAPCPY
1398 for (
int i = 0; i <
n; i++)
1413 if (l <= 0 || l >
fBufSize)
return;
1429 if (l <= 0 || l >
fBufSize)
return;
1432 for (
int i = 0; i <
n; i++)
1446 if (l <= 0 || l >
fBufSize)
return;
1449 # ifdef USE_BSWAPCPY
1453 for (
int i = 0; i <
n; i++)
1468 if (l <= 0 || l >
fBufSize)
return;
1471 for (
int i = 0; i <
n; i++)
1485 if (n <= 0 || 3*n >
fBufSize)
return;
1491 for (
int j=0;j <
n; j++) {
1492 UInt_t aint; *
this >> aint; f[j] = (
Float_t)(aint/factor + xmin);
1498 if (!nbits) nbits = 12;
1507 for (i = 0; i <
n; i++) {
1512 fIntValue |= (theMan & ((1<<(nbits+1))-1)) <<(23-nbits);
1513 if(1<<(nbits+1) & theMan) fFloatValue = -fFloatValue;
1525 if (n <= 0 || 3*n >
fBufSize)
return;
1528 for (
int j=0;j <
n; j++) {
1529 UInt_t aint; *
this >> aint; ptr[j] = (
Float_t)(aint/factor + minvalue);
1539 if (n <= 0 || 3*n >
fBufSize)
return;
1541 if (!nbits) nbits = 12;
1550 for (
Int_t i = 0; i <
n; i++) {
1555 fIntValue |= (theMan & ((1<<(nbits+1))-1)) <<(23-nbits);
1556 if(1<<(nbits+1) & theMan) fFloatValue = -fFloatValue;
1557 ptr[i] = fFloatValue;
1567 if (n <= 0 || 3*n >
fBufSize)
return;
1573 for (
int j=0;j <
n; j++) {
1574 UInt_t aint; *
this >> aint; d[j] = (
Double_t)(aint/factor + xmin);
1583 for (i = 0; i <
n; i++) {
1596 for (i = 0; i <
n; i++) {
1601 fIntValue |= (theMan & ((1<<(nbits+1))-1)) <<(23-nbits);
1602 if (1<<(nbits+1) & theMan) fFloatValue = -fFloatValue;
1615 if (n <= 0 || 3*n >
fBufSize)
return;
1618 for (
int j=0;j <
n; j++) {
1619 UInt_t aint; *
this >> aint; d[j] = (
Double_t)(aint/factor + minvalue);
1629 if (n <= 0 || 3*n >
fBufSize)
return;
1634 for (
Int_t i = 0; i <
n; i++) {
1647 for (
Int_t i = 0; i <
n; i++) {
1652 fIntValue |= (theMan & ((1<<(nbits+1))-1)) <<(23-nbits);
1653 if (1<<(nbits+1) & theMan) fFloatValue = -fFloatValue;
1669 (*streamer)(*
this,start,0);
1673 int objectSize = cl->
Size();
1674 char *obj = (
char*)start;
1675 char *end = obj + n*objectSize;
1677 for(; obj<end; obj+=objectSize) ((
TClass*)cl)->Streamer(obj,*
this, onFileClass);
1695 for (
Int_t j=0;j<
n;j++) {
1696 if (!start[j]) start[j] = cl->
New();
1700 (*streamer)(*
this,(
void*)start,0);
1706 for (
Int_t j=0; j<
n; j++){
1708 void *old = start[j];
1710 if (old && old!=start[j] &&
1735 for (
Int_t j=0; j<
n; j++){
1736 if (!start[j]) start[j] = ((
TClass*)cl)->New();
1737 ((
TClass*)cl)->Streamer(start[j],*
this,onFileClass);
1759 if (
sizeof(
Bool_t) > 1) {
1760 for (
int i = 0; i <
n; i++)
1805 # ifdef USE_BSWAPCPY
1809 for (
int i = 0; i <
n; i++)
1835 # ifdef USE_BSWAPCPY
1839 for (
int i = 0; i <
n; i++)
1903 for (
int i = 0; i <
n; i++)
1928 # ifdef USE_BSWAPCPY
1932 for (
int i = 0; i <
n; i++)
1958 for (
int i = 0; i <
n; i++)
2016 if (
sizeof(
Bool_t) > 1) {
2017 for (
int i = 0; i <
n; i++)
2071 # ifdef USE_BSWAPCPY
2075 for (
int i = 0; i <
n; i++)
2095 # ifdef USE_BSWAPCPY
2099 for (
int i = 0; i <
n; i++)
2147 for (
int i = 0; i <
n; i++)
2166 # ifdef USE_BSWAPCPY
2170 for (
int i = 0; i <
n; i++)
2190 for (
int i = 0; i <
n; i++)
2216 for (
int j = 0; j <
n; j++) {
2218 if (x < xmin) x =
xmin;
2219 if (x > xmax) x =
xmax;
2220 UInt_t aint =
UInt_t(0.5+factor*(x-xmin)); *
this << aint;
2226 if (!nbits) nbits = 12;
2235 for (i = 0; i <
n; i++) {
2238 UShort_t theMan = ((1<<(nbits+1))-1) & (fIntValue>>(23-nbits-1));
2241 if (theMan&1<<nbits) theMan = (1<<nbits) - 1;
2242 if (fFloatValue < 0) theMan |= 1<<(nbits+1);
2267 for (
int j = 0; j <
n; j++) {
2269 if (x < xmin) x =
xmin;
2270 if (x > xmax) x =
xmax;
2271 UInt_t aint =
UInt_t(0.5+factor*(x-xmin)); *
this << aint;
2280 for (i = 0; i <
n; i++) {
2292 for (i = 0; i <
n; i++) {
2295 UShort_t theMan = ((1<<(nbits+1))-1) & (fIntValue>>(23-nbits-1));
2298 if(theMan&1<<nbits) theMan = (1<<nbits) - 1;
2299 if (fFloatValue < 0) theMan |= 1<<(nbits+1);
2315 (*streamer)(*
this, start, 0);
2319 char *obj = (
char*)start;
2321 int size = cl->
Size();
2323 for(
Int_t j=0; j<
n; j++,obj+=size) {
2324 ((
TClass*)cl)->Streamer(obj,*
this);
2343 (*streamer)(*
this,(
void*)start,0);
2353 for (
Int_t j=0;j<
n;j++) {
2355 if (!strInfo && !start[j]) {
2370 for (
Int_t j=0;j<
n;j++) {
2371 if (!start[j]) start[j] = ((
TClass*)cl)->New();
2372 ((
TClass*)cl)->Streamer(start[j],*
this);
2431 Int_t baseOffset = 0;
2432 if (clRef && (clRef!=(
TClass*)(-1)) && clCast) {
2435 if (baseOffset == -1) {
2442 Error(
"ReadObject",
"got object of wrong class! requested %s but got %s",
2450 Info(
"ReadObjectAny",
"Using Converter StreamerInfo from %s to %s",clRef->
GetName(),clCast->
GetName());
2451 clRef =
const_cast<TClass*
>(clCast);
2456 Error(
"ReadObject",
"trying to read an emulated class (%s) to store in a compiled pointer (%s)",
2468 if (obj == (
void*) -1) obj = 0;
2471 return (obj+baseOffset);
2476 if (clRef == (
TClass*) -1) {
2494 Error(
"ReadObject",
"object tag too large, I/O buffer corrupted");
2502 if (clRef && (clRef!=(
TClass*)(-1)) && clCast) {
2505 if (baseOffset == -1) {
2506 Error(
"ReadObject",
"Got object of wrong class (Got %s while expecting %s)",
2524 obj = (
char*)clRef->
New();
2526 Error(
"ReadObject",
"could not create object of class %s",
2539 clRef->
Streamer( obj, *
this, clOnfile );
2544 return obj+baseOffset;
2564 if (!actualObjectStart) {
2592 Warning(
"WriteObjectAny",
"since %s has no public constructor\n"
2593 "\twhich can be called without argument, objects of this class\n"
2594 "\tcan not be read with the current library. You will need to\n"
2595 "\tadd a default constructor before attempting to read it.",
2621 ((
TClass*)actualClass)->Streamer((
void*)actualObjectStart,*
this);
2630 struct DynamicType {
2634 virtual ~DynamicType() {}
2657 Error(
"WriteObjectAny",
"ptrClass argument may not be 0");
2667 DynamicType* d_ptr = (DynamicType*)obj;
2669 "An object of type %s (from type_info) passed through a %s pointer was truncated (due a missing dictionary)!!!",
2670 typeid(*d_ptr).name(),ptrClass->
GetName());
2673 }
else if (clActual && (clActual != ptrClass)) {
2674 const char *temp = (
const char*) obj;
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",
"got wrong class: %s", cl->
GetName());
2764 if (objTag) *objTag = (bcnt & ~kByteCountMask);
2767 if (!cl) cl = (
TClass*)-1;
2843 Error(
"SkipVersion",
"Could not find the StreamerInfo with a checksum of %d for the class \"%s\" in %s.",
2846 Error(
"SkipVersion",
"Could not find the StreamerInfo with a checksum of %d for the class \"%s\" (buffer with no parent)",
2866 Error(
"SkipVersion",
"Could not find the StreamerInfo with a checksum of %d for the class \"%s\" in %s.",
2872 Error(
"SkipVersion",
"Class %s not known to file %s.",
2922 && (
v.cnt &&
v.cnt >= 6)
2929 return vinfo->TStreamerInfo::GetClassVersion();
2939 Error(
"ReadVersion",
"Could not find the StreamerInfo with a checksum of 0x%x for the class \"%s\" in %s.",
2942 Error(
"ReadVersion",
"Could not find the StreamerInfo with a checksum of 0x%x for the class \"%s\" (buffer with no parent)",
2953 if (
v.cnt &&
v.cnt >= 6)
2970 Error(
"ReadVersion",
"Could not find the StreamerInfo with a checksum of 0x%x for the class \"%s\" in %s.",
2976 Error(
"ReadVersion",
"Class %s not known to file %s.",
3048 return vinfo->TStreamerInfo::GetClassVersion();
3088 Error(
"ReadVersion",
"Class %s not known to file %s.",
3111 if (version<=1 && cl->IsForeign()) {
3116 Error(
"WriteVersion",
"version number cannot be larger than %hd)",
3141 if (version<=1 && cl->IsForeign()) {
3142 Error(
"WriteVersionMemberWise",
"Member-wise streaming of foreign collection not yet implemented!");
3147 Error(
"WriteVersionMemberWise",
"version number cannot be larger than %hd)",
3166 else Warning(
"StreamObject",
"No TClass for the type %s is available, the object was not read.", typeinfo.name());
3176 else Warning(
"StreamObject",
"No TClass for the type %s is available, the object was not read.", className);
3184 ((
TClass*)cl)->Streamer(obj, *
this, (
TClass*)onFileClass );
3192 obj->Streamer(*
this);
3217 if (!offset)
return offset;
3237 Warning(
"CheckObject",
"reference to unavailable class %s,"
3238 " pointers of this type will be 0", cl->
GetName());
3240 Warning(
"CheckObject",
"reference to an unavailable class,"
3241 " pointers of that type will be 0");
3246 }
else if (cli == -1) {
3267 Warning(
"CheckObject",
"reference to object of unavailable class %s, offset=%d"
3268 " pointer will be 0", cl ? cl->
GetName() :
"TObject",offset);
3274 }
else if (cli == -1) {
3302 if (!obj || !
fMap || !ptrClass)
return kFALSE;
3308 if (clActual && (ptrClass != clActual)) {
3309 const char *temp = (
const char*) obj;
3503 if (max == 0)
return 0;
3520 if (max == 0)
return;
3543 while (nr < max-1) {
3563 WriteBuf(s, (strlen(s)+1)*
sizeof(
char));
3574 Warning(
"ReadBuffer",
"The file was written during several processes with an "
3575 "older ROOT version; the TRefTable entries might be inconsistent.");
3585 return fileProcessID;
3628 if (!file)
return 0;
3661 char **end = arr + nobjects;
3673 char **arr =
reinterpret_cast<char**
>(a->
GetObjectRef(0));
3677 char **end = arr + nobjects;
3736 Error(
"ReadClassBuffer",
3737 "Could not find the right streamer info to convert %s version %d into a %s, object skipped at offset %d",
3751 auto ninfos = infos->
GetSize();
3752 if (version < -1 || version >= ninfos) {
3753 Error(
"ReadBuffer1",
"class: %s, attempting to access a wrong version: %d, object skipped at offset %d",
3766 const_cast<TClass*
>(cl)->BuildRealData(pointer);
3770 const_cast<TClass*
>(cl)->RegisterStreamerInfo(sinfo);
3771 if (
gDebug > 0) printf(
"Creating StreamerInfo for class: %s, version: %d\n", cl->
GetName(), version);
3773 }
else if (version==0) {
3780 Error(
"ReadClassBuffer",
"Could not find the StreamerInfo for version %d of the class %s, object skipped at offset %d",
3788 const_cast<TClass*
>(cl)->BuildRealData(pointer);
3836 Error(
"ReadClassBuffer",
3837 "Could not find the right streamer info to convert %s version %d into a %s, object skipped at offset %d",
3860 if (version < -1 || version >= infocapacity) {
3861 Error(
"ReadClassBuffer",
"class: %s, attempting to access a wrong version: %d, object skipped at offset %d",
3873 const_cast<TClass*
>(cl)->BuildRealData(pointer);
3878 if (sinfo->
IsCompiled()) const_cast<TClass*>(cl)->SetLastReadInfo(sinfo);
3896 auto ninfos = infos->
GetSize();
3897 if (!(version < -1 || version >= ninfos)) {
3901 const_cast<TClass *
>(cl)->BuildRealData(pointer);
3904 const_cast<TClass *
>(cl)->RegisterStreamerInfo(sinfo);
3907 "Creating StreamerInfo for class: %s, version: %d\n",
3911 sinfo->
Clear(
"build");
3918 }
else if (version==0) {
3925 Error(
"ReadClassBuffer",
"Could not find the StreamerInfo for version %d of the class %s, object skipped at offset %d",
3936 if (sinfo->TStreamerInfo::IsRecovered()) R__c=0;
3941 if (
gDebug > 2) printf(
" ReadBuffer for class: %s has read %d bytes\n", cl->
GetName(), R__c);
3960 sinfo = (
TStreamerInfo*)const_cast<TClass*>(cl)->GetCurrentStreamerInfo();
3962 const_cast<TClass*
>(cl)->BuildRealData(pointer);
3964 const_cast<TClass*
>(cl)->SetCurrentStreamerInfo(sinfo);
3965 const_cast<TClass*
>(cl)->RegisterStreamerInfo(sinfo);
3973 const_cast<TClass*
>(cl)->BuildRealData(pointer);
4001 TStreamerInfoActions::ActionContainer_t::const_iterator end = sequence.
fActions.end();
4002 for(TStreamerInfoActions::ActionContainer_t::const_iterator iter = sequence.
fActions.begin();
4005 (*iter).PrintDebug(*
this,obj);
4011 TStreamerInfoActions::ActionContainer_t::const_iterator end = sequence.
fActions.end();
4012 for(TStreamerInfoActions::ActionContainer_t::const_iterator iter = sequence.
fActions.begin();
4030 TStreamerInfoActions::ActionContainer_t::const_iterator end = sequence.
fActions.end();
4031 for(TStreamerInfoActions::ActionContainer_t::const_iterator iter = sequence.
fActions.begin();
4034 (*iter).PrintDebug(*
this,*(
char**)start_collection);
4035 (*iter)(*
this,start_collection,end_collection);
4040 TStreamerInfoActions::ActionContainer_t::const_iterator end = sequence.
fActions.end();
4041 for(TStreamerInfoActions::ActionContainer_t::const_iterator iter = sequence.
fActions.begin();
4044 (*iter)(*
this,start_collection,end_collection);
4062 void *arr0 = start_collection ? loopconfig->
GetFirstAddress(start_collection,end_collection) : 0;
4064 TStreamerInfoActions::ActionContainer_t::const_iterator end = sequence.
fActions.end();
4065 for(TStreamerInfoActions::ActionContainer_t::const_iterator iter = sequence.
fActions.begin();
4068 (*iter).PrintDebug(*
this,arr0);
4069 (*iter)(*
this,start_collection,end_collection,loopconfig);
4074 TStreamerInfoActions::ActionContainer_t::const_iterator end = sequence.
fActions.end();
4075 for(TStreamerInfoActions::ActionContainer_t::const_iterator iter = sequence.
fActions.begin();
4078 (*iter)(*
this,start_collection,end_collection,loopconfig);
TObject * GetParent() const
Return pointer to parent of this buffer.
virtual TClass * ReadClass(const TClass *cl=0, UInt_t *objTag=0)
Read class definition from I/O buffer.
Describe Streamer information for one class version.
virtual void IncrementLevel(TVirtualStreamerInfo *info)
Increment level.
virtual Int_t GetNProcessIDs() const
static TProcessID * GetPID()
static: returns pointer to current TProcessID
virtual UInt_t GetTRefExecId()
Return the exec id stored in the current TStreamerInfo element.
static TProcessID * GetProcessID(UShort_t pid)
static function returning a pointer to TProcessID number pid in fgPIDs
void SetReadParam(Int_t mapsize)
Set the initial size of the map used to store object and class references during reading.
void SetBufferOffset(Int_t offset=0)
virtual Int_t WriteClones(TClonesArray *a, Int_t nobjects)
Interface to TStreamerInfo::WriteBufferClones.
TStreamerInfoActions::TActionSequence * GetWriteObjectWiseActions()
static Bool_t CanDelete()
static function returning true if ReadBuffer can delete object
virtual ~TBufferFile()
Delete an I/O buffer object.
void Add(ULong64_t hash, Long64_t key, Long64_t value)
Add an (key,value) pair to the table. The key should be unique.
void frombuf(char *&buf, Bool_t *x)
void CheckCount(UInt_t offset)
Check if offset is not too large (< kMaxMapCount) when writing.
void Remove(ULong64_t hash, Long64_t key)
Remove entry with specified key from the TExMap.
virtual void WriteString(const char *s)
Write string to I/O buffer.
Bool_t HasDefaultConstructor() const
virtual Int_t ReadArray(Bool_t *&b)
Read array of bools from the I/O buffer.
const UInt_t kMaxMapCount
virtual void WriteFastArrayFloat16(const Float_t *f, Int_t n, TStreamerElement *ele=0)
Write array of n floats (as truncated float) into the I/O buffer.
virtual Version_t ReadVersionForMemberWise(const TClass *cl=0)
Read class version from I/O buffer.
void SetWriteParam(Int_t mapsize)
Set the initial size of the hashtable used to store object and class references during writing...
virtual void WriteObjectClass(const void *actualObjStart, const TClass *actualClass)
Write object to I/O buffer.
virtual Int_t ReadClones(TClonesArray *a, Int_t nobjects, Version_t objvers)
Interface to TStreamerInfo::ReadBufferClones.
The concrete implementation of TBuffer for writing/reading to/from a ROOT file or socket...
ActionContainer_t fActions
virtual void WriteClass(const TClass *cl)
Write class description to I/O buffer.
void BuildEmulated(TFile *file)
Create an Emulation TStreamerInfo object.
virtual void WriteFloat16(Float_t *f, TStreamerElement *ele=0)
Write a Float16_t to the buffer.
Int_t ApplySequence(const TStreamerInfoActions::TActionSequence &sequence, void *object)
Read one collection of objects from the buffer using the StreamerInfoLoopAction.
TLoopConfiguration * fLoopConfig
If this is a bundle of memberwise streaming action, this configures the looping.
static Int_t GetGlobalWriteParam()
Get default write map size.
Int_t GetLast() const
Return index of last object in array.
virtual void WriteArrayDouble32(const Double_t *d, Int_t n, TStreamerElement *ele=0)
Write array of n doubles (as float) into the I/O buffer.
virtual void ReadFastArrayWithNbits(Float_t *ptr, Int_t n, Int_t nbits)
Read array of n floats (written as truncated float) from the I/O buffer.
virtual Int_t ReadArrayDouble32(Double_t *&d, TStreamerElement *ele=0)
Read array of doubles (written as float) from the I/O buffer.
virtual void ReadFastArrayWithFactor(Float_t *ptr, Int_t n, Double_t factor, Double_t minvalue)
Read array of n floats (written as truncated float) from the I/O buffer.
R__EXTERN TVirtualMutex * gInterpreterMutex
const UInt_t kByteCountMask
virtual void ReadTString(TString &s)
Read TString from TBuffer.
virtual UInt_t WriteVersionMemberWise(const TClass *cl, Bool_t useBcnt=kFALSE)
Write class version to I/O buffer after setting the kStreamedMemberWise bit in the version number...
virtual void ReadDouble32(Double_t *d, TStreamerElement *ele=0)
Read a Double32_t from the buffer, see comments about Double32_t encoding at TBufferFile::WriteDouble...
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
static void SetGlobalReadParam(Int_t mapsize)
Set the initial size of the map used to store object and class references during reading.
static Int_t fgMapSize
Default map size for all TBuffer objects.
Long_t Property() const
Set TObject::fBits and fStreamerType to cache information about the class.
Buffer base class used for serializing objects.
virtual UInt_t WriteVersion(const TClass *cl, Bool_t useBcnt=kFALSE)
Write class version to I/O buffer.
static bool Class_Has_StreamerInfo(const TClass *cl)
Thread-safe check on StreamerInfos of a TClass.
const Version_t kMaxVersion
Bool_t IsForeign() const
Return kTRUE is the class is Foreign (the class does not have a Streamer method). ...
virtual void SetByteCount(UInt_t cntpos, Bool_t packInVersion=kFALSE)
Set byte count at position cntpos in the buffer.
virtual void WriteCharStar(char *s)
Write char* into TBuffer.
virtual Int_t ReadStaticArrayDouble32(Double_t *d, TStreamerElement *ele=0)
Read array of doubles (written as float) from the I/O buffer.
Short_t Min(Short_t a, Short_t b)
virtual TObject * FindObject(const char *name) const
Find an object in this list using its name.
virtual void * ReadObjectAny(const TClass *cast)
Read object from I/O buffer.
const UInt_t kNewClassTag
UInt_t CheckObject(UInt_t offset, const TClass *cl, Bool_t readClass=kFALSE)
Check for object in the read map.
void MapObject(const TObject *obj, UInt_t offset=1)
Add object to the fMap container.
virtual void WriteArrayFloat16(const Float_t *f, Int_t n, TStreamerElement *ele=0)
Write array of n floats (as truncated float) into the I/O buffer.
virtual void ReadLong(Long_t &l)
Read Long from TBuffer.
void SetPidOffset(UShort_t offset)
This offset is used when a key (or basket) is transfered from one file to the other.
virtual void ForceWriteInfo(TFile *file, Bool_t force=kFALSE)=0
static void SetGlobalWriteParam(Int_t mapsize)
Set the initial size of the map used to store object and class references during reading.
Double_t GetFactor() const
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual void WriteFastArrayString(const Char_t *c, Int_t n)
Write array of n characters into the I/O buffer.
#define R__LOCKGUARD_IMT(mutex)
void * bswapcpy32(void *to, const void *from, size_t n)
Int_t GetBaseClassOffset(const TClass *toBase, void *address=0, bool isDerivedObject=true)
virtual TObject * ReadObject(const TClass *cl)
Read object from 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.
Int_t fDisplacement
Value to be added to the map offsets.
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...
virtual void SkipObjectAny()
Skip any kind of object from buffer.
virtual void * GetFirstAddress(void *start, const void *end) const =0
TExMap * fMap
Map containing object,offset pairs for reading/writing.
virtual Int_t ReadArrayFloat16(Float_t *&f, TStreamerElement *ele=0)
Read array of floats (written as truncated float) from the I/O buffer.
void * bswapcpy16(void *to, const void *from, size_t n)
virtual void ReadCharStar(char *&s)
Read char* from TBuffer.
virtual char * ReadString(char *s, Int_t max)
Read string from I/O buffer.
Int_t IsRecovered() const
Bool_t IsCompiled() const
void * New(ENewType defConstructor=kClassNew, Bool_t quiet=kFALSE) const
Return a pointer to a newly allocated object of this class.
virtual void WriteStdString(const std::string *s)
Write std::string to TBuffer.
TClass * GetActualClass(const void *object) const
Return a pointer the the real class of the object.
virtual void TagStreamerInfo(TVirtualStreamerInfo *info)
Mark the classindex of the current file as using this TStreamerInfo.
virtual Int_t ReadBuf(void *buf, Int_t max)
Read max bytes from the I/O buffer into buf.
void tobuf(char *&buf, Bool_t x)
A TProcessID identifies a ROOT job in a unique way in time and space.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
char *(* ReAllocCharFun_t)(char *, size_t, size_t)
virtual void ReadStdString(std::string *s)
Read std::string from TBuffer.
Base class of the Configurations for the member wise looping routines.
const Version_t kByteCountVMask
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)
Function called by the Streamer functions to serialize object at p to buffer b.
Int_t GetClassVersion() const
static ULong_t Void_Hash(const void *ptr)
Return hash value for this object.
TVirtualStreamerInfo * FindStreamerInfo(TObjArray *arr, UInt_t checksum) const
Find the TVirtualStreamerInfo in the StreamerInfos corresponding to checksum.
UInt_t GetCheckSum(ECheckSum code=kCurrentCheckSum) const
Call GetCheckSum with validity check.
virtual Version_t ReadVersionNoCheckSum(UInt_t *start=0, UInt_t *bcnt=0)
Read class version from I/O buffer, when the caller knows for sure that there is no checksum written/...
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class)
Deserialize information from a buffer into an object.
virtual Int_t ReadStaticArrayFloat16(Float_t *f, TStreamerElement *ele=0)
Read array of floats (written as truncated float) from the I/O buffer.
Int_t fMapCount
Number of objects or classes in map.
virtual void WriteTString(const TString &s)
Write TString to TBuffer.
TObject * UncheckedAt(Int_t i) const
void ResetMap()
Delete existing fMap and reset map counter.
TStreamerInfo * fInfo
Pointer to TStreamerInfo object writing/reading the buffer.
Int_t ApplySequenceVecPtr(const TStreamerInfoActions::TActionSequence &sequence, void *start_collection, void *end_collection)
Read one collection of objects from the buffer using the StreamerInfoLoopAction.
Bool_t HasRuleWithSourceClass(const TString &source) const
Return True if we have any rule whose source class is 'source'.
Long64_t GetValue(ULong64_t hash, Long64_t key)
Return the value belonging to specified key and hash value.
virtual Int_t ReadStaticArray(Bool_t *b)
Read array of bools from the I/O buffer.
virtual TProcessID * GetLastProcessID(TRefTable *reftable) const
Return the last TProcessID in the file.
void BuildOld()
rebuild the TStreamerInfo structure
void Clear(Option_t *)
If opt contains 'built', reset this StreamerInfo as if Build or BuildOld was never called on it (usef...
TVirtualStreamerInfo * GetStreamerInfo(Int_t version=0) const
returns a pointer to the TVirtualStreamerInfo object for version If the object does not exist...
virtual void StreamObject(void *obj, const std::type_info &typeinfo, const TClass *onFileClass=0)
Stream an object given its C++ typeinfo information.
virtual void ForceWriteInfoClones(TClonesArray *a)
Make sure TStreamerInfo is not optimized, otherwise it will not be possible to support schema evoluti...
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...
void InitMap()
Create the fMap container and initialize them with the null object.
UInt_t GetCheckSum() const
virtual Int_t ReadClassEmulated(const TClass *cl, void *object, const TClass *onfile_class)
Read emulated class.
Bool_t TestBit(UInt_t f) const
virtual Version_t ReadVersion(UInt_t *start=0, UInt_t *bcnt=0, const TClass *cl=0)
Read class version from I/O buffer.
virtual const char * GetName() const
Returns name of object.
The ROOT global object gROOT contains a list of all defined classes.
virtual void SkipVersion(const TClass *cl=0)
Skip class version from I/O buffer.
Version_t GetClassVersion() const
TStreamerInfoActions::TActionSequence * GetReadMemberWiseActions(Bool_t forCollection)
virtual void WriteBuf(const void *buf, Int_t max)
Write max bytes from buf into the I/O buffer.
virtual void ReadWithNbits(Float_t *ptr, Int_t nbits)
Read a Float16_t from the buffer when the number of bits is specified (explicitly or not) see comment...
void SetClassVersion(Int_t vers)
UShort_t fPidOffset
Offset to be added to the pid index in this key/buffer.
void Delete(Option_t *opt="")
Delete all entries stored in the TExMap.
virtual void WriteArray(const Bool_t *b, Int_t n)
Write array of n bools into the I/O buffer.
TExMap * fClassMap
Map containing object,class pairs for reading.
virtual void ReadFastArrayDouble32(Double_t *d, Int_t n, TStreamerElement *ele=0)
Read array of n doubles (written as float) from the I/O buffer.
void Clobber(Ssiz_t nc)
Clear string and make sure it has a capacity of nc.
Bool_t IsLoaded() const
Return true if the shared library of this class is currently in the a process's memory.
Int_t fMapSize
Default size of map.
void Build()
Build the I/O data structure for the current class version.
virtual Int_t GetSize() const
virtual const char * GetName() const
Returns name of object.
virtual void ReadFastArrayFloat16(Float_t *f, Int_t n, TStreamerElement *ele=0)
Read array of n floats (written as truncated float) from the I/O buffer.
TClass * GetClass() const
virtual Int_t GetNumber() const =0
virtual void WriteDouble32(Double_t *d, TStreamerElement *ele=0)
Write a Double32_t to the buffer.
A TRefTable maintains the association between a referenced object and the parent object supporting th...
#define R__LOCKGUARD(mutex)
virtual void ForceWriteInfo(TVirtualStreamerInfo *info, Bool_t force)
force writing the TStreamerInfo to the file
TVirtualStreamerInfo * GetLastReadInfo() const
virtual void WriteObject(const TObject *obj)
Write object to I/O buffer.
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 GetVersionOwner() const
Return the version number of the owner file.
virtual void ReadFloat16(Float_t *f, TStreamerElement *ele=0)
Read a Float16_t from the buffer, see comments about Float16_t encoding at TBufferFile::WriteFloat16(...
static Int_t GetGlobalReadParam()
Get default read map size.
virtual UInt_t GetUniqueID() const
Return the unique object id.
Mother of all ROOT objects.
static TStreamerElement * GetCurrentElement()
static function returning a pointer to the current TStreamerElement fgElement points to the current T...
TObject * Last() const
Return the object in the last filled slot. Returns 0 if no entries.
An array of clone (identical) objects.
virtual UShort_t WriteProcessID(TProcessID *pid)
Check if the ProcessID pidd is already in the file, if not, add it and return the index number in the...
virtual void WriteFastArray(const Bool_t *b, Int_t n)
Write array of n bools into the I/O buffer.
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
static TClass * Load(TBuffer &b)
Load class description from I/O buffer and return class object.
const ROOT::Detail::TSchemaRuleSet * GetSchemaRules() const
Return the set of the schema rules if any.
InfoList_t fInfoStack
Stack of pointers to the TStreamerInfos.
virtual void DecrementLevel(TVirtualStreamerInfo *)
Decrement level.
const TObjArray * GetStreamerInfos() const
virtual Int_t WriteObjectAny(const void *obj, const TClass *ptrClass)
Write object to I/O buffer.
TObject ** GetObjectRef() const
Bool_t InheritsFrom(const char *cl) const
Return kTRUE if this class inherits from a class with name "classname".
virtual void ReadWithFactor(Float_t *ptr, Double_t factor, Double_t minvalue)
Read a Float16_t from the buffer when the factor and minimum value have been specified see comments a...
static void frombufOld(char *&buf, Long_t *x)
Handle old file formats.
void Streamer(void *obj, TBuffer &b, const TClass *onfile_class=0) const
TStreamerInfoActions::TActionSequence * GetReadObjectWiseActions()
Abstract Interface class describing Streamer information for one class.
TObjArray * GetListOfProcessIDs() const
virtual TProcessID * ReadProcessID(UShort_t pidf)
The TProcessID with number pidf is read from file.
virtual void ReadFastArrayString(Char_t *c, Int_t n)
Read array of n characters from the I/O buffer.
virtual UShort_t WriteProcessID(TProcessID *pid)
Check if the ProcessID pid is already in the file.
virtual void WriteFastArrayDouble32(const Double_t *d, Int_t n, TStreamerElement *ele=0)
Write array of n doubles (as float) into the I/O buffer.
virtual void SetOnFileClass(const TClass *cl)
Int_t Size() const
Return size of object of this class.
This class stores a (key,value) pair using an external hash.
virtual TProcessID * ReadProcessID(UShort_t pidf)
The TProcessID with number pidf is read from this file.
void GetMappedObject(UInt_t tag, void *&ptr, TClass *&ClassPtr) const
Retrieve the object stored in the buffer's object map at 'tag' Set ptr and ClassPtr respectively to t...
TArrayC * GetClassIndex() const
void AddAt(UInt_t slot, ULong64_t hash, Long64_t key, Long64_t value)
Add an (key,value) pair to the table.
TStreamerInfoActions::TActionSequence * GetWriteMemberWiseActions(Bool_t forCollection)
void AutoExpand(Int_t size_needed)
Automatically calculate a new size and expand the buffer to fit at least size_needed.
virtual void ReadFastArray(Bool_t *b, Int_t n)
Read array of n bools from the I/O buffer.
Array of chars or bytes (8 bits per element).
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
UInt_t Hash(ECaseCompare cmp=kExact) const
Return hash value.