12 #ifndef ROOT_TBufferFile 13 #define ROOT_TBufferFile 44 class TActionSequence;
65 fDisplacement(0),fPidOffset(0), fMap(0), fClassMap(0),
66 fInfo(0), fInfoStack() {}
73 void CheckCount(
UInt_t offset);
76 virtual void WriteObjectClass(
const void *actualObjStart,
const TClass *actualClass,
Bool_t cacheReuse);
79 enum { kMapSize = 503 };
80 enum { kStreamedMemberWise =
BIT(14) };
82 kNotDecompressed =
BIT(15),
83 kTextBasedStreaming =
BIT(18),
96 void GetMappedObject(
UInt_t tag,
void* &ptr,
TClass* &ClassPtr)
const;
98 void MapObject(
const void *obj,
const TClass *cl,
UInt_t offset = 1);
99 void Reset() { SetBufferOffset(); ResetMap(); }
102 void SetReadParam(
Int_t mapsize);
103 void SetWriteParam(
Int_t mapsize);
106 Bool_t CheckObject(
const void *obj,
const TClass *ptrClass);
108 virtual Int_t GetVersionOwner()
const;
110 virtual Int_t CheckByteCount(
UInt_t startpos,
UInt_t bcnt,
const char *classname);
113 virtual void SkipVersion(
const TClass *cl = 0);
120 virtual void *ReadObjectAny(
const TClass* cast);
121 virtual void SkipObjectAny();
133 virtual void WriteBuf(
const void *buf,
Int_t max);
135 virtual char *ReadString(
char *
s,
Int_t max);
136 virtual void WriteString(
const char *s);
139 virtual void WriteClass(
const TClass *cl);
156 { fDisplacement = (
Int_t)(Length() - skipped); }
202 virtual void ReadFastArrayString(
Char_t *c,
Int_t n);
206 virtual void ReadFastArray(
Int_t *i,
Int_t n);
228 virtual void WriteArray(
const Int_t *i,
Int_t n);
239 virtual void WriteFastArray(
const Bool_t *b,
Int_t n);
240 virtual void WriteFastArray(
const Char_t *c,
Int_t n);
241 virtual void WriteFastArrayString(
const Char_t *c,
Int_t n);
245 virtual void WriteFastArray(
const Int_t *i,
Int_t n);
246 virtual void WriteFastArray(
const UInt_t *i,
Int_t n);
247 virtual void WriteFastArray(
const Long_t *l,
Int_t n);
258 virtual void StreamObject(
void *obj,
const std::type_info &typeinfo,
const TClass* onFileClass = 0 );
259 virtual void StreamObject(
void *obj,
const char *className,
const TClass* onFileClass = 0 );
260 virtual void StreamObject(
void *obj,
const TClass *cl,
const TClass* onFileClass = 0 );
261 virtual void StreamObject(
TObject *obj);
263 virtual void ReadBool(
Bool_t &b);
264 virtual void ReadChar(
Char_t &c);
265 virtual void ReadUChar(
UChar_t &c);
266 virtual void ReadShort(
Short_t &s);
267 virtual void ReadUShort(
UShort_t &s);
268 virtual void ReadInt(
Int_t &i);
269 virtual void ReadUInt(
UInt_t &i);
270 virtual void ReadLong(
Long_t &l);
271 virtual void ReadULong(
ULong_t &l);
272 virtual void ReadLong64(
Long64_t &l);
274 virtual void ReadFloat(
Float_t &f);
275 virtual void ReadDouble(
Double_t &d);
276 virtual void ReadCharP(
Char_t *c);
278 virtual void ReadStdString(std::string *s);
280 virtual void ReadCharStar(
char* &s);
282 virtual void WriteBool(
Bool_t b);
283 virtual void WriteChar(
Char_t c);
284 virtual void WriteUChar(
UChar_t c);
285 virtual void WriteShort(
Short_t s);
286 virtual void WriteUShort(
UShort_t s);
287 virtual void WriteInt(
Int_t i);
288 virtual void WriteUInt(
UInt_t i);
289 virtual void WriteLong(
Long_t l);
290 virtual void WriteULong(
ULong_t l);
291 virtual void WriteLong64(
Long64_t l);
293 virtual void WriteFloat(
Float_t f);
294 virtual void WriteDouble(
Double_t d);
295 virtual void WriteCharP(
const Char_t *c);
296 virtual void WriteTString(
const TString &s);
298 virtual void WriteStdString(
const std::string *s);
299 virtual void WriteCharStar(
char *s);
303 virtual UInt_t GetTRefExecId();
314 virtual Int_t ReadClassEmulated(
const TClass *cl,
void *
object,
const TClass *onfile_class);
315 virtual Int_t ReadClassBuffer(
const TClass *cl,
void *pointer,
const TClass *onfile_class);
317 virtual Int_t WriteClassBuffer(
const TClass *cl,
void *pointer);
324 static void SetGlobalReadParam(
Int_t mapsize);
325 static void SetGlobalWriteParam(
Int_t mapsize);
326 static Int_t GetGlobalReadParam();
327 static Int_t GetGlobalWriteParam();
338 if (fBufCur +
sizeof(
UChar_t) > fBufMax) AutoExpand(fBufSize+
sizeof(
UChar_t));
345 if (fBufCur +
sizeof(
Char_t) > fBufMax) AutoExpand(fBufSize+
sizeof(
Char_t));
352 if (fBufCur +
sizeof(
UChar_t) > fBufMax) AutoExpand(fBufSize+
sizeof(
UChar_t));
359 if (fBufCur +
sizeof(
Short_t) > fBufMax) AutoExpand(fBufSize+
sizeof(
Short_t));
366 if (fBufCur +
sizeof(
UShort_t) > fBufMax) AutoExpand(fBufSize+
sizeof(
UShort_t));
373 if (fBufCur +
sizeof(
Int_t) > fBufMax) AutoExpand(fBufSize+
sizeof(
Int_t));
380 if (fBufCur +
sizeof(
UInt_t) > fBufMax) AutoExpand(fBufSize+
sizeof(
UInt_t));
387 if (fBufCur +
sizeof(
Long_t) > fBufMax) AutoExpand(fBufSize+
sizeof(
Long_t));
394 if (fBufCur +
sizeof(
ULong_t) > fBufMax) AutoExpand(fBufSize+
sizeof(
ULong_t));
401 if (fBufCur +
sizeof(
Long64_t) > fBufMax) AutoExpand(fBufSize+
sizeof(
Long64_t));
415 if (fBufCur +
sizeof(
Float_t) > fBufMax) AutoExpand(fBufSize+
sizeof(
Float_t));
422 if (fBufCur +
sizeof(
Double_t) > fBufMax) AutoExpand(fBufSize+
sizeof(
Double_t));
Describe Streamer information for one class version.
void frombuf(char *&buf, Bool_t *x)
virtual Int_t ReadArray(Bool_t *&b)
Read array of bools from the I/O buffer.
The concrete implementation of TBuffer for writing/reading to/from a ROOT file or socket...
void SetBufferDisplacement()
Int_t GetBufferDisplacement() const
char *(* ReAllocCharFun_t)(char *, size_t, size_t)
static Int_t fgMapSize
Default map size for all TBuffer objects.
Buffer base class used for serializing objects.
std::vector< TStreamerInfo * > InfoList_t
virtual void ReadChar(Char_t &c)
virtual void ClassMember(const char *, const char *=0, Int_t=-1, Int_t=-1)
virtual void ReadUInt(UInt_t &i)
virtual void ReadLong(Long_t &l)
Read Long from TBuffer.
virtual void WriteBool(Bool_t b)
INLINE_TEMPLATE_ARGS Int_t ReadTString(TBuffer &buf, void *addr, const TConfiguration *config)
virtual void WriteULong(ULong_t l)
virtual void WriteULong64(ULong64_t l)
virtual void ReadFloat(Float_t &f)
virtual void WriteUChar(UChar_t c)
Int_t fDisplacement
Value to be added to the map offsets.
virtual void WriteUShort(UShort_t s)
virtual void ReadLong64(Long64_t &l)
TExMap * fMap
Map containing object,offset pairs for reading/writing.
virtual void ReadInt(Int_t &i)
#define ClassDef(name, id)
virtual void ReadStdString(std::string *s)=0
virtual void SetStreamerElementNumber(TStreamerElement *, Int_t)
virtual void ReadUChar(UChar_t &c)
void tobuf(char *&buf, Bool_t x)
A TProcessID identifies a ROOT job in a unique way in time and space.
virtual void WriteShort(Short_t s)
UShort_t GetPidOffset() const
virtual void ReadULong64(ULong64_t &l)
Int_t fMapCount
Number of objects or classes in map.
TStreamerInfo * fInfo
Pointer to TStreamerInfo object writing/reading the buffer.
virtual void WriteUInt(UInt_t i)
virtual Int_t ReadStaticArray(Bool_t *b)
Read array of bools from the I/O buffer.
Wrapper around an object and giving indirect access to its content even if the object is not of a cla...
The ROOT global object gROOT contains a list of all defined classes.
virtual void WriteInt(Int_t i)
virtual void ReadCharP(Char_t *c)
virtual void ClassEnd(const TClass *)
virtual void WriteFloat(Float_t f)
UShort_t fPidOffset
Offset to be added to the pid index in this key/buffer.
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.
Int_t fMapSize
Default size of map.
virtual void WriteLong(Long_t l)
virtual void WriteObject(const TObject *obj, Bool_t cacheReuse)=0
unsigned long long ULong64_t
A TRefTable maintains the association between a referenced object and the parent object supporting th...
virtual void WriteDouble(Double_t d)
void SetBufferDisplacement(Int_t skipped)
static constexpr double s
Binding & operator=(OUT(*fun)(void))
Mother of all ROOT objects.
virtual void ReadBool(Bool_t &b)
virtual void WriteCharP(const Char_t *c)
An array of clone (identical) objects.
virtual void WriteLong64(Long64_t l)
virtual void ClassBegin(const TClass *, Version_t=-1)
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
virtual void ReadUShort(UShort_t &s)
InfoList_t fInfoStack
Stack of pointers to the TStreamerInfos.
Int_t GetMapCount() const
virtual void ReadShort(Short_t &s)
Abstract Interface class describing Streamer information for one class.
TVirtualStreamerInfo * GetInfo()
virtual void ReadULong(ULong_t &l)
virtual void WriteStdString(const std::string *s)=0
virtual void WriteChar(Char_t c)
This class stores a (key,value) pair using an external hash.
virtual void ReadFastArray(Bool_t *b, Int_t n)
Read array of n bools from the I/O buffer.
virtual void ReadDouble(Double_t &d)