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