Logo ROOT  
Reference Guide
TBuffer.h
Go to the documentation of this file.
1// @(#)root/base:$Id$
2// Author: Rene Brun, Philippe Canal, Fons Rademakers 04/05/96
3
4/*************************************************************************
5 * Copyright (C) 1995-2000, 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_TBuffer
13#define ROOT_TBuffer
14
15
16//////////////////////////////////////////////////////////////////////////
17// //
18// TBuffer //
19// //
20// Buffer base class used for serializing objects. //
21// //
22//////////////////////////////////////////////////////////////////////////
23
24#include "TDataType.h"
25#include "TObject.h"
26#include "TClass.h"
27#include "Bytes.h"
28
29#include <vector>
30
33class TString;
34class TProcessID;
36class TRefTable;
37class TVirtualArray;
39 class TActionSequence;
40}
41
42class TBuffer : public TObject {
43
44protected:
45 typedef std::vector<TVirtualArray*> CacheList_t;
46
47 Bool_t fMode; //Read or write mode
48 Int_t fVersion; //Buffer format version
49 Int_t fBufSize; //Size of buffer
50 char *fBuffer; //Buffer used to store objects
51 char *fBufCur; //Current position in buffer
52 char *fBufMax; //End of buffer
53 TObject *fParent; //Pointer to parent object owning this buffer
54 ReAllocCharFun_t fReAllocFunc; //! Realloc function to be used when extending the buffer.
55 CacheList_t fCacheStack; //Stack of pointers to the cache where to temporarily store the value of 'missing' data members
56
57 // Default ctor
60
61 // TBuffer objects cannot be copied or assigned
62 TBuffer(const TBuffer &); // not implemented
63 void operator=(const TBuffer &); // not implemented
64
65 Int_t Read(const char *name) { return TObject::Read(name); }
66 Int_t Write(const char *name, Int_t opt, Int_t bufs)
67 { return TObject::Write(name, opt, bufs); }
68 Int_t Write(const char *name, Int_t opt, Int_t bufs) const
69 { return TObject::Write(name, opt, bufs); }
70
71public:
72 enum EMode { kRead = 0, kWrite = 1 };
74 kIsOwner = BIT(16), //if set TBuffer owns fBuffer
75 kCannotHandleMemberWiseStreaming = BIT(17) //if set TClonesArray should not use member wise streaming
76 };
77 enum { kInitialSize = 1024, kMinimalSize = 128 };
78
79 TBuffer(EMode mode);
80 TBuffer(EMode mode, Int_t bufsiz);
81 TBuffer(EMode mode, Int_t bufsiz, void *buf, Bool_t adopt = kTRUE, ReAllocCharFun_t reallocfunc = 0);
82 virtual ~TBuffer();
83
84 Int_t GetBufferVersion() const { return fVersion; }
85 Bool_t IsReading() const { return (fMode & kWrite) == 0; }
86 Bool_t IsWriting() const { return (fMode & kWrite) != 0; }
87 void SetReadMode();
88 void SetWriteMode();
89 void SetBuffer(void *buf, UInt_t bufsiz = 0, Bool_t adopt = kTRUE, ReAllocCharFun_t reallocfunc = 0);
91 void SetReAllocFunc(ReAllocCharFun_t reallocfunc = 0);
92 void SetBufferOffset(Int_t offset = 0) { fBufCur = fBuffer+offset; }
93 void SetParent(TObject *parent);
94 TObject *GetParent() const;
95 char *Buffer() const { return fBuffer; }
96 char *GetCurrent() const { return fBufCur; }
97 Int_t BufferSize() const { return fBufSize; }
98 void DetachBuffer() { fBuffer = 0; }
99 Int_t Length() const { return (Int_t)(fBufCur - fBuffer); }
100 void Expand(Int_t newsize, Bool_t copy = kTRUE); // expand buffer to newsize
101 void AutoExpand(Int_t size_needed); // expand buffer to newsize
102 Bool_t ByteSwapBuffer(Long64_t n, EDataType type); // Byte-swap N primitive-elements in the buffer
103
104 virtual Bool_t CheckObject(const TObject *obj) = 0;
105 virtual Bool_t CheckObject(const void *obj, const TClass *ptrClass) = 0;
106
107 virtual Int_t ReadBuf(void *buf, Int_t max) = 0;
108 virtual void WriteBuf(const void *buf, Int_t max) = 0;
109
110 virtual char *ReadString(char *s, Int_t max) = 0;
111 virtual void WriteString(const char *s) = 0;
112
113 virtual Int_t GetVersionOwner() const = 0;
114 virtual Int_t GetMapCount() const = 0;
115 virtual void GetMappedObject(UInt_t tag, void* &ptr, TClass* &ClassPtr) const = 0;
116 virtual void MapObject(const TObject *obj, UInt_t offset = 1) = 0;
117 virtual void MapObject(const void *obj, const TClass *cl, UInt_t offset = 1) = 0;
118 virtual void Reset() = 0;
119 virtual void InitMap() = 0;
120 virtual void ResetMap() = 0;
121 virtual void SetReadParam(Int_t mapsize) = 0;
122 virtual void SetWriteParam(Int_t mapsize) = 0;
123
124 virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss) = 0;
125 virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const char *classname) = 0;
126 virtual void SetByteCount(UInt_t cntpos, Bool_t packInVersion = kFALSE)= 0;
127
128 virtual void SkipVersion(const TClass *cl = 0) = 0;
129 virtual Version_t ReadVersion(UInt_t *start = 0, UInt_t *bcnt = 0, const TClass *cl = 0) = 0;
130 virtual Version_t ReadVersionNoCheckSum(UInt_t *start = 0, UInt_t *bcnt = 0) = 0;
131 virtual Version_t ReadVersionForMemberWise(const TClass *cl = 0) = 0;
132 virtual UInt_t WriteVersion(const TClass *cl, Bool_t useBcnt = kFALSE) = 0;
133 virtual UInt_t WriteVersionMemberWise(const TClass *cl, Bool_t useBcnt = kFALSE) = 0;
134
135 virtual void *ReadObjectAny(const TClass* cast) = 0;
136 virtual void SkipObjectAny() = 0;
137
138 virtual void TagStreamerInfo(TVirtualStreamerInfo* info) = 0;
139 virtual void IncrementLevel(TVirtualStreamerInfo* info) = 0;
140 virtual void SetStreamerElementNumber(TStreamerElement *elem, Int_t comp_type) = 0;
142
143 virtual void ClassBegin(const TClass*, Version_t = -1) = 0;
144 virtual void ClassEnd(const TClass*) = 0;
145 virtual void ClassMember(const char*, const char* = 0, Int_t = -1, Int_t = -1) = 0;
147
148 virtual TVirtualArray *PeekDataCache() const;
149 virtual TVirtualArray *PopDataCache();
150 virtual void PushDataCache(TVirtualArray *);
151
152 virtual TClass *ReadClass(const TClass *cl = 0, UInt_t *objTag = 0) = 0;
153 virtual void WriteClass(const TClass *cl) = 0;
154
155 virtual TObject *ReadObject(const TClass *cl) = 0;
156 virtual void WriteObject(const TObject *obj, Bool_t cacheReuse) = 0;
157
158 template <class T> Int_t WriteObject(const T *objptr, Bool_t cacheReuse = kTRUE);
159
160 virtual Int_t WriteObjectAny(const void *obj, const TClass *ptrClass, Bool_t cacheReuse = kTRUE) = 0;
161
162 virtual UShort_t GetPidOffset() const = 0;
163 virtual void SetPidOffset(UShort_t offset) = 0;
164 virtual Int_t GetBufferDisplacement() const = 0;
165 virtual void SetBufferDisplacement() = 0;
166 virtual void SetBufferDisplacement(Int_t skipped) = 0;
167
168 // basic types and arrays of basic types
169 virtual void ReadFloat16 (Float_t *f, TStreamerElement *ele=0) = 0;
170 virtual void WriteFloat16(Float_t *f, TStreamerElement *ele=0) = 0;
171 virtual void ReadDouble32 (Double_t *d, TStreamerElement *ele=0) = 0;
172 virtual void WriteDouble32(Double_t *d, TStreamerElement *ele=0) = 0;
173 virtual void ReadWithFactor(Float_t *ptr, Double_t factor, Double_t minvalue) = 0;
174 virtual void ReadWithNbits(Float_t *ptr, Int_t nbits) = 0;
175 virtual void ReadWithFactor(Double_t *ptr, Double_t factor, Double_t minvalue) = 0;
176 virtual void ReadWithNbits(Double_t *ptr, Int_t nbits) = 0;
177
178 virtual Int_t ReadArray(Bool_t *&b) = 0;
179 virtual Int_t ReadArray(Char_t *&c) = 0;
180 virtual Int_t ReadArray(UChar_t *&c) = 0;
181 virtual Int_t ReadArray(Short_t *&h) = 0;
182 virtual Int_t ReadArray(UShort_t *&h) = 0;
183 virtual Int_t ReadArray(Int_t *&i) = 0;
184 virtual Int_t ReadArray(UInt_t *&i) = 0;
185 virtual Int_t ReadArray(Long_t *&l) = 0;
186 virtual Int_t ReadArray(ULong_t *&l) = 0;
187 virtual Int_t ReadArray(Long64_t *&l) = 0;
188 virtual Int_t ReadArray(ULong64_t *&l) = 0;
189 virtual Int_t ReadArray(Float_t *&f) = 0;
190 virtual Int_t ReadArray(Double_t *&d) = 0;
193
199 virtual Int_t ReadStaticArray(Int_t *i) = 0;
200 virtual Int_t ReadStaticArray(UInt_t *i) = 0;
209
210 virtual void ReadFastArray(Bool_t *b, Int_t n) = 0;
211 virtual void ReadFastArray(Char_t *c, Int_t n) = 0;
212 virtual void ReadFastArrayString(Char_t *c, Int_t n) = 0;
213 virtual void ReadFastArray(UChar_t *c, Int_t n) = 0;
214 virtual void ReadFastArray(Short_t *h, Int_t n) = 0;
215 virtual void ReadFastArray(UShort_t *h, Int_t n) = 0;
216 virtual void ReadFastArray(Int_t *i, Int_t n) = 0;
217 virtual void ReadFastArray(UInt_t *i, Int_t n) = 0;
218 virtual void ReadFastArray(Long_t *l, Int_t n) = 0;
219 virtual void ReadFastArray(ULong_t *l, Int_t n) = 0;
220 virtual void ReadFastArray(Long64_t *l, Int_t n) = 0;
221 virtual void ReadFastArray(ULong64_t *l, Int_t n) = 0;
222 virtual void ReadFastArray(Float_t *f, Int_t n) = 0;
223 virtual void ReadFastArray(Double_t *d, Int_t n) = 0;
226 virtual void ReadFastArrayWithFactor(Float_t *ptr, Int_t n, Double_t factor, Double_t minvalue) = 0;
227 virtual void ReadFastArrayWithNbits(Float_t *ptr, Int_t n, Int_t nbits) = 0;
228 virtual void ReadFastArrayWithFactor(Double_t *ptr, Int_t n, Double_t factor, Double_t minvalue) = 0;
229 virtual void ReadFastArrayWithNbits(Double_t *ptr, Int_t n, Int_t nbits) = 0;
230 virtual void ReadFastArray(void *start , const TClass *cl, Int_t n=1, TMemberStreamer *s=0, const TClass *onFileClass=0) = 0;
231 virtual void ReadFastArray(void **startp, const TClass *cl, Int_t n=1, Bool_t isPreAlloc=kFALSE, TMemberStreamer *s=0, const TClass *onFileClass=0) = 0;
232
233 virtual void WriteArray(const Bool_t *b, Int_t n) = 0;
234 virtual void WriteArray(const Char_t *c, Int_t n) = 0;
235 virtual void WriteArray(const UChar_t *c, Int_t n) = 0;
236 virtual void WriteArray(const Short_t *h, Int_t n) = 0;
237 virtual void WriteArray(const UShort_t *h, Int_t n) = 0;
238 virtual void WriteArray(const Int_t *i, Int_t n) = 0;
239 virtual void WriteArray(const UInt_t *i, Int_t n) = 0;
240 virtual void WriteArray(const Long_t *l, Int_t n) = 0;
241 virtual void WriteArray(const ULong_t *l, Int_t n) = 0;
242 virtual void WriteArray(const Long64_t *l, Int_t n) = 0;
243 virtual void WriteArray(const ULong64_t *l, Int_t n) = 0;
244 virtual void WriteArray(const Float_t *f, Int_t n) = 0;
245 virtual void WriteArray(const Double_t *d, Int_t n) = 0;
246 virtual void WriteArrayFloat16(const Float_t *f, Int_t n, TStreamerElement *ele=0) = 0;
247 virtual void WriteArrayDouble32(const Double_t *d, Int_t n, TStreamerElement *ele=0) = 0;
248
249 virtual void WriteFastArray(const Bool_t *b, Int_t n) = 0;
250 virtual void WriteFastArray(const Char_t *c, Int_t n) = 0;
251 virtual void WriteFastArrayString(const Char_t *c, Int_t n) = 0;
252 virtual void WriteFastArray(const UChar_t *c, Int_t n) = 0;
253 virtual void WriteFastArray(const Short_t *h, Int_t n) = 0;
254 virtual void WriteFastArray(const UShort_t *h, Int_t n) = 0;
255 virtual void WriteFastArray(const Int_t *i, Int_t n) = 0;
256 virtual void WriteFastArray(const UInt_t *i, Int_t n) = 0;
257 virtual void WriteFastArray(const Long_t *l, Int_t n) = 0;
258 virtual void WriteFastArray(const ULong_t *l, Int_t n) = 0;
259 virtual void WriteFastArray(const Long64_t *l, Int_t n) = 0;
260 virtual void WriteFastArray(const ULong64_t *l, Int_t n) = 0;
261 virtual void WriteFastArray(const Float_t *f, Int_t n) = 0;
262 virtual void WriteFastArray(const Double_t *d, Int_t n) = 0;
263 virtual void WriteFastArrayFloat16(const Float_t *f, Int_t n, TStreamerElement *ele=0) = 0;
264 virtual void WriteFastArrayDouble32(const Double_t *d, Int_t n, TStreamerElement *ele=0) = 0;
265 virtual void WriteFastArray(void *start, const TClass *cl, Int_t n=1, TMemberStreamer *s=0) = 0;
266 virtual Int_t WriteFastArray(void **startp, const TClass *cl, Int_t n=1, Bool_t isPreAlloc=kFALSE, TMemberStreamer *s=0) = 0;
267
268 virtual void StreamObject(void *obj, const std::type_info &typeinfo, const TClass* onFileClass = 0 ) = 0;
269 virtual void StreamObject(void *obj, const char *className, const TClass* onFileClass = 0 ) = 0;
270 virtual void StreamObject(void *obj, const TClass *cl, const TClass* onFileClass = 0 ) = 0;
271 virtual void StreamObject(TObject *obj) = 0;
272
273 virtual void ReadBool(Bool_t &b) = 0;
274 virtual void ReadChar(Char_t &c) = 0;
275 virtual void ReadUChar(UChar_t &c) = 0;
276 virtual void ReadShort(Short_t &s) = 0;
277 virtual void ReadUShort(UShort_t &s) = 0;
278 virtual void ReadInt(Int_t &i) = 0;
279 virtual void ReadUInt(UInt_t &i) = 0;
280 virtual void ReadLong(Long_t &l) = 0;
281 virtual void ReadULong(ULong_t &l) = 0;
282 virtual void ReadLong64(Long64_t &l) = 0;
283 virtual void ReadULong64(ULong64_t &l) = 0;
284 virtual void ReadFloat(Float_t &f) = 0;
285 virtual void ReadDouble(Double_t &d) = 0;
286 virtual void ReadCharP(Char_t *c) = 0;
287 virtual void ReadTString(TString &s) = 0;
288 virtual void ReadStdString(std::string *s) = 0;
289 virtual void ReadCharStar(char* &s) = 0;
290
291 virtual inline void ReadStdString(std::string &s) { ReadStdString(&s); }
292
293 virtual void WriteBool(Bool_t b) = 0;
294 virtual void WriteChar(Char_t c) = 0;
295 virtual void WriteUChar(UChar_t c) = 0;
296 virtual void WriteShort(Short_t s) = 0;
297 virtual void WriteUShort(UShort_t s) = 0;
298 virtual void WriteInt(Int_t i) = 0;
299 virtual void WriteUInt(UInt_t i) = 0;
300 virtual void WriteLong(Long_t l) = 0;
301 virtual void WriteULong(ULong_t l) = 0;
302 virtual void WriteLong64(Long64_t l) = 0;
303 virtual void WriteULong64(ULong64_t l) = 0;
304 virtual void WriteFloat(Float_t f) = 0;
305 virtual void WriteDouble(Double_t d) = 0;
306 virtual void WriteCharP(const Char_t *c) = 0;
307 virtual void WriteTString(const TString &s) = 0;
308 virtual void WriteStdString(const std::string *s) = 0;
309 virtual void WriteCharStar(char *s) = 0;
310
311 virtual inline void WriteStdString(std::string &s) { WriteStdString(&s); }
312
313 // Special basic ROOT objects and collections
314 virtual TProcessID *GetLastProcessID(TRefTable *reftable) const = 0;
315 virtual UInt_t GetTRefExecId() = 0;
316 virtual TProcessID *ReadProcessID(UShort_t pidf) = 0;
317 virtual UShort_t WriteProcessID(TProcessID *pid) = 0;
318
319 // Utilities for TStreamerInfo
320 virtual void ForceWriteInfo(TVirtualStreamerInfo *info, Bool_t force) = 0;
322 virtual Int_t ReadClones (TClonesArray *a, Int_t nobjects, Version_t objvers) = 0;
323 virtual Int_t WriteClones(TClonesArray *a, Int_t nobjects) = 0;
324
325 // Utilities for TClass
326 virtual Int_t ReadClassEmulated(const TClass *cl, void *object, const TClass *onfile_class = 0) = 0;
327 virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class = 0) = 0;
328 virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, Int_t version, UInt_t start, UInt_t count, const TClass *onfile_class = 0) = 0;
329 virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer) = 0;
330
331 // Utilites to streamer using sequences.
332 virtual Int_t ApplySequence(const TStreamerInfoActions::TActionSequence &sequence, void *object) = 0;
333 virtual Int_t ApplySequenceVecPtr(const TStreamerInfoActions::TActionSequence &sequence, void *start_collection, void *end_collection) = 0;
334 virtual Int_t ApplySequence(const TStreamerInfoActions::TActionSequence &sequence, void *start_collection, void *end_collection) = 0;
335
336 static TClass *GetClass(const std::type_info &typeinfo);
337 static TClass *GetClass(const char *className);
338
339 ClassDef(TBuffer,0) //Buffer base class used for serializing objects
340};
341
342//---------------------- TBuffer default external operators --------------------
343
344inline TBuffer &operator>>(TBuffer &buf, Bool_t &b) { buf.ReadBool(b); return buf; }
345inline TBuffer &operator>>(TBuffer &buf, Char_t &c) { buf.ReadChar(c); return buf; }
346inline TBuffer &operator>>(TBuffer &buf, UChar_t &c) { buf.ReadUChar(c); return buf; }
347inline TBuffer &operator>>(TBuffer &buf, Short_t &s) { buf.ReadShort(s); return buf; }
348inline TBuffer &operator>>(TBuffer &buf, UShort_t &s) { buf.ReadUShort(s); return buf; }
349inline TBuffer &operator>>(TBuffer &buf, Int_t &i) { buf.ReadInt(i); return buf; }
350inline TBuffer &operator>>(TBuffer &buf, UInt_t &i) { buf.ReadUInt(i); return buf; }
351inline TBuffer &operator>>(TBuffer &buf, Long_t &l) { buf.ReadLong(l); return buf; }
352inline TBuffer &operator>>(TBuffer &buf, ULong_t &l) { buf.ReadULong(l); return buf; }
353inline TBuffer &operator>>(TBuffer &buf, Long64_t &l) { buf.ReadLong64(l); return buf; }
354inline TBuffer &operator>>(TBuffer &buf, ULong64_t &l){ buf.ReadULong64(l);return buf; }
355inline TBuffer &operator>>(TBuffer &buf, Float_t &f) { buf.ReadFloat(f); return buf; }
356inline TBuffer &operator>>(TBuffer &buf, Double_t &d) { buf.ReadDouble(d); return buf; }
357inline TBuffer &operator>>(TBuffer &buf, Char_t *c) { buf.ReadCharP(c); return buf; }
358inline TBuffer &operator>>(TBuffer &buf, TString &s) { buf.ReadTString(s);return buf; }
359
360inline TBuffer &operator<<(TBuffer &buf, Bool_t b) { buf.WriteBool(b); return buf; }
361inline TBuffer &operator<<(TBuffer &buf, Char_t c) { buf.WriteChar(c); return buf; }
362inline TBuffer &operator<<(TBuffer &buf, UChar_t c) { buf.WriteUChar(c); return buf; }
363inline TBuffer &operator<<(TBuffer &buf, Short_t s) { buf.WriteShort(s); return buf; }
364inline TBuffer &operator<<(TBuffer &buf, UShort_t s) { buf.WriteUShort(s); return buf; }
365inline TBuffer &operator<<(TBuffer &buf, Int_t i) { buf.WriteInt(i); return buf; }
366inline TBuffer &operator<<(TBuffer &buf, UInt_t i) { buf.WriteUInt(i); return buf; }
367inline TBuffer &operator<<(TBuffer &buf, Long_t l) { buf.WriteLong(l); return buf; }
368inline TBuffer &operator<<(TBuffer &buf, ULong_t l) { buf.WriteULong(l); return buf; }
369inline TBuffer &operator<<(TBuffer &buf, Long64_t l) { buf.WriteLong64(l); return buf; }
370inline TBuffer &operator<<(TBuffer &buf, ULong64_t l){ buf.WriteULong64(l);return buf; }
371inline TBuffer &operator<<(TBuffer &buf, Float_t f) { buf.WriteFloat(f); return buf; }
372inline TBuffer &operator<<(TBuffer &buf, Double_t d) { buf.WriteDouble(d); return buf; }
373inline TBuffer &operator<<(TBuffer &buf, const Char_t *c) { buf.WriteCharP(c); return buf; }
374inline TBuffer &operator<<(TBuffer &buf, const TString &s) { buf.WriteTString(s);return buf; }
375
376#ifndef __CINT__
377
378#if defined(R__SOLARIS) && defined(R__GNU)
379#include <typeinfo>
380#endif
381
382template <class Tmpl> TBuffer &operator>>(TBuffer &buf, Tmpl *&obj)
383{
384 // Read TObject derived classes from a TBuffer. Need to provide
385 // custom version for non-TObject derived classes.
386
387 // This operator has to be a templated and/or automatically
388 // generated if we want to be able to check the type of the
389 // incoming object. I.e. a operator>>(TBuffer &buf, TObject *&)
390 // would not be sufficient to pass the information 'which class do we want'
391 // since the pointer could be zero (so typeid(*obj) is not usable).
392
393 auto cl = TClass::GetClass<Tmpl>();
394 obj = (Tmpl *) ( (void*) buf.ReadObjectAny(cl) );
395 return buf;
396}
397
398template <class Tmpl> TBuffer &operator<<(TBuffer &buf, const Tmpl *obj)
399{
400 auto cl = (obj) ? TClass::GetClass<Tmpl>() : nullptr;
401 buf.WriteObjectAny(obj, cl);
402 return buf;
403}
404#else
405template <class Tmpl> TBuffer &operator>>(TBuffer &buf, Tmpl *&obj);
406template <class Tmpl> TBuffer &operator<<(TBuffer &buf, Tmpl *&obj);
407#endif
408
409template <class T>
410inline Int_t TBuffer::WriteObject(const T *objptr, Bool_t cacheReuse)
411{
412 auto cl = (objptr) ? TClass::GetClass<T>() : nullptr;
413 return WriteObjectAny(objptr, cl, cacheReuse);
414}
415
416#endif // ROOT_TBuffer
#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
unsigned short UShort_t
Definition: RtypesCore.h:36
int Int_t
Definition: RtypesCore.h:41
short Version_t
Definition: RtypesCore.h:61
unsigned char UChar_t
Definition: RtypesCore.h:34
char Char_t
Definition: RtypesCore.h:29
unsigned int UInt_t
Definition: RtypesCore.h:42
const Bool_t kFALSE
Definition: RtypesCore.h:88
unsigned long ULong_t
Definition: RtypesCore.h:51
long Long_t
Definition: RtypesCore.h:50
bool Bool_t
Definition: RtypesCore.h:59
short Short_t
Definition: RtypesCore.h:35
double Double_t
Definition: RtypesCore.h:55
long long Long64_t
Definition: RtypesCore.h:69
unsigned long long ULong64_t
Definition: RtypesCore.h:70
float Float_t
Definition: RtypesCore.h:53
const Bool_t kTRUE
Definition: RtypesCore.h:87
#define ClassDef(name, id)
Definition: Rtypes.h:326
#define BIT(n)
Definition: Rtypes.h:83
TBuffer & operator>>(TBuffer &buf, Bool_t &b)
Definition: TBuffer.h:344
TBuffer & operator<<(TBuffer &buf, Bool_t b)
Definition: TBuffer.h:360
EDataType
Definition: TDataType.h:28
char name[80]
Definition: TGX11.cxx:109
int type
Definition: TGX11.cxx:120
char *(* ReAllocCharFun_t)(char *, size_t, size_t)
Definition: TStorage.h:30
Buffer base class used for serializing objects.
Definition: TBuffer.h:42
virtual void WriteCharStar(char *s)=0
virtual Int_t WriteFastArray(void **startp, const TClass *cl, Int_t n=1, Bool_t isPreAlloc=kFALSE, TMemberStreamer *s=0)=0
virtual void WriteStdString(const std::string *s)=0
virtual void WriteClass(const TClass *cl)=0
virtual void ReadWithNbits(Float_t *ptr, Int_t nbits)=0
virtual void ReadWithFactor(Float_t *ptr, Double_t factor, Double_t minvalue)=0
TBuffer()
Definition: TBuffer.h:58
virtual Int_t ReadStaticArray(UShort_t *h)=0
virtual Int_t ApplySequenceVecPtr(const TStreamerInfoActions::TActionSequence &sequence, void *start_collection, void *end_collection)=0
virtual void WriteArray(const Short_t *h, Int_t n)=0
virtual void ForceWriteInfoClones(TClonesArray *a)=0
virtual void ReadWithFactor(Double_t *ptr, Double_t factor, Double_t minvalue)=0
virtual void SkipVersion(const TClass *cl=0)=0
virtual void WriteArray(const Float_t *f, Int_t n)=0
std::vector< TVirtualArray * > CacheList_t
Definition: TBuffer.h:45
void SetWriteMode()
Set buffer in write mode.
Definition: TBuffer.cxx:315
virtual void ReadFastArrayWithFactor(Double_t *ptr, Int_t n, Double_t factor, Double_t minvalue)=0
virtual void Reset()=0
virtual void WriteStdString(std::string &s)
Definition: TBuffer.h:311
void SetReAllocFunc(ReAllocCharFun_t reallocfunc=0)
Set which memory reallocation method to use.
Definition: TBuffer.cxx:286
virtual void WriteString(const char *s)=0
Bool_t ByteSwapBuffer(Long64_t n, EDataType type)
Byte-swap N primitive-elements in the buffer.
Definition: TBuffer.cxx:392
virtual void GetMappedObject(UInt_t tag, void *&ptr, TClass *&ClassPtr) const =0
virtual Version_t ReadVersionNoCheckSum(UInt_t *start=0, UInt_t *bcnt=0)=0
virtual void ReadTString(TString &s)=0
virtual void ReadBool(Bool_t &b)=0
virtual UInt_t GetTRefExecId()=0
virtual void WriteULong(ULong_t l)=0
virtual void ReadFastArray(UShort_t *h, Int_t n)=0
virtual TVirtualStreamerInfo * GetInfo()=0
virtual void ClassBegin(const TClass *, Version_t=-1)=0
virtual void WriteArray(const UShort_t *h, Int_t n)=0
CacheList_t fCacheStack
Realloc function to be used when extending the buffer.
Definition: TBuffer.h:55
virtual void ReadShort(Short_t &s)=0
virtual void WriteFastArray(const Double_t *d, Int_t n)=0
virtual TProcessID * ReadProcessID(UShort_t pidf)=0
Return the current Process-ID.
Definition: TBuffer.cxx:344
virtual void ReadFastArrayDouble32(Double_t *d, Int_t n, TStreamerElement *ele=0)=0
virtual Int_t ReadStaticArray(Int_t *i)=0
Int_t Write(const char *name, Int_t opt, Int_t bufs)
Write this object to the current directory.
Definition: TBuffer.h:66
virtual UInt_t WriteVersionMemberWise(const TClass *cl, Bool_t useBcnt=kFALSE)=0
virtual Int_t ReadStaticArray(UInt_t *i)=0
virtual UShort_t WriteProcessID(TProcessID *pid)=0
Always return 0 (current processID).
Definition: TBuffer.cxx:353
void operator=(const TBuffer &)
virtual Int_t ReadArray(Int_t *&i)=0
virtual void SetByteCount(UInt_t cntpos, Bool_t packInVersion=kFALSE)=0
virtual void ReadInt(Int_t &i)=0
virtual TObject * ReadObject(const TClass *cl)=0
virtual void StreamObject(TObject *obj)=0
virtual void ReadDouble(Double_t &d)=0
virtual void ReadFastArray(ULong64_t *l, Int_t n)=0
Int_t fBufSize
Definition: TBuffer.h:49
virtual Int_t ApplySequence(const TStreamerInfoActions::TActionSequence &sequence, void *start_collection, void *end_collection)=0
virtual void ClassMember(const char *, const char *=0, Int_t=-1, Int_t=-1)=0
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=0)=0
virtual void SkipObjectAny()=0
virtual void ReadFastArray(Long_t *l, Int_t n)=0
virtual void WriteArray(const Double_t *d, Int_t n)=0
virtual void WriteDouble(Double_t d)=0
virtual void ReadFastArray(void **startp, const TClass *cl, Int_t n=1, Bool_t isPreAlloc=kFALSE, TMemberStreamer *s=0, const TClass *onFileClass=0)=0
void SetParent(TObject *parent)
Set parent owning this buffer.
Definition: TBuffer.cxx:270
virtual Int_t ReadArray(Float_t *&f)=0
virtual void WriteUChar(UChar_t c)=0
virtual void ReadLong64(Long64_t &l)=0
TObject * GetParent() const
Return pointer to parent of this buffer.
Definition: TBuffer.cxx:262
virtual Int_t ReadArray(Short_t *&h)=0
virtual void WriteLong(Long_t l)=0
virtual Int_t ReadStaticArray(Char_t *c)=0
char * GetCurrent() const
Definition: TBuffer.h:96
virtual Int_t ReadClones(TClonesArray *a, Int_t nobjects, Version_t objvers)=0
void Expand(Int_t newsize, Bool_t copy=kTRUE)
Expand (or shrink) the I/O buffer to newsize bytes.
Definition: TBuffer.cxx:223
virtual Int_t ReadArray(UChar_t *&c)=0
virtual void SetBufferDisplacement(Int_t skipped)=0
virtual void WriteUInt(UInt_t i)=0
virtual Int_t GetBufferDisplacement() const =0
virtual void ReadFastArray(Double_t *d, Int_t n)=0
virtual void ReadFastArrayString(Char_t *c, Int_t n)=0
virtual void * ReadObjectAny(const TClass *cast)=0
virtual void ReadFloat(Float_t &f)=0
virtual UShort_t GetPidOffset() const =0
virtual void ReadFastArray(Long64_t *l, Int_t n)=0
virtual void ReadChar(Char_t &c)=0
virtual void SetReadParam(Int_t mapsize)=0
virtual Version_t ReadVersion(UInt_t *start=0, UInt_t *bcnt=0, const TClass *cl=0)=0
virtual void WriteArray(const ULong64_t *l, Int_t n)=0
virtual Int_t ReadStaticArray(Long_t *l)=0
virtual Int_t ReadStaticArray(Float_t *f)=0
virtual void ReadFastArray(Int_t *i, Int_t n)=0
virtual Int_t ReadArray(Double_t *&d)=0
Int_t BufferSize() const
Definition: TBuffer.h:97
virtual void ReadFastArray(UChar_t *c, Int_t n)=0
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, Int_t version, UInt_t start, UInt_t count, const TClass *onfile_class=0)=0
EStatusBits
Definition: TBuffer.h:73
@ kCannotHandleMemberWiseStreaming
Definition: TBuffer.h:75
@ kIsOwner
Definition: TBuffer.h:74
virtual Int_t WriteClones(TClonesArray *a, Int_t nobjects)=0
virtual Int_t WriteObjectAny(const void *obj, const TClass *ptrClass, Bool_t cacheReuse=kTRUE)=0
virtual void SetStreamerElementNumber(TStreamerElement *elem, Int_t comp_type)=0
virtual void ReadFastArray(Float_t *f, Int_t n)=0
virtual void WriteFastArray(void *start, const TClass *cl, Int_t n=1, TMemberStreamer *s=0)=0
virtual void WriteFastArray(const UChar_t *c, Int_t n)=0
virtual void WriteShort(Short_t s)=0
TBuffer(const TBuffer &)
virtual Int_t ReadStaticArrayDouble32(Double_t *d, TStreamerElement *ele=0)=0
virtual void PushDataCache(TVirtualArray *)
Push a new data cache area onto the list of area to be used for temporarily store 'missing' data memb...
Definition: TBuffer.cxx:362
virtual void WriteFastArray(const Long64_t *l, Int_t n)=0
virtual void ReadCharP(Char_t *c)=0
virtual void StreamObject(void *obj, const std::type_info &typeinfo, const TClass *onFileClass=0)=0
Int_t Write(const char *name, Int_t opt, Int_t bufs) const
Write this object to the current directory.
Definition: TBuffer.h:68
virtual void WriteArray(const Bool_t *b, Int_t n)=0
virtual void WriteArrayFloat16(const Float_t *f, Int_t n, TStreamerElement *ele=0)=0
virtual TVirtualArray * PopDataCache()
Pop and Return the 'current' data cache area from the list of area to be used for temporarily store '...
Definition: TBuffer.cxx:381
virtual Int_t ReadArray(Bool_t *&b)=0
@ kWrite
Definition: TBuffer.h:72
@ kRead
Definition: TBuffer.h:72
char * fBufMax
Definition: TBuffer.h:52
virtual void ReadStdString(std::string &s)
Definition: TBuffer.h:291
char * fBufCur
Definition: TBuffer.h:51
virtual Int_t ReadStaticArray(Short_t *h)=0
virtual void ClassEnd(const TClass *)=0
virtual void WriteLong64(Long64_t l)=0
virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss)=0
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 WriteFastArray(const ULong64_t *l, Int_t n)=0
Bool_t IsWriting() const
Definition: TBuffer.h:86
virtual void WriteChar(Char_t c)=0
virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const char *classname)=0
virtual void ReadFastArray(Bool_t *b, Int_t n)=0
void SetBuffer(void *buf, UInt_t bufsiz=0, Bool_t adopt=kTRUE, ReAllocCharFun_t reallocfunc=0)
Sets a new buffer in an existing TBuffer object.
Definition: TBuffer.cxx:187
virtual TVirtualArray * PeekDataCache() const
Return the 'current' data cache area from the list of area to be used for temporarily store 'missing'...
Definition: TBuffer.cxx:371
virtual void ReadFastArrayFloat16(Float_t *f, Int_t n, TStreamerElement *ele=0)=0
virtual Int_t ReadStaticArray(ULong64_t *l)=0
virtual void WriteBool(Bool_t b)=0
virtual void ReadFastArray(Short_t *h, Int_t n)=0
virtual Int_t ReadArray(Long_t *&l)=0
virtual void WriteFastArrayFloat16(const Float_t *f, Int_t n, TStreamerElement *ele=0)=0
virtual void WriteArray(const Long_t *l, Int_t n)=0
@ kMinimalSize
Definition: TBuffer.h:77
@ kInitialSize
Definition: TBuffer.h:77
virtual void WriteUShort(UShort_t s)=0
virtual void WriteArray(const Char_t *c, Int_t n)=0
virtual void WriteULong64(ULong64_t l)=0
virtual void WriteArray(const Int_t *i, Int_t n)=0
virtual void WriteFastArrayDouble32(const Double_t *d, Int_t n, TStreamerElement *ele=0)=0
virtual void StreamObject(void *obj, const TClass *cl, const TClass *onFileClass=0)=0
virtual Int_t ApplySequence(const TStreamerInfoActions::TActionSequence &sequence, void *object)=0
virtual void IncrementLevel(TVirtualStreamerInfo *info)=0
virtual void MapObject(const void *obj, const TClass *cl, UInt_t offset=1)=0
virtual void SetWriteParam(Int_t mapsize)=0
virtual Int_t ReadClassEmulated(const TClass *cl, void *object, const TClass *onfile_class=0)=0
virtual void ReadULong64(ULong64_t &l)=0
virtual void ReadFastArrayWithNbits(Float_t *ptr, Int_t n, Int_t nbits)=0
virtual void ReadFastArray(UInt_t *i, Int_t n)=0
virtual Int_t GetVersionOwner() const =0
virtual void WriteFastArray(const ULong_t *l, Int_t n)=0
virtual Int_t ReadStaticArray(UChar_t *c)=0
virtual Int_t ReadArrayFloat16(Float_t *&f, TStreamerElement *ele=0)=0
virtual void WriteFastArray(const Char_t *c, Int_t n)=0
virtual ~TBuffer()
Delete an I/O buffer object.
Definition: TBuffer.cxx:140
virtual void ReadULong(ULong_t &l)=0
virtual void ReadLong(Long_t &l)=0
virtual void WriteArrayDouble32(const Double_t *d, Int_t n, TStreamerElement *ele=0)=0
virtual void DecrementLevel(TVirtualStreamerInfo *)=0
static TClass * GetClass(const std::type_info &typeinfo)
Forward to TROOT::GetClass().
Definition: TBuffer.cxx:328
virtual void ReadFastArray(void *start, const TClass *cl, Int_t n=1, TMemberStreamer *s=0, const TClass *onFileClass=0)=0
virtual Int_t ReadStaticArray(Double_t *d)=0
virtual Int_t ReadArray(UShort_t *&h)=0
Bool_t IsReading() const
Definition: TBuffer.h:85
virtual Int_t ReadArray(UInt_t *&i)=0
virtual void WriteArray(const Long64_t *l, Int_t n)=0
virtual void WriteFastArray(const UInt_t *i, Int_t n)=0
Bool_t fMode
Definition: TBuffer.h:47
virtual void ResetMap()=0
void SetBufferOffset(Int_t offset=0)
Definition: TBuffer.h:92
virtual TClass * ReadClass(const TClass *cl=0, UInt_t *objTag=0)=0
virtual Int_t ReadArrayDouble32(Double_t *&d, TStreamerElement *ele=0)=0
virtual void SetPidOffset(UShort_t offset)=0
virtual void InitMap()=0
ReAllocCharFun_t GetReAllocFunc() const
Return the reallocation method currently used.
Definition: TBuffer.cxx:277
virtual void WriteFastArrayString(const Char_t *c, Int_t n)=0
ReAllocCharFun_t fReAllocFunc
Definition: TBuffer.h:54
char * fBuffer
Definition: TBuffer.h:50
TObject * fParent
Definition: TBuffer.h:53
virtual Int_t ReadStaticArray(Bool_t *b)=0
virtual void WriteObject(const TObject *obj, Bool_t cacheReuse)=0
virtual void ReadFastArrayWithNbits(Double_t *ptr, Int_t n, Int_t nbits)=0
virtual Int_t ReadArray(Long64_t *&l)=0
virtual Int_t ReadStaticArray(Long64_t *l)=0
virtual Int_t GetMapCount() const =0
void SetReadMode()
Set buffer in read mode.
Definition: TBuffer.cxx:302
virtual TProcessID * GetLastProcessID(TRefTable *reftable) const =0
virtual void ReadFastArrayWithFactor(Float_t *ptr, Int_t n, Double_t factor, Double_t minvalue)=0
virtual UInt_t WriteVersion(const TClass *cl, Bool_t useBcnt=kFALSE)=0
virtual void WriteFastArray(const Int_t *i, Int_t n)=0
Int_t GetBufferVersion() const
Definition: TBuffer.h:84
virtual void ReadUChar(UChar_t &c)=0
virtual void ReadFloat16(Float_t *f, TStreamerElement *ele=0)=0
virtual Int_t ReadArray(ULong64_t *&l)=0
virtual void WriteInt(Int_t i)=0
virtual void ReadDouble32(Double_t *d, TStreamerElement *ele=0)=0
void DetachBuffer()
Definition: TBuffer.h:98
virtual void ReadUInt(UInt_t &i)=0
virtual void StreamObject(void *obj, const char *className, const TClass *onFileClass=0)=0
virtual void ForceWriteInfo(TVirtualStreamerInfo *info, Bool_t force)=0
virtual void ReadFastArray(Char_t *c, Int_t n)=0
virtual Bool_t CheckObject(const void *obj, const TClass *ptrClass)=0
virtual void WriteBuf(const void *buf, Int_t max)=0
virtual void ReadStdString(std::string *s)=0
virtual void WriteCharP(const Char_t *c)=0
virtual Int_t ReadStaticArray(ULong_t *l)=0
virtual Version_t ReadVersionForMemberWise(const TClass *cl=0)=0
virtual void SetBufferDisplacement()=0
virtual void WriteFastArray(const Short_t *h, Int_t n)=0
virtual Bool_t CheckObject(const TObject *obj)=0
virtual Int_t ReadArray(ULong_t *&l)=0
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
virtual void ReadWithNbits(Double_t *ptr, Int_t nbits)=0
virtual void WriteDouble32(Double_t *d, TStreamerElement *ele=0)=0
Int_t Read(const char *name)
Read contents of object with specified name from the current directory.
Definition: TBuffer.h:65
virtual void ReadCharStar(char *&s)=0
virtual char * ReadString(char *s, Int_t max)=0
virtual void ReadUShort(UShort_t &s)=0
virtual void WriteArray(const UChar_t *c, Int_t n)=0
Int_t fVersion
Definition: TBuffer.h:48
virtual void WriteFloat(Float_t f)=0
virtual void TagStreamerInfo(TVirtualStreamerInfo *info)=0
virtual void ReadFastArray(ULong_t *l, Int_t n)=0
virtual void WriteArray(const UInt_t *i, Int_t n)=0
virtual void WriteFastArray(const Float_t *f, Int_t n)=0
virtual void WriteFastArray(const UShort_t *h, Int_t n)=0
Int_t Length() const
Definition: TBuffer.h:99
virtual void WriteTString(const TString &s)=0
virtual Int_t ReadBuf(void *buf, Int_t max)=0
virtual void MapObject(const TObject *obj, UInt_t offset=1)=0
virtual void WriteFastArray(const Long_t *l, Int_t n)=0
virtual void WriteArray(const ULong_t *l, Int_t n)=0
virtual void WriteFastArray(const Bool_t *b, Int_t n)=0
virtual Int_t ReadStaticArrayFloat16(Float_t *f, TStreamerElement *ele=0)=0
char * Buffer() const
Definition: TBuffer.h:95
virtual Int_t ReadArray(Char_t *&c)=0
virtual void WriteFloat16(Float_t *f, TStreamerElement *ele=0)=0
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition: TClass.h:75
An array of clone (identical) objects.
Definition: TClonesArray.h:32
Mother of all ROOT objects.
Definition: TObject.h:37
virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
Definition: TObject.cxx:785
virtual Int_t Read(const char *name)
Read contents of object with specified name from the current directory.
Definition: TObject.cxx:562
A TProcessID identifies a ROOT job in a unique way in time and space.
Definition: TProcessID.h:69
A TRefTable maintains the association between a referenced object and the parent object supporting th...
Definition: TRefTable.h:35
Basic string class.
Definition: TString.h:131
Wrapper around an object and giving indirect access to its content even if the object is not of a cla...
Definition: TVirtualArray.h:26
Abstract Interface class describing Streamer information for one class.
const Int_t n
Definition: legend1.C:16
double T(double x)
Definition: ChebyshevPol.h:34
static constexpr double s
auto * l
Definition: textangle.C:4
auto * a
Definition: textangle.C:12