Logo ROOT   6.12/07
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 "TBuffer.h"
26 #include "Bytes.h"
27 
28 #include <vector>
29 
30 #ifdef R__OLDHPACC
31 namespace std {
32  using ::string;
33  using ::vector;
34 }
35 #endif
36 
38 class TStreamerInfo;
39 class TStreamerElement;
40 class TClass;
41 class TExMap;
42 class TVirtualArray;
43 namespace TStreamerInfoActions {
44  class TActionSequence;
45 }
46 
47 class TBufferFile : public TBuffer {
48 
49 protected:
50  typedef std::vector<TStreamerInfo*> InfoList_t;
51 
52  Int_t fMapCount; ///< Number of objects or classes in map
53  Int_t fMapSize; ///< Default size of map
54  Int_t fDisplacement; ///< Value to be added to the map offsets
55  UShort_t fPidOffset; ///< Offset to be added to the pid index in this key/buffer.
56  TExMap *fMap; ///< Map containing object,offset pairs for reading/writing
57  TExMap *fClassMap; ///< Map containing object,class pairs for reading
58  TStreamerInfo *fInfo; ///< Pointer to TStreamerInfo object writing/reading the buffer
59  InfoList_t fInfoStack; ///< Stack of pointers to the TStreamerInfos
60 
61  static Int_t fgMapSize; ///< Default map size for all TBuffer objects
62 
63  // Default ctor
64  TBufferFile() : TBuffer(), fMapCount(0), fMapSize(0),
65  fDisplacement(0),fPidOffset(0), fMap(0), fClassMap(0),
66  fInfo(0), fInfoStack() {}
67 
68  // TBuffer objects cannot be copied or assigned
69  TBufferFile(const TBufferFile &); ///< not implemented
70  void operator=(const TBufferFile &); ///< not implemented
71 
72  Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss, const char* classname);
73  void CheckCount(UInt_t offset);
74  UInt_t CheckObject(UInt_t offset, const TClass *cl, Bool_t readClass = kFALSE);
75 
76  virtual void WriteObjectClass(const void *actualObjStart, const TClass *actualClass, Bool_t cacheReuse);
77 
78 public:
79  enum { kMapSize = 503 };
80  enum { kStreamedMemberWise = BIT(14) }; //added to version number to know if a collection has been stored member-wise
81  enum EStatusBits {
82  kNotDecompressed = BIT(15), //indicates a weird buffer, used by TBasket
83  kTextBasedStreaming = BIT(18), //indicates if buffer used for XML/SQL object streaming
84 
85  kUser1 = BIT(21), //free for user
86  kUser2 = BIT(22), //free for user
87  kUser3 = BIT(23) //free for user
88  };
89 
91  TBufferFile(TBuffer::EMode mode, Int_t bufsiz);
92  TBufferFile(TBuffer::EMode mode, Int_t bufsiz, void *buf, Bool_t adopt = kTRUE, ReAllocCharFun_t reallocfunc = 0);
93  virtual ~TBufferFile();
94 
95  Int_t GetMapCount() const { return fMapCount; }
96  void GetMappedObject(UInt_t tag, void* &ptr, TClass* &ClassPtr) const;
97  void MapObject(const TObject *obj, UInt_t offset = 1);
98  void MapObject(const void *obj, const TClass *cl, UInt_t offset = 1);
99  void Reset() { SetBufferOffset(); ResetMap(); }
100  void InitMap();
101  void ResetMap();
102  void SetReadParam(Int_t mapsize);
103  void SetWriteParam(Int_t mapsize);
104 
105  Bool_t CheckObject(const TObject *obj);
106  Bool_t CheckObject(const void *obj, const TClass *ptrClass);
107 
108  virtual Int_t GetVersionOwner() const;
109  virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss);
110  virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const char *classname);
111  virtual void SetByteCount(UInt_t cntpos, Bool_t packInVersion = kFALSE);
112 
113  virtual void SkipVersion(const TClass *cl = 0);
114  virtual Version_t ReadVersion(UInt_t *start = 0, UInt_t *bcnt = 0, const TClass *cl = 0);
115  virtual Version_t ReadVersionNoCheckSum(UInt_t *start = 0, UInt_t *bcnt = 0);
116  virtual Version_t ReadVersionForMemberWise(const TClass *cl = 0);
117  virtual UInt_t WriteVersion(const TClass *cl, Bool_t useBcnt = kFALSE);
118  virtual UInt_t WriteVersionMemberWise(const TClass *cl, Bool_t useBcnt = kFALSE);
119 
120  virtual void *ReadObjectAny(const TClass* cast);
121  virtual void SkipObjectAny();
122 
123  virtual void TagStreamerInfo(TVirtualStreamerInfo* info);
124  virtual void IncrementLevel(TVirtualStreamerInfo* info);
126  virtual void DecrementLevel(TVirtualStreamerInfo*);
128  virtual void ClassBegin(const TClass*, Version_t = -1) {}
129  virtual void ClassEnd(const TClass*) {}
130  virtual void ClassMember(const char*, const char* = 0, Int_t = -1, Int_t = -1) {}
131 
132  virtual Int_t ReadBuf(void *buf, Int_t max);
133  virtual void WriteBuf(const void *buf, Int_t max);
134 
135  virtual char *ReadString(char *s, Int_t max);
136  virtual void WriteString(const char *s);
137 
138  virtual TClass *ReadClass(const TClass *cl = 0, UInt_t *objTag = 0);
139  virtual void WriteClass(const TClass *cl);
140 
141  virtual TObject *ReadObject(const TClass *cl);
142  virtual void WriteObject(const TObject *obj, Bool_t cacheReuse = kTRUE);
143 
144  using TBuffer::WriteObject;
145 
146  virtual Int_t WriteObjectAny(const void *obj, const TClass *ptrClass, Bool_t cacheReuse = kTRUE);
147 
149  // See comment in TBuffer::SetPidOffset
150  return fPidOffset;
151  }
152  void SetPidOffset(UShort_t offset);
153  Int_t GetBufferDisplacement() const { return fDisplacement; }
154  void SetBufferDisplacement() { fDisplacement = 0; }
156  { fDisplacement = (Int_t)(Length() - skipped); }
157 
158  // basic types and arrays of basic types
159  virtual void ReadFloat16 (Float_t *f, TStreamerElement *ele=0);
160  virtual void WriteFloat16(Float_t *f, TStreamerElement *ele=0);
161  virtual void ReadDouble32 (Double_t *d, TStreamerElement *ele=0);
162  virtual void WriteDouble32(Double_t *d, TStreamerElement *ele=0);
163  virtual void ReadWithFactor(Float_t *ptr, Double_t factor, Double_t minvalue);
164  virtual void ReadWithNbits(Float_t *ptr, Int_t nbits);
165  virtual void ReadWithFactor(Double_t *ptr, Double_t factor, Double_t minvalue);
166  virtual void ReadWithNbits(Double_t *ptr, Int_t nbits);
167 
168  virtual Int_t ReadArray(Bool_t *&b);
169  virtual Int_t ReadArray(Char_t *&c);
170  virtual Int_t ReadArray(UChar_t *&c);
171  virtual Int_t ReadArray(Short_t *&h);
172  virtual Int_t ReadArray(UShort_t *&h);
173  virtual Int_t ReadArray(Int_t *&i);
174  virtual Int_t ReadArray(UInt_t *&i);
175  virtual Int_t ReadArray(Long_t *&l);
176  virtual Int_t ReadArray(ULong_t *&l);
177  virtual Int_t ReadArray(Long64_t *&l);
178  virtual Int_t ReadArray(ULong64_t *&l);
179  virtual Int_t ReadArray(Float_t *&f);
180  virtual Int_t ReadArray(Double_t *&d);
181  virtual Int_t ReadArrayFloat16(Float_t *&f, TStreamerElement *ele=0);
182  virtual Int_t ReadArrayDouble32(Double_t *&d, TStreamerElement *ele=0);
183 
184  virtual Int_t ReadStaticArray(Bool_t *b);
185  virtual Int_t ReadStaticArray(Char_t *c);
186  virtual Int_t ReadStaticArray(UChar_t *c);
187  virtual Int_t ReadStaticArray(Short_t *h);
188  virtual Int_t ReadStaticArray(UShort_t *h);
189  virtual Int_t ReadStaticArray(Int_t *i);
190  virtual Int_t ReadStaticArray(UInt_t *i);
191  virtual Int_t ReadStaticArray(Long_t *l);
192  virtual Int_t ReadStaticArray(ULong_t *l);
193  virtual Int_t ReadStaticArray(Long64_t *l);
194  virtual Int_t ReadStaticArray(ULong64_t *l);
195  virtual Int_t ReadStaticArray(Float_t *f);
196  virtual Int_t ReadStaticArray(Double_t *d);
197  virtual Int_t ReadStaticArrayFloat16(Float_t *f, TStreamerElement *ele=0);
198  virtual Int_t ReadStaticArrayDouble32(Double_t *d, TStreamerElement *ele=0);
199 
200  virtual void ReadFastArray(Bool_t *b, Int_t n);
201  virtual void ReadFastArray(Char_t *c, Int_t n);
202  virtual void ReadFastArrayString(Char_t *c, Int_t n);
203  virtual void ReadFastArray(UChar_t *c, Int_t n);
204  virtual void ReadFastArray(Short_t *h, Int_t n);
205  virtual void ReadFastArray(UShort_t *h, Int_t n);
206  virtual void ReadFastArray(Int_t *i, Int_t n);
207  virtual void ReadFastArray(UInt_t *i, Int_t n);
208  virtual void ReadFastArray(Long_t *l, Int_t n);
209  virtual void ReadFastArray(ULong_t *l, Int_t n);
210  virtual void ReadFastArray(Long64_t *l, Int_t n);
211  virtual void ReadFastArray(ULong64_t *l, Int_t n);
212  virtual void ReadFastArray(Float_t *f, Int_t n);
213  virtual void ReadFastArray(Double_t *d, Int_t n);
214  virtual void ReadFastArrayFloat16(Float_t *f, Int_t n, TStreamerElement *ele=0);
215  virtual void ReadFastArrayDouble32(Double_t *d, Int_t n, TStreamerElement *ele=0);
216  virtual void ReadFastArrayWithFactor(Float_t *ptr, Int_t n, Double_t factor, Double_t minvalue) ;
217  virtual void ReadFastArrayWithNbits(Float_t *ptr, Int_t n, Int_t nbits);
218  virtual void ReadFastArrayWithFactor(Double_t *ptr, Int_t n, Double_t factor, Double_t minvalue);
219  virtual void ReadFastArrayWithNbits(Double_t *ptr, Int_t n, Int_t nbits) ;
220  virtual void ReadFastArray(void *start , const TClass *cl, Int_t n=1, TMemberStreamer *s=0, const TClass* onFileClass=0 );
221  virtual void ReadFastArray(void **startp, const TClass *cl, Int_t n=1, Bool_t isPreAlloc=kFALSE, TMemberStreamer *s=0, const TClass* onFileClass=0);
222 
223  virtual void WriteArray(const Bool_t *b, Int_t n);
224  virtual void WriteArray(const Char_t *c, Int_t n);
225  virtual void WriteArray(const UChar_t *c, Int_t n);
226  virtual void WriteArray(const Short_t *h, Int_t n);
227  virtual void WriteArray(const UShort_t *h, Int_t n);
228  virtual void WriteArray(const Int_t *i, Int_t n);
229  virtual void WriteArray(const UInt_t *i, Int_t n);
230  virtual void WriteArray(const Long_t *l, Int_t n);
231  virtual void WriteArray(const ULong_t *l, Int_t n);
232  virtual void WriteArray(const Long64_t *l, Int_t n);
233  virtual void WriteArray(const ULong64_t *l, Int_t n);
234  virtual void WriteArray(const Float_t *f, Int_t n);
235  virtual void WriteArray(const Double_t *d, Int_t n);
236  virtual void WriteArrayFloat16(const Float_t *f, Int_t n, TStreamerElement *ele=0);
237  virtual void WriteArrayDouble32(const Double_t *d, Int_t n, TStreamerElement *ele=0);
238 
239  virtual void WriteFastArray(const Bool_t *b, Int_t n);
240  virtual void WriteFastArray(const Char_t *c, Int_t n);
241  virtual void WriteFastArrayString(const Char_t *c, Int_t n);
242  virtual void WriteFastArray(const UChar_t *c, Int_t n);
243  virtual void WriteFastArray(const Short_t *h, Int_t n);
244  virtual void WriteFastArray(const UShort_t *h, Int_t n);
245  virtual void WriteFastArray(const Int_t *i, Int_t n);
246  virtual void WriteFastArray(const UInt_t *i, Int_t n);
247  virtual void WriteFastArray(const Long_t *l, Int_t n);
248  virtual void WriteFastArray(const ULong_t *l, Int_t n);
249  virtual void WriteFastArray(const Long64_t *l, Int_t n);
250  virtual void WriteFastArray(const ULong64_t *l, Int_t n);
251  virtual void WriteFastArray(const Float_t *f, Int_t n);
252  virtual void WriteFastArray(const Double_t *d, Int_t n);
253  virtual void WriteFastArrayFloat16(const Float_t *f, Int_t n, TStreamerElement *ele=0);
254  virtual void WriteFastArrayDouble32(const Double_t *d, Int_t n, TStreamerElement *ele=0);
255  virtual void WriteFastArray(void *start, const TClass *cl, Int_t n=1, TMemberStreamer *s=0);
256  virtual Int_t WriteFastArray(void **startp, const TClass *cl, Int_t n=1, Bool_t isPreAlloc=kFALSE, TMemberStreamer *s=0);
257 
258  virtual void StreamObject(void *obj, const std::type_info &typeinfo, const TClass* onFileClass = 0 );
259  virtual void StreamObject(void *obj, const char *className, const TClass* onFileClass = 0 );
260  virtual void StreamObject(void *obj, const TClass *cl, const TClass* onFileClass = 0 );
261  virtual void StreamObject(TObject *obj);
262 
263  virtual void ReadBool(Bool_t &b);
264  virtual void ReadChar(Char_t &c);
265  virtual void ReadUChar(UChar_t &c);
266  virtual void ReadShort(Short_t &s);
267  virtual void ReadUShort(UShort_t &s);
268  virtual void ReadInt(Int_t &i);
269  virtual void ReadUInt(UInt_t &i);
270  virtual void ReadLong(Long_t &l);
271  virtual void ReadULong(ULong_t &l);
272  virtual void ReadLong64(Long64_t &l);
273  virtual void ReadULong64(ULong64_t &l);
274  virtual void ReadFloat(Float_t &f);
275  virtual void ReadDouble(Double_t &d);
276  virtual void ReadCharP(Char_t *c);
277  virtual void ReadTString(TString &s);
278  virtual void ReadStdString(std::string *s);
280  virtual void ReadCharStar(char* &s);
281 
282  virtual void WriteBool(Bool_t b);
283  virtual void WriteChar(Char_t c);
284  virtual void WriteUChar(UChar_t c);
285  virtual void WriteShort(Short_t s);
286  virtual void WriteUShort(UShort_t s);
287  virtual void WriteInt(Int_t i);
288  virtual void WriteUInt(UInt_t i);
289  virtual void WriteLong(Long_t l);
290  virtual void WriteULong(ULong_t l);
291  virtual void WriteLong64(Long64_t l);
292  virtual void WriteULong64(ULong64_t l);
293  virtual void WriteFloat(Float_t f);
294  virtual void WriteDouble(Double_t d);
295  virtual void WriteCharP(const Char_t *c);
296  virtual void WriteTString(const TString &s);
298  virtual void WriteStdString(const std::string *s);
299  virtual void WriteCharStar(char *s);
300 
301  // Special basic ROOT objects and collections
302  virtual TProcessID *GetLastProcessID(TRefTable *reftable) const;
303  virtual UInt_t GetTRefExecId();
304  virtual TProcessID *ReadProcessID(UShort_t pidf);
305  virtual UShort_t WriteProcessID(TProcessID *pid);
306 
307  // Utilities for TStreamerInfo
308  virtual void ForceWriteInfo(TVirtualStreamerInfo *info, Bool_t force);
309  virtual void ForceWriteInfoClones(TClonesArray *a);
310  virtual Int_t ReadClones (TClonesArray *a, Int_t nobjects, Version_t objvers);
311  virtual Int_t WriteClones(TClonesArray *a, Int_t nobjects);
312 
313  // Utilities for TClass
314  virtual Int_t ReadClassEmulated(const TClass *cl, void *object, const TClass *onfile_class);
315  virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class);
316  virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, Int_t version, UInt_t start, UInt_t count, const TClass *onfile_class);
317  virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer);
318 
319  // Utilites to streamer using sequences.
320  Int_t ApplySequence(const TStreamerInfoActions::TActionSequence &sequence, void *object);
321  Int_t ApplySequenceVecPtr(const TStreamerInfoActions::TActionSequence &sequence, void *start_collection, void *end_collection);
322  Int_t ApplySequence(const TStreamerInfoActions::TActionSequence &sequence, void *start_collection, void *end_collection);
323 
324  static void SetGlobalReadParam(Int_t mapsize);
325  static void SetGlobalWriteParam(Int_t mapsize);
326  static Int_t GetGlobalReadParam();
327  static Int_t GetGlobalWriteParam();
328 
329  ClassDef(TBufferFile,0) //concrete implementation of TBuffer for writing/reading to/from a ROOT file or socket.
330 };
331 
332 
333 //---------------------- TBufferFile inlines ---------------------------------------
334 
335 //______________________________________________________________________________
337 {
338  if (fBufCur + sizeof(UChar_t) > fBufMax) AutoExpand(fBufSize+sizeof(UChar_t));
339  tobuf(fBufCur, b);
340 }
341 
342 //______________________________________________________________________________
344 {
345  if (fBufCur + sizeof(Char_t) > fBufMax) AutoExpand(fBufSize+sizeof(Char_t));
346  tobuf(fBufCur, c);
347 }
348 
349 //______________________________________________________________________________
351 {
352  if (fBufCur + sizeof(UChar_t) > fBufMax) AutoExpand(fBufSize+sizeof(UChar_t));
353  tobuf(fBufCur, (Char_t)c);
354 }
355 
356 //______________________________________________________________________________
358 {
359  if (fBufCur + sizeof(Short_t) > fBufMax) AutoExpand(fBufSize+sizeof(Short_t));
360  tobuf(fBufCur, h);
361 }
362 
363 //______________________________________________________________________________
365 {
366  if (fBufCur + sizeof(UShort_t) > fBufMax) AutoExpand(fBufSize+sizeof(UShort_t));
367  tobuf(fBufCur, (Short_t)h);
368 }
369 
370 //______________________________________________________________________________
372 {
373  if (fBufCur + sizeof(Int_t) > fBufMax) AutoExpand(fBufSize+sizeof(Int_t));
374  tobuf(fBufCur, i);
375 }
376 
377 //______________________________________________________________________________
379 {
380  if (fBufCur + sizeof(UInt_t) > fBufMax) AutoExpand(fBufSize+sizeof(UInt_t));
381  tobuf(fBufCur, (Int_t)i);
382 }
383 
384 //______________________________________________________________________________
386 {
387  if (fBufCur + sizeof(Long_t) > fBufMax) AutoExpand(fBufSize+sizeof(Long_t));
388  tobuf(fBufCur, l);
389 }
390 
391 //______________________________________________________________________________
393 {
394  if (fBufCur + sizeof(ULong_t) > fBufMax) AutoExpand(fBufSize+sizeof(ULong_t));
395  tobuf(fBufCur, (Long_t)l);
396 }
397 
398 //______________________________________________________________________________
400 {
401  if (fBufCur + sizeof(Long64_t) > fBufMax) AutoExpand(fBufSize+sizeof(Long64_t));
402  tobuf(fBufCur, ll);
403 }
404 
405 //______________________________________________________________________________
407 {
408  if (fBufCur + sizeof(ULong64_t) > fBufMax) AutoExpand(fBufSize+sizeof(ULong64_t));
409  tobuf(fBufCur, (Long64_t)ll);
410 }
411 
412 //______________________________________________________________________________
414 {
415  if (fBufCur + sizeof(Float_t) > fBufMax) AutoExpand(fBufSize+sizeof(Float_t));
416  tobuf(fBufCur, f);
417 }
418 
419 //______________________________________________________________________________
421 {
422  if (fBufCur + sizeof(Double_t) > fBufMax) AutoExpand(fBufSize+sizeof(Double_t));
423  tobuf(fBufCur, d);
424 }
425 
426 //______________________________________________________________________________
427 inline void TBufferFile::WriteCharP(const Char_t *c)
428 {
429  WriteString(c);
430 }
431 
432 //______________________________________________________________________________
434 {
435  frombuf(fBufCur, &b);
436 }
437 
438 //______________________________________________________________________________
440 {
441  frombuf(fBufCur, &c);
442 }
443 
444 //______________________________________________________________________________
446 {
448 }
449 
450 //______________________________________________________________________________
452 {
453  frombuf(fBufCur, &h);
454 }
455 
456 //______________________________________________________________________________
458 {
460 }
461 
462 //______________________________________________________________________________
464 {
465  frombuf(fBufCur, &i);
466 }
467 
468 //______________________________________________________________________________
470 {
472 }
473 
474 
475 // in implementation file because special case with old version
476 //______________________________________________________________________________
477 //inline void TBufferFile::ReadLong(Long_t &ll)
478 //{
479 // frombuf(fBufCur, &ll);
480 //}
481 
482 //______________________________________________________________________________
484 {
486 }
487 
488 
489 //______________________________________________________________________________
491 {
492  frombuf(fBufCur, &ll);
493 }
494 
495 //______________________________________________________________________________
497 {
499 }
500 
501 //______________________________________________________________________________
503 {
504  frombuf(fBufCur, &f);
505 }
506 
507 //______________________________________________________________________________
509 {
510  frombuf(fBufCur, &d);
511 }
512 
513 //______________________________________________________________________________
515 {
516  ReadString(c, -1);
517 }
518 
519 //______________________________________________________________________________
521  { return TBufferFile::ReadArray((Char_t *&)c); }
522 //______________________________________________________________________________
524  { return TBufferFile::ReadArray((Short_t *&)h); }
525 //______________________________________________________________________________
527  { return TBufferFile::ReadArray((Int_t *&)i); }
528 //______________________________________________________________________________
530  { return TBufferFile::ReadArray((Long_t *&)l); }
531 //______________________________________________________________________________
533  { return TBufferFile::ReadArray((Long64_t *&)ll); }
534 
535 //______________________________________________________________________________
537  { return TBufferFile::ReadStaticArray((Char_t *)c); }
538 //______________________________________________________________________________
540  { return TBufferFile::ReadStaticArray((Short_t *)h); }
541 //______________________________________________________________________________
543  { return TBufferFile::ReadStaticArray((Int_t *)i); }
544 //______________________________________________________________________________
546  { return TBufferFile::ReadStaticArray((Long_t *)l); }
547 //______________________________________________________________________________
549  { return TBufferFile::ReadStaticArray((Long64_t *)ll); }
550 
551 //______________________________________________________________________________
553  { TBufferFile::ReadFastArray((Char_t *)c, n); }
554 //______________________________________________________________________________
556  { TBufferFile::ReadFastArray((Short_t *)h, n); }
557 //______________________________________________________________________________
559  { TBufferFile::ReadFastArray((Int_t *)i, n); }
560 //______________________________________________________________________________
562  { TBufferFile::ReadFastArray((Long_t *)l, n); }
563 //______________________________________________________________________________
565  { TBufferFile::ReadFastArray((Long64_t *)ll, n); }
566 
567 //______________________________________________________________________________
568 inline void TBufferFile::WriteArray(const UChar_t *c, Int_t n)
569  { TBufferFile::WriteArray((const Char_t *)c, n); }
570 //______________________________________________________________________________
572  { TBufferFile::WriteArray((const Short_t *)h, n); }
573 //______________________________________________________________________________
574 inline void TBufferFile::WriteArray(const UInt_t *i, Int_t n)
575  { TBufferFile::WriteArray((const Int_t *)i, n); }
576 //______________________________________________________________________________
577 inline void TBufferFile::WriteArray(const ULong64_t *ll, Int_t n)
578  { TBufferFile::WriteArray((const Long64_t *)ll, n); }
579 
580 //______________________________________________________________________________
582  { TBufferFile::WriteFastArray((const Char_t *)c, n); }
583 //______________________________________________________________________________
585  { TBufferFile::WriteFastArray((const Short_t *)h, n); }
586 //______________________________________________________________________________
588  { TBufferFile::WriteFastArray((const Int_t *)i, n); }
589 //______________________________________________________________________________
591  { TBufferFile::WriteFastArray((const Long64_t *)ll, n); }
592 
593 #endif
Describe Streamer information for one class version.
Definition: TStreamerInfo.h:43
void frombuf(char *&buf, Bool_t *x)
Definition: Bytes.h:280
virtual Int_t ReadArray(Bool_t *&b)
Read array of bools from the I/O buffer.
The concrete implementation of TBuffer for writing/reading to/from a ROOT file or socket...
Definition: TBufferFile.h:47
long long Long64_t
Definition: RtypesCore.h:69
void SetBufferDisplacement()
Definition: TBufferFile.h:154
short Version_t
Definition: RtypesCore.h:61
float Float_t
Definition: RtypesCore.h:53
unsigned short UShort_t
Definition: RtypesCore.h:36
#define BIT(n)
Definition: Rtypes.h:78
TH1 * h
Definition: legend2.C:5
Int_t GetBufferDisplacement() const
Definition: TBufferFile.h:153
char *(* ReAllocCharFun_t)(char *, size_t, size_t)
Definition: TStorage.h:30
static Int_t fgMapSize
Default map size for all TBuffer objects.
Definition: TBufferFile.h:61
Buffer base class used for serializing objects.
Definition: TBuffer.h:40
Basic string class.
Definition: TString.h:125
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
std::vector< TStreamerInfo * > InfoList_t
Definition: TBufferFile.h:50
virtual void ReadChar(Char_t &c)
Definition: TBufferFile.h:439
virtual void ClassMember(const char *, const char *=0, Int_t=-1, Int_t=-1)
Definition: TBufferFile.h:130
virtual void ReadUInt(UInt_t &i)
Definition: TBufferFile.h:469
STL namespace.
virtual void ReadLong(Long_t &l)
Read Long from TBuffer.
virtual void WriteBool(Bool_t b)
Definition: TBufferFile.h:336
INLINE_TEMPLATE_ARGS Int_t ReadTString(TBuffer &buf, void *addr, const TConfiguration *config)
virtual void WriteULong(ULong_t l)
Definition: TBufferFile.h:392
virtual void WriteULong64(ULong64_t l)
Definition: TBufferFile.h:406
virtual void ReadFloat(Float_t &f)
Definition: TBufferFile.h:502
virtual void WriteUChar(UChar_t c)
Definition: TBufferFile.h:350
Int_t fDisplacement
Value to be added to the map offsets.
Definition: TBufferFile.h:54
virtual void WriteUShort(UShort_t s)
Definition: TBufferFile.h:364
virtual void ReadLong64(Long64_t &l)
Definition: TBufferFile.h:490
TExMap * fMap
Map containing object,offset pairs for reading/writing.
Definition: TBufferFile.h:56
virtual void ReadInt(Int_t &i)
Definition: TBufferFile.h:463
#define ClassDef(name, id)
Definition: Rtypes.h:320
virtual void ReadStdString(std::string *s)=0
virtual void SetStreamerElementNumber(TStreamerElement *, Int_t)
Definition: TBufferFile.h:125
virtual void ReadUChar(UChar_t &c)
Definition: TBufferFile.h:445
void tobuf(char *&buf, Bool_t x)
Definition: Bytes.h:57
A TProcessID identifies a ROOT job in a unique way in time and space.
Definition: TProcessID.h:69
virtual void WriteShort(Short_t s)
Definition: TBufferFile.h:357
UShort_t GetPidOffset() const
Definition: TBufferFile.h:148
virtual void ReadULong64(ULong64_t &l)
Definition: TBufferFile.h:496
Int_t fMapCount
Number of objects or classes in map.
Definition: TBufferFile.h:52
TStreamerInfo * fInfo
Pointer to TStreamerInfo object writing/reading the buffer.
Definition: TBufferFile.h:58
virtual void WriteUInt(UInt_t i)
Definition: TBufferFile.h:378
virtual Int_t ReadStaticArray(Bool_t *b)
Read array of bools from the I/O buffer.
Wrapper around an object and giving indirect access to its content even if the object is not of a cla...
Definition: TVirtualArray.h:26
auto * a
Definition: textangle.C:12
EStatusBits
Definition: TBuffer.h:71
unsigned int UInt_t
Definition: RtypesCore.h:42
short Short_t
Definition: RtypesCore.h:35
The ROOT global object gROOT contains a list of all defined classes.
Definition: TClass.h:75
virtual void WriteInt(Int_t i)
Definition: TBufferFile.h:371
virtual void ReadCharP(Char_t *c)
Definition: TBufferFile.h:514
virtual void ClassEnd(const TClass *)
Definition: TBufferFile.h:129
virtual void WriteFloat(Float_t f)
Definition: TBufferFile.h:413
UShort_t fPidOffset
Offset to be added to the pid index in this key/buffer.
Definition: TBufferFile.h:55
virtual void WriteArray(const Bool_t *b, Int_t n)
Write array of n bools into the I/O buffer.
const Bool_t kFALSE
Definition: RtypesCore.h:88
TExMap * fClassMap
Map containing object,class pairs for reading.
Definition: TBufferFile.h:57
long Long_t
Definition: RtypesCore.h:50
Int_t fMapSize
Default size of map.
Definition: TBufferFile.h:53
virtual void WriteLong(Long_t l)
Definition: TBufferFile.h:385
double Double_t
Definition: RtypesCore.h:55
virtual void WriteObject(const TObject *obj, Bool_t cacheReuse)=0
unsigned long long ULong64_t
Definition: RtypesCore.h:70
unsigned long ULong_t
Definition: RtypesCore.h:51
A TRefTable maintains the association between a referenced object and the parent object supporting th...
Definition: TRefTable.h:35
virtual void WriteDouble(Double_t d)
Definition: TBufferFile.h:420
void SetBufferDisplacement(Int_t skipped)
Definition: TBufferFile.h:155
static constexpr double s
Binding & operator=(OUT(*fun)(void))
Mother of all ROOT objects.
Definition: TObject.h:37
virtual void ReadBool(Bool_t &b)
Definition: TBufferFile.h:433
char Char_t
Definition: RtypesCore.h:29
virtual void WriteCharP(const Char_t *c)
Definition: TBufferFile.h:427
An array of clone (identical) objects.
Definition: TClonesArray.h:32
virtual void WriteLong64(Long64_t l)
Definition: TBufferFile.h:399
auto * l
Definition: textangle.C:4
virtual void ClassBegin(const TClass *, Version_t=-1)
Definition: TBufferFile.h:128
virtual void WriteFastArray(const Bool_t *b, Int_t n)
Write array of n bools into the I/O buffer.
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
Definition: TRolke.cxx:630
virtual void ReadUShort(UShort_t &s)
Definition: TBufferFile.h:457
InfoList_t fInfoStack
Stack of pointers to the TStreamerInfos.
Definition: TBufferFile.h:59
void Reset()
Definition: TBufferFile.h:99
unsigned char UChar_t
Definition: RtypesCore.h:34
Int_t GetMapCount() const
Definition: TBufferFile.h:95
virtual void ReadShort(Short_t &s)
Definition: TBufferFile.h:451
Abstract Interface class describing Streamer information for one class.
TVirtualStreamerInfo * GetInfo()
Definition: TBufferFile.h:127
virtual void ReadULong(ULong_t &l)
Definition: TBufferFile.h:483
virtual void WriteStdString(const std::string *s)=0
const Bool_t kTRUE
Definition: RtypesCore.h:87
const Int_t n
Definition: legend1.C:16
virtual void WriteChar(Char_t c)
Definition: TBufferFile.h:343
This class stores a (key,value) pair using an external hash.
Definition: TExMap.h:33
virtual void ReadFastArray(Bool_t *b, Int_t n)
Read array of n bools from the I/O buffer.
virtual void ReadDouble(Double_t &d)
Definition: TBufferFile.h:508