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