Logo ROOT  
Reference Guide
TBufferFile.h
Go to the documentation of this file.
1 // @(#)root/io:$Id: 697641b2b52ed3d97bb5bde0fb5d2ff4a2f6c24f $
2 // Author: Rene Brun 17/01/2007
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TBufferFile
13 #define ROOT_TBufferFile
14 
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TBufferFile //
19 // //
20 // The concrete implementation of TBuffer for writing/reading to/from a //
21 // ROOT file or socket. //
22 // //
23 //////////////////////////////////////////////////////////////////////////
24 
25 #include "TBufferIO.h"
26 #include "Bytes.h"
27 
28 #include <vector>
29 #include <string>
30 
31 #ifdef R__OLDHPACC
32 namespace std {
33  using ::string;
34  using ::vector;
35 }
36 #endif
37 
39 class TStreamerInfo;
40 class TStreamerElement;
41 class TClass;
42 class TVirtualArray;
43 namespace TStreamerInfoActions {
44  class TActionSequence;
45 }
46 
47 class TBufferFile : public TBufferIO {
48 
49 protected:
50  typedef std::vector<TStreamerInfo*> InfoList_t;
51 
52  TStreamerInfo *fInfo{nullptr}; ///< Pointer to TStreamerInfo object writing/reading the buffer
53  InfoList_t fInfoStack; ///< Stack of pointers to the TStreamerInfos
54 
55  // Default ctor
56  TBufferFile() {} // NOLINT: not allowed to use = default because of TObject::kIsOnHeap detection, see ROOT-10300
57 
58  // TBuffer objects cannot be copied or assigned
59  TBufferFile(const TBufferFile &) = delete; ///< not implemented
60  void operator=(const TBufferFile &) = delete; ///< not implemented
61 
62  Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss, const char* classname);
63  void CheckCount(UInt_t offset) override;
64  UInt_t CheckObject(UInt_t offset, const TClass *cl, Bool_t readClass = kFALSE);
65 
66  void WriteObjectClass(const void *actualObjStart, const TClass *actualClass, Bool_t cacheReuse) override;
67 
68 public:
69  enum { kStreamedMemberWise = BIT(14) }; //added to version number to know if a collection has been stored member-wise
70 
72  TBufferFile(TBuffer::EMode mode, Int_t bufsiz);
73  TBufferFile(TBuffer::EMode mode, Int_t bufsiz, void *buf, Bool_t adopt = kTRUE, ReAllocCharFun_t reallocfunc = nullptr);
74  virtual ~TBufferFile();
75 
76  Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss) override;
77  Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const char *classname) override;
78  void SetByteCount(UInt_t cntpos, Bool_t packInVersion = kFALSE) override;
79 
80  void SkipVersion(const TClass *cl = nullptr) override;
81  Version_t ReadVersion(UInt_t *start = nullptr, UInt_t *bcnt = nullptr, const TClass *cl = nullptr) override;
82  Version_t ReadVersionNoCheckSum(UInt_t *start = nullptr, UInt_t *bcnt = nullptr) override;
83  Version_t ReadVersionForMemberWise(const TClass *cl = nullptr) override;
84  UInt_t WriteVersion(const TClass *cl, Bool_t useBcnt = kFALSE) override;
85  UInt_t WriteVersionMemberWise(const TClass *cl, Bool_t useBcnt = kFALSE) override;
86 
87  void *ReadObjectAny(const TClass* cast) override;
88  void SkipObjectAny() override;
89 
90  void IncrementLevel(TVirtualStreamerInfo* info) override;
92  void DecrementLevel(TVirtualStreamerInfo*) override;
94  void ClassBegin(const TClass*, Version_t = -1) override {}
95  void ClassEnd(const TClass*) override {}
96  void ClassMember(const char*, const char* = 0, Int_t = -1, Int_t = -1) override {}
97 
98  Int_t ReadBuf(void *buf, Int_t max) override;
99  void WriteBuf(const void *buf, Int_t max) override;
100 
101  char *ReadString(char *s, Int_t max) override;
102  void WriteString(const char *s) override;
103 
104  TClass *ReadClass(const TClass *cl = nullptr, UInt_t *objTag = nullptr) override;
105  void WriteClass(const TClass *cl) override;
106 
107  TObject *ReadObject(const TClass *cl) override;
108 
110 
111  // basic types and arrays of basic types
112  void ReadFloat16 (Float_t *f, TStreamerElement *ele = nullptr) override;
113  void WriteFloat16(Float_t *f, TStreamerElement *ele = nullptr) override;
114  void ReadDouble32 (Double_t *d, TStreamerElement *ele = nullptr) override;
115  void WriteDouble32(Double_t *d, TStreamerElement *ele = nullptr) override;
116  void ReadWithFactor(Float_t *ptr, Double_t factor, Double_t minvalue) override;
117  void ReadWithNbits(Float_t *ptr, Int_t nbits) override;
118  void ReadWithFactor(Double_t *ptr, Double_t factor, Double_t minvalue) override;
119  void ReadWithNbits(Double_t *ptr, Int_t nbits) override;
120 
121  Int_t ReadArray(Bool_t *&b) override;
122  Int_t ReadArray(Char_t *&c) override;
123  Int_t ReadArray(UChar_t *&c) override;
124  Int_t ReadArray(Short_t *&h) override;
125  Int_t ReadArray(UShort_t *&h) override;
126  Int_t ReadArray(Int_t *&i) override;
127  Int_t ReadArray(UInt_t *&i) override;
128  Int_t ReadArray(Long_t *&l) override;
129  Int_t ReadArray(ULong_t *&l) override;
130  Int_t ReadArray(Long64_t *&l) override;
131  Int_t ReadArray(ULong64_t *&l) override;
132  Int_t ReadArray(Float_t *&f) override;
133  Int_t ReadArray(Double_t *&d) override;
134  Int_t ReadArrayFloat16(Float_t *&f, TStreamerElement *ele = nullptr) override;
135  Int_t ReadArrayDouble32(Double_t *&d, TStreamerElement *ele = nullptr) override;
136 
137  Int_t ReadStaticArray(Bool_t *b) override;
138  Int_t ReadStaticArray(Char_t *c) override;
139  Int_t ReadStaticArray(UChar_t *c) override;
140  Int_t ReadStaticArray(Short_t *h) override;
141  Int_t ReadStaticArray(UShort_t *h) override;
142  Int_t ReadStaticArray(Int_t *i) override;
143  Int_t ReadStaticArray(UInt_t *i) override;
144  Int_t ReadStaticArray(Long_t *l) override;
145  Int_t ReadStaticArray(ULong_t *l) override;
146  Int_t ReadStaticArray(Long64_t *l) override;
147  Int_t ReadStaticArray(ULong64_t *l) override;
148  Int_t ReadStaticArray(Float_t *f) override;
149  Int_t ReadStaticArray(Double_t *d) override;
150  Int_t ReadStaticArrayFloat16(Float_t *f, TStreamerElement *ele = nullptr) override;
151  Int_t ReadStaticArrayDouble32(Double_t *d, TStreamerElement *ele = nullptr) override;
152 
153  void ReadFastArray(Bool_t *b, Int_t n) override;
154  void ReadFastArray(Char_t *c, Int_t n) override;
155  void ReadFastArrayString(Char_t *c, Int_t n) override;
156  void ReadFastArray(UChar_t *c, Int_t n) override;
157  void ReadFastArray(Short_t *h, Int_t n) override;
158  void ReadFastArray(UShort_t *h, Int_t n) override;
159  void ReadFastArray(Int_t *i, Int_t n) override;
160  void ReadFastArray(UInt_t *i, Int_t n) override;
161  void ReadFastArray(Long_t *l, Int_t n) override;
162  void ReadFastArray(ULong_t *l, Int_t n) override;
163  void ReadFastArray(Long64_t *l, Int_t n) override;
164  void ReadFastArray(ULong64_t *l, Int_t n) override;
165  void ReadFastArray(Float_t *f, Int_t n) override;
166  void ReadFastArray(Double_t *d, Int_t n) override;
167  void ReadFastArrayFloat16(Float_t *f, Int_t n, TStreamerElement *ele = nullptr) override;
168  void ReadFastArrayDouble32(Double_t *d, Int_t n, TStreamerElement *ele = nullptr) override;
169  void ReadFastArrayWithFactor(Float_t *ptr, Int_t n, Double_t factor, Double_t minvalue) override;
170  void ReadFastArrayWithNbits(Float_t *ptr, Int_t n, Int_t nbits) override;
171  void ReadFastArrayWithFactor(Double_t *ptr, Int_t n, Double_t factor, Double_t minvalue) override;
172  void ReadFastArrayWithNbits(Double_t *ptr, Int_t n, Int_t nbits) override;
173  void ReadFastArray(void *start , const TClass *cl, Int_t n=1, TMemberStreamer *s = nullptr, const TClass* onFileClass = nullptr) override;
174  void ReadFastArray(void **startp, const TClass *cl, Int_t n=1, Bool_t isPreAlloc=kFALSE, TMemberStreamer *s = nullptr, const TClass* onFileClass = nullptr) override;
175 
176  void WriteArray(const Bool_t *b, Int_t n) override;
177  void WriteArray(const Char_t *c, Int_t n) override;
178  void WriteArray(const UChar_t *c, Int_t n) override;
179  void WriteArray(const Short_t *h, Int_t n) override;
180  void WriteArray(const UShort_t *h, Int_t n) override;
181  void WriteArray(const Int_t *i, Int_t n) override;
182  void WriteArray(const UInt_t *i, Int_t n) override;
183  void WriteArray(const Long_t *l, Int_t n) override;
184  void WriteArray(const ULong_t *l, Int_t n) override;
185  void WriteArray(const Long64_t *l, Int_t n) override;
186  void WriteArray(const ULong64_t *l, Int_t n) override;
187  void WriteArray(const Float_t *f, Int_t n) override;
188  void WriteArray(const Double_t *d, Int_t n) override;
189  void WriteArrayFloat16(const Float_t *f, Int_t n, TStreamerElement *ele = nullptr) override;
190  void WriteArrayDouble32(const Double_t *d, Int_t n, TStreamerElement *ele = nullptr) override;
191 
192  void WriteFastArray(const Bool_t *b, Int_t n) override;
193  void WriteFastArray(const Char_t *c, Int_t n) override;
194  void WriteFastArrayString(const Char_t *c, Int_t n) override;
195  void WriteFastArray(const UChar_t *c, Int_t n) override;
196  void WriteFastArray(const Short_t *h, Int_t n) override;
197  void WriteFastArray(const UShort_t *h, Int_t n) override;
198  void WriteFastArray(const Int_t *i, Int_t n) override;
199  void WriteFastArray(const UInt_t *i, Int_t n) override;
200  void WriteFastArray(const Long_t *l, Int_t n) override;
201  void WriteFastArray(const ULong_t *l, Int_t n) override;
202  void WriteFastArray(const Long64_t *l, Int_t n) override;
203  void WriteFastArray(const ULong64_t *l, Int_t n) override;
204  void WriteFastArray(const Float_t *f, Int_t n) override;
205  void WriteFastArray(const Double_t *d, Int_t n) override;
206  void WriteFastArrayFloat16(const Float_t *f, Int_t n, TStreamerElement *ele = nullptr) override;
207  void WriteFastArrayDouble32(const Double_t *d, Int_t n, TStreamerElement *ele = nullptr) override;
208  void WriteFastArray(void *start, const TClass *cl, Int_t n=1, TMemberStreamer *s = nullptr) override;
209  Int_t WriteFastArray(void **startp, const TClass *cl, Int_t n=1, Bool_t isPreAlloc=kFALSE, TMemberStreamer *s = nullptr) override;
210 
211  void StreamObject(void *obj, const std::type_info &typeinfo, const TClass* onFileClass = nullptr) override;
212  void StreamObject(void *obj, const char *className, const TClass* onFileClass = nullptr) override;
213  void StreamObject(void *obj, const TClass *cl, const TClass* onFileClass = nullptr) override;
214  void StreamObject(TObject *obj) override;
215 
216  void ReadBool(Bool_t &b) override;
217  void ReadChar(Char_t &c) override;
218  void ReadUChar(UChar_t &c) override;
219  void ReadShort(Short_t &s) override;
220  void ReadUShort(UShort_t &s) override;
221  void ReadInt(Int_t &i) override;
222  void ReadUInt(UInt_t &i) override;
223  void ReadLong(Long_t &l) override;
224  void ReadULong(ULong_t &l) override;
225  void ReadLong64(Long64_t &l) override;
226  void ReadULong64(ULong64_t &l) override;
227  void ReadFloat(Float_t &f) override;
228  void ReadDouble(Double_t &d) override;
229  void ReadCharP(Char_t *c) override;
230  void ReadTString(TString &s) override;
231  void ReadStdString(std::string *s) override;
233  void ReadCharStar(char* &s) override;
234 
235  void WriteBool(Bool_t b) override;
236  void WriteChar(Char_t c) override;
237  void WriteUChar(UChar_t c) override;
238  void WriteShort(Short_t s) override;
239  void WriteUShort(UShort_t s) override;
240  void WriteInt(Int_t i) override;
241  void WriteUInt(UInt_t i) override;
242  void WriteLong(Long_t l) override;
243  void WriteULong(ULong_t l) override;
244  void WriteLong64(Long64_t l) override;
245  void WriteULong64(ULong64_t l) override;
246  void WriteFloat(Float_t f) override;
247  void WriteDouble(Double_t d) override;
248  void WriteCharP(const Char_t *c) override;
249  void WriteTString(const TString &s) override;
251  void WriteStdString(const std::string *s) override;
252  void WriteCharStar(char *s) override;
253 
254  // Utilities for TClass
255  Int_t ReadClassEmulated(const TClass *cl, void *object, const TClass *onfile_class) override;
256  Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class) override;
257  Int_t ReadClassBuffer(const TClass *cl, void *pointer, Int_t version, UInt_t start, UInt_t count, const TClass *onfile_class) override;
258  Int_t WriteClassBuffer(const TClass *cl, void *pointer) override;
259 
260  // Utilities to streamer using sequences.
261  Int_t ApplySequence(const TStreamerInfoActions::TActionSequence &sequence, void *object) override;
262  Int_t ApplySequenceVecPtr(const TStreamerInfoActions::TActionSequence &sequence, void *start_collection, void *end_collection) override;
263  Int_t ApplySequence(const TStreamerInfoActions::TActionSequence &sequence, void *start_collection, void *end_collection) override;
264 
265  ClassDefOverride(TBufferFile,0) //concrete implementation of TBuffer for writing/reading to/from a ROOT file or socket.
266 };
267 
268 
269 //---------------------- TBufferFile inlines ---------------------------------------
270 
271 //______________________________________________________________________________
273 {
274  if (fBufCur + sizeof(UChar_t) > fBufMax) AutoExpand(fBufSize+sizeof(UChar_t));
275  tobuf(fBufCur, b);
276 }
277 
278 //______________________________________________________________________________
280 {
281  if (fBufCur + sizeof(Char_t) > fBufMax) AutoExpand(fBufSize+sizeof(Char_t));
282  tobuf(fBufCur, c);
283 }
284 
285 //______________________________________________________________________________
287 {
288  if (fBufCur + sizeof(UChar_t) > fBufMax) AutoExpand(fBufSize+sizeof(UChar_t));
289  tobuf(fBufCur, (Char_t)c);
290 }
291 
292 //______________________________________________________________________________
294 {
295  if (fBufCur + sizeof(Short_t) > fBufMax) AutoExpand(fBufSize+sizeof(Short_t));
296  tobuf(fBufCur, h);
297 }
298 
299 //______________________________________________________________________________
301 {
302  if (fBufCur + sizeof(UShort_t) > fBufMax) AutoExpand(fBufSize+sizeof(UShort_t));
303  tobuf(fBufCur, (Short_t)h);
304 }
305 
306 //______________________________________________________________________________
308 {
309  if (fBufCur + sizeof(Int_t) > fBufMax) AutoExpand(fBufSize+sizeof(Int_t));
310  tobuf(fBufCur, i);
311 }
312 
313 //______________________________________________________________________________
315 {
316  if (fBufCur + sizeof(UInt_t) > fBufMax) AutoExpand(fBufSize+sizeof(UInt_t));
317  tobuf(fBufCur, (Int_t)i);
318 }
319 
320 //______________________________________________________________________________
322 {
323  if (fBufCur + sizeof(Long_t) > fBufMax) AutoExpand(fBufSize+sizeof(Long_t));
324  tobuf(fBufCur, l);
325 }
326 
327 //______________________________________________________________________________
329 {
330  if (fBufCur + sizeof(ULong_t) > fBufMax) AutoExpand(fBufSize+sizeof(ULong_t));
331  tobuf(fBufCur, (Long_t)l);
332 }
333 
334 //______________________________________________________________________________
336 {
337  if (fBufCur + sizeof(Long64_t) > fBufMax) AutoExpand(fBufSize+sizeof(Long64_t));
338  tobuf(fBufCur, ll);
339 }
340 
341 //______________________________________________________________________________
343 {
344  if (fBufCur + sizeof(ULong64_t) > fBufMax) AutoExpand(fBufSize+sizeof(ULong64_t));
345  tobuf(fBufCur, (Long64_t)ll);
346 }
347 
348 //______________________________________________________________________________
350 {
351  if (fBufCur + sizeof(Float_t) > fBufMax) AutoExpand(fBufSize+sizeof(Float_t));
352  tobuf(fBufCur, f);
353 }
354 
355 //______________________________________________________________________________
357 {
358  if (fBufCur + sizeof(Double_t) > fBufMax) AutoExpand(fBufSize+sizeof(Double_t));
359  tobuf(fBufCur, d);
360 }
361 
362 //______________________________________________________________________________
363 inline void TBufferFile::WriteCharP(const Char_t *c)
364 {
365  WriteString(c);
366 }
367 
368 //______________________________________________________________________________
370 {
371  frombuf(fBufCur, &b);
372 }
373 
374 //______________________________________________________________________________
376 {
377  frombuf(fBufCur, &c);
378 }
379 
380 //______________________________________________________________________________
382 {
384 }
385 
386 //______________________________________________________________________________
388 {
389  frombuf(fBufCur, &h);
390 }
391 
392 //______________________________________________________________________________
394 {
396 }
397 
398 //______________________________________________________________________________
400 {
401  frombuf(fBufCur, &i);
402 }
403 
404 //______________________________________________________________________________
406 {
408 }
409 
410 
411 // in implementation file because special case with old version
412 //______________________________________________________________________________
413 //inline void TBufferFile::ReadLong(Long_t &ll)
414 //{
415 // frombuf(fBufCur, &ll);
416 //}
417 
418 //______________________________________________________________________________
420 {
422 }
423 
424 
425 //______________________________________________________________________________
427 {
428  frombuf(fBufCur, &ll);
429 }
430 
431 //______________________________________________________________________________
433 {
435 }
436 
437 //______________________________________________________________________________
439 {
440  frombuf(fBufCur, &f);
441 }
442 
443 //______________________________________________________________________________
445 {
446  frombuf(fBufCur, &d);
447 }
448 
449 //______________________________________________________________________________
451 {
452  ReadString(c, -1);
453 }
454 
455 //______________________________________________________________________________
457  { return TBufferFile::ReadArray((Char_t *&)c); }
458 //______________________________________________________________________________
460  { return TBufferFile::ReadArray((Short_t *&)h); }
461 //______________________________________________________________________________
463  { return TBufferFile::ReadArray((Int_t *&)i); }
464 //______________________________________________________________________________
466  { return TBufferFile::ReadArray((Long_t *&)l); }
467 //______________________________________________________________________________
469  { return TBufferFile::ReadArray((Long64_t *&)ll); }
470 
471 //______________________________________________________________________________
473  { return TBufferFile::ReadStaticArray((Char_t *)c); }
474 //______________________________________________________________________________
476  { return TBufferFile::ReadStaticArray((Short_t *)h); }
477 //______________________________________________________________________________
479  { return TBufferFile::ReadStaticArray((Int_t *)i); }
480 //______________________________________________________________________________
482  { return TBufferFile::ReadStaticArray((Long_t *)l); }
483 //______________________________________________________________________________
485  { return TBufferFile::ReadStaticArray((Long64_t *)ll); }
486 
487 //______________________________________________________________________________
490 //______________________________________________________________________________
493 //______________________________________________________________________________
496 //______________________________________________________________________________
499 //______________________________________________________________________________
502 
503 //______________________________________________________________________________
505  { TBufferFile::WriteArray((const Char_t *)c, n); }
506 //______________________________________________________________________________
508  { TBufferFile::WriteArray((const Short_t *)h, n); }
509 //______________________________________________________________________________
510 inline void TBufferFile::WriteArray(const UInt_t *i, Int_t n)
511  { TBufferFile::WriteArray((const Int_t *)i, n); }
512 //______________________________________________________________________________
513 inline void TBufferFile::WriteArray(const ULong64_t *ll, Int_t n)
514  { TBufferFile::WriteArray((const Long64_t *)ll, n); }
515 
516 //______________________________________________________________________________
518  { TBufferFile::WriteFastArray((const Char_t *)c, n); }
519 //______________________________________________________________________________
521  { TBufferFile::WriteFastArray((const Short_t *)h, n); }
522 //______________________________________________________________________________
524  { TBufferFile::WriteFastArray((const Int_t *)i, n); }
525 //______________________________________________________________________________
527  { TBufferFile::WriteFastArray((const Long64_t *)ll, n); }
528 
529 #endif
c
#define c(i)
Definition: RSha256.hxx:119
l
auto * l
Definition: textangle.C:4
TBufferFile::ReadFastArrayString
void ReadFastArrayString(Char_t *c, Int_t n) override
Read array of n characters from the I/O buffer.
Definition: TBufferFile.cxx:1269
n
const Int_t n
Definition: legend1.C:16
TBufferFile::ReadFastArrayWithNbits
void ReadFastArrayWithNbits(Float_t *ptr, Int_t n, Int_t nbits) override
Read array of n floats (written as truncated float) from the I/O buffer.
Definition: TBufferFile.cxx:1468
TBufferFile::operator=
void operator=(const TBufferFile &)=delete
not implemented
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
TBufferFile::ReadUChar
void ReadUChar(UChar_t &c) override
Definition: TBufferFile.h:381
TBufferFile::WriteVersion
UInt_t WriteVersion(const TClass *cl, Bool_t useBcnt=kFALSE) override
Write class version to I/O buffer.
Definition: TBufferFile.cxx:2977
TBufferFile::ReadStaticArray
Int_t ReadStaticArray(Bool_t *b) override
Read array of bools from the I/O buffer.
Definition: TBufferFile.cxx:975
Version_t
short Version_t
Definition: RtypesCore.h:65
TBuffer::ReadStdString
virtual void ReadStdString(std::string *s)=0
f
#define f(i)
Definition: RSha256.hxx:122
TBufferFile::WriteArrayFloat16
void WriteArrayFloat16(const Float_t *f, Int_t n, TStreamerElement *ele=nullptr) override
Write array of n floats (as truncated float) into the I/O buffer.
Definition: TBufferFile.cxx:1901
TBufferFile::ReadFastArrayWithFactor
void ReadFastArrayWithFactor(Float_t *ptr, Int_t n, Double_t factor, Double_t minvalue) override
Read array of n floats (written as truncated float) from the I/O buffer.
Definition: TBufferFile.cxx:1454
TBufferFile::ReadDouble32
void ReadDouble32(Double_t *d, TStreamerElement *ele=nullptr) override
Read a Double32_t from the buffer, see comments about Double32_t encoding at TBufferFile::WriteDouble...
Definition: TBufferFile.cxx:448
TBufferFile::ReadTString
void ReadTString(TString &s) override
Read TString from TBuffer.
Definition: TBufferFile.cxx:185
TBuffer::fBufCur
char * fBufCur
Definition: TBuffer.h:52
UShort_t
unsigned short UShort_t
Definition: RtypesCore.h:40
TBufferFile::WriteDouble
void WriteDouble(Double_t d) override
Definition: TBufferFile.h:356
TBufferFile::ClassMember
void ClassMember(const char *, const char *=0, Int_t=-1, Int_t=-1) override
Definition: TBufferFile.h:96
TBufferFile::WriteVersionMemberWise
UInt_t WriteVersionMemberWise(const TClass *cl, Bool_t useBcnt=kFALSE) override
Write class version to I/O buffer after setting the kStreamedMemberWise bit in the version number.
Definition: TBufferFile.cxx:3007
TBufferFile::CheckByteCount
Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss, const char *classname)
Check byte count with current buffer position.
Definition: TBufferFile.cxx:355
tobuf
void tobuf(char *&buf, Bool_t x)
Definition: Bytes.h:55
TBufferFile::SetStreamerElementNumber
void SetStreamerElementNumber(TStreamerElement *, Int_t) override
Definition: TBufferFile.h:91
TBufferFile::ReadUShort
void ReadUShort(UShort_t &s) override
Definition: TBufferFile.h:393
Long64_t
long long Long64_t
Definition: RtypesCore.h:73
TBufferFile::WriteChar
void WriteChar(Char_t c) override
Definition: TBufferFile.h:279
TBufferFile::WriteFastArray
void WriteFastArray(const Bool_t *b, Int_t n) override
Write array of n bools into the I/O buffer.
Definition: TBufferFile.cxx:1940
Float_t
float Float_t
Definition: RtypesCore.h:57
TGeant4Unit::s
static constexpr double s
Definition: TGeant4SystemOfUnits.h:168
TBufferFile::WriteArray
void WriteArray(const Bool_t *b, Int_t n) override
Write array of n bools into the I/O buffer.
Definition: TBufferFile.cxx:1677
TBufferFile::ReadClass
TClass * ReadClass(const TClass *cl=nullptr, UInt_t *objTag=nullptr) override
Read class definition from I/O buffer.
Definition: TBufferFile.cxx:2565
Int_t
int Int_t
Definition: RtypesCore.h:45
TBufferIO::CheckObject
Bool_t CheckObject(const TObject *obj) override
Check if the specified object is already in the buffer.
Definition: TBufferIO.cxx:225
TBuffer::WriteStdString
virtual void WriteStdString(const std::string *s)=0
TBufferFile::WriteFastArrayDouble32
void WriteFastArrayDouble32(const Double_t *d, Int_t n, TStreamerElement *ele=nullptr) override
Write array of n doubles (as float) into the I/O buffer.
Definition: TBufferFile.cxx:2184
TBufferFile::ReadFastArrayDouble32
void ReadFastArrayDouble32(Double_t *d, Int_t n, TStreamerElement *ele=nullptr) override
Read array of n doubles (written as float) from the I/O buffer.
Definition: TBufferFile.cxx:1496
TBuffer::fBufMax
char * fBufMax
Definition: TBuffer.h:53
ReAllocCharFun_t
char *(* ReAllocCharFun_t)(char *, size_t, size_t)
Definition: TStorage.h:30
TBufferFile::WriteObjectClass
void WriteObjectClass(const void *actualObjStart, const TClass *actualClass, Bool_t cacheReuse) override
Write object to I/O buffer.
Definition: TBufferFile.cxx:2488
TVirtualArray
Definition: TVirtualArray.h:26
TBufferFile::CheckObject
UInt_t CheckObject(UInt_t offset, const TClass *cl, Bool_t readClass=kFALSE)
Check for object in the read map.
Definition: TBufferFile.cxx:3090
TBufferFile::ReadArrayFloat16
Int_t ReadArrayFloat16(Float_t *&f, TStreamerElement *ele=nullptr) override
Read array of floats (written as truncated float) from the I/O buffer.
Definition: TBufferFile.cxx:933
TBufferFile::ReadArrayDouble32
Int_t ReadArrayDouble32(Double_t *&d, TStreamerElement *ele=nullptr) override
Read array of doubles (written as float) from the I/O buffer.
Definition: TBufferFile.cxx:955
TBufferFile::ReadString
char * ReadString(char *s, Int_t max) override
Read string from I/O buffer.
Definition: TBufferFile.cxx:3201
TBufferFile::WriteInt
void WriteInt(Int_t i) override
Definition: TBufferFile.h:307
TBufferFile::WriteBuf
void WriteBuf(const void *buf, Int_t max) override
Write max bytes from buf into the I/O buffer.
Definition: TBufferFile.cxx:3183
TBufferFile::StreamObject
void StreamObject(void *obj, const std::type_info &typeinfo, const TClass *onFileClass=nullptr) override
Stream an object given its C++ typeinfo information.
Definition: TBufferFile.cxx:3038
TBufferFile::WriteCharP
void WriteCharP(const Char_t *c) override
Definition: TBufferFile.h:363
TString
Definition: TString.h:136
ClassDefOverride
#define ClassDefOverride(name, id)
Definition: Rtypes.h:329
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
TBufferFile::WriteTString
void WriteTString(const TString &s) override
Write TString to TBuffer.
Definition: TBufferFile.cxx:210
b
#define b(i)
Definition: RSha256.hxx:118
TBufferFile::TBufferFile
TBufferFile()
Definition: TBufferFile.h:56
TVirtualStreamerInfo
Definition: TVirtualStreamerInfo.h:37
bool
TBufferFile::IncrementLevel
void IncrementLevel(TVirtualStreamerInfo *info) override
Increment level.
Definition: TBufferFile.cxx:119
TBufferFile::InfoList_t
std::vector< TStreamerInfo * > InfoList_t
Definition: TBufferFile.h:50
TBufferFile::WriteClassBuffer
Int_t WriteClassBuffer(const TClass *cl, void *pointer) override
Function called by the Streamer functions to serialize object at p to buffer b.
Definition: TBufferFile.cxx:3502
TBufferFile::WriteCharStar
void WriteCharStar(char *s) override
Write char* into TBuffer.
Definition: TBufferFile.cxx:301
TBufferFile::ReadInt
void ReadInt(Int_t &i) override
Definition: TBufferFile.h:399
TBufferFile::WriteUChar
void WriteUChar(UChar_t c) override
Definition: TBufferFile.h:286
TBufferFile::ReadChar
void ReadChar(Char_t &c) override
Definition: TBufferFile.h:375
TBufferFile::ReadULong
void ReadULong(ULong_t &l) override
Definition: TBufferFile.h:419
TBufferFile::ReadDouble
void ReadDouble(Double_t &d) override
Definition: TBufferFile.h:444
TBufferFile::ReadVersionNoCheckSum
Version_t ReadVersionNoCheckSum(UInt_t *start=nullptr, UInt_t *bcnt=nullptr) override
Read class version from I/O buffer, when the caller knows for sure that there is no checksum written/...
Definition: TBufferFile.cxx:2866
TBufferFile::WriteDouble32
void WriteDouble32(Double_t *d, TStreamerElement *ele=nullptr) override
Write a Double32_t to the buffer.
Definition: TBufferFile.cxx:653
TBufferFile::WriteBool
void WriteBool(Bool_t b) override
Definition: TBufferFile.h:272
TBufferFile::WriteStdString
void WriteStdString(const std::string *s) override
Write std::string to TBuffer.
Definition: TBufferFile.cxx:260
TBufferFile::SkipVersion
void SkipVersion(const TClass *cl=nullptr) override
Skip class version from I/O buffer.
Definition: TBufferFile.cxx:2689
TBufferFile::ReadCharP
void ReadCharP(Char_t *c) override
Definition: TBufferFile.h:450
TBufferFile::WriteClass
void WriteClass(const TClass *cl) override
Write class description to I/O buffer.
Definition: TBufferFile.cxx:2651
TBufferIO.h
TBuffer::EMode
EMode
Definition: TBuffer.h:73
TStreamerInfo
Definition: TStreamerInfo.h:44
TBufferFile::WriteLong64
void WriteLong64(Long64_t l) override
Definition: TBufferFile.h:335
TBufferFile::ReadBuf
Int_t ReadBuf(void *buf, Int_t max) override
Read max bytes from the I/O buffer into buf.
Definition: TBufferFile.cxx:3166
h
#define h(i)
Definition: RSha256.hxx:124
TBufferFile::ClassEnd
void ClassEnd(const TClass *) override
Definition: TBufferFile.h:95
TStreamerInfoActions
Definition: TBuffer.h:39
TBufferFile::ReadVersionForMemberWise
Version_t ReadVersionForMemberWise(const TClass *cl=nullptr) override
Read class version from I/O buffer.
Definition: TBufferFile.cxx:2909
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
Long_t
long Long_t
Definition: RtypesCore.h:54
TBufferFile::ReadObjectAny
void * ReadObjectAny(const TClass *cast) override
Read object from I/O buffer.
Definition: TBufferFile.cxx:2348
TBufferFile::WriteShort
void WriteShort(Short_t s) override
Definition: TBufferFile.h:293
BIT
#define BIT(n)
Definition: Rtypes.h:85
TBufferFile::GetInfo
TVirtualStreamerInfo * GetInfo() override
Definition: TBufferFile.h:93
UInt_t
unsigned int UInt_t
Definition: RtypesCore.h:46
ULong_t
unsigned long ULong_t
Definition: RtypesCore.h:55
Short_t
short Short_t
Definition: RtypesCore.h:39
TBufferFile::WriteFastArrayString
void WriteFastArrayString(const Char_t *c, Int_t n) override
Write array of n characters into the I/O buffer.
Definition: TBufferFile.cxx:1973
TBufferFile::fInfo
TStreamerInfo * fInfo
Pointer to TStreamerInfo object writing/reading the buffer.
Definition: TBufferFile.h:52
TBufferFile::WriteFloat
void WriteFloat(Float_t f) override
Definition: TBufferFile.h:349
TBufferFile::ReadFastArrayFloat16
void ReadFastArrayFloat16(Float_t *f, Int_t n, TStreamerElement *ele=nullptr) override
Read array of n floats (written as truncated float) from the I/O buffer.
Definition: TBufferFile.cxx:1414
TBufferFile::kStreamedMemberWise
@ kStreamedMemberWise
Definition: TBufferFile.h:69
TBufferFile::ReadStaticArrayFloat16
Int_t ReadStaticArrayFloat16(Float_t *f, TStreamerElement *ele=nullptr) override
Read array of floats (written as truncated float) from the I/O buffer.
Definition: TBufferFile.cxx:1200
TBufferFile::ReadClassBuffer
Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class) override
Deserialize information from a buffer into an object.
Definition: TBufferFile.cxx:3360
unsigned int
TBufferIO
Definition: TBufferIO.h:30
TBufferFile::ReadFastArray
void ReadFastArray(Bool_t *b, Int_t n) override
Read array of n bools from the I/O buffer.
Definition: TBufferFile.cxx:1240
ULong64_t
unsigned long long ULong64_t
Definition: RtypesCore.h:74
TBufferFile::WriteFloat16
void WriteFloat16(Float_t *f, TStreamerElement *ele=nullptr) override
Write a Float16_t to the buffer.
Definition: TBufferFile.cxx:589
TBufferFile::WriteUShort
void WriteUShort(UShort_t s) override
Definition: TBufferFile.h:300
Double_t
double Double_t
Definition: RtypesCore.h:59
TBufferFile::WriteULong
void WriteULong(ULong_t l) override
Definition: TBufferFile.h:328
TBuffer::fBufSize
Int_t fBufSize
Definition: TBuffer.h:50
TBufferFile::SetByteCount
void SetByteCount(UInt_t cntpos, Bool_t packInVersion=kFALSE) override
Set byte count at position cntpos in the buffer.
Definition: TBufferFile.cxx:318
TBufferFile::ApplySequenceVecPtr
Int_t ApplySequenceVecPtr(const TStreamerInfoActions::TActionSequence &sequence, void *start_collection, void *end_collection) override
Read one collection of objects from the buffer using the StreamerInfoLoopAction.
Definition: TBufferFile.cxx:3574
TBufferFile::WriteLong
void WriteLong(Long_t l) override
Definition: TBufferFile.h:321
TClass
Definition: TClass.h:80
TBufferFile::ReadStaticArrayDouble32
Int_t ReadStaticArrayDouble32(Double_t *d, TStreamerElement *ele=nullptr) override
Read array of doubles (written as float) from the I/O buffer.
Definition: TBufferFile.cxx:1221
frombuf
void frombuf(char *&buf, Bool_t *x)
Definition: Bytes.h:278
TBufferFile::WriteFastArrayFloat16
void WriteFastArrayFloat16(const Float_t *f, Int_t n, TStreamerElement *ele=nullptr) override
Write array of n floats (as truncated float) into the I/O buffer.
Definition: TBufferFile.cxx:2133
UChar_t
unsigned char UChar_t
Definition: RtypesCore.h:38
TObject
Definition: TObject.h:37
Bytes.h
TBufferFile::SkipObjectAny
void SkipObjectAny() override
Skip any kind of object from buffer.
Definition: TBufferFile.cxx:2328
TBufferFile::ReadCharStar
void ReadCharStar(char *&s) override
Read char* from TBuffer.
Definition: TBufferFile.cxx:284
d
#define d(i)
Definition: RSha256.hxx:120
TBufferFile::WriteArrayDouble32
void WriteArrayDouble32(const Double_t *d, Int_t n, TStreamerElement *ele=nullptr) override
Write array of n doubles (as float) into the I/O buffer.
Definition: TBufferFile.cxx:1921
TBufferFile::ReadStdString
void ReadStdString(std::string *s) override
Read std::string from TBuffer.
Definition: TBufferFile.cxx:229
TBufferFile::ReadWithNbits
void ReadWithNbits(Float_t *ptr, Int_t nbits) override
Read a Float16_t from the buffer when the number of bits is specified (explicitly or not) see comment...
Definition: TBufferFile.cxx:482
TBufferFile::ReadClassEmulated
Int_t ReadClassEmulated(const TClass *cl, void *object, const TClass *onfile_class) override
Read emulated class.
Definition: TBufferFile.cxx:3236
TBufferFile::ApplySequence
Int_t ApplySequence(const TStreamerInfoActions::TActionSequence &sequence, void *object) override
Read one collection of objects from the buffer using the StreamerInfoLoopAction.
Definition: TBufferFile.cxx:3545
TBufferFile::ReadFloat16
void ReadFloat16(Float_t *f, TStreamerElement *ele=nullptr) override
Read a Float16_t from the buffer, see comments about Float16_t encoding at TBufferFile::WriteFloat16(...
Definition: TBufferFile.cxx:432
TBufferFile::ClassBegin
void ClassBegin(const TClass *, Version_t=-1) override
Definition: TBufferFile.h:94
TBufferFile::ReadFloat
void ReadFloat(Float_t &f) override
Definition: TBufferFile.h:438
TBufferFile::ReadULong64
void ReadULong64(ULong64_t &l) override
Definition: TBufferFile.h:432
TBuffer::AutoExpand
void AutoExpand(Int_t size_needed)
Automatically calculate a new size and expand the buffer to fit at least size_needed.
Definition: TBuffer.cxx:158
TBufferFile::WriteULong64
void WriteULong64(ULong64_t l) override
Definition: TBufferFile.h:342
TMemberStreamer
Definition: TMemberStreamer.h:26
TBufferFile::ReadBool
void ReadBool(Bool_t &b) override
Definition: TBufferFile.h:369
TStreamerInfoActions::TActionSequence
Definition: TStreamerInfoActions.h:172
TBufferFile::ReadWithFactor
void ReadWithFactor(Float_t *ptr, Double_t factor, Double_t minvalue) override
Read a Float16_t from the buffer when the factor and minimum value have been specified see comments a...
Definition: TBufferFile.cxx:470
TBufferFile::ReadUInt
void ReadUInt(UInt_t &i) override
Definition: TBufferFile.h:405
TBufferFile::ReadLong
void ReadLong(Long_t &l) override
Read Long from TBuffer.
Definition: TBufferFile.cxx:172
TBufferFile::ReadObject
TObject * ReadObject(const TClass *cl) override
Read object from I/O buffer.
Definition: TBufferFile.cxx:2320
TBufferFile::fInfoStack
InfoList_t fInfoStack
Stack of pointers to the TStreamerInfos.
Definition: TBufferFile.h:53
Char_t
char Char_t
Definition: RtypesCore.h:33
TBufferFile::ReadArray
Int_t ReadArray(Bool_t *&b) override
Read array of bools from the I/O buffer.
Definition: TBufferFile.cxx:700
TBufferFile::WriteUInt
void WriteUInt(UInt_t i) override
Definition: TBufferFile.h:314
TBufferFile
Definition: TBufferFile.h:47
TStreamerElement
Definition: TStreamerElement.h:33
TBufferFile::ReadLong64
void ReadLong64(Long64_t &l) override
Definition: TBufferFile.h:426
TBufferFile::DecrementLevel
void DecrementLevel(TVirtualStreamerInfo *) override
Decrement level.
Definition: TBufferFile.cxx:128
TBufferFile::ReadVersion
Version_t ReadVersion(UInt_t *start=nullptr, UInt_t *bcnt=nullptr, const TClass *cl=nullptr) override
Read class version from I/O buffer.
Definition: TBufferFile.cxx:2760
TBufferFile::~TBufferFile
virtual ~TBufferFile()
Delete an I/O buffer object.
Definition: TBufferFile.cxx:112
TBufferFile::WriteString
void WriteString(const char *s) override
Write string to I/O buffer.
Definition: TBufferFile.cxx:3228
TBufferFile::ReadShort
void ReadShort(Short_t &s) override
Definition: TBufferFile.h:387
int
TBufferFile::CheckCount
void CheckCount(UInt_t offset) override
Check if offset is not too large (< kMaxMapCount) when writing.
Definition: TBufferFile.cxx:3074