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));
300 std::string *obj = &s;
313 obj->resize(nbig,
'\0');
317 obj->resize(nwh,
'\0');
329 const std::string *obj = &s;
331 Int_t nbig = obj->length();
350 char *buf = (
char *)(
fBuffer + cntpos);
395 const char *
name = clss ? clss->
GetName() : classname ? classname : 0;
399 Error(
"CheckByteCount",
"object of class %s read too few bytes: %d instead of %d",
400 name,bcnt+offset,bcnt);
403 Error(
"CheckByteCount",
"object of class %s read too many bytes: %d instead of %d",
404 name,bcnt+offset,bcnt);
406 Warning(
"CheckByteCount",
"%s::Streamer() not in sync with data on file %s, fix Streamer()",
409 Warning(
"CheckByteCount",
"%s::Streamer() not in sync with data, fix Streamer()",
413 if ( ((
char *)endpos) >
fBufMax ) {
415 Error(
"CheckByteCount",
416 "Byte count probably corrupted around buffer position %d:\n\t%d for a possible maximum of %d",
417 startpos, bcnt, offset);
468 if (!nbits) nbits = 12;
504 ptr[0] = (
Float_t)(aint/factor + minvalue);
523 temp.fIntValue = theExp;
524 temp.fIntValue <<= 23;
525 temp.fIntValue |= (theMan & ((1<<(nbits+1))-1)) <<(23-nbits);
526 if(1<<(nbits+1) & theMan) temp.fFloatValue = -temp.fFloatValue;
527 ptr[0] = temp.fFloatValue;
539 ptr[0] = (
Double_t)(aint/factor + minvalue);
558 temp.fIntValue = theExp;
559 temp.fIntValue <<= 23;
560 temp.fIntValue |= (theMan & ((1<<(nbits+1))-1)) <<(23-nbits);
561 if(1<<(nbits+1) & theMan) temp.fFloatValue = -temp.fFloatValue;
562 ptr[0] = (
Double_t)temp.fFloatValue;
628 if (x < xmin) x =
xmin;
629 if (x > xmax) x =
xmax;
635 if (!nbits) nbits = 12;
645 UShort_t theMan = ((1<<(nbits+1))-1) & (fIntValue>>(23-nbits-1));
648 if (theMan&1<<nbits) theMan = (1<<nbits) - 1;
649 if (fFloatValue < 0) theMan |= 1<<(nbits+1);
692 if (x < xmin) x =
xmin;
693 if (x > xmax) x =
xmax;
713 UShort_t theMan = ((1<<(nbits+1))-1) & (fIntValue>>(23-nbits-1)) ;
716 if (theMan&1<<nbits) theMan = (1<<nbits)-1 ;
717 if (fFloatValue < 0) theMan |= 1<<(nbits+1);
736 if (n <= 0 || n >
fBufSize)
return 0;
741 for (
int i = 0; i <
n; i++)
765 if (l <= 0 || l >
fBufSize)
return 0;
788 if (l <= 0 || l >
fBufSize)
return 0;
797 for (
int i = 0; i <
n; i++)
821 if (l <= 0 || l >
fBufSize)
return 0;
823 if (!ii) ii =
new Int_t[
n];
830 for (
int i = 0; i <
n; i++)
854 if (l <= 0 || l >
fBufSize)
return 0;
880 if (l <= 0 || l >
fBufSize)
return 0;
885 for (
int i = 0; i <
n; i++)
908 if (l <= 0 || l >
fBufSize)
return 0;
917 for (
int i = 0; i <
n; i++)
941 if (l <= 0 || l >
fBufSize)
return 0;
946 for (
int i = 0; i <
n; i++)
969 if (n <= 0 || 3*n >
fBufSize)
return 0;
991 if (n <= 0 || 3*n >
fBufSize)
return 0;
1011 if (n <= 0 || n >
fBufSize)
return 0;
1015 if (
sizeof(
Bool_t) > 1) {
1016 for (
int i = 0; i <
n; i++)
1039 if (l <= 0 || l >
fBufSize)
return 0;
1061 if (l <= 0 || l >
fBufSize)
return 0;
1066 # ifdef USE_BSWAPCPY 1070 for (
int i = 0; i <
n; i++)
1093 if (l <= 0 || l >
fBufSize)
return 0;
1098 # ifdef USE_BSWAPCPY 1102 for (
int i = 0; i <
n; i++)
1125 if (l <= 0 || l >
fBufSize)
return 0;
1150 if (l <= 0 || l >
fBufSize)
return 0;
1155 for (
int i = 0; i <
n; i++)
1177 if (n <= 0 || l >
fBufSize)
return 0;
1182 # ifdef USE_BSWAPCPY 1186 for (
int i = 0; i <
n; i++)
1209 if (n <= 0 || l >
fBufSize)
return 0;
1214 for (
int i = 0; i <
n; i++)
1236 if (n <= 0 || 3*n >
fBufSize)
return 0;
1257 if (n <= 0 || 3*n >
fBufSize)
return 0;
1271 if (n <= 0 || n >
fBufSize)
return;
1273 if (
sizeof(
Bool_t) > 1) {
1274 for (
int i = 0; i <
n; i++)
1288 if (n <= 0 || n >
fBufSize)
return;
1303 if (lenchar < 255) {
1309 if (len <= 0 || len >
fBufSize)
return;
1311 if (len >= n) len = n-1;
1329 if (n <= 0 || l >
fBufSize)
return;
1332 # ifdef USE_BSWAPCPY 1336 for (
int i = 0; i <
n; i++)
1351 if (l <= 0 || l >
fBufSize)
return;
1354 # ifdef USE_BSWAPCPY 1358 for (
int i = 0; i <
n; i++)
1373 if (l <= 0 || l >
fBufSize)
return;
1389 if (l <= 0 || l >
fBufSize)
return;
1392 for (
int i = 0; i <
n; i++)
1406 if (l <= 0 || l >
fBufSize)
return;
1409 # ifdef USE_BSWAPCPY 1413 for (
int i = 0; i <
n; i++)
1428 if (l <= 0 || l >
fBufSize)
return;
1431 for (
int i = 0; i <
n; i++)
1445 if (n <= 0 || 3*n >
fBufSize)
return;
1451 for (
int j=0;j <
n; j++) {
1452 UInt_t aint; *
this >> aint; f[j] = (
Float_t)(aint/factor + xmin);
1458 if (!nbits) nbits = 12;
1467 for (i = 0; i <
n; i++) {
1472 fIntValue |= (theMan & ((1<<(nbits+1))-1)) <<(23-nbits);
1473 if(1<<(nbits+1) & theMan) fFloatValue = -fFloatValue;
1485 if (n <= 0 || 3*n >
fBufSize)
return;
1488 for (
int j=0;j <
n; j++) {
1489 UInt_t aint; *
this >> aint; ptr[j] = (
Float_t)(aint/factor + minvalue);
1499 if (n <= 0 || 3*n >
fBufSize)
return;
1501 if (!nbits) nbits = 12;
1510 for (
Int_t i = 0; i <
n; i++) {
1515 fIntValue |= (theMan & ((1<<(nbits+1))-1)) <<(23-nbits);
1516 if(1<<(nbits+1) & theMan) fFloatValue = -fFloatValue;
1517 ptr[i] = fFloatValue;
1527 if (n <= 0 || 3*n >
fBufSize)
return;
1533 for (
int j=0;j <
n; j++) {
1534 UInt_t aint; *
this >> aint; d[j] = (
Double_t)(aint/factor + xmin);
1543 for (i = 0; i <
n; i++) {
1556 for (i = 0; i <
n; i++) {
1561 fIntValue |= (theMan & ((1<<(nbits+1))-1)) <<(23-nbits);
1562 if (1<<(nbits+1) & theMan) fFloatValue = -fFloatValue;
1575 if (n <= 0 || 3*n >
fBufSize)
return;
1578 for (
int j=0;j <
n; j++) {
1579 UInt_t aint; *
this >> aint; d[j] = (
Double_t)(aint/factor + minvalue);
1589 if (n <= 0 || 3*n >
fBufSize)
return;
1594 for (
Int_t i = 0; i <
n; i++) {
1607 for (
Int_t i = 0; i <
n; i++) {
1612 fIntValue |= (theMan & ((1<<(nbits+1))-1)) <<(23-nbits);
1613 if (1<<(nbits+1) & theMan) fFloatValue = -fFloatValue;
1629 (*streamer)(*
this,start,0);
1633 int objectSize = cl->
Size();
1634 char *obj = (
char*)start;
1635 char *end = obj + n*objectSize;
1637 for(; obj<end; obj+=objectSize) ((
TClass*)cl)->Streamer(obj,*
this, onFileClass);
1655 for (
Int_t j=0;j<
n;j++) {
1656 if (!start[j]) start[j] = cl->
New();
1660 (*streamer)(*
this,(
void*)start,0);
1666 for (
Int_t j=0; j<
n; j++){
1668 void *old = start[j];
1670 if (old && old!=start[j] &&
1695 for (
Int_t j=0; j<
n; j++){
1696 if (!start[j]) start[j] = ((
TClass*)cl)->New();
1697 ((
TClass*)cl)->Streamer(start[j],*
this,onFileClass);
1719 if (
sizeof(
Bool_t) > 1) {
1720 for (
int i = 0; i <
n; i++)
1765 # ifdef USE_BSWAPCPY 1769 for (
int i = 0; i <
n; i++)
1795 # ifdef USE_BSWAPCPY 1799 for (
int i = 0; i <
n; i++)
1863 for (
int i = 0; i <
n; i++)
1888 # ifdef USE_BSWAPCPY 1892 for (
int i = 0; i <
n; i++)
1918 for (
int i = 0; i <
n; i++)
1976 if (
sizeof(
Bool_t) > 1) {
1977 for (
int i = 0; i <
n; i++)
2031 # ifdef USE_BSWAPCPY 2035 for (
int i = 0; i <
n; i++)
2055 # ifdef USE_BSWAPCPY 2059 for (
int i = 0; i <
n; i++)
2107 for (
int i = 0; i <
n; i++)
2126 # ifdef USE_BSWAPCPY 2130 for (
int i = 0; i <
n; i++)
2150 for (
int i = 0; i <
n; i++)
2176 for (
int j = 0; j <
n; j++) {
2178 if (x < xmin) x =
xmin;
2179 if (x > xmax) x =
xmax;
2180 UInt_t aint =
UInt_t(0.5+factor*(x-xmin)); *
this << aint;
2186 if (!nbits) nbits = 12;
2195 for (i = 0; i <
n; i++) {
2198 UShort_t theMan = ((1<<(nbits+1))-1) & (fIntValue>>(23-nbits-1));
2201 if (theMan&1<<nbits) theMan = (1<<nbits) - 1;
2202 if (fFloatValue < 0) theMan |= 1<<(nbits+1);
2227 for (
int j = 0; j <
n; j++) {
2229 if (x < xmin) x =
xmin;
2230 if (x > xmax) x =
xmax;
2231 UInt_t aint =
UInt_t(0.5+factor*(x-xmin)); *
this << aint;
2240 for (i = 0; i <
n; i++) {
2252 for (i = 0; i <
n; i++) {
2255 UShort_t theMan = ((1<<(nbits+1))-1) & (fIntValue>>(23-nbits-1));
2258 if(theMan&1<<nbits) theMan = (1<<nbits) - 1;
2259 if (fFloatValue < 0) theMan |= 1<<(nbits+1);
2275 (*streamer)(*
this, start, 0);
2279 char *obj = (
char*)start;
2281 int size = cl->
Size();
2283 for(
Int_t j=0; j<
n; j++,obj+=size) {
2284 ((
TClass*)cl)->Streamer(obj,*
this);
2303 (*streamer)(*
this,(
void*)start,0);
2313 for (
Int_t j=0;j<
n;j++) {
2315 if (!strInfo && !start[j]) {
2330 for (
Int_t j=0;j<
n;j++) {
2331 if (!start[j]) start[j] = ((
TClass*)cl)->New();
2332 ((
TClass*)cl)->Streamer(start[j],*
this);
2391 Int_t baseOffset = 0;
2392 if (clRef && (clRef!=(
TClass*)(-1)) && clCast) {
2395 if (baseOffset == -1) {
2402 Error(
"ReadObject",
"got object of wrong class! requested %s but got %s",
2410 Info(
"ReadObjectAny",
"Using Converter StreamerInfo from %s to %s",clRef->
GetName(),clCast->
GetName());
2411 clRef =
const_cast<TClass*
>(clCast);
2416 Error(
"ReadObject",
"trying to read an emulated class (%s) to store in a compiled pointer (%s)",
2428 if (obj == (
void*) -1) obj = 0;
2431 return (obj+baseOffset);
2436 if (clRef == (
TClass*) -1) {
2454 Error(
"ReadObject",
"object tag too large, I/O buffer corrupted");
2462 if (clRef && (clRef!=(
TClass*)(-1)) && clCast) {
2465 if (baseOffset == -1) {
2466 Error(
"ReadObject",
"Got object of wrong class (Got %s while expecting %s)",
2484 obj = (
char*)clRef->
New();
2486 Error(
"ReadObject",
"could not create object of class %s",
2499 clRef->
Streamer( obj, *
this, clOnfile );
2504 return obj+baseOffset;
2524 if (!actualObjectStart) {
2552 Warning(
"WriteObjectAny",
"since %s has no public constructor\n" 2553 "\twhich can be called without argument, objects of this class\n" 2554 "\tcan not be read with the current library. You will need to\n" 2555 "\tadd a default constructor before attempting to read it.",
2581 ((
TClass*)actualClass)->Streamer((
void*)actualObjectStart,*
this);
2590 struct DynamicType {
2594 virtual ~DynamicType() {}
2617 Error(
"WriteObjectAny",
"ptrClass argument may not be 0");
2627 DynamicType* d_ptr = (DynamicType*)obj;
2629 "An object of type %s (from type_info) passed through a %s pointer was truncated (due a missing dictionary)!!!",
2630 typeid(*d_ptr).name(),ptrClass->
GetName());
2633 }
else if (clActual && (clActual != ptrClass)) {
2634 const char *temp = (
const char*) obj;
2656 if (fBufCur < fBuffer || fBufCur >
fBufMax) {
2661 UInt_t bcnt, tag, startpos = 0;
2674 if (objTag) *objTag = tag;
2697 UInt_t clTag = (tag & ~kClassMask);
2704 Error(
"ReadClass",
"illegal class tag=%d (0<tag<=%d), I/O buffer corrupted",
2719 Error(
"ReadClass",
"got wrong class: %s", cl->
GetName());
2724 if (objTag) *objTag = (bcnt & ~kByteCountMask);
2727 if (!cl) cl = (
TClass*)-1;
2803 Error(
"SkipVersion",
"Could not find the StreamerInfo with a checksum of %d for the class \"%s\" in %s.",
2806 Error(
"SkipVersion",
"Could not find the StreamerInfo with a checksum of %d for the class \"%s\" (buffer with no parent)",
2826 Error(
"SkipVersion",
"Could not find the StreamerInfo with a checksum of %d for the class \"%s\" in %s.",
2832 Error(
"SkipVersion",
"Class %s not known to file %s.",
2882 && (
v.cnt &&
v.cnt >= 6)
2889 return vinfo->TStreamerInfo::GetClassVersion();
2899 Error(
"ReadVersion",
"Could not find the StreamerInfo with a checksum of 0x%x for the class \"%s\" in %s.",
2902 Error(
"ReadVersion",
"Could not find the StreamerInfo with a checksum of 0x%x for the class \"%s\" (buffer with no parent)",
2913 if (
v.cnt &&
v.cnt >= 6)
2930 Error(
"ReadVersion",
"Could not find the StreamerInfo with a checksum of 0x%x for the class \"%s\" in %s.",
2936 Error(
"ReadVersion",
"Class %s not known to file %s.",
3008 return vinfo->TStreamerInfo::GetClassVersion();
3048 Error(
"ReadVersion",
"Class %s not known to file %s.",
3071 if (version<=1 && cl->IsForeign()) {
3076 Error(
"WriteVersion",
"version number cannot be larger than %hd)",
3101 if (version<=1 && cl->IsForeign()) {
3102 Error(
"WriteVersionMemberWise",
"Member-wise streaming of foreign collection not yet implemented!");
3107 Error(
"WriteVersionMemberWise",
"version number cannot be larger than %hd)",
3126 else Warning(
"StreamObject",
"No TClass for the type %s is available, the object was not read.", typeinfo.name());
3136 else Warning(
"StreamObject",
"No TClass for the type %s is available, the object was not read.", className);
3144 ((
TClass*)cl)->Streamer(obj, *
this, (
TClass*)onFileClass );
3152 obj->Streamer(*
this);
3177 if (!offset)
return offset;
3197 Warning(
"CheckObject",
"reference to unavailable class %s," 3198 " pointers of this type will be 0", cl->
GetName());
3200 Warning(
"CheckObject",
"reference to an unavailable class," 3201 " pointers of that type will be 0");
3206 }
else if (cli == -1) {
3227 Warning(
"CheckObject",
"reference to object of unavailable class %s, offset=%d" 3228 " pointer will be 0", cl ? cl->
GetName() :
"TObject",offset);
3234 }
else if (cli == -1) {
3262 if (!obj || !
fMap || !ptrClass)
return kFALSE;
3268 if (clActual && (ptrClass != clActual)) {
3269 const char *temp = (
const char*) obj;
3463 if (max == 0)
return 0;
3480 if (max == 0)
return;
3503 while (nr < max-1) {
3523 WriteBuf(s, (strlen(s)+1)*
sizeof(
char));
3534 Warning(
"ReadBuffer",
"The file was written during several processes with an " 3535 "older ROOT version; the TRefTable entries might be inconsistent.");
3545 return fileProcessID;
3588 if (!file)
return 0;
3621 char **end = arr + nobjects;
3633 char **arr =
reinterpret_cast<char**
>(a->
GetObjectRef(0));
3637 char **end = arr + nobjects;
3696 Error(
"ReadClassBuffer",
3697 "Could not find the right streamer info to convert %s version %d into a %s, object skipped at offset %d",
3711 auto ninfos = infos->
GetSize();
3712 if (version < -1 || version >= ninfos) {
3713 Error(
"ReadBuffer1",
"class: %s, attempting to access a wrong version: %d, object skipped at offset %d",
3726 const_cast<TClass*
>(cl)->BuildRealData(pointer);
3730 const_cast<TClass*
>(cl)->RegisterStreamerInfo(sinfo);
3731 if (
gDebug > 0) printf(
"Creating StreamerInfo for class: %s, version: %d\n", cl->
GetName(), version);
3733 }
else if (version==0) {
3740 Error(
"ReadClassBuffer",
"Could not find the StreamerInfo for version %d of the class %s, object skipped at offset %d",
3748 const_cast<TClass*
>(cl)->BuildRealData(pointer);
3796 Error(
"ReadClassBuffer",
3797 "Could not find the right streamer info to convert %s version %d into a %s, object skipped at offset %d",
3820 if (version < -1 || version >= infocapacity) {
3821 Error(
"ReadClassBuffer",
"class: %s, attempting to access a wrong version: %d, object skipped at offset %d",
3833 const_cast<TClass*
>(cl)->BuildRealData(pointer);
3838 if (sinfo->
IsCompiled()) const_cast<TClass*>(cl)->SetLastReadInfo(sinfo);
3856 auto ninfos = infos->
GetSize();
3857 if (!(version < -1 || version >= ninfos)) {
3861 const_cast<TClass *
>(cl)->BuildRealData(pointer);
3864 const_cast<TClass *
>(cl)->RegisterStreamerInfo(sinfo);
3867 "Creating StreamerInfo for class: %s, version: %d\n",
3871 sinfo->
Clear(
"build");
3878 }
else if (version==0) {
3885 Error(
"ReadClassBuffer",
"Could not find the StreamerInfo for version %d of the class %s, object skipped at offset %d",
3896 if (sinfo->TStreamerInfo::IsRecovered()) R__c=0;
3901 if (
gDebug > 2) printf(
" ReadBuffer for class: %s has read %d bytes\n", cl->
GetName(), R__c);
3920 sinfo = (
TStreamerInfo*)const_cast<TClass*>(cl)->GetCurrentStreamerInfo();
3922 const_cast<TClass*
>(cl)->BuildRealData(pointer);
3924 const_cast<TClass*
>(cl)->SetCurrentStreamerInfo(sinfo);
3925 const_cast<TClass*
>(cl)->RegisterStreamerInfo(sinfo);
3933 const_cast<TClass*
>(cl)->BuildRealData(pointer);
3961 TStreamerInfoActions::ActionContainer_t::const_iterator end = sequence.
fActions.end();
3962 for(TStreamerInfoActions::ActionContainer_t::const_iterator iter = sequence.
fActions.begin();
3965 (*iter).PrintDebug(*
this,obj);
3971 TStreamerInfoActions::ActionContainer_t::const_iterator end = sequence.
fActions.end();
3972 for(TStreamerInfoActions::ActionContainer_t::const_iterator iter = sequence.
fActions.begin();
3990 TStreamerInfoActions::ActionContainer_t::const_iterator end = sequence.
fActions.end();
3991 for(TStreamerInfoActions::ActionContainer_t::const_iterator iter = sequence.
fActions.begin();
3994 (*iter).PrintDebug(*
this,*(
char**)start_collection);
3995 (*iter)(*
this,start_collection,end_collection);
4000 TStreamerInfoActions::ActionContainer_t::const_iterator end = sequence.
fActions.end();
4001 for(TStreamerInfoActions::ActionContainer_t::const_iterator iter = sequence.
fActions.begin();
4004 (*iter)(*
this,start_collection,end_collection);
4022 void *arr0 = start_collection ? loopconfig->
GetFirstAddress(start_collection,end_collection) : 0;
4024 TStreamerInfoActions::ActionContainer_t::const_iterator end = sequence.
fActions.end();
4025 for(TStreamerInfoActions::ActionContainer_t::const_iterator iter = sequence.
fActions.begin();
4028 (*iter).PrintDebug(*
this,arr0);
4029 (*iter)(*
this,start_collection,end_collection,loopconfig);
4034 TStreamerInfoActions::ActionContainer_t::const_iterator end = sequence.
fActions.end();
4035 for(TStreamerInfoActions::ActionContainer_t::const_iterator iter = sequence.
fActions.begin();
4038 (*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...
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.
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.
#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.
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
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.
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.
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'.
virtual void * GetFirstAddress(void *start, const void *end) const =0
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 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.
virtual Int_t GetNumber() const =0
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 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 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.
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 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.