42 #if (defined(__linux) || defined(__APPLE__)) && defined(__i386__) && \
69 static inline
ULong_t Void_Hash(const
void *ptr)
93 fDisplacement(0),fPidOffset(0), fMap(0), fClassMap(0),
94 fInfo(0), fInfoStack()
110 fDisplacement(0),fPidOffset(0), fMap(0), fClassMap(0),
111 fInfo(0), fInfoStack()
132 TBuffer(mode,bufsiz,buf,adopt,reallocfunc),
133 fDisplacement(0),fPidOffset(0), fMap(0), fClassMap(0),
134 fInfo(0), fInfoStack()
172 if (number < 0 || number >= nindex) {
173 Error(
"TagStreamerInfo",
"StreamerInfo: %s number: %d out of range[0,%d] in file: %s",
177 if (cindex->
fArray[number] == 0) {
179 cindex->
fArray[number] = 1;
215 char *sw = (
char *)x;
225 char *sw = (
char *)x;
232 memcpy(x, buf,
sizeof(
Long_t));
299 std::string *
obj = &s;
312 obj->resize(nbig,
'\0');
316 obj->resize(nwh,
'\0');
328 const std::string *
obj = &s;
330 Int_t nbig = obj->length();
349 char *buf = (
char *)(
fBuffer + cntpos);
394 const char *
name = clss ? clss->
GetName() : classname ? classname : 0;
398 Error(
"CheckByteCount",
"object of class %s read too few bytes: %d instead of %d",
399 name,bcnt+offset,bcnt);
402 Error(
"CheckByteCount",
"object of class %s read too many bytes: %d instead of %d",
403 name,bcnt+offset,bcnt);
405 Warning(
"CheckByteCount",
"%s::Streamer() not in sync with data on file %s, fix Streamer()",
408 Warning(
"CheckByteCount",
"%s::Streamer() not in sync with data, fix Streamer()",
412 if ( ((
char *)endpos) >
fBufMax ) {
414 Error(
"CheckByteCount",
415 "Byte count probably corrupted around buffer position %d:\n\t%d for a possible maximum of %d",
416 startpos, bcnt, offset);
467 if (!nbits) nbits = 12;
503 ptr[0] = (
Float_t)(aint/factor + minvalue);
522 temp.fIntValue = theExp;
523 temp.fIntValue <<= 23;
524 temp.fIntValue |= (theMan & ((1<<(nbits+1))-1)) <<(23-nbits);
525 if(1<<(nbits+1) & theMan) temp.fFloatValue = -temp.fFloatValue;
526 ptr[0] = temp.fFloatValue;
538 ptr[0] = (
Double_t)(aint/factor + minvalue);
557 temp.fIntValue = theExp;
558 temp.fIntValue <<= 23;
559 temp.fIntValue |= (theMan & ((1<<(nbits+1))-1)) <<(23-nbits);
560 if(1<<(nbits+1) & theMan) temp.fFloatValue = -temp.fFloatValue;
561 ptr[0] = (
Double_t)temp.fFloatValue;
627 if (x < xmin) x =
xmin;
628 if (x > xmax) x =
xmax;
634 if (!nbits) nbits = 12;
644 UShort_t theMan = ((1<<(nbits+1))-1) & (fIntValue>>(23-nbits-1));
647 if (theMan&1<<nbits) theMan = (1<<nbits) - 1;
648 if (fFloatValue < 0) theMan |= 1<<(nbits+1);
691 if (x < xmin) x =
xmin;
692 if (x > xmax) x =
xmax;
712 UShort_t theMan = ((1<<(nbits+1))-1) & (fIntValue>>(23-nbits-1)) ;
715 if (theMan&1<<nbits) theMan = (1<<nbits)-1 ;
716 if (fFloatValue < 0) theMan |= 1<<(nbits+1);
735 if (n <= 0 || n >
fBufSize)
return 0;
740 for (
int i = 0; i <
n; i++)
764 if (l <= 0 || l >
fBufSize)
return 0;
787 if (l <= 0 || l >
fBufSize)
return 0;
796 for (
int i = 0; i <
n; i++)
820 if (l <= 0 || l >
fBufSize)
return 0;
822 if (!ii) ii =
new Int_t[
n];
829 for (
int i = 0; i <
n; i++)
853 if (l <= 0 || l >
fBufSize)
return 0;
879 if (l <= 0 || l >
fBufSize)
return 0;
884 for (
int i = 0; i <
n; i++)
907 if (l <= 0 || l >
fBufSize)
return 0;
916 for (
int i = 0; i <
n; i++)
940 if (l <= 0 || l >
fBufSize)
return 0;
945 for (
int i = 0; i <
n; i++)
968 if (n <= 0 || 3*n >
fBufSize)
return 0;
990 if (n <= 0 || 3*n >
fBufSize)
return 0;
1010 if (n <= 0 || n >
fBufSize)
return 0;
1014 if (
sizeof(
Bool_t) > 1) {
1015 for (
int i = 0; i <
n; i++)
1038 if (l <= 0 || l >
fBufSize)
return 0;
1060 if (l <= 0 || l >
fBufSize)
return 0;
1065 # ifdef USE_BSWAPCPY
1069 for (
int i = 0; i <
n; i++)
1092 if (l <= 0 || l >
fBufSize)
return 0;
1097 # ifdef USE_BSWAPCPY
1101 for (
int i = 0; i <
n; i++)
1124 if (l <= 0 || l >
fBufSize)
return 0;
1149 if (l <= 0 || l >
fBufSize)
return 0;
1154 for (
int i = 0; i <
n; i++)
1176 if (n <= 0 || l >
fBufSize)
return 0;
1181 # ifdef USE_BSWAPCPY
1185 for (
int i = 0; i <
n; i++)
1208 if (n <= 0 || l >
fBufSize)
return 0;
1213 for (
int i = 0; i <
n; i++)
1235 if (n <= 0 || 3*n >
fBufSize)
return 0;
1256 if (n <= 0 || 3*n >
fBufSize)
return 0;
1270 if (n <= 0 || n >
fBufSize)
return;
1272 if (
sizeof(
Bool_t) > 1) {
1273 for (
int i = 0; i <
n; i++)
1287 if (n <= 0 || n >
fBufSize)
return;
1302 if (lenchar < 255) {
1308 if (len <= 0 || len >
fBufSize)
return;
1310 if (len >= n) len = n-1;
1328 if (n <= 0 || l >
fBufSize)
return;
1331 # ifdef USE_BSWAPCPY
1335 for (
int i = 0; i <
n; i++)
1350 if (l <= 0 || l >
fBufSize)
return;
1353 # ifdef USE_BSWAPCPY
1357 for (
int i = 0; i <
n; i++)
1372 if (l <= 0 || l >
fBufSize)
return;
1388 if (l <= 0 || l >
fBufSize)
return;
1391 for (
int i = 0; i <
n; i++)
1405 if (l <= 0 || l >
fBufSize)
return;
1408 # ifdef USE_BSWAPCPY
1412 for (
int i = 0; i <
n; i++)
1427 if (l <= 0 || l >
fBufSize)
return;
1430 for (
int i = 0; i <
n; i++)
1444 if (n <= 0 || 3*n >
fBufSize)
return;
1450 for (
int j=0;j <
n; j++) {
1451 UInt_t aint; *
this >> aint; f[j] = (
Float_t)(aint/factor + xmin);
1457 if (!nbits) nbits = 12;
1466 for (i = 0; i <
n; i++) {
1471 fIntValue |= (theMan & ((1<<(nbits+1))-1)) <<(23-nbits);
1472 if(1<<(nbits+1) & theMan) fFloatValue = -fFloatValue;
1484 if (n <= 0 || 3*n >
fBufSize)
return;
1487 for (
int j=0;j <
n; j++) {
1488 UInt_t aint; *
this >> aint; ptr[j] = (
Float_t)(aint/factor + minvalue);
1498 if (n <= 0 || 3*n >
fBufSize)
return;
1500 if (!nbits) nbits = 12;
1509 for (
Int_t i = 0; i <
n; i++) {
1514 fIntValue |= (theMan & ((1<<(nbits+1))-1)) <<(23-nbits);
1515 if(1<<(nbits+1) & theMan) fFloatValue = -fFloatValue;
1516 ptr[i] = fFloatValue;
1526 if (n <= 0 || 3*n >
fBufSize)
return;
1532 for (
int j=0;j <
n; j++) {
1533 UInt_t aint; *
this >> aint; d[j] = (
Double_t)(aint/factor + xmin);
1542 for (i = 0; i <
n; i++) {
1555 for (i = 0; i <
n; i++) {
1560 fIntValue |= (theMan & ((1<<(nbits+1))-1)) <<(23-nbits);
1561 if (1<<(nbits+1) & theMan) fFloatValue = -fFloatValue;
1574 if (n <= 0 || 3*n >
fBufSize)
return;
1577 for (
int j=0;j <
n; j++) {
1578 UInt_t aint; *
this >> aint; d[j] = (
Double_t)(aint/factor + minvalue);
1588 if (n <= 0 || 3*n >
fBufSize)
return;
1593 for (
Int_t i = 0; i <
n; i++) {
1606 for (
Int_t i = 0; i <
n; i++) {
1611 fIntValue |= (theMan & ((1<<(nbits+1))-1)) <<(23-nbits);
1612 if (1<<(nbits+1) & theMan) fFloatValue = -fFloatValue;
1628 (*streamer)(*
this,
start,0);
1632 int objectSize = cl->
Size();
1633 char *
obj = (
char*)start;
1634 char *end = obj + n*objectSize;
1636 for(; obj<end; obj+=objectSize) ((
TClass*)cl)->Streamer(obj,*
this, onFileClass);
1654 for (
Int_t j=0;j<
n;j++) {
1655 if (!start[j]) start[j] = cl->
New();
1659 (*streamer)(*
this,(
void*)start,0);
1665 for (
Int_t j=0; j<
n; j++){
1667 void *old = start[j];
1669 if (old && old!=start[j] &&
1694 for (
Int_t j=0; j<
n; j++){
1695 if (!start[j]) start[j] = ((
TClass*)cl)->New();
1696 ((
TClass*)cl)->Streamer(start[j],*
this,onFileClass);
1718 if (
sizeof(
Bool_t) > 1) {
1719 for (
int i = 0; i <
n; i++)
1764 # ifdef USE_BSWAPCPY
1768 for (
int i = 0; i <
n; i++)
1794 # ifdef USE_BSWAPCPY
1798 for (
int i = 0; i <
n; i++)
1862 for (
int i = 0; i <
n; i++)
1887 # ifdef USE_BSWAPCPY
1891 for (
int i = 0; i <
n; i++)
1917 for (
int i = 0; i <
n; i++)
1975 if (
sizeof(
Bool_t) > 1) {
1976 for (
int i = 0; i <
n; i++)
2030 # ifdef USE_BSWAPCPY
2034 for (
int i = 0; i <
n; i++)
2054 # ifdef USE_BSWAPCPY
2058 for (
int i = 0; i <
n; i++)
2106 for (
int i = 0; i <
n; i++)
2125 # ifdef USE_BSWAPCPY
2129 for (
int i = 0; i <
n; i++)
2149 for (
int i = 0; i <
n; i++)
2175 for (
int j = 0; j <
n; j++) {
2177 if (x < xmin) x =
xmin;
2178 if (x > xmax) x =
xmax;
2179 UInt_t aint =
UInt_t(0.5+factor*(x-xmin)); *
this << aint;
2185 if (!nbits) nbits = 12;
2194 for (i = 0; i <
n; i++) {
2197 UShort_t theMan = ((1<<(nbits+1))-1) & (fIntValue>>(23-nbits-1));
2200 if (theMan&1<<nbits) theMan = (1<<nbits) - 1;
2201 if (fFloatValue < 0) theMan |= 1<<(nbits+1);
2226 for (
int j = 0; j <
n; j++) {
2228 if (x < xmin) x =
xmin;
2229 if (x > xmax) x =
xmax;
2230 UInt_t aint =
UInt_t(0.5+factor*(x-xmin)); *
this << aint;
2239 for (i = 0; i <
n; i++) {
2251 for (i = 0; i <
n; i++) {
2254 UShort_t theMan = ((1<<(nbits+1))-1) & (fIntValue>>(23-nbits-1));
2257 if(theMan&1<<nbits) theMan = (1<<nbits) - 1;
2258 if (fFloatValue < 0) theMan |= 1<<(nbits+1);
2274 (*streamer)(*
this,
start, 0);
2278 char *
obj = (
char*)start;
2280 int size = cl->
Size();
2282 for(
Int_t j=0; j<
n; j++,obj+=size) {
2283 ((
TClass*)cl)->Streamer(obj,*
this);
2302 (*streamer)(*
this,(
void*)start,0);
2312 for (
Int_t j=0;j<
n;j++) {
2314 if (!strInfo && !start[j]) {
2329 for (
Int_t j=0;j<
n;j++) {
2330 if (!start[j]) start[j] = ((
TClass*)cl)->New();
2331 ((
TClass*)cl)->Streamer(start[j],*
this);
2390 Int_t baseOffset = 0;
2391 if (clRef && (clRef!=(
TClass*)(-1)) && clCast) {
2394 if (baseOffset == -1) {
2401 Error(
"ReadObject",
"got object of wrong class! requested %s but got %s",
2409 Info(
"ReadObjectAny",
"Using Converter StreamerInfo from %s to %s",clRef->
GetName(),clCast->
GetName());
2410 clRef =
const_cast<TClass*
>(clCast);
2415 Error(
"ReadObject",
"trying to read an emulated class (%s) to store in a compiled pointer (%s)",
2427 if (obj == (
void*) -1) obj = 0;
2430 return (obj+baseOffset);
2435 if (clRef == (
TClass*) -1) {
2453 Error(
"ReadObject",
"object tag too large, I/O buffer corrupted");
2461 if (clRef && (clRef!=(
TClass*)(-1)) && clCast) {
2464 if (baseOffset == -1) {
2465 Error(
"ReadObject",
"Got object of wrong class (Got %s while expecting %s)",
2483 obj = (
char*)clRef->
New();
2485 Error(
"ReadObject",
"could not create object of class %s",
2498 clRef->
Streamer( obj, *
this, clOnfile );
2503 return obj+baseOffset;
2523 if (!actualObjectStart) {
2535 ULong_t hash = Void_Hash(actualObjectStart);
2551 Warning(
"WriteObjectAny",
"since %s has no public constructor\n"
2552 "\twhich can be called without argument, objects of this class\n"
2553 "\tcan not be read with the current library. You will need to\n"
2554 "\tadd a default constructor before attempting to read it.",
2580 ((
TClass*)actualClass)->Streamer((
void*)actualObjectStart,*
this);
2589 struct DynamicType {
2593 virtual ~DynamicType() {}
2616 Error(
"WriteObjectAny",
"ptrClass argument may not be 0");
2626 DynamicType* d_ptr = (DynamicType*)obj;
2628 "An object of type %s (from type_info) passed through a %s pointer was truncated (due a missing dictionary)!!!",
2629 typeid(*d_ptr).name(),ptrClass->
GetName());
2632 }
else if (clActual && (clActual != ptrClass)) {
2633 const char *temp = (
const char*) obj;
2655 if (fBufCur < fBuffer || fBufCur >
fBufMax) {
2660 UInt_t bcnt, tag, startpos = 0;
2673 if (objTag) *objTag = tag;
2696 UInt_t clTag = (tag & ~kClassMask);
2703 Error(
"ReadClass",
"illegal class tag=%d (0<tag<=%d), I/O buffer corrupted",
2718 Error(
"ReadClass",
"got wrong class: %s", cl->
GetName());
2723 if (objTag) *objTag = (bcnt & ~kByteCountMask);
2726 if (!cl) cl = (
TClass*)-1;
2802 Error(
"SkipVersion",
"Could not find the StreamerInfo with a checksum of %d for the class \"%s\" in %s.",
2805 Error(
"SkipVersion",
"Could not find the StreamerInfo with a checksum of %d for the class \"%s\" (buffer with no parent)",
2825 Error(
"SkipVersion",
"Could not find the StreamerInfo with a checksum of %d for the class \"%s\" in %s.",
2831 Error(
"SkipVersion",
"Class %s not known to file %s.",
2881 && (
v.cnt &&
v.cnt >= 6)
2888 return vinfo->TStreamerInfo::GetClassVersion();
2898 Error(
"ReadVersion",
"Could not find the StreamerInfo with a checksum of 0x%x for the class \"%s\" in %s.",
2901 Error(
"ReadVersion",
"Could not find the StreamerInfo with a checksum of 0x%x for the class \"%s\" (buffer with no parent)",
2912 if (
v.cnt &&
v.cnt >= 6)
2929 Error(
"ReadVersion",
"Could not find the StreamerInfo with a checksum of 0x%x for the class \"%s\" in %s.",
2935 Error(
"ReadVersion",
"Class %s not known to file %s.",
3007 return vinfo->TStreamerInfo::GetClassVersion();
3047 Error(
"ReadVersion",
"Class %s not known to file %s.",
3070 if (version<=1 && cl->IsForeign()) {
3075 Error(
"WriteVersion",
"version number cannot be larger than %hd)",
3100 if (version<=1 && cl->IsForeign()) {
3101 Error(
"WriteVersionMemberWise",
"Member-wise streaming of foreign collection not yet implemented!");
3106 Error(
"WriteVersionMemberWise",
"version number cannot be larger than %hd)",
3125 else Warning(
"StreamObject",
"No TClass for the type %s is available, the object was not read.", typeinfo.name());
3135 else Warning(
"StreamObject",
"No TClass for the type %s is available, the object was not read.", className);
3143 ((
TClass*)cl)->Streamer(obj, *
this, (
TClass*)onFileClass );
3151 obj->Streamer(*
this);
3176 if (!offset)
return offset;
3196 Warning(
"CheckObject",
"reference to unavailable class %s,"
3197 " pointers of this type will be 0", cl->
GetName());
3199 Warning(
"CheckObject",
"reference to an unavailable class,"
3200 " pointers of that type will be 0");
3205 }
else if (cli == -1) {
3226 Warning(
"CheckObject",
"reference to object of unavailable class %s, offset=%d"
3227 " pointer will be 0", cl ? cl->
GetName() :
"TObject",
offset);
3233 }
else if (cli == -1) {
3261 if (!obj || !
fMap || !ptrClass)
return kFALSE;
3267 if (clActual && (ptrClass != clActual)) {
3268 const char *temp = (
const char*) obj;
3323 ULong_t hash = Void_Hash(obj);
3355 ULong_t hash = Void_Hash(obj);
3462 if (max == 0)
return 0;
3479 if (max == 0)
return;
3502 while (nr < max-1) {
3522 WriteBuf(s, (strlen(s)+1)*
sizeof(
char));
3533 Warning(
"ReadBuffer",
"The file was written during several processes with an "
3534 "older ROOT version; the TRefTable entries might be inconsistent.");
3544 return fileProcessID;
3580 if (!file)
return 0;
3613 char **end = arr + nobjects;
3625 char **arr =
reinterpret_cast<char**
>(a->
GetObjectRef(0));
3629 char **end = arr + nobjects;
3688 Error(
"ReadClassBuffer",
3689 "Could not find the right streamer info to convert %s version %d into a %s, object skipped at offset %d",
3703 auto ninfos = infos->
GetSize();
3704 if (version < -1 || version >= ninfos) {
3705 Error(
"ReadBuffer1",
"class: %s, attempting to access a wrong version: %d, object skipped at offset %d",
3718 const_cast<TClass*
>(cl)->BuildRealData(pointer);
3722 const_cast<TClass*
>(cl)->RegisterStreamerInfo(sinfo);
3723 if (
gDebug > 0)
printf(
"Creating StreamerInfo for class: %s, version: %d\n", cl->
GetName(), version);
3725 }
else if (version==0) {
3732 Error(
"ReadClassBuffer",
"Could not find the StreamerInfo for version %d of the class %s, object skipped at offset %d",
3740 const_cast<TClass*
>(cl)->BuildRealData(pointer);
3788 Error(
"ReadClassBuffer",
3789 "Could not find the right streamer info to convert %s version %d into a %s, object skipped at offset %d",
3812 if (version < -1 || version >= infocapacity) {
3813 Error(
"ReadClassBuffer",
"class: %s, attempting to access a wrong version: %d, object skipped at offset %d",
3825 const_cast<TClass*
>(cl)->BuildRealData(pointer);
3830 if (sinfo->
IsCompiled()) const_cast<TClass*>(cl)->SetLastReadInfo(sinfo);
3848 auto ninfos = infos->
GetSize();
3849 if (!(version < -1 || version >= ninfos)) {
3853 const_cast<TClass *
>(cl)->BuildRealData(pointer);
3856 const_cast<TClass *
>(cl)->RegisterStreamerInfo(sinfo);
3859 "Creating StreamerInfo for class: %s, version: %d\n",
3863 sinfo->
Clear(
"build");
3870 }
else if (version==0) {
3877 Error(
"ReadClassBuffer",
"Could not find the StreamerInfo for version %d of the class %s, object skipped at offset %d",
3888 if (sinfo->TStreamerInfo::IsRecovered()) R__c=0;
3893 if (
gDebug > 2)
printf(
" ReadBuffer for class: %s has read %d bytes\n", cl->
GetName(), R__c);
3912 sinfo = (
TStreamerInfo*)const_cast<TClass*>(cl)->GetCurrentStreamerInfo();
3914 const_cast<TClass*
>(cl)->BuildRealData(pointer);
3916 const_cast<TClass*
>(cl)->SetCurrentStreamerInfo(sinfo);
3917 const_cast<TClass*
>(cl)->RegisterStreamerInfo(sinfo);
3925 const_cast<TClass*
>(cl)->BuildRealData(pointer);
3953 TStreamerInfoActions::ActionContainer_t::const_iterator end = sequence.
fActions.end();
3954 for(TStreamerInfoActions::ActionContainer_t::const_iterator
iter = sequence.
fActions.begin();
3957 (*iter).PrintDebug(*
this,obj);
3963 TStreamerInfoActions::ActionContainer_t::const_iterator end = sequence.
fActions.end();
3964 for(TStreamerInfoActions::ActionContainer_t::const_iterator
iter = sequence.
fActions.begin();
3982 TStreamerInfoActions::ActionContainer_t::const_iterator end = sequence.
fActions.end();
3983 for(TStreamerInfoActions::ActionContainer_t::const_iterator
iter = sequence.
fActions.begin();
3986 (*iter).PrintDebug(*
this,*(
char**)start_collection);
3987 (*iter)(*
this,start_collection,end_collection);
3992 TStreamerInfoActions::ActionContainer_t::const_iterator end = sequence.
fActions.end();
3993 for(TStreamerInfoActions::ActionContainer_t::const_iterator
iter = sequence.
fActions.begin();
3996 (*iter)(*
this,start_collection,end_collection);
4014 void *arr0 = start_collection ? loopconfig->
GetFirstAddress(start_collection,end_collection) : 0;
4016 TStreamerInfoActions::ActionContainer_t::const_iterator end = sequence.
fActions.end();
4017 for(TStreamerInfoActions::ActionContainer_t::const_iterator
iter = sequence.
fActions.begin();
4020 (*iter).PrintDebug(*
this,arr0);
4021 (*iter)(*
this,start_collection,end_collection,loopconfig);
4026 TStreamerInfoActions::ActionContainer_t::const_iterator end = sequence.
fActions.end();
4027 for(TStreamerInfoActions::ActionContainer_t::const_iterator
iter = sequence.
fActions.begin();
4030 (*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
Return true if we have access to a default constructor.
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 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.
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 char * ReadString(char *s, Int_t max)
Read string from I/O buffer.
Int_t IsRecovered() const
virtual void StreamObject(void *obj, const type_info &typeinfo, const TClass *onFileClass=0)
Stream an object given its C++ typeinfo information.
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.
TClass * GetActualClass(const void *object) const
Return a pointer the the real class of the object.
std::map< std::string, std::string >::const_iterator iter
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)
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
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 cointains 'built', reset this StreamerInfo as if Build or BuildOld was never called on it (use...
TVirtualStreamerInfo * GetStreamerInfo(Int_t version=0) const
returns a pointer to the TVirtualStreamerInfo object for version If the object does not exist...
virtual void ReadStdString(std::string &s)
Read std::string from TBuffer.
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.
ClassImp(TBufferFile) static inline ULong_t Void_Hash(const void *ptr)
Return hash value for this object.
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.
ClassImp(TMCParticle) void TMCParticle printf(": p=(%7.3f,%7.3f,%9.3f) ;", fPx, fPy, fPz)
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.
static Vc_ALWAYS_INLINE int_v max(const int_v &x, const int_v &y)
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 WriteStdString(const std::string &s)
Write std::string to TBuffer.
virtual void WriteFastArray(const Bool_t *b, Int_t n)
Write array of n bools into the I/O buffer.
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 minimun 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.