Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
32namespace std {
33 using ::string;
34 using ::vector;
35}
36#endif
37
39class TStreamerInfo;
41class TClass;
42class TVirtualArray;
43namespace TStreamerInfoActions {
44 class TActionSequence;
45}
46
47class TBufferFile : public TBufferIO {
48
49protected:
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;
65
66 void WriteObjectClass(const void *actualObjStart, const TClass *actualClass, Bool_t cacheReuse) override;
68
69public:
70 enum { kStreamedMemberWise = BIT(14) }; //added to version number to know if a collection has been stored member-wise
71
75 ~TBufferFile() override;
76
78 Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const char *classname) override;
80
81 void SkipVersion(const TClass *cl = nullptr) override;
82 Version_t ReadVersion(UInt_t *start = nullptr, UInt_t *bcnt = nullptr, const TClass *cl = nullptr) override;
83 Version_t ReadVersionNoCheckSum(UInt_t *start = nullptr, UInt_t *bcnt = nullptr) override;
84 Version_t ReadVersionForMemberWise(const TClass *cl = nullptr) override;
85 UInt_t WriteVersion(const TClass *cl, Bool_t useBcnt = kFALSE) override;
87
88 void *ReadObjectAny(const TClass* cast) override;
89 void SkipObjectAny() override;
90
95 void ClassBegin(const TClass*, Version_t = -1) override {}
96 void ClassEnd(const TClass*) override {}
97 void ClassMember(const char*, const char * = nullptr, Int_t = -1, Int_t = -1) override {}
98
99 Int_t ReadBuf(void *buf, Int_t max) override;
100 void WriteBuf(const void *buf, Int_t max) override;
101
102 char *ReadString(char *s, Int_t max) override;
103 void WriteString(const char *s) override;
104
105 TClass *ReadClass(const TClass *cl = nullptr, UInt_t *objTag = nullptr) override;
106 void WriteClass(const TClass *cl) override;
107
108 TObject *ReadObject(const TClass *cl) override;
109
111
112 // basic types and arrays of basic types
113 void ReadFloat16 (Float_t *f, TStreamerElement *ele = nullptr) override;
114 void WriteFloat16(Float_t *f, TStreamerElement *ele = nullptr) override;
115 void ReadDouble32 (Double_t *d, TStreamerElement *ele = nullptr) override;
116 void WriteDouble32(Double_t *d, TStreamerElement *ele = nullptr) override;
117 void ReadWithFactor(Float_t *ptr, Double_t factor, Double_t minvalue) override;
118 void ReadWithNbits(Float_t *ptr, Int_t nbits) override;
119 void ReadWithFactor(Double_t *ptr, Double_t factor, Double_t minvalue) override;
120 void ReadWithNbits(Double_t *ptr, Int_t nbits) override;
121
122 Int_t ReadArray(Bool_t *&b) override;
123 Int_t ReadArray(Char_t *&c) override;
124 Int_t ReadArray(UChar_t *&c) override;
125 Int_t ReadArray(Short_t *&h) override;
126 Int_t ReadArray(UShort_t *&h) override;
127 Int_t ReadArray(Int_t *&i) override;
128 Int_t ReadArray(UInt_t *&i) override;
129 Int_t ReadArray(Long_t *&l) override;
130 Int_t ReadArray(ULong_t *&l) override;
131 Int_t ReadArray(Long64_t *&l) override;
132 Int_t ReadArray(ULong64_t *&l) override;
133 Int_t ReadArray(Float_t *&f) override;
134 Int_t ReadArray(Double_t *&d) override;
135 Int_t ReadArrayFloat16(Float_t *&f, TStreamerElement *ele = nullptr) override;
136 Int_t ReadArrayDouble32(Double_t *&d, TStreamerElement *ele = nullptr) override;
137
138 Int_t ReadStaticArray(Bool_t *b) override;
139 Int_t ReadStaticArray(Char_t *c) override;
140 Int_t ReadStaticArray(UChar_t *c) override;
141 Int_t ReadStaticArray(Short_t *h) override;
142 Int_t ReadStaticArray(UShort_t *h) override;
143 Int_t ReadStaticArray(Int_t *i) override;
144 Int_t ReadStaticArray(UInt_t *i) override;
145 Int_t ReadStaticArray(Long_t *l) override;
146 Int_t ReadStaticArray(ULong_t *l) override;
147 Int_t ReadStaticArray(Long64_t *l) override;
148 Int_t ReadStaticArray(ULong64_t *l) override;
149 Int_t ReadStaticArray(Float_t *f) override;
150 Int_t ReadStaticArray(Double_t *d) override;
153
154 void ReadFastArray(Bool_t *b, Int_t n) override;
155 void ReadFastArray(Char_t *c, Int_t n) override;
156 void ReadFastArrayString(Char_t *c, Int_t n) override;
157 void ReadFastArray(UChar_t *c, Int_t n) override;
158 void ReadFastArray(Short_t *h, Int_t n) override;
159 void ReadFastArray(UShort_t *h, Int_t n) override;
160 void ReadFastArray(Int_t *i, Int_t n) override;
161 void ReadFastArray(UInt_t *i, Int_t n) override;
162 void ReadFastArray(Long_t *l, Int_t n) override;
163 void ReadFastArray(ULong_t *l, Int_t n) override;
164 void ReadFastArray(Long64_t *l, Int_t n) override;
165 void ReadFastArray(ULong64_t *l, Int_t n) override;
166 void ReadFastArray(Float_t *f, Int_t n) override;
167 void ReadFastArray(Double_t *d, Int_t n) override;
168 void ReadFastArrayFloat16(Float_t *f, Int_t n, TStreamerElement *ele = nullptr) override;
169 void ReadFastArrayDouble32(Double_t *d, Int_t n, TStreamerElement *ele = nullptr) override;
170 void ReadFastArrayWithFactor(Float_t *ptr, Int_t n, Double_t factor, Double_t minvalue) override;
171 void ReadFastArrayWithNbits(Float_t *ptr, Int_t n, Int_t nbits) override;
172 void ReadFastArrayWithFactor(Double_t *ptr, Int_t n, Double_t factor, Double_t minvalue) override;
173 void ReadFastArrayWithNbits(Double_t *ptr, Int_t n, Int_t nbits) override;
174 void ReadFastArray(void *start , const TClass *cl, Int_t n=1, TMemberStreamer *s = nullptr, const TClass* onFileClass = nullptr) override;
175 void ReadFastArray(void **startp, const TClass *cl, Int_t n=1, Bool_t isPreAlloc=kFALSE, TMemberStreamer *s = nullptr, const TClass* onFileClass = nullptr) override;
176
177 void WriteArray(const Bool_t *b, Int_t n) override;
178 void WriteArray(const Char_t *c, Int_t n) override;
179 void WriteArray(const UChar_t *c, Int_t n) override;
180 void WriteArray(const Short_t *h, Int_t n) override;
181 void WriteArray(const UShort_t *h, Int_t n) override;
182 void WriteArray(const Int_t *i, Int_t n) override;
183 void WriteArray(const UInt_t *i, Int_t n) override;
184 void WriteArray(const Long_t *l, Int_t n) override;
185 void WriteArray(const ULong_t *l, Int_t n) override;
186 void WriteArray(const Long64_t *l, Int_t n) override;
187 void WriteArray(const ULong64_t *l, Int_t n) override;
188 void WriteArray(const Float_t *f, Int_t n) override;
189 void WriteArray(const Double_t *d, Int_t n) override;
190 void WriteArrayFloat16(const Float_t *f, Int_t n, TStreamerElement *ele = nullptr) override;
191 void WriteArrayDouble32(const Double_t *d, Int_t n, TStreamerElement *ele = nullptr) override;
192
193 void WriteFastArray(const Bool_t *b, Long64_t n) override;
194 void WriteFastArray(const Char_t *c, Long64_t n) override;
195 void WriteFastArrayString(const Char_t *c, Long64_t n) override;
196 void WriteFastArray(const UChar_t *c, Long64_t n) override;
197 void WriteFastArray(const Short_t *h, Long64_t n) override;
198 void WriteFastArray(const UShort_t *h, Long64_t n) override;
199 void WriteFastArray(const Int_t *i, Long64_t n) override;
200 void WriteFastArray(const UInt_t *i, Long64_t n) override;
201 void WriteFastArray(const Long_t *l, Long64_t n) override;
202 void WriteFastArray(const ULong_t *l, Long64_t n) override;
203 void WriteFastArray(const Long64_t *l, Long64_t n) override;
204 void WriteFastArray(const ULong64_t *l, Long64_t n) override;
205 void WriteFastArray(const Float_t *f, Long64_t n) override;
206 void WriteFastArray(const Double_t *d, Long64_t n) override;
207 void WriteFastArrayFloat16(const Float_t *f, Long64_t n, TStreamerElement *ele = nullptr) override;
208 void WriteFastArrayDouble32(const Double_t *d, Long64_t n, TStreamerElement *ele = nullptr) override;
209 void WriteFastArray(void *start, const TClass *cl, Long64_t n=1, TMemberStreamer *s = nullptr) override;
210 Int_t WriteFastArray(void **startp, const TClass *cl, Long64_t n=1, Bool_t isPreAlloc=kFALSE, TMemberStreamer *s = nullptr) override;
211
212 void StreamObject(void *obj, const std::type_info &typeinfo, const TClass* onFileClass = nullptr) override;
213 void StreamObject(void *obj, const char *className, const TClass* onFileClass = nullptr) override;
214 void StreamObject(void *obj, const TClass *cl, const TClass* onFileClass = nullptr) override;
215 void StreamObject(TObject *obj) override;
216
217 void ReadBool(Bool_t &b) override;
218 void ReadChar(Char_t &c) override;
219 void ReadUChar(UChar_t &c) override;
220 void ReadShort(Short_t &s) override;
221 void ReadUShort(UShort_t &s) override;
222 void ReadInt(Int_t &i) override;
223 void ReadUInt(UInt_t &i) override;
224 void ReadLong(Long_t &l) override;
225 void ReadULong(ULong_t &l) override;
226 void ReadLong64(Long64_t &l) override;
227 void ReadULong64(ULong64_t &l) override;
228 void ReadFloat(Float_t &f) override;
229 void ReadDouble(Double_t &d) override;
230 void ReadCharP(Char_t *c) override;
231 void ReadTString(TString &s) override;
232 void ReadStdString(std::string *s) override;
234 void ReadCharStar(char* &s) override;
235
236 void WriteBool(Bool_t b) override;
237 void WriteChar(Char_t c) override;
238 void WriteUChar(UChar_t c) override;
239 void WriteShort(Short_t s) override;
240 void WriteUShort(UShort_t s) override;
241 void WriteInt(Int_t i) override;
242 void WriteUInt(UInt_t i) override;
243 void WriteLong(Long_t l) override;
244 void WriteULong(ULong_t l) override;
245 void WriteLong64(Long64_t l) override;
246 void WriteULong64(ULong64_t l) override;
247 void WriteFloat(Float_t f) override;
248 void WriteDouble(Double_t d) override;
249 void WriteCharP(const Char_t *c) override;
250 void WriteTString(const TString &s) override;
252 void WriteStdString(const std::string *s) override;
253 void WriteCharStar(char *s) override;
254
255 // Utilities for TClass
256 Int_t ReadClassEmulated(const TClass *cl, void *object, const TClass *onfile_class) override;
257 Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class) override;
258 Int_t ReadClassBuffer(const TClass *cl, void *pointer, Int_t version, UInt_t start, UInt_t count, const TClass *onfile_class) override;
259 Int_t WriteClassBuffer(const TClass *cl, void *pointer) override;
260
261 // Utilities to streamer using sequences.
265
266 ClassDefOverride(TBufferFile,0) //concrete implementation of TBuffer for writing/reading to/from a ROOT file or socket.
267};
268
269
270//---------------------- TBufferFile inlines ---------------------------------------
271
272//______________________________________________________________________________
274{
275 // Three cases here in which we should not read the collection:
276 // 1. The collection has zero or a negative number of elements or
277 // 2. The length in bytes of the collection is zero or negative
278 // 3. The remaining part of the buffer is too short to read the collection
280}
281
282//______________________________________________________________________________
284{
285 if (fBufCur + sizeof(UChar_t) > fBufMax) AutoExpand(fBufSize+sizeof(UChar_t));
286 tobuf(fBufCur, b);
287}
288
289//______________________________________________________________________________
291{
292 if (fBufCur + sizeof(Char_t) > fBufMax) AutoExpand(fBufSize+sizeof(Char_t));
293 tobuf(fBufCur, c);
294}
295
296//______________________________________________________________________________
298{
299 if (fBufCur + sizeof(UChar_t) > fBufMax) AutoExpand(fBufSize+sizeof(UChar_t));
301}
302
303//______________________________________________________________________________
305{
306 if (fBufCur + sizeof(Short_t) > fBufMax) AutoExpand(fBufSize+sizeof(Short_t));
307 tobuf(fBufCur, h);
308}
309
310//______________________________________________________________________________
312{
313 if (fBufCur + sizeof(UShort_t) > fBufMax) AutoExpand(fBufSize+sizeof(UShort_t));
315}
316
317//______________________________________________________________________________
319{
320 if (fBufCur + sizeof(Int_t) > fBufMax) AutoExpand(fBufSize+sizeof(Int_t));
321 tobuf(fBufCur, i);
322}
323
324//______________________________________________________________________________
326{
327 if (fBufCur + sizeof(UInt_t) > fBufMax) AutoExpand(fBufSize+sizeof(UInt_t));
328 tobuf(fBufCur, (Int_t)i);
329}
330
331//______________________________________________________________________________
333{
334 if (fBufCur + sizeof(Long_t) > fBufMax) AutoExpand(fBufSize+sizeof(Long_t));
335 tobuf(fBufCur, l);
336}
337
338//______________________________________________________________________________
340{
341 if (fBufCur + sizeof(ULong_t) > fBufMax) AutoExpand(fBufSize+sizeof(ULong_t));
343}
344
345//______________________________________________________________________________
347{
348 if (fBufCur + sizeof(Long64_t) > fBufMax) AutoExpand(fBufSize+sizeof(Long64_t));
349 tobuf(fBufCur, ll);
350}
351
352//______________________________________________________________________________
354{
355 if (fBufCur + sizeof(ULong64_t) > fBufMax) AutoExpand(fBufSize+sizeof(ULong64_t));
356 tobuf(fBufCur, (Long64_t)ll);
357}
358
359//______________________________________________________________________________
361{
362 if (fBufCur + sizeof(Float_t) > fBufMax) AutoExpand(fBufSize+sizeof(Float_t));
363 tobuf(fBufCur, f);
364}
365
366//______________________________________________________________________________
368{
369 if (fBufCur + sizeof(Double_t) > fBufMax) AutoExpand(fBufSize+sizeof(Double_t));
370 tobuf(fBufCur, d);
371}
372
373//______________________________________________________________________________
375{
376 WriteString(c);
377}
378
379//______________________________________________________________________________
381{
382 frombuf(fBufCur, &b);
383}
384
385//______________________________________________________________________________
387{
388 frombuf(fBufCur, &c);
389}
390
391//______________________________________________________________________________
396
397//______________________________________________________________________________
399{
400 frombuf(fBufCur, &h);
401}
402
403//______________________________________________________________________________
408
409//______________________________________________________________________________
411{
412 frombuf(fBufCur, &i);
413}
414
415//______________________________________________________________________________
417{
419}
420
421
422// in implementation file because special case with old version
423//______________________________________________________________________________
424//inline void TBufferFile::ReadLong(Long_t &ll)
425//{
426// frombuf(fBufCur, &ll);
427//}
428
429//______________________________________________________________________________
431{
433}
434
435
436//______________________________________________________________________________
438{
439 frombuf(fBufCur, &ll);
440}
441
442//______________________________________________________________________________
447
448//______________________________________________________________________________
450{
451 frombuf(fBufCur, &f);
452}
453
454//______________________________________________________________________________
456{
457 frombuf(fBufCur, &d);
458}
459
460//______________________________________________________________________________
462{
463 ReadString(c, -1);
464}
465
466//______________________________________________________________________________
469//______________________________________________________________________________
472//______________________________________________________________________________
475//______________________________________________________________________________
478//______________________________________________________________________________
481
482//______________________________________________________________________________
485//______________________________________________________________________________
488//______________________________________________________________________________
491//______________________________________________________________________________
494//______________________________________________________________________________
497
498//______________________________________________________________________________
501//______________________________________________________________________________
504//______________________________________________________________________________
507//______________________________________________________________________________
510//______________________________________________________________________________
513
514//______________________________________________________________________________
516 { TBufferFile::WriteArray((const Char_t *)c, n); }
517//______________________________________________________________________________
519 { TBufferFile::WriteArray((const Short_t *)h, n); }
520//______________________________________________________________________________
521inline void TBufferFile::WriteArray(const UInt_t *i, Int_t n)
522 { TBufferFile::WriteArray((const Int_t *)i, n); }
523//______________________________________________________________________________
525 { TBufferFile::WriteArray((const Long64_t *)ll, n); }
526
527//______________________________________________________________________________
530//______________________________________________________________________________
533//______________________________________________________________________________
536//______________________________________________________________________________
539
540#endif
void frombuf(char *&buf, Bool_t *x)
Definition Bytes.h:278
void tobuf(char *&buf, Bool_t x)
Definition Bytes.h:55
#define d(i)
Definition RSha256.hxx:102
#define b(i)
Definition RSha256.hxx:100
#define f(i)
Definition RSha256.hxx:104
#define c(i)
Definition RSha256.hxx:101
#define h(i)
Definition RSha256.hxx:106
bool Bool_t
Definition RtypesCore.h:63
unsigned short UShort_t
Definition RtypesCore.h:40
int Int_t
Definition RtypesCore.h:45
short Version_t
Definition RtypesCore.h:65
unsigned char UChar_t
Definition RtypesCore.h:38
char Char_t
Definition RtypesCore.h:37
unsigned long ULong_t
Definition RtypesCore.h:55
long Long_t
Definition RtypesCore.h:54
unsigned int UInt_t
Definition RtypesCore.h:46
float Float_t
Definition RtypesCore.h:57
short Short_t
Definition RtypesCore.h:39
constexpr Bool_t kFALSE
Definition RtypesCore.h:101
double Double_t
Definition RtypesCore.h:59
long long Long64_t
Definition RtypesCore.h:80
unsigned long long ULong64_t
Definition RtypesCore.h:81
constexpr Bool_t kTRUE
Definition RtypesCore.h:100
#define BIT(n)
Definition Rtypes.h:85
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h offset
Option_t Option_t TPoint TPoint const char mode
char *(* ReAllocCharFun_t)(char *, size_t, size_t)
Definition TStorage.h:30
The concrete implementation of TBuffer for writing/reading to/from a ROOT file or socket.
Definition TBufferFile.h:47
void WriteFastArrayFloat16(const Float_t *f, Long64_t n, TStreamerElement *ele=nullptr) override
Write array of n floats (as truncated float) into the I/O buffer.
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...
void WriteBuf(const void *buf, Int_t max) override
Write max bytes from buf into the I/O buffer.
void WriteFastArray(const Bool_t *b, Long64_t n) override
Write array of n bools into the I/O buffer.
void operator=(const TBufferFile &)=delete
not implemented
TObject * ReadObject(const TClass *cl) override
Read object from I/O buffer.
TBufferFile(const TBufferFile &)=delete
not implemented
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...
Int_t ReadStaticArrayFloat16(Float_t *f, TStreamerElement *ele=nullptr) override
Read array of floats (written as truncated float) from the I/O buffer.
void DecrementLevel(TVirtualStreamerInfo *) override
Decrement level.
Version_t ReadVersion(UInt_t *start=nullptr, UInt_t *bcnt=nullptr, const TClass *cl=nullptr) override
Read class version from I/O buffer.
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/...
void SetByteCount(UInt_t cntpos, Bool_t packInVersion=kFALSE) override
Set byte count at position cntpos in the buffer.
~TBufferFile() override
Delete an I/O buffer object.
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...
void WriteObjectClass(const void *actualObjStart, const TClass *actualClass, Bool_t cacheReuse) override
Write object to I/O buffer.
void ReadTString(TString &s) override
Read TString from TBuffer.
void ReadCharStar(char *&s) override
Read char* from TBuffer.
void WriteLong(Long_t l) override
void StreamObject(void *obj, const std::type_info &typeinfo, const TClass *onFileClass=nullptr) override
Stream an object given its C++ typeinfo information.
void WriteFloat(Float_t f) override
UInt_t WriteVersion(const TClass *cl, Bool_t useBcnt=kFALSE) override
Write class version to I/O buffer.
Int_t ReadBuf(void *buf, Int_t max) override
Read max bytes from the I/O buffer into buf.
void WriteShort(Short_t s) override
void WriteULong64(ULong64_t l) override
void WriteString(const char *s) override
Write string to I/O buffer.
void WriteUInt(UInt_t i) override
char * ReadString(char *s, Int_t max) override
Read string from I/O buffer.
void ReadUShort(UShort_t &s) override
void ReadShort(Short_t &s) override
void WriteArray(const Bool_t *b, Int_t n) override
Write array of n bools into the I/O buffer.
void WriteULong(ULong_t l) override
void ClassBegin(const TClass *, Version_t=-1) override
Definition TBufferFile.h:95
void WriteUChar(UChar_t c) override
void ReadFastArray(Bool_t *b, Int_t n) override
Read array of n bools from the I/O buffer.
void ReadFastArrayString(Char_t *c, Int_t n) override
Read array of n characters from the I/O buffer.
Int_t ReadArray(Bool_t *&b) override
Read array of bools from the I/O buffer.
Int_t ApplySequence(const TStreamerInfoActions::TActionSequence &sequence, void *object) override
Read one collection of objects from the buffer using the StreamerInfoLoopAction.
void ReadInt(Int_t &i) override
void * ReadObjectAny(const TClass *cast) override
Read object from I/O buffer.
void SkipObjectAny() override
Skip any kind of object from buffer.
Int_t ReadStaticArrayDouble32(Double_t *d, TStreamerElement *ele=nullptr) override
Read array of doubles (written as float) from the I/O buffer.
void WriteCharP(const Char_t *c) override
TClass * ReadClass(const TClass *cl=nullptr, UInt_t *objTag=nullptr) override
Read class definition from I/O buffer.
Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class) override
Deserialize information from a buffer into an object.
void SkipVersion(const TClass *cl=nullptr) override
Skip class version from I/O buffer.
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(...
@ kStreamedMemberWise
Definition TBufferFile.h:70
void WriteFastArrayDouble32(const Double_t *d, Long64_t n, TStreamerElement *ele=nullptr) override
Write array of n doubles (as float) into the I/O buffer.
void ReadCharP(Char_t *c) override
void WriteFastArrayString(const Char_t *c, Long64_t n) override
Write array of n characters into the I/O buffer.
void ClassMember(const char *, const char *=nullptr, Int_t=-1, Int_t=-1) override
Definition TBufferFile.h:97
Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss, const char *classname)
Check byte count with current buffer position.
void WriteCharStar(char *s) override
Write char* into TBuffer.
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.
void WriteStdString(const std::string *s) override
Write std::string to TBuffer.
Int_t WriteClassBuffer(const TClass *cl, void *pointer) override
Function called by the Streamer functions to serialize object at p to buffer b.
void WriteLong64(Long64_t l) override
void WriteClass(const TClass *cl) override
Write class description to I/O buffer.
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.
void WriteChar(Char_t c) override
void SetStreamerElementNumber(TStreamerElement *, Int_t) override
Definition TBufferFile.h:92
void ReadBool(Bool_t &b) override
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.
void ReadUInt(UInt_t &i) override
void ReadULong64(ULong64_t &l) override
void CheckCount(UInt_t offset) override
Check if offset is not too large (< kMaxMapCount) when writing.
bool ShouldNotReadCollection(Int_t lengthInBytes, Int_t nElements=1) const
Int_t ReadArrayFloat16(Float_t *&f, TStreamerElement *ele=nullptr) override
Read array of floats (written as truncated float) from the I/O buffer.
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.
void WriteUShort(UShort_t s) override
void ReadStdString(std::string *s) override
Read std::string from TBuffer.
void WriteFloat16(Float_t *f, TStreamerElement *ele=nullptr) override
Write a Float16_t to the buffer.
std::vector< TStreamerInfo * > InfoList_t
Definition TBufferFile.h:50
Int_t ReadStaticArray(Bool_t *b) override
Read array of bools from the I/O buffer.
void WriteTString(const TString &s) override
Write TString to TBuffer.
UInt_t CheckObject(UInt_t offset, const TClass *cl, Bool_t readClass=kFALSE)
Check for object in the read map.
InfoList_t fInfoStack
Stack of pointers to the TStreamerInfos.
Definition TBufferFile.h:53
void ReadDouble(Double_t &d) override
void WriteBool(Bool_t b) override
void WriteInt(Int_t i) override
void WriteDouble32(Double_t *d, TStreamerElement *ele=nullptr) override
Write a Double32_t to the buffer.
void ReadLong(Long_t &l) override
Read Long from TBuffer.
void ReadULong(ULong_t &l) override
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.
void ReadFloat(Float_t &f) override
void ReadChar(Char_t &c) override
void ReadLong64(Long64_t &l) override
void IncrementLevel(TVirtualStreamerInfo *info) override
Increment level.
Int_t ReadArrayDouble32(Double_t *&d, TStreamerElement *ele=nullptr) override
Read array of doubles (written as float) from the I/O buffer.
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.
void ReadUChar(UChar_t &c) override
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.
TVirtualStreamerInfo * GetInfo() override
Definition TBufferFile.h:94
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.
Version_t ReadVersionForMemberWise(const TClass *cl=nullptr) override
Read class version from I/O buffer.
void ClassEnd(const TClass *) override
Definition TBufferFile.h:96
TStreamerInfo * fInfo
Pointer to TStreamerInfo object writing/reading the buffer.
Definition TBufferFile.h:52
Int_t ReadClassEmulated(const TClass *cl, void *object, const TClass *onfile_class) override
Read emulated class.
void WriteDouble(Double_t d) override
Direct subclass of TBuffer, implements common methods for TBufferFile and TBufferText classes.
Definition TBufferIO.h:30
Bool_t CheckObject(const TObject *obj) override
Check if the specified object is already in the buffer.
virtual void WriteStdString(const std::string *s)=0
Int_t fBufSize
Definition TBuffer.h:50
char * fBufMax
Definition TBuffer.h:53
char * fBufCur
Definition TBuffer.h:52
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
virtual void ReadStdString(std::string *s)=0
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition TClass.h:81
Mother of all ROOT objects.
Definition TObject.h:41
Describes a persistent version of a class.
Basic string class.
Definition TString.h:139
Wrapper around an object and giving indirect access to its content even if the object is not of a cla...
Abstract Interface class describing Streamer information for one class.
const Int_t n
Definition legend1.C:16
TLine l
Definition textangle.C:4