43 #if (defined(__linux) || defined(__APPLE__)) && defined(__i386__) && \ 94 fDisplacement(0),fPidOffset(0), fMap(0), fClassMap(0),
95 fInfo(0), fInfoStack()
133 TBuffer(mode,bufsiz,buf,adopt,reallocfunc),
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;
2569 if (!actualObjectStart) {
2597 Warning(
"WriteObjectAny",
"since %s has no public constructor\n" 2598 "\twhich can be called without argument, objects of this class\n" 2599 "\tcan not be read with the current library. You will need to\n" 2600 "\tadd a default constructor before attempting to read it.",
2628 ((
TClass*)actualClass)->Streamer((
void*)actualObjectStart,*
this);
2637 struct DynamicType {
2641 virtual ~DynamicType() {}
2670 Error(
"WriteObjectAny",
"ptrClass argument may not be 0");
2680 DynamicType* d_ptr = (DynamicType*)obj;
2682 "An object of type %s (from type_info) passed through a %s pointer was truncated (due a missing dictionary)!!!",
2683 typeid(*d_ptr).name(),ptrClass->
GetName());
2686 }
else if (clActual && (clActual != ptrClass)) {
2687 const char *temp = (
const char*) obj;
2709 if (fBufCur < fBuffer || fBufCur >
fBufMax) {
2714 UInt_t bcnt, tag, startpos = 0;
2727 if (objTag) *objTag = tag;
2750 UInt_t clTag = (tag & ~kClassMask);
2757 Error(
"ReadClass",
"illegal class tag=%d (0<tag<=%d), I/O buffer corrupted",
2772 Error(
"ReadClass",
"The on-file class is \"'%s\" which is not compatible with the requested class: \"%s\"",
2778 if (objTag) *objTag = (bcnt & ~kByteCountMask);
2781 if (!cl) cl = (
TClass*)-1;
2857 Error(
"SkipVersion",
"Could not find the StreamerInfo with a checksum of %d for the class \"%s\" in %s.",
2860 Error(
"SkipVersion",
"Could not find the StreamerInfo with a checksum of %d for the class \"%s\" (buffer with no parent)",
2872 const TList *list = ((
TFile*)fParent)->GetStreamerInfoCache();
2880 Error(
"SkipVersion",
"Could not find the StreamerInfo with a checksum of %d for the class \"%s\" in %s.",
2881 checksum, cl->
GetName(), ((
TFile*)fParent)->GetName());
2886 Error(
"SkipVersion",
"Class %s not known to file %s.",
2936 && (
v.cnt &&
v.cnt >= 6)
2943 return vinfo->TStreamerInfo::GetClassVersion();
2953 Error(
"ReadVersion",
"Could not find the StreamerInfo with a checksum of 0x%x for the class \"%s\" in %s.",
2956 Error(
"ReadVersion",
"Could not find the StreamerInfo with a checksum of 0x%x for the class \"%s\" (buffer with no parent)",
2967 if (
v.cnt &&
v.cnt >= 6)
2976 const TList *list = ((
TFile*)fParent)->GetStreamerInfoCache();
2984 Error(
"ReadVersion",
"Could not find the StreamerInfo with a checksum of 0x%x for the class \"%s\" in %s.",
2985 checksum, cl->
GetName(), ((
TFile*)fParent)->GetName());
2990 Error(
"ReadVersion",
"Class %s not known to file %s.",
3062 return vinfo->TStreamerInfo::GetClassVersion();
3087 const TList *list = ((
TFile*)fParent)->GetStreamerInfoCache();
3102 Error(
"ReadVersion",
"Class %s not known to file %s.",
3125 if (version<=1 && cl->IsForeign()) {
3130 Error(
"WriteVersion",
"version number cannot be larger than %hd)",
3155 if (version<=1 && cl->IsForeign()) {
3156 Error(
"WriteVersionMemberWise",
"Member-wise streaming of foreign collection not yet implemented!");
3161 Error(
"WriteVersionMemberWise",
"version number cannot be larger than %hd)",
3180 else Warning(
"StreamObject",
"No TClass for the type %s is available, the object was not read.", typeinfo.name());
3190 else Warning(
"StreamObject",
"No TClass for the type %s is available, the object was not read.", className);
3198 ((
TClass*)cl)->Streamer(obj, *
this, (
TClass*)onFileClass );
3206 obj->Streamer(*
this);
3231 if (!offset)
return offset;
3251 Warning(
"CheckObject",
"reference to unavailable class %s," 3252 " pointers of this type will be 0", cl->
GetName());
3254 Warning(
"CheckObject",
"reference to an unavailable class," 3255 " pointers of that type will be 0");
3260 }
else if (cli == -1) {
3281 Warning(
"CheckObject",
"reference to object of unavailable class %s, offset=%d" 3282 " pointer will be 0", cl ? cl->
GetName() :
"TObject",offset);
3288 }
else if (cli == -1) {
3316 if (!obj || !
fMap || !ptrClass)
return kFALSE;
3322 if (clActual && (ptrClass != clActual)) {
3323 const char *temp = (
const char*) obj;
3517 if (max == 0)
return 0;
3534 if (max == 0)
return;
3557 while (nr < max-1) {
3577 WriteBuf(s, (strlen(s)+1)*
sizeof(
char));
3588 Warning(
"ReadBuffer",
"The file was written during several processes with an " 3589 "older ROOT version; the TRefTable entries might be inconsistent.");
3599 return fileProcessID;
3642 if (!file)
return 0;
3675 char **end = arr + nobjects;
3687 char **arr =
reinterpret_cast<char**
>(a->
GetObjectRef(0));
3691 char **end = arr + nobjects;
3750 Error(
"ReadClassBuffer",
3751 "Could not find the right streamer info to convert %s version %d into a %s, object skipped at offset %d",
3765 auto ninfos = infos->
GetSize();
3766 if (version < -1 || version >= ninfos) {
3767 Error(
"ReadBuffer1",
"class: %s, attempting to access a wrong version: %d, object skipped at offset %d",
3780 const_cast<TClass*
>(cl)->BuildRealData(pointer);
3784 const_cast<TClass*
>(cl)->RegisterStreamerInfo(sinfo);
3785 if (
gDebug > 0) printf(
"Creating StreamerInfo for class: %s, version: %d\n", cl->
GetName(), version);
3787 }
else if (version==0) {
3794 Error(
"ReadClassBuffer",
"Could not find the StreamerInfo for version %d of the class %s, object skipped at offset %d",
3802 const_cast<TClass*
>(cl)->BuildRealData(pointer);
3850 Error(
"ReadClassBuffer",
3851 "Could not find the right streamer info to convert %s version %d into a %s, object skipped at offset %d",
3874 if (version < -1 || version >= infocapacity) {
3875 Error(
"ReadClassBuffer",
"class: %s, attempting to access a wrong version: %d, object skipped at offset %d",
3887 const_cast<TClass*
>(cl)->BuildRealData(pointer);
3892 if (sinfo->
IsCompiled()) const_cast<TClass*>(cl)->SetLastReadInfo(sinfo);
3910 auto ninfos = infos->
GetSize();
3911 if (!(version < -1 || version >= ninfos)) {
3915 const_cast<TClass *
>(cl)->BuildRealData(pointer);
3918 const_cast<TClass *
>(cl)->RegisterStreamerInfo(sinfo);
3921 "Creating StreamerInfo for class: %s, version: %d\n",
3925 sinfo->
Clear(
"build");
3932 }
else if (version==0) {
3939 Error(
"ReadClassBuffer",
"Could not find the StreamerInfo for version %d of the class %s, object skipped at offset %d",
3950 if (sinfo->TStreamerInfo::IsRecovered()) R__c=0;
3955 if (
gDebug > 2) printf(
" ReadBuffer for class: %s has read %d bytes\n", cl->
GetName(), R__c);
3974 sinfo = (
TStreamerInfo*)const_cast<TClass*>(cl)->GetCurrentStreamerInfo();
3976 const_cast<TClass*
>(cl)->BuildRealData(pointer);
3978 const_cast<TClass*
>(cl)->SetCurrentStreamerInfo(sinfo);
3979 const_cast<TClass*
>(cl)->RegisterStreamerInfo(sinfo);
3987 const_cast<TClass*
>(cl)->BuildRealData(pointer);
4015 TStreamerInfoActions::ActionContainer_t::const_iterator end = sequence.
fActions.end();
4016 for(TStreamerInfoActions::ActionContainer_t::const_iterator iter = sequence.
fActions.begin();
4019 (*iter).PrintDebug(*
this,obj);
4025 TStreamerInfoActions::ActionContainer_t::const_iterator end = sequence.
fActions.end();
4026 for(TStreamerInfoActions::ActionContainer_t::const_iterator iter = sequence.
fActions.begin();
4044 TStreamerInfoActions::ActionContainer_t::const_iterator end = sequence.
fActions.end();
4045 for(TStreamerInfoActions::ActionContainer_t::const_iterator iter = sequence.
fActions.begin();
4048 (*iter).PrintDebug(*
this,*(
char**)start_collection);
4049 (*iter)(*
this,start_collection,end_collection);
4054 TStreamerInfoActions::ActionContainer_t::const_iterator end = sequence.
fActions.end();
4055 for(TStreamerInfoActions::ActionContainer_t::const_iterator iter = sequence.
fActions.begin();
4058 (*iter)(*
this,start_collection,end_collection);
4076 void *arr0 = start_collection ? loopconfig->
GetFirstAddress(start_collection,end_collection) : 0;
4078 TStreamerInfoActions::ActionContainer_t::const_iterator end = sequence.
fActions.end();
4079 for(TStreamerInfoActions::ActionContainer_t::const_iterator iter = sequence.
fActions.begin();
4082 (*iter).PrintDebug(*
this,arr0);
4083 (*iter)(*
this,start_collection,end_collection,loopconfig);
4088 TStreamerInfoActions::ActionContainer_t::const_iterator end = sequence.
fActions.end();
4089 for(TStreamerInfoActions::ActionContainer_t::const_iterator iter = sequence.
fActions.begin();
4092 (*iter)(*
this,start_collection,end_collection,loopconfig);
Bool_t HasRuleWithSourceClass(const TString &source) const
Return True if we have any rule whose source class is 'source'.
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.
static TProcessID * GetPID()
static: returns pointer to current TProcessID
virtual UInt_t GetTRefExecId()
Return the exec id stored in the current TStreamerInfo element.
virtual const char * GetName() const
Returns name of object.
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 UInt_t GetUniqueID() const
Return the unique object id.
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)
Bool_t IsForeign() const
Return kTRUE is the class is Foreign (the class does not have a Streamer method). ...
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.
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 Int_t ReadClones(TClonesArray *a, Int_t nobjects, Version_t objvers)
Interface to TStreamerInfo::ReadBufferClones.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
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.
virtual TProcessID * GetLastProcessID(TRefTable *reftable) const
Return the last TProcessID in the file.
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.
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...
TObject * GetParent() const
Return pointer to parent of this buffer.
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...
TArrayC * GetClassIndex() const
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...
TVirtualStreamerInfo * GetStreamerInfo(Int_t version=0) const
returns a pointer to the TVirtualStreamerInfo object for version If the object does not exist...
TObjArray * GetListOfProcessIDs() const
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
char *(* ReAllocCharFun_t)(char *, size_t, size_t)
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.
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.
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
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...
const Version_t kMaxVersion
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 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.
TObject ** GetObjectRef() const
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.
UInt_t Hash(ECaseCompare cmp=kExact) const
Return hash value.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual TObject * FindObject(const char *name) const
Delete a TObjLink object.
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.
TObject * Last() const
Return the object in the last filled slot. Returns 0 if no entries.
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.
Bool_t IsLoaded() const
Return true if the shared library of this class is currently in the a process's memory.
virtual void WriteStdString(const std::string *s)
Write std::string to TBuffer.
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.
const TObjArray * GetStreamerInfos() const
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.
static ULong_t Void_Hash(const void *ptr)
Return hash value for this object.
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.
void ResetMap()
Delete existing fMap and reset map counter.
TStreamerInfo * fInfo
Pointer to TStreamerInfo object writing/reading the buffer.
virtual void WriteObjectClass(const void *actualObjStart, const TClass *actualClass, Bool_t cacheReuse)
Write object to I/O 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 IsCompiled() const
Int_t GetLast() const
Return index of last object in array.
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.
TVirtualStreamerInfo * FindStreamerInfo(TObjArray *arr, UInt_t checksum) const
Find the TVirtualStreamerInfo in the StreamerInfos corresponding to checksum.
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...
UInt_t GetCheckSum() const
TVirtualStreamerInfo * GetLastReadInfo() const
Int_t IsRecovered() const
virtual void StreamObject(void *obj, const std::type_info &typeinfo, const TClass *onFileClass=0)
Stream an object given its C++ typeinfo information.
TClass * GetActualClass(const void *object) const
Return a pointer the the real class of the object.
virtual void ForceWriteInfoClones(TClonesArray *a)
Make sure TStreamerInfo is not optimized, otherwise it will not be possible to support schema evoluti...
Bool_t HasDefaultConstructor() const
void InitMap()
Create the fMap container and initialize them with the null object.
virtual Int_t ReadClassEmulated(const TClass *cl, void *object, const TClass *onfile_class)
Read emulated class.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Int_t Size() const
Return size of object of this class.
virtual Version_t ReadVersion(UInt_t *start=0, UInt_t *bcnt=0, const TClass *cl=0)
Read class version from I/O buffer.
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.
Bool_t InheritsFrom(const char *cl) const
Return kTRUE if this class inherits from a class with name "classname".
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.
Long_t Property() const
Set TObject::fBits and fStreamerType to cache information about the class.
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.
void Streamer(void *obj, TBuffer &b, const TClass *onfile_class=0) const
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 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.
Version_t GetClassVersion() const
Int_t fMapSize
Default size of map.
virtual Int_t WriteObjectAny(const void *obj, const TClass *ptrClass, Bool_t cacheReuse=kTRUE)
Write object to I/O buffer.
void Build()
Build the I/O data structure for the current class version.
TObject * UncheckedAt(Int_t i) const
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.
virtual Int_t GetNumber() const =0
Double_t GetFactor() const
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...
static constexpr double s
#define R__LOCKGUARD(mutex)
virtual void ForceWriteInfo(TVirtualStreamerInfo *info, Bool_t force)
force writing the TStreamerInfo to the file
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 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.
TClass * GetClass() const
Mother of all ROOT objects.
static TStreamerElement * GetCurrentElement()
static function returning a pointer to the current TStreamerElement fgElement points to the current T...
Int_t GetClassVersion() const
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 Int_t GetNProcessIDs() const
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.
InfoList_t fInfoStack
Stack of pointers to the TStreamerInfos.
virtual void DecrementLevel(TVirtualStreamerInfo *)
Decrement level.
const ROOT::Detail::TSchemaRuleSet * GetSchemaRules() const
Return the set of the schema rules if any.
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.
UInt_t GetCheckSum(ECheckSum code=kCurrentCheckSum) const
Call GetCheckSum with validity check.
TStreamerInfoActions::TActionSequence * GetReadObjectWiseActions()
virtual const char * GetName() const
Returns name of object.
virtual Int_t GetSize() const
Abstract Interface class describing Streamer information for one class.
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)
virtual void WriteObject(const TObject *obj, Bool_t cacheReuse=kTRUE)
Write object to I/O buffer.
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.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
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.
virtual Int_t GetVersionOwner() const
Return the version number of the owner file.
void * New(ENewType defConstructor=kClassNew, Bool_t quiet=kFALSE) const
Return a pointer to a newly allocated object of this class.
Array of chars or bytes (8 bits per element).