Logo ROOT   6.10/09
Reference Guide
TStreamerInfoReadBuffer.cxx
Go to the documentation of this file.
1 // @(#)root/io:$Id$
2 // Author: Rene Brun 12/10/2000
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 #include "TBuffer.h"
13 #include "TFile.h"
14 #include "TClass.h"
15 #include "TBufferFile.h"
16 #include "TClonesArray.h"
17 #include "TError.h"
18 #include "TRef.h"
19 #include "TProcessID.h"
20 #include "TStreamer.h"
21 #include "TStreamerElement.h"
22 #include "TStreamerInfo.h"
24 #include "TContainerConverters.h"
25 #include "TVirtualArray.h"
26 #include "TVirtualObject.h"
27 
28 // GetCurrentElement.
29 // Currently only used by TRef::Streamer.
30 
32 {
33  //Pointer to current TStreamerElement
34  //Thread local storage.
35 
36  TTHREAD_TLS(TStreamerElement*) fgElement(0);
37 
38  return fgElement;
39 }
40 
41 ////////////////////////////////////////////////////////////////////////////////
42 ///static function returning a pointer to the current TStreamerElement
43 ///fgElement points to the current TStreamerElement being read in ReadBuffer
44 
46 {
47  return CurrentElement();
48 }
49 
50 //==========CPP macros
51 
52 #define DOLOOP for(Int_t k=0; k<narr; ++k)
53 
54 #define ReadBasicTypeElem(name,index) \
55  { \
56  name *x=(name*)(arr[index]+ioffset); \
57  b >> *x; \
58  }
59 
60 #define ReadBasicType(name) \
61  { \
62  ReadBasicTypeElem(name,0); \
63  }
64 
65 #define ReadBasicTypeLoop(name) \
66  { \
67  for(Int_t k=0; k<narr; ++k) ReadBasicTypeElem(name,k); \
68  }
69 
70 #define ReadBasicArrayElem(name,index) \
71  { \
72  name *x=(name*)(arr[index]+ioffset); \
73  b.ReadFastArray(x,compinfo[i]->fLength); \
74  }
75 
76 #define ReadBasicArray(name) \
77  { \
78  ReadBasicArrayElem(name,0); \
79  }
80 
81 #define ReadBasicArrayLoop(name) \
82  { \
83  for(Int_t k=0; k<narr; ++k) ReadBasicArrayElem(name,k) \
84  }
85 
86 #define ReadBasicPointerElem(name,index) \
87  { \
88  Char_t isArray; \
89  b >> isArray; \
90  Int_t *l = (Int_t*)(arr[index]+imethod); \
91  if (*l < 0 || *l > b.BufferSize()) continue; \
92  name **f = (name**)(arr[index]+ioffset); \
93  int j; \
94  if (isArray) for(j=0;j<compinfo[i]->fLength;j++) { \
95  delete [] f[j]; \
96  f[j] = 0; if (*l <=0) continue; \
97  f[j] = new name[*l]; \
98  b.ReadFastArray(f[j],*l); \
99  } \
100  else for(j=0;j<compinfo[i]->fLength;j++) { \
101  delete [] f[j]; \
102  f[j] = 0; \
103  } \
104  }
105 
106 #define ReadBasicPointer(name) \
107  { \
108  const int imethod = compinfo[i]->fMethod+eoffset; \
109  ReadBasicPointerElem(name,0); \
110  }
111 
112 #define ReadBasicPointerLoop(name) \
113  { \
114  int imethod = compinfo[i]->fMethod+eoffset; \
115  for(int k=0; k<narr; ++k) { \
116  ReadBasicPointerElem(name,k); \
117  } \
118  }
119 
120 #define SkipCBasicType(name) \
121  { \
122  name dummy; \
123  DOLOOP{ b >> dummy; } \
124  break; \
125  }
126 
127 #define SkipCFloat16(name) \
128  { \
129  name dummy; \
130  DOLOOP { b.ReadFloat16(&dummy,aElement); } \
131  break; \
132  }
133 
134 #define SkipCDouble32(name) \
135  { \
136  name dummy; \
137  DOLOOP { b.ReadDouble32(&dummy,aElement); }\
138  break; \
139  }
140 
141 #define SkipCBasicArray(name,ReadArrayFunc) \
142  { \
143  name* readbuf = new name[compinfo->fLength]; \
144  DOLOOP { \
145  b.ReadArrayFunc(readbuf, compinfo->fLength); \
146  } \
147  delete[] readbuf; \
148  break; \
149  }
150 
151 #define SkipCBasicPointer(name,ReadArrayFunc) \
152  { \
153  Int_t addCounter = -111; \
154  if ((imethod>0) && (compinfo->fMethod>0)) addCounter = -1; \
155  if((addCounter<-1) && (aElement!=0) && (aElement->IsA()==TStreamerBasicPointer::Class())) { \
156  TStreamerElement* elemCounter = (TStreamerElement*) thisVar->GetElements()->FindObject(((TStreamerBasicPointer*)aElement)->GetCountName()); \
157  if (elemCounter) addCounter = elemCounter->GetTObjectOffset(); \
158  } \
159  if (addCounter>=-1) { \
160  int len = aElement->GetArrayDim()?aElement->GetArrayLength():1; \
161  Char_t isArray; \
162  DOLOOP { \
163  b >> isArray; \
164  char *arr_k = arr[k]; \
165  Int_t *l = (addCounter==-1 && arr_k) ? (Int_t*)(arr_k+imethod) : &addCounter; \
166  if (*l>0) { \
167  name* readbuf = new name[*l]; \
168  for (int j=0;j<len;j++) \
169  b.ReadArrayFunc(readbuf, *l); \
170  delete[] readbuf; \
171  } \
172  } \
173  } \
174  break; \
175  }
176 
177 ////////////////////////////////////////////////////////////////////////////////
178 /// Skip an element.
179 
180 template <class T>
181 Int_t TStreamerInfo::ReadBufferSkip(TBuffer &b, const T &arr, const TCompInfo *compinfo, Int_t kase,
182  TStreamerElement *aElement, Int_t narr,
183  Int_t eoffset)
184 {
185  TStreamerInfo* thisVar = this;
186 
187  // Skip elements in a TClonesArray
188 
189  TClass* cle = compinfo->fClass;
190 
191  Int_t imethod = compinfo->fMethod+eoffset;
192 
193  switch (kase) {
194 
195  // skip basic types
212  UInt_t dummy;
213  DOLOOP{
214  b >> dummy;
215  if ((dummy & kIsReferenced) != 0) {
216  UShort_t pidf;
217  b >> pidf;
218  }
219  }
220  break;
221  }
222 
223  // skip array of basic types array[8]
239 
240  // skip pointer to an array of basic types array[n]
256 
257  // skip char*
259  DOLOOP {
260  Int_t nch; b >> nch;
261  if (nch>0) {
262  char* readbuf = new char[nch];
263  b.ReadFastArray(readbuf,nch);
264  delete[] readbuf;
265  }
266  }
267  break;
268  }
269 
270  // skip Class* derived from TObject
272  DOLOOP{
273  for (Int_t j=0;j<compinfo->fLength;j++) {
274  b.SkipObjectAny();
275  }
276  }
277  break;
278  }
279 
280  // skip array counter //[n]
282  DOLOOP {
283  Int_t dummy; b >> dummy;
284  aElement->SetTObjectOffset(dummy);
285  }
286  break;
287  }
288 
289  // skip Class * derived from TObject with comment field //->
290  // skip Class derived from TObject
293  if (cle == TRef::Class()) {
294  TRef refjunk;
295  DOLOOP{ refjunk.Streamer(b);}
296  } else {
297  DOLOOP{
298  b.SkipObjectAny();
299  }
300  }
301  break;
302  }
303 
304  // skip Special case for TString, TObject, TNamed
306  TString s;
307  DOLOOP {
308  s.Streamer(b);
309  }
310  break;
311  }
313  TObject x;
314  DOLOOP {
315  x.Streamer(b);
316  }
317  break;
318  }
320  TNamed n;
321  DOLOOP {
322  n.Streamer(b);
323  }
324  break;
325  }
326 
327  // skip Class * not derived from TObject with comment field //->
329  DOLOOP {
330  b.SkipObjectAny();
331  }
332  break;
333  }
334 
335  // skip Class* not derived from TObject
337  DOLOOP {
338  for (Int_t j=0;j<compinfo->fLength;j++) {
339  b.SkipObjectAny();
340  }
341  }
342  break;
343  }
344 
345  // skip Any Class not derived from TObject
347  DOLOOP {
348  b.SkipObjectAny();
349  }
350  break;
351  }
352 
353  // skip Any Class not derived from TObject
357  if (fOldVersion<3) return 0;
358  b.SkipObjectAny();
359  break;
360  }
361 
362  // skip Base Class
364  DOLOOP {
365  b.SkipObjectAny();
366  }
367  break;
368  }
369 
372  DOLOOP {
373  b.SkipObjectAny();
374  }
375  break;
376  }
377  default:
378  //Error("ReadBufferClones","The element type %d is not supported yet\n",compinfo->fType);
379  return -1;
380  }
381  return 0;
382 }
383 
384 #define ConvCBasicType(name,stream) \
385  { \
386  DOLOOP { \
387  name u; \
388  stream; \
389  switch(compinfo->fNewType) { \
390  case TStreamerInfo::kBool: {Bool_t *x=(Bool_t*)(arr[k]+ioffset); *x = (Bool_t)u; break;} \
391  case TStreamerInfo::kChar: {Char_t *x=(Char_t*)(arr[k]+ioffset); *x = (Char_t)u; break;} \
392  case TStreamerInfo::kShort: {Short_t *x=(Short_t*)(arr[k]+ioffset); *x = (Short_t)u; break;} \
393  case TStreamerInfo::kInt: {Int_t *x=(Int_t*)(arr[k]+ioffset); *x = (Int_t)u; break;} \
394  case TStreamerInfo::kLong: {Long_t *x=(Long_t*)(arr[k]+ioffset); *x = (Long_t)u; break;} \
395  case TStreamerInfo::kLong64: {Long64_t *x=(Long64_t*)(arr[k]+ioffset); *x = (Long64_t)u; break;} \
396  case TStreamerInfo::kFloat: {Float_t *x=(Float_t*)(arr[k]+ioffset); *x = (Float_t)u; break;} \
397  case TStreamerInfo::kFloat16: {Float_t *x=(Float_t*)(arr[k]+ioffset); *x = (Float_t)u; break;} \
398  case TStreamerInfo::kDouble: {Double_t *x=(Double_t*)(arr[k]+ioffset); *x = (Double_t)u; break;} \
399  case TStreamerInfo::kDouble32:{Double_t *x=(Double_t*)(arr[k]+ioffset); *x = (Double_t)u; break;} \
400  case TStreamerInfo::kUChar: {UChar_t *x=(UChar_t*)(arr[k]+ioffset); *x = (UChar_t)u; break;} \
401  case TStreamerInfo::kUShort: {UShort_t *x=(UShort_t*)(arr[k]+ioffset); *x = (UShort_t)u; break;} \
402  case TStreamerInfo::kUInt: {UInt_t *x=(UInt_t*)(arr[k]+ioffset); *x = (UInt_t)u; break;} \
403  case TStreamerInfo::kULong: {ULong_t *x=(ULong_t*)(arr[k]+ioffset); *x = (ULong_t)u; break;} \
404  case TStreamerInfo::kULong64: {ULong64_t*x=(ULong64_t*)(arr[k]+ioffset);*x = (ULong64_t)u;break;} \
405  } \
406  } break; \
407  }
408 
409 #define ConvCBasicArrayTo(newtype) \
410  { \
411  newtype *f=(newtype*)(arr[k]+ioffset); \
412  for (j=0;j<len;j++) f[j] = (newtype)readbuf[j]; \
413  break; \
414  }
415 
416 #define ConvCBasicArray(name,ReadArrayFunc) \
417  { \
418  int j, len = compinfo->fLength; \
419  name* readbuf = new name[len]; \
420  int newtype = compinfo->fNewType%20; \
421  DOLOOP { \
422  b.ReadArrayFunc(readbuf, len); \
423  switch(newtype) { \
424  case TStreamerInfo::kBool: ConvCBasicArrayTo(Bool_t); \
425  case TStreamerInfo::kChar: ConvCBasicArrayTo(Char_t); \
426  case TStreamerInfo::kShort: ConvCBasicArrayTo(Short_t); \
427  case TStreamerInfo::kInt: ConvCBasicArrayTo(Int_t); \
428  case TStreamerInfo::kLong: ConvCBasicArrayTo(Long_t); \
429  case TStreamerInfo::kLong64: ConvCBasicArrayTo(Long64_t); \
430  case TStreamerInfo::kFloat: ConvCBasicArrayTo(Float_t); \
431  case TStreamerInfo::kFloat16: ConvCBasicArrayTo(Float_t); \
432  case TStreamerInfo::kDouble: ConvCBasicArrayTo(Double_t); \
433  case TStreamerInfo::kDouble32: ConvCBasicArrayTo(Double_t); \
434  case TStreamerInfo::kUChar: ConvCBasicArrayTo(UChar_t); \
435  case TStreamerInfo::kUShort: ConvCBasicArrayTo(UShort_t); \
436  case TStreamerInfo::kUInt: ConvCBasicArrayTo(UInt_t); \
437  case TStreamerInfo::kULong: ConvCBasicArrayTo(ULong_t); \
438  case TStreamerInfo::kULong64: ConvCBasicArrayTo(ULong64_t); \
439  } \
440  } \
441  delete[] readbuf; \
442  break; \
443  }
444 
445 #define ConvCBasicPointerToOutOfRange(newtype,ReadArrayFunc) \
446  { \
447  newtype **f=(newtype**)(arr[k]+ioffset); \
448  for (j=0;j<len;j++) { \
449  delete [] f[j]; \
450  f[j] = 0; \
451  } \
452  break; \
453  }
454 
455 #define ConvCBasicPointerTo(newtype,ReadArrayFunc) \
456  { \
457  newtype **f=(newtype**)(arr[k]+ioffset); \
458  for (j=0;j<len;j++) { \
459  delete [] f[j]; \
460  f[j] = new newtype[*l]; \
461  newtype *af = f[j]; \
462  b.ReadArrayFunc(readbuf, *l); \
463  for (jj=0;jj<*l;jj++) af[jj] = (newtype)readbuf[jj]; \
464  } \
465  break; \
466  }
467 
468 #define ConvCBasicPointer(name,ReadArrayFunc) \
469  { \
470  Char_t isArray; \
471  int j, jj, len = aElement->GetArrayDim()?aElement->GetArrayLength():1; \
472  name* readbuf = 0; \
473  int newtype = compinfo->fNewType %20; \
474  Int_t imethod = compinfo->fMethod+eoffset; \
475  DOLOOP { \
476  b >> isArray; \
477  Int_t *l = (Int_t*)(arr[k]+imethod); \
478  if (*l>0 && *l < b.BufferSize()) { \
479  readbuf = new name[*l]; \
480  switch(newtype) { \
481  case TStreamerInfo::kBool: ConvCBasicPointerTo(Bool_t,ReadArrayFunc); \
482  case TStreamerInfo::kChar: ConvCBasicPointerTo(Char_t,ReadArrayFunc); \
483  case TStreamerInfo::kShort: ConvCBasicPointerTo(Short_t,ReadArrayFunc); \
484  case TStreamerInfo::kInt: ConvCBasicPointerTo(Int_t,ReadArrayFunc); \
485  case TStreamerInfo::kLong: ConvCBasicPointerTo(Long_t,ReadArrayFunc); \
486  case TStreamerInfo::kLong64: ConvCBasicPointerTo(Long64_t,ReadArrayFunc); \
487  case TStreamerInfo::kFloat: ConvCBasicPointerTo(Float_t,ReadArrayFunc); \
488  case TStreamerInfo::kFloat16: ConvCBasicPointerTo(Float_t,ReadArrayFunc); \
489  case TStreamerInfo::kDouble: ConvCBasicPointerTo(Double_t,ReadArrayFunc); \
490  case TStreamerInfo::kDouble32: ConvCBasicPointerTo(Double_t,ReadArrayFunc); \
491  case TStreamerInfo::kUChar: ConvCBasicPointerTo(UChar_t,ReadArrayFunc); \
492  case TStreamerInfo::kUShort: ConvCBasicPointerTo(UShort_t,ReadArrayFunc); \
493  case TStreamerInfo::kUInt: ConvCBasicPointerTo(UInt_t,ReadArrayFunc); \
494  case TStreamerInfo::kULong: ConvCBasicPointerTo(ULong_t,ReadArrayFunc); \
495  case TStreamerInfo::kULong64: ConvCBasicPointerTo(ULong64_t,ReadArrayFunc); \
496  } \
497  delete[] readbuf; \
498  } else { \
499  switch(newtype) { \
500  case TStreamerInfo::kBool: ConvCBasicPointerToOutOfRange(Bool_t,ReadArrayFunc); \
501  case TStreamerInfo::kChar: ConvCBasicPointerToOutOfRange(Char_t,ReadArrayFunc); \
502  case TStreamerInfo::kShort: ConvCBasicPointerToOutOfRange(Short_t,ReadArrayFunc); \
503  case TStreamerInfo::kInt: ConvCBasicPointerToOutOfRange(Int_t,ReadArrayFunc); \
504  case TStreamerInfo::kLong: ConvCBasicPointerToOutOfRange(Long_t,ReadArrayFunc); \
505  case TStreamerInfo::kLong64: ConvCBasicPointerToOutOfRange(Long64_t,ReadArrayFunc); \
506  case TStreamerInfo::kFloat: ConvCBasicPointerToOutOfRange(Float_t,ReadArrayFunc); \
507  case TStreamerInfo::kFloat16: ConvCBasicPointerToOutOfRange(Float_t,ReadArrayFunc); \
508  case TStreamerInfo::kDouble: ConvCBasicPointerToOutOfRange(Double_t,ReadArrayFunc); \
509  case TStreamerInfo::kDouble32: ConvCBasicPointerToOutOfRange(Double_t,ReadArrayFunc); \
510  case TStreamerInfo::kUChar: ConvCBasicPointerToOutOfRange(UChar_t,ReadArrayFunc); \
511  case TStreamerInfo::kUShort: ConvCBasicPointerToOutOfRange(UShort_t,ReadArrayFunc); \
512  case TStreamerInfo::kUInt: ConvCBasicPointerToOutOfRange(UInt_t,ReadArrayFunc); \
513  case TStreamerInfo::kULong: ConvCBasicPointerToOutOfRange(ULong_t,ReadArrayFunc); \
514  case TStreamerInfo::kULong64: ConvCBasicPointerToOutOfRange(ULong64_t,ReadArrayFunc); \
515  } \
516  } \
517  readbuf = 0; \
518  } break; \
519  }
520 
521 ////////////////////////////////////////////////////////////////////////////////
522 /// Handle Artificial StreamerElement
523 
524 template <class T>
526  TStreamerElement *aElement, Int_t narr,
527  Int_t eoffset)
528 {
529  TStreamerArtificial *artElement = (TStreamerArtificial*)aElement;
530  ROOT::TSchemaRule::ReadRawFuncPtr_t rawfunc = artElement->GetReadRawFunc();
531 
532  if (rawfunc) {
533  for(Int_t k=0; k<narr; ++k) {
534  rawfunc( arr[k], b ); // Intentionally pass the object, so that the member can be set from other members.
535  }
536  return 0;
537  }
538 
539  ROOT::TSchemaRule::ReadFuncPtr_t readfunc = artElement->GetReadFunc();
540  // Process the result
541  if (readfunc) {
542  TVirtualObject obj(0);
543  TVirtualArray *objarr = ((TBufferFile&)b).PeekDataCache();
544  if (objarr) {
545  obj.fClass = objarr->fClass;
546  for(Int_t k=0; k<narr; ++k) {
547  obj.fObject = objarr->GetObjectAt(k);
548  readfunc(arr[k]+eoffset, &obj);
549  }
550  obj.fObject = 0; // Prevent auto deletion
551  } else {
552  for(Int_t k=0; k<narr; ++k) {
553  readfunc(arr[k]+eoffset, &obj);
554  }
555  }
556  return 0;
557  }
558 
559  return 0;
560 }
561 
562 ////////////////////////////////////////////////////////////////////////////////
563 /// Convert elements of a TClonesArray
564 
565 template <class T>
566 Int_t TStreamerInfo::ReadBufferConv(TBuffer &b, const T &arr, const TCompInfo *compinfo, Int_t kase,
567  TStreamerElement *aElement, Int_t narr,
568  Int_t eoffset)
569 {
570  Int_t ioffset = eoffset+compinfo->fOffset;
571 
572  switch (kase) {
573 
574  // convert basic types
580  ConvCBasicType(Long64_t,b >> u);
581  } else {
582  ConvCBasicType(Long_t,b >> u);
583  }
593 #if defined(_MSC_VER) && (_MSC_VER <= 1200)
594  ConvCBasicType(Long64_t,b >> u);
595 #else
596  ConvCBasicType(ULong64_t,b >> u);
597 #endif
598  } else {
599  ConvCBasicType(ULong_t,b >> u);
600  }
601 #if defined(_MSC_VER) && (_MSC_VER <= 1200)
603 #else
605 #endif
607  DOLOOP {
608  UInt_t u;
609  b >> u;
610  if ((u & kIsReferenced) != 0) {
611  UShort_t pidf;
612  b >> pidf;
613  pidf += b.GetPidOffset();
614  TProcessID *pid = b.ReadProcessID(pidf);
615  if (pid!=0) {
616  TObject *obj = (TObject*)(arr[k]+eoffset);
617  UInt_t gpid = pid->GetUniqueID();
618  UInt_t uid;
619  if (gpid>=0xff) {
620  uid = obj->GetUniqueID() | 0xff000000;
621  } else {
622  uid = ( obj->GetUniqueID() & 0xffffff) + (gpid<<24);
623  }
624  obj->SetUniqueID(uid);
625  pid->PutObjectWithID(obj);
626  }
627  }
628  switch(compinfo->fNewType) {
629  case TStreamerInfo::kBool: {Bool_t *x=(Bool_t*)(arr[k]+ioffset); *x = (Bool_t)u; break;}
630  case TStreamerInfo::kChar: {Char_t *x=(Char_t*)(arr[k]+ioffset); *x = (Char_t)u; break;}
631  case TStreamerInfo::kShort: {Short_t *x=(Short_t*)(arr[k]+ioffset); *x = (Short_t)u; break;}
632  case TStreamerInfo::kInt: {Int_t *x=(Int_t*)(arr[k]+ioffset); *x = (Int_t)u; break;}
633  case TStreamerInfo::kLong: {Long_t *x=(Long_t*)(arr[k]+ioffset); *x = (Long_t)u; break;}
634  case TStreamerInfo::kLong64: {Long64_t *x=(Long64_t*)(arr[k]+ioffset); *x = (Long64_t)u; break;}
635  case TStreamerInfo::kFloat: {Float_t *x=(Float_t*)(arr[k]+ioffset); *x = (Float_t)u; break;}
636  case TStreamerInfo::kFloat16: {Float_t *x=(Float_t*)(arr[k]+ioffset); *x = (Float_t)u; break;}
637  case TStreamerInfo::kDouble: {Double_t *x=(Double_t*)(arr[k]+ioffset); *x = (Double_t)u; break;}
638  case TStreamerInfo::kDouble32:{Double_t *x=(Double_t*)(arr[k]+ioffset); *x = (Double_t)u; break;}
639  case TStreamerInfo::kUChar: {UChar_t *x=(UChar_t*)(arr[k]+ioffset); *x = (UChar_t)u; break;}
640  case TStreamerInfo::kUShort: {UShort_t *x=(UShort_t*)(arr[k]+ioffset); *x = (UShort_t)u; break;}
641  case TStreamerInfo::kUInt: {UInt_t *x=(UInt_t*)(arr[k]+ioffset); *x = (UInt_t)u; break;}
642  case TStreamerInfo::kULong: {ULong_t *x=(ULong_t*)(arr[k]+ioffset); *x = (ULong_t)u; break;}
643  case TStreamerInfo::kULong64: {ULong64_t*x=(ULong64_t*)(arr[k]+ioffset);*x = (ULong64_t)u;break;}
644  }
645  } break;
646  }
647 
648  // convert array of basic types array[8]
654  if (compinfo->fNewType==TStreamerInfo::kLong64 || compinfo->fNewType==TStreamerInfo::kULong64) {
655  ConvCBasicArray(Long64_t,ReadFastArray);
656  } else {
657  ConvCBasicArray(Long_t,ReadFastArray);
658  }
668  if (compinfo->fNewType==TStreamerInfo::kLong64 || compinfo->fNewType==TStreamerInfo::kULong64) {
669 #if defined(_MSC_VER) && (_MSC_VER <= 1200)
670  ConvCBasicArray(Long64_t,ReadFastArray)
671 #else
672  ConvCBasicArray(ULong64_t,ReadFastArray)
673 #endif
674  } else {
675  ConvCBasicArray(ULong_t,ReadFastArray);
676  }
677 #if defined(_MSC_VER) && (_MSC_VER <= 1200)
679 #else
681 #endif
682 
683  // convert pointer to an array of basic types array[n]
689  if (compinfo->fNewType==TStreamerInfo::kLong64 || compinfo->fNewType==TStreamerInfo::kULong64) {
690  ConvCBasicPointer(Long64_t,ReadFastArray);
691  } else {
692  ConvCBasicPointer(Long_t,ReadFastArray);
693  }
703  if (compinfo->fNewType==TStreamerInfo::kLong64 || compinfo->fNewType==TStreamerInfo::kULong64) {
704 #if defined(_MSC_VER) && (_MSC_VER <= 1200)
705  ConvCBasicPointer(Long64_t,ReadFastArray)
706 #else
707  ConvCBasicPointer(ULong64_t,ReadFastArray)
708 #endif
709  } else {
710  ConvCBasicPointer(ULong_t,ReadFastArray);
711  }
712 #if defined(_MSC_VER) && (_MSC_VER <= 1200)
714 #else
716 #endif
717 
718  default:
719  // Warning("ReadBufferConv","The element type %d is not supported yet",compinfo->fType);
720  return -1;
721 
722  }
723 
724  return 0;
725 }
726 
727 // Helper function for TStreamerInfo::ReadBuffer
728 namespace {
729  template <class T> Bool_t R__TestUseCache(TStreamerElement *element)
730  {
731  return element->TestBit(TStreamerElement::kCache);
732  }
733 
734  template <> Bool_t R__TestUseCache<TVirtualArray>(TStreamerElement*)
735  {
736  // We are already using the cache, no need to recurse one more time.
737  return kFALSE;
738  }
739 }
740 
741 ////////////////////////////////////////////////////////////////////////////////
742 /// Deserialize information from buffer b into object at pointer
743 /// if (arrayMode & 1) ptr is a pointer to array of pointers to the objects
744 /// otherwise it is a pointer to a pointer to a single object.
745 /// This also means that T is of a type such that arr[i] is a pointer to an
746 /// object. Currently the only anticipated instantiation are for T==char**
747 /// and T==TVirtualCollectionProxy
748 
749 template <class T>
751  TCompInfo *const*const compinfo, Int_t first, Int_t last,
752  Int_t narr, Int_t eoffset, Int_t arrayMode)
753 {
754  TStreamerInfo *thisVar = this;
755  Bool_t needIncrement = !( arrayMode & 2 );
756  arrayMode = arrayMode & (~2);
757 
758  if (needIncrement) b.IncrementLevel(thisVar);
759 
760  //loop on all active members
761 
762  // In order to speed up the case where the object being written is
763  // not in a collection (i.e. arrayMode is false), we actually
764  // duplicate the code for the elementary types using this typeOffset.
765  static const int kHaveLoop = 1024;
766  const Int_t typeOffset = arrayMode ? kHaveLoop : 0;
767 
768  TClass *cle = 0;
769  TClass *newCle = 0;
770  TMemberStreamer *pstreamer=0;
771  Int_t isPreAlloc = 0;
772  for (Int_t i=first;i<last;i++) {
773  TStreamerElement * aElement = (TStreamerElement*)compinfo[i]->fElem;
774  CurrentElement() = aElement;
775 
776  if (needIncrement) b.SetStreamerElementNumber(aElement,compinfo[i]->fType);
777 
778  if (aElement->TestBit(TStreamerElement::kWrite)) continue;
779 
780  if (R__TestUseCache<T>(aElement)) {
781  Int_t bufpos = b.Length();
782  if (((TBufferFile&)b).PeekDataCache()==0) {
783  Warning("ReadBuffer","Skipping %s::%s because the cache is missing.",thisVar->GetName(),aElement->GetName());
784  thisVar->ReadBufferSkip(b,arr,compinfo[i],compinfo[i]->fType+TStreamerInfo::kSkip,aElement,narr,eoffset);
785  } else {
786  if (gDebug > 1) {
787  printf("ReadBuffer, class:%s, name=%s, fType[%d]=%d,"
788  " %s, bufpos=%d, arr=%p, eoffset=%d, Redirect=%p\n",
789  fClass->GetName(),aElement->GetName(),i,compinfo[i]->fType,
790  aElement->ClassName(),b.Length(),arr[0], eoffset,((TBufferFile&)b).PeekDataCache()->GetObjectAt(0));
791  }
792  thisVar->ReadBuffer(b,*((TBufferFile&)b).PeekDataCache(),compinfo,i,i+1,narr,eoffset, arrayMode);
793  }
794  if (aElement->TestBit(TStreamerElement::kRepeat)) { b.SetBufferOffset(bufpos); }
795  continue;
796  }
797  const Int_t ioffset = compinfo[i]->fOffset+eoffset;
798 
799  if (gDebug > 1) {
800  printf("ReadBuffer, class:%s, name=%s, fType[%d]=%d,"
801  " %s, bufpos=%d, arr=%p, offset=%d\n",
802  fClass->GetName(),aElement->GetName(),i,compinfo[i]->fType,
803  aElement->ClassName(),b.Length(),arr[0], ioffset);
804  }
805 
806  Int_t kase = compinfo[i]->fType;
807 
808  switch (kase + typeOffset) {
809 
810  // read basic types
811  case TStreamerInfo::kBool: ReadBasicType(Bool_t); continue;
812  case TStreamerInfo::kChar: ReadBasicType(Char_t); continue;
814  case TStreamerInfo::kInt: ReadBasicType(Int_t); continue;
815  case TStreamerInfo::kLong: ReadBasicType(Long_t); continue;
821  case TStreamerInfo::kUInt: ReadBasicType(UInt_t); continue;
825  Float_t *x=(Float_t*)(arr[0]+ioffset);
826  b.ReadFloat16(x,aElement);
827  continue;
828  }
830  Double_t *x=(Double_t*)(arr[0]+ioffset);
831  b.ReadDouble32(x,aElement);
832  continue;
833  }
834 
835  case TStreamerInfo::kBool + kHaveLoop: ReadBasicTypeLoop(Bool_t); continue;
836  case TStreamerInfo::kChar + kHaveLoop: ReadBasicTypeLoop(Char_t); continue;
837  case TStreamerInfo::kShort + kHaveLoop: ReadBasicTypeLoop(Short_t); continue;
838  case TStreamerInfo::kInt + kHaveLoop: ReadBasicTypeLoop(Int_t); continue;
839  case TStreamerInfo::kLong + kHaveLoop: ReadBasicTypeLoop(Long_t); continue;
840  case TStreamerInfo::kLong64 + kHaveLoop: ReadBasicTypeLoop(Long64_t); continue;
841  case TStreamerInfo::kFloat + kHaveLoop: ReadBasicTypeLoop(Float_t); continue;
842  case TStreamerInfo::kDouble + kHaveLoop: ReadBasicTypeLoop(Double_t); continue;
843  case TStreamerInfo::kUChar + kHaveLoop: ReadBasicTypeLoop(UChar_t); continue;
844  case TStreamerInfo::kUShort + kHaveLoop: ReadBasicTypeLoop(UShort_t); continue;
845  case TStreamerInfo::kUInt + kHaveLoop: ReadBasicTypeLoop(UInt_t); continue;
846  case TStreamerInfo::kULong + kHaveLoop: ReadBasicTypeLoop(ULong_t); continue;
847  case TStreamerInfo::kULong64+ kHaveLoop: ReadBasicTypeLoop(ULong64_t); continue;
848  case TStreamerInfo::kFloat16 + kHaveLoop: {
849  for(Int_t k=0; k<narr; ++k) {
850  Float_t *x=(Float_t*)(arr[k]+ioffset);
851  b.ReadFloat16(x,aElement);
852  }
853  continue;
854  }
855  case TStreamerInfo::kDouble32 + kHaveLoop: {
856  for(Int_t k=0; k<narr; ++k) {
857  Double_t *x=(Double_t*)(arr[k]+ioffset);
858  b.ReadDouble32(x,aElement);
859  }
860  continue;
861  }
862 
863  // read array of basic types like array[8]
878  b.ReadFastArrayFloat16((Float_t*)(arr[0]+ioffset),compinfo[i]->fLength,aElement);
879  continue;
880  }
882  b.ReadFastArrayDouble32((Double_t*)(arr[0]+ioffset),compinfo[i]->fLength,aElement);
883  continue;
884  }
885 
900  for(Int_t k=0; k<narr; ++k) {
901  b.ReadFastArrayFloat16((Float_t*)(arr[k]+ioffset),compinfo[i]->fLength,aElement);
902  }
903  continue;
904  }
906  for(Int_t k=0; k<narr; ++k) {
907  b.ReadFastArrayDouble32((Double_t*)(arr[k]+ioffset),compinfo[i]->fLength,aElement);
908  }
909  continue;
910  }
911 
912  // read pointer to an array of basic types array[n]
927  Char_t isArray;
928  b >> isArray;
929  const int imethod = compinfo[i]->fMethod+eoffset;
930  Int_t *l = (Int_t*)(arr[0]+imethod);
931  Float_t **f = (Float_t**)(arr[0]+ioffset);
932  int j;
933  for(j=0;j<compinfo[i]->fLength;j++) {
934  delete [] f[j];
935  f[j] = 0; if (*l <=0) continue;
936  f[j] = new Float_t[*l];
937  b.ReadFastArrayFloat16(f[j],*l,aElement);
938  }
939  continue;
940  }
942  Char_t isArray;
943  b >> isArray;
944  const int imethod = compinfo[i]->fMethod+eoffset;
945  Int_t *l = (Int_t*)(arr[0]+imethod);
946  Double_t **f = (Double_t**)(arr[0]+ioffset);
947  int j;
948  for(j=0;j<compinfo[i]->fLength;j++) {
949  delete [] f[j];
950  f[j] = 0; if (*l <=0) continue;
951  f[j] = new Double_t[*l];
952  b.ReadFastArrayDouble32(f[j],*l,aElement);
953  }
954  continue;
955  }
956 
971  const int imethod = compinfo[i]->fMethod+eoffset;
972  for(Int_t k=0; k<narr; ++k) {
973  Char_t isArray;
974  b >> isArray;
975  Int_t *l = (Int_t*)(arr[k]+imethod);
976  Float_t **f = (Float_t**)(arr[k]+ioffset);
977  int j;
978  for(j=0;j<compinfo[i]->fLength;j++) {
979  delete [] f[j];
980  f[j] = 0; if (*l <=0) continue;
981  f[j] = new Float_t[*l];
982  b.ReadFastArrayFloat16(f[j],*l,aElement);
983  }
984  }
985  continue;
986  }
988  const int imethod = compinfo[i]->fMethod+eoffset;
989  for(Int_t k=0; k<narr; ++k) {
990  Char_t isArray;
991  b >> isArray;
992  Int_t *l = (Int_t*)(arr[k]+imethod);
993  Double_t **f = (Double_t**)(arr[k]+ioffset);
994  int j;
995  for(j=0;j<compinfo[i]->fLength;j++) {
996  delete [] f[j];
997  f[j] = 0; if (*l <=0) continue;
998  f[j] = new Double_t[*l];
999  b.ReadFastArrayDouble32(f[j],*l,aElement);
1000  }
1001  }
1002  continue;
1003  }
1004  }
1005 
1006  switch (kase) {
1007 
1008  // char*
1009  case TStreamerInfo::kCharStar: {
1010  DOLOOP {
1011  char **f = (char**)(arr[k]+ioffset);
1012  b.ReadCharStar(*f);
1013  }
1014  }
1015  continue;
1016 
1017  // special case for TObject::fBits in case of a referenced object
1018  case TStreamerInfo::kBits: {
1019  DOLOOP {
1020  UInt_t *x=(UInt_t*)(arr[k]+ioffset); b >> *x;
1021  if ((*x & kIsReferenced) != 0) {
1022  UShort_t pidf;
1023  b >> pidf;
1024  pidf += b.GetPidOffset();
1025  TProcessID *pid = b.ReadProcessID(pidf);
1026  if (pid!=0) {
1027  TObject *obj = (TObject*)(arr[k]+eoffset);
1028  UInt_t gpid = pid->GetUniqueID();
1029  UInt_t uid;
1030  if (gpid>=0xff) {
1031  uid = obj->GetUniqueID() | 0xff000000;
1032  } else {
1033  uid = ( obj->GetUniqueID() & 0xffffff) + (gpid<<24);
1034  }
1035  obj->SetUniqueID(uid);
1036  pid->PutObjectWithID(obj);
1037  }
1038  }
1039  }
1040  }
1041  continue;
1042 
1043  // array counter //[n]
1044  case TStreamerInfo::kCounter: {
1045  DOLOOP {
1046  Int_t *x=(Int_t*)(arr[k]+ioffset);
1047  b >> *x;
1048  }
1049  }
1050  continue;
1051 
1052 
1053  // Special case for TString, TObject, TNamed
1054  case TStreamerInfo::kTString: { DOLOOP { ((TString*)(arr[k]+ioffset))->Streamer(b); } } continue;
1055  case TStreamerInfo::kTObject: { DOLOOP { ((TObject*)(arr[k]+ioffset))->TObject::Streamer(b);} } continue;
1056  case TStreamerInfo::kTNamed: { DOLOOP { ((TNamed*) (arr[k]+ioffset))->TNamed::Streamer(b) ;} } continue;
1057 
1058  }
1059 
1060  SWIT:
1061  isPreAlloc= 0;
1062  cle = compinfo[i]->fClass;
1063  newCle = compinfo[i]->fNewClass;
1064  pstreamer = compinfo[i]->fStreamer;
1065 
1066  switch (kase) {
1067 
1068  case TStreamerInfo::kAnyp: // Class* not derived from TObject with comment field //->
1070  case TStreamerInfo::kObjectp: // Class* derived from TObject with comment field //->
1072  isPreAlloc = 1;
1073  // Intentional fallthrough now that isPreAlloc is set.
1074  case TStreamerInfo::kObjectP: // Class* derived from TObject with no comment field NOTE: Re-added by Phil
1076  case TStreamerInfo::kAnyP: // Class* not derived from TObject with no comment field NOTE:: Re-added by Phil
1078  DOLOOP {
1079  b.ReadFastArray((void**)(arr[k]+ioffset),cle,compinfo[i]->fLength,isPreAlloc,pstreamer);
1080  }
1081  }
1082  continue;
1083 
1084 // case TStreamerInfo::kSTLvarp: // Variable size array of STL containers.
1085 // {
1086 // TMemberStreamer *pstreamer = compinfo[i]->fStreamer;
1087 // TClass *cl = compinfo[i]->fClass;
1088 // ROOT::NewArrFunc_t arraynew = cl->GetNewArray();
1089 // ROOT::DelArrFunc_t arraydel = cl->GetDeleteArray();
1090 // UInt_t start,count;
1091 // // Version_t v =
1092 // b.ReadVersion(&start, &count, cle);
1093 // if (pstreamer == 0) {
1094 // Int_t size = cl->Size();
1095 // Int_t imethod = compinfo[i]->fMethod+eoffset;
1096 // DOLOOP {
1097 // char **contp = (char**)(arr[k]+ioffset);
1098 // const Int_t *counter = (Int_t*)(arr[k]+imethod);
1099 // const Int_t sublen = (*counter);
1100 
1101 // for(int j=0;j<compinfo[i]->fLength;++j) {
1102 // if (arraydel) arraydel(contp[j]);
1103 // contp[j] = 0;
1104 // if (sublen<=0) continue;
1105 // if (arraynew) {
1106 // contp[j] = (char*)arraynew(sublen, 0);
1107 // char *cont = contp[j];
1108 // for(int k=0;k<sublen;++k) {
1109 // cl->Streamer( cont, b );
1110 // cont += size;
1111 // }
1112 // } else {
1113 // // Can't create an array of object
1114 // Error("ReadBuffer","The element %s::%s type %d (%s) can be read because of the class does not have access to new %s[..]\n",
1115 // GetName(),aElement->GetFullName(),kase,aElement->GetTypeName(),GetName());
1116 // void *cont = cl->New();
1117 // for(int k=0;k<sublen;++k) {
1118 // cl->Streamer( cont, b );
1119 // }
1120 // }
1121 // }
1122 // }
1123 // } else {
1124 // DOLOOP{(*pstreamer)(b,arr[k]+ioffset,compinfo[i]->fLength);}
1125 // }
1126 // b.CheckByteCount(start,count,aElement->GetFullName());
1127 // }
1128 // continue;
1129 
1130  case TStreamerInfo::kSTLp: // Pointer to Container with no virtual table (stl) and no comment
1131  case TStreamerInfo::kSTLp + TStreamerInfo::kOffsetL: // array of pointers to Container with no virtual table (stl) and no comment
1132  {
1133  UInt_t start,count;
1134  Version_t vers = b.ReadVersion(&start, &count, cle);
1135 
1136  if ( vers & TBufferFile::kStreamedMemberWise ) {
1137  // Collection was saved member-wise
1138 
1139  vers &= ~( TBufferFile::kStreamedMemberWise );
1140 
1141  TClass *newClass = aElement->GetNewClass();
1142  TClass *oldClass = aElement->GetClassPointer();
1143  if( vers < 9 && newClass && newClass!=oldClass ) {
1144  Error( "ReadBuffer", "Unfortunately, version %d of TStreamerInfo (used in %s) did not record enough information to convert a %s into a %s.",
1145  vers, b.GetParent() ? b.GetParent()->GetName() : "memory/socket", oldClass->GetName(), newClass->GetName() );
1146  continue;
1147  }
1148 
1149  Version_t vClVersion = 0; // For vers less than 9, we have to use the current version.
1150  if( vers >= 9 ) {
1151  vClVersion = b.ReadVersionForMemberWise( cle->GetCollectionProxy()->GetValueClass() );
1152  }
1153 
1154  TVirtualCollectionProxy *newProxy = (newClass ? newClass->GetCollectionProxy() : 0);
1155  TVirtualCollectionProxy *oldProxy = oldClass->GetCollectionProxy();
1156  TStreamerInfo *subinfo = 0;
1157 
1158  if( newProxy ) {
1159  // coverity[dereference] oldProxy->GetValueClass() can not be null since this was streamed memberwise.
1160  subinfo = (TStreamerInfo*)newProxy->GetValueClass()->GetConversionStreamerInfo( oldProxy->GetValueClass(), vClVersion );
1161  } else {
1162  subinfo = (TStreamerInfo*)oldProxy->GetValueClass()->GetStreamerInfo( vClVersion );
1163  newProxy = oldProxy;
1164  }
1165  if (subinfo) {
1166  DOLOOP {
1167  void* env;
1168  void **contp = (void**)(arr[k]+ioffset);
1169  int j;
1170  for(j=0;j<compinfo[i]->fLength;j++) {
1171  void *cont = contp[j];
1172  if (cont==0) {
1173  contp[j] = cle->New();
1174  cont = contp[j];
1175  }
1176  TVirtualCollectionProxy::TPushPop helper( newProxy, cont );
1177  Int_t nobjects;
1178  b >> nobjects;
1179  env = newProxy->Allocate(nobjects,true);
1180  subinfo->ReadBufferSTL(b,newProxy,nobjects,/* offset */ 0, vers>=7 );
1181  newProxy->Commit(env);
1182  }
1183  }
1184  }
1185  b.CheckByteCount(start,count,aElement->GetFullName());
1186  continue;
1187  }
1188  if (pstreamer == 0) {
1189  DOLOOP {
1190  void **contp = (void**)(arr[k]+ioffset);
1191  int j;
1192  for(j=0;j<compinfo[i]->fLength;j++) {
1193  void *cont = contp[j];
1194  if (cont==0) {
1195  // int R__n;
1196  // b >> R__n;
1197  // b.SetOffset(b.GetOffset()-4); // rewind to the start of the int
1198  // if (R__n) continue;
1199  contp[j] = cle->New();
1200  cont = contp[j];
1201  }
1202  cle->Streamer( cont, b );
1203  }
1204  }
1205  } else {
1206  DOLOOP {(*pstreamer)(b,arr[k]+ioffset,compinfo[i]->fLength);}
1207  }
1208  b.CheckByteCount(start,count,aElement->GetFullName());
1209  }
1210  continue;
1211 
1212  case TStreamerInfo::kSTL: // Container with no virtual table (stl) and no comment
1213  case TStreamerInfo::kSTL + TStreamerInfo::kOffsetL: // array of Container with no virtual table (stl) and no comment
1214  {
1215  UInt_t start, count;
1216  Version_t vers = b.ReadVersion(&start, &count, cle);
1217 
1218  if ( vers & TBufferFile::kStreamedMemberWise ) {
1219  // Collection was saved member-wise
1220  vers &= ~( TBufferFile::kStreamedMemberWise );
1221 
1222  TClass *newClass = aElement->GetNewClass();
1223  TClass *oldClass = aElement->GetClassPointer();
1224 
1225  if( vers < 8 && newClass && newClass!=oldClass ) {
1226  Error( "ReadBuffer", "Unfortunately, version %d of TStreamerInfo (used in %s) did not record enough information to convert a %s into a %s.",
1227  vers, b.GetParent() ? b.GetParent()->GetName() : "memory/socket", oldClass->GetName(), newClass->GetName() );
1228  continue;
1229  }
1230  TVirtualCollectionProxy *oldProxy = oldClass->GetCollectionProxy();
1231  TClass *valueClass = oldProxy ? oldProxy->GetValueClass() : 0;
1232  Version_t vClVersion = 0; // For vers less than 8, we have to use the current version.
1233  if( vers >= 8 ) {
1234  vClVersion = b.ReadVersionForMemberWise( valueClass );
1235  }
1236 
1237  if (valueClass == 0) {
1238  // MemberWise streaming applies to only collection of classes, and hence
1239  // valueClass can only be null if we are reading without the original library
1240  // and the collection is always empty,
1241  // So let's skip the rest (which requires the StreamerInfo of the valueClass ... which we do not have)
1242 
1243  b.SetBufferOffset(start+count+sizeof(UInt_t));
1244  continue;
1245  }
1246 
1247  TVirtualCollectionProxy *newProxy = (newClass ? newClass->GetCollectionProxy() : 0);
1248  TStreamerInfo *subinfo = 0;
1249 
1250  if( newProxy ) {
1251  // coverity[dereference] oldProxy->GetValueClass() can not be null since this was streamed memberwise.
1252  subinfo = (TStreamerInfo*)newProxy->GetValueClass()->GetConversionStreamerInfo( oldProxy->GetValueClass(), vClVersion );
1253  } else {
1254  subinfo = (TStreamerInfo*)valueClass->GetStreamerInfo( vClVersion );
1255  newProxy = oldProxy;
1256  }
1257  if (subinfo) {
1258  DOLOOP {
1259  int objectSize = cle->Size();
1260  char *obj = arr[k]+ioffset;
1261  char *end = obj + compinfo[i]->fLength*objectSize;
1262 
1263  for(; obj<end; obj+=objectSize) {
1264  TVirtualCollectionProxy::TPushPop helper( newProxy, obj );
1265  Int_t nobjects;
1266  b >> nobjects;
1267  void* env = newProxy->Allocate(nobjects,true);
1268  subinfo->ReadBufferSTL(b,newProxy,nobjects,/* offset */ 0, vers >= 7);
1269  newProxy->Commit(env);
1270  }
1271  }
1272  }
1273  b.CheckByteCount(start,count,aElement->GetTypeName());
1274  continue;
1275  }
1276  if (fOldVersion<3){ // case of old TStreamerInfo
1277  // Backward compatibility. Some TStreamerElement's where without
1278  // Streamer but were not removed from element list
1279  if (aElement->IsBase() && aElement->IsA()!=TStreamerBase::Class()) {
1280  b.SetBufferOffset(start); //there is no byte count
1281  } else if (vers==0) {
1282  b.SetBufferOffset(start); //there is no byte count
1283  }
1284  }
1285  if (pstreamer == 0) {
1286  if( !newCle ) {
1287  newCle = cle;
1288  cle = 0;
1289  }
1290  DOLOOP {
1291  b.ReadFastArray((void*)(arr[k]+ioffset),newCle,compinfo[i]->fLength,(TMemberStreamer*)0, cle );
1292  }
1293  } else {
1294  DOLOOP {(*pstreamer)(b,arr[k]+ioffset,compinfo[i]->fLength);}
1295  }
1296  b.CheckByteCount(start,count,aElement->GetTypeName());
1297  }
1298  continue;
1299 
1300  case TStreamerInfo::kObject: // Class derived from TObject
1301  if (cle->IsStartingWithTObject() && cle->GetState() > TClass::kEmulated) {
1302  DOLOOP {((TObject*)(arr[k]+ioffset))->Streamer(b);}
1303  continue; // intentionally inside the if statement.
1304  // if the class does not start with its TObject part (or does
1305  // not have one), we use the generic case.
1306  }
1307  case TStreamerInfo::kAny: // Class not derived from TObject
1308  if (pstreamer) {
1309  DOLOOP {(*pstreamer)(b,arr[k]+ioffset,0);}
1310  } else {
1311  if( newCle )
1312  DOLOOP { newCle->Streamer( arr[k]+ioffset, b, cle ); }
1313  else
1314  DOLOOP { cle->Streamer(arr[k]+ioffset,b);}
1315  }
1316  continue;
1317 
1319  TFile *file = (TFile*)b.GetParent();
1320  if (file && file->GetVersion() < 30208) {
1321  // For older ROOT file we use a totally different case to treat
1322  // this situation, so we change 'kase' and restart.
1323  kase = TStreamerInfo::kStreamer;
1324  goto SWIT;
1325  }
1326  // there is intentionally no break/continue statement here.
1327  // For newer ROOT file, we always use the generic case for kOffsetL(s)
1328  }
1329 
1331  DOLOOP {
1332  b.ReadFastArray((void*)(arr[k]+ioffset),cle,compinfo[i]->fLength,pstreamer);
1333  }
1334  continue;
1335  }
1336 
1337  // Base Class
1338  case TStreamerInfo::kBase:
1339  if (!(arrayMode&1)) {
1340  if(pstreamer) {kase = TStreamerInfo::kStreamer; goto SWIT;}
1341  DOLOOP { ((TStreamerBase*)aElement)->ReadBuffer(b,arr[k]);}
1342  } else {
1343  // FIXME: Rather than relying on the StreamerElement to
1344  // contain the base class version information we should
1345  // embed it in the bytestream even in the member-wise case.
1346  // For now rely, on the StreamerElement:
1347  TStreamerInfo *binfo = ((TStreamerInfo*)((TStreamerBase*)aElement)->GetBaseStreamerInfo());
1348  binfo->ReadBuffer(b,arr,binfo->fCompFull,0,binfo->fNfulldata,narr,ioffset,arrayMode);
1349  }
1350  continue;
1351 
1355  {
1356  // Backward compatibility. Some TStreamerElement's where without
1357  // Streamer but were not removed from element list
1358  UInt_t start,count;
1359  Version_t v = b.ReadVersion(&start, &count, cle);
1360  if (fOldVersion<3){ // case of old TStreamerInfo
1361  if (count<= 0 || v != fOldVersion) {
1362  b.SetBufferOffset(start);
1363  continue;
1364  }
1365  }
1366  DOLOOP {
1367  b.ReadFastArray((void*)(arr[k]+ioffset),cle,compinfo[i]->fLength,pstreamer);
1368  }
1369  b.CheckByteCount(start,count,aElement->GetFullName());
1370  continue;
1371  }
1372 
1373 
1375  // Backward compatibility. Some TStreamerElement's where without
1376  // Streamer but were not removed from element list
1377  UInt_t start,count;
1378  Version_t v = b.ReadVersion(&start, &count, cle);
1379  if (fOldVersion<3){ // case of old TStreamerInfo
1380  if (aElement->IsBase() && aElement->IsA()!=TStreamerBase::Class()) {
1381  b.SetBufferOffset(start); //it was no byte count
1382  } else if (kase == TStreamerInfo::kSTL || kase == TStreamerInfo::kSTL+TStreamerInfo::kOffsetL ||
1383  count<= 0 || v != fOldVersion) {
1384  b.SetBufferOffset(start);
1385  continue;
1386  }
1387  }
1388  if (pstreamer == 0) {
1389  Error("ReadBuffer","Streamer for %s is null\n",aElement->GetName());
1390  if (gDebug > 0) {
1391  aElement->ls(); continue;
1392  }
1393  } else {
1394  DOLOOP {(*pstreamer)(b,arr[k]+ioffset,compinfo[i]->fLength);}
1395  }
1396  b.CheckByteCount(start,count,aElement->GetFullName());
1397  }
1398  continue;
1399 
1401  // -- A pointer to a varying-length array of objects.
1402  // MyClass* ary; //[n]
1403  // -- Or a pointer to a varying-length array of pointers to objects.
1404  // MyClass** ary; //[n]
1406  // -- An array of pointers to a varying-length array of objects.
1407  // MyClass* ary[d]; //[n]
1408  // -- Or an array of pointers to a varying-length array of pointers to objects.
1409  // MyClass** ary[d]; //[n]
1410  {
1411  // Get the class of the data member.
1412  TClass* cl = compinfo[i]->fClass;
1413  // Which are we, an array of objects or an array of pointers to objects?
1414  Bool_t isPtrPtr = (strstr(aElement->GetTypeName(), "**") != 0);
1415  // Check for a private streamer.
1416  if (pstreamer) {
1417  // -- We have a private streamer.
1418  // Read the class version and byte count from the buffer.
1419  UInt_t start = 0;
1420  UInt_t count = 0;
1421  b.ReadVersion(&start, &count, cl);
1422  // Loop over the entries in the clones array or the STL container.
1423  for (Int_t k = 0; k < narr; ++k) {
1424  Int_t* counter = (Int_t*) (arr[k] /*entry pointer*/ + eoffset /*entry offset*/ + compinfo[i]->fMethod /*counter offset*/);
1425  // And call the private streamer, passing it the buffer, the object, and the counter.
1426  (*pstreamer)(b, arr[k] /*entry pointer*/ + ioffset /*object offset*/, *counter);
1427  }
1428  b.CheckByteCount(start, count, aElement->GetFullName());
1429  // We are done, next streamer element.
1430  continue;
1431  }
1432  // At this point we do *not* have a private streamer.
1433  // Get the version of the file we are reading from.
1434  TFile* file = (TFile*) b.GetParent();
1435  // By default assume the file version is the newest.
1436  Int_t fileVersion = kMaxInt;
1437  if (file) {
1438  fileVersion = file->GetVersion();
1439  }
1440  // Read the class version and byte count from the buffer.
1441  UInt_t start = 0;
1442  UInt_t count = 0;
1443  b.ReadVersion(&start, &count, cl);
1444  if (fileVersion > 51508) {
1445  // -- Newer versions allow polymorphic pointers.
1446  // Loop over the entries in the clones array or the STL container.
1447  for (Int_t k = 0; k < narr; ++k) {
1448  // Get the counter for the varying length array.
1449  Int_t vlen = *((Int_t*) (arr[k] /*entry pointer*/ + eoffset /*entry offset*/ + compinfo[i]->fMethod /*counter offset*/));
1450  //Int_t realLen;
1451  //b >> realLen;
1452  //if (realLen != vlen) {
1453  // fprintf(stderr, "read vlen: %d realLen: %s\n", vlen, realLen);
1454  //}
1455  // Get a pointer to the array of pointers.
1456  char** pp = (char**) (arr[k] /*entry pointer*/ + ioffset /*object offset*/);
1457  if (!pp) {
1458  continue;
1459  }
1460  // Loop over each element of the array of pointers to varying-length arrays.
1461  for (Int_t ndx = 0; ndx < compinfo[i]->fLength; ++ndx) {
1462  //if (!pp[ndx]) {
1463  // -- We do not have a pointer to a varying-length array.
1464  //Error("ReadBuffer", "The pointer to element %s::%s type %d (%s) is null\n", thisVar->GetName(), aElement->GetFullName(), compinfo[i]->fType, aElement->GetTypeName());
1465  //continue;
1466  //}
1467  // Delete any memory at pp[ndx].
1468  if (!isPtrPtr) {
1469  cl->DeleteArray(pp[ndx]);
1470  pp[ndx] = 0;
1471  } else {
1472  // Using vlen is wrong here because it has already
1473  // been overwritten with the value needed to read
1474  // the current record. Fixing this will require
1475  // doing a pass over the object at the beginning
1476  // of the I/O and releasing all the buffer memory
1477  // for varying length arrays before we overwrite
1478  // the counter values.
1479  //
1480  // For now we will just leak memory, just as we
1481  // have always done in the past. Fix this.
1482  //
1483  //char** r = (char**) pp[ndx];
1484  //if (r) {
1485  // for (Int_t v = 0; v < vlen; ++v) {
1486  // cl->Destructor(r[v]);
1487  // r[v] = 0;
1488  // }
1489  //}
1490  delete[] pp[ndx];
1491  pp[ndx] = 0;
1492  }
1493  if (!vlen) {
1494  continue;
1495  }
1496  // Note: We now have pp[ndx] is null.
1497  // Allocate memory to read into.
1498  if (!isPtrPtr) {
1499  // -- We are a varying-length array of objects.
1500  // Note: Polymorphism is not allowed here.
1501  // Allocate a new array of objects to read into.
1502  pp[ndx] = (char*) cl->NewArray(vlen);
1503  if (!pp[ndx]) {
1504  Error("ReadBuffer", "Memory allocation failed!\n");
1505  continue;
1506  }
1507  } else {
1508  // -- We are a varying-length array of pointers to objects.
1509  // Note: The object pointers are allowed to be polymorphic.
1510  // Allocate a new array of pointers to objects to read into.
1511  pp[ndx] = (char*) new char*[vlen];
1512  if (!pp[ndx]) {
1513  Error("ReadBuffer", "Memory allocation failed!\n");
1514  continue;
1515  }
1516  // And set each pointer to null.
1517  memset(pp[ndx], 0, vlen * sizeof(char*)); // This is the right size we really have a char**: pp[ndx] = (char*) new char*[vlen];
1518  }
1519  if (!isPtrPtr) {
1520  // -- We are a varying-length array of objects.
1521  b.ReadFastArray(pp[ndx], cl, vlen, 0);
1522  }
1523  else {
1524  // -- We are a varying-length array of object pointers.
1525  b.ReadFastArray((void**) pp[ndx], cl, vlen, kFALSE, 0);
1526  } // isPtrPtr
1527  } // ndx
1528  } // k
1529  }
1530  else {
1531  // -- Older versions do *not* allow polymorphic pointers.
1532  // Loop over the entries in the clones array or the STL container.
1533  for (Int_t k = 0; k < narr; ++k) {
1534  // Get the counter for the varying length array.
1535  Int_t vlen = *((Int_t*) (arr[k] /*entry pointer*/ + eoffset /*entry offset*/ + compinfo[i]->fMethod /*counter offset*/));
1536  //Int_t realLen;
1537  //b >> realLen;
1538  //if (realLen != vlen) {
1539  // fprintf(stderr, "read vlen: %d realLen: %s\n", vlen, realLen);
1540  //}
1541  // Get a pointer to the array of pointers.
1542  char** pp = (char**) (arr[k] /*entry pointer*/ + ioffset /*object offset*/);
1543  if (!pp) {
1544  continue;
1545  }
1546  // Loop over each element of the array of pointers to varying-length arrays.
1547  for (Int_t ndx = 0; ndx < compinfo[i]->fLength; ++ndx) {
1548  //if (!pp[ndx]) {
1549  // -- We do not have a pointer to a varying-length array.
1550  //Error("ReadBuffer", "The pointer to element %s::%s type %d (%s) is null\n", thisVar->GetName(), aElement->GetFullName(), compinfo[i]->fType, aElement->GetTypeName());
1551  //continue;
1552  //}
1553  // Delete any memory at pp[ndx].
1554  if (!isPtrPtr) {
1555  cl->DeleteArray(pp[ndx]);
1556  pp[ndx] = 0;
1557  } else {
1558  // Using vlen is wrong here because it has already
1559  // been overwritten with the value needed to read
1560  // the current record. Fixing this will require
1561  // doing a pass over the object at the beginning
1562  // of the I/O and releasing all the buffer memory
1563  // for varying length arrays before we overwrite
1564  // the counter values.
1565  //
1566  // For now we will just leak memory, just as we
1567  // have always done in the past. Fix this.
1568  //
1569  //char** r = (char**) pp[ndx];
1570  //if (r) {
1571  // for (Int_t v = 0; v < vlen; ++v) {
1572  // cl->Destructor(r[v]);
1573  // r[v] = 0;
1574  // }
1575  //}
1576  delete[] pp[ndx];
1577  pp[ndx] = 0;
1578  }
1579  if (!vlen) {
1580  continue;
1581  }
1582  // Note: We now have pp[ndx] is null.
1583  // Allocate memory to read into.
1584  if (!isPtrPtr) {
1585  // -- We are a varying-length array of objects.
1586  // Note: Polymorphism is not allowed here.
1587  // Allocate a new array of objects to read into.
1588  pp[ndx] = (char*) cl->NewArray(vlen);
1589  if (!pp[ndx]) {
1590  Error("ReadBuffer", "Memory allocation failed!\n");
1591  continue;
1592  }
1593  } else {
1594  // -- We are a varying-length array of pointers to objects.
1595  // Note: The object pointers are allowed to be polymorphic.
1596  // Allocate a new array of pointers to objects to read into.
1597  pp[ndx] = (char*) new char*[vlen];
1598  if (!pp[ndx]) {
1599  Error("ReadBuffer", "Memory allocation failed!\n");
1600  continue;
1601  }
1602  // And set each pointer to null.
1603  memset(pp[ndx], 0, vlen * sizeof(char*)); // This is the right size we really have a char**: pp[ndx] = (char*) new char*[vlen];
1604  }
1605  if (!isPtrPtr) {
1606  // -- We are a varying-length array of objects.
1607  // Loop over the elements of the varying length array.
1608  for (Int_t v = 0; v < vlen; ++v) {
1609  // Read the object from the buffer.
1610  cl->Streamer(pp[ndx] + (v * cl->Size()), b);
1611  } // v
1612  }
1613  else {
1614  // -- We are a varying-length array of object pointers.
1615  // Get a pointer to the object pointer array.
1616  char** r = (char**) pp[ndx];
1617  // Loop over the elements of the varying length array.
1618  for (Int_t v = 0; v < vlen; ++v) {
1619  // Allocate an object to read into.
1620  r[v] = (char*) cl->New();
1621  if (!r[v]) {
1622  // Do not print a second error message here.
1623  //Error("ReadBuffer", "Memory allocation failed!\n");
1624  continue;
1625  }
1626  // Read the object from the buffer.
1627  cl->Streamer(r[v], b);
1628  } // v
1629  } // isPtrPtr
1630  } // ndx
1631  } // k
1632  } // fileVersion
1633  b.CheckByteCount(start, count, aElement->GetFullName());
1634  continue;
1635  }
1636 
1638  ((TBufferFile&)b).PushDataCache( new TVirtualArray( aElement->GetClassPointer(), narr ) );
1639  continue;
1641  delete ((TBufferFile&)b).PopDataCache();
1642  continue;
1643 
1644  case -1:
1645  // -- Skip an ignored TObject base class.
1646  continue;
1647 
1648  default: {
1649  int ans = -1;
1650 
1651  if (TStreamerInfo::kCache <= kase && kase < TStreamerInfo::kArtificial) {
1652 
1653  //T &cache_add = *(T*)b.PeekDataCacheArray();
1654  R__ASSERT(kFALSE); // cache_add);
1655 
1656  // thisVar->ReadBuffer(b,cache_addr,i,kase-TStreamerInfo::kCache,aElement,narr,eoffset)
1657 
1658  continue;
1659  }
1660 
1661  if (kase >= TStreamerInfo::kConv)
1662  ans = thisVar->ReadBufferConv(b,arr,compinfo[i],kase,aElement,narr,eoffset);
1663  if (ans==0) continue;
1664 
1665  if (kase >= TStreamerInfo::kSkip)
1666  ans = thisVar->ReadBufferSkip(b,arr,compinfo[i],kase,aElement,narr,eoffset);
1667  if (ans==0) continue;
1668 
1669  if (kase >= TStreamerInfo::kArtificial) {
1670  ans = thisVar->ReadBufferArtificial(b,arr,aElement,narr,eoffset);
1671  }
1672  if (ans==0) continue;
1673  }
1674  if (aElement)
1675  Error("ReadBuffer","The element %s::%s type %d (%s) is not supported yet\n",
1676  thisVar->GetName(),aElement->GetFullName(),kase,aElement->GetTypeName());
1677  else
1678  Error("ReadBuffer","The TStreamerElement for %s %d is missing!\n",
1679  thisVar->GetName(),i);
1680 
1681  continue;
1682  }
1683  }
1684  if (needIncrement) b.DecrementLevel(thisVar);
1685  return 0;
1686 }
1687 
1688 template Int_t TStreamerInfo::ReadBufferSkip<char**>(TBuffer &b, char** const &arr, const TCompInfo *compinfo, Int_t kase,
1689  TStreamerElement *aElement, Int_t narr,
1690  Int_t eoffset);
1691 template Int_t TStreamerInfo::ReadBufferSkip<TVirtualCollectionProxy>(TBuffer &b, const TVirtualCollectionProxy &arr, const TCompInfo *compinfo, Int_t kase,
1692  TStreamerElement *aElement, Int_t narr,
1693  Int_t eoffset);
1694 template Int_t TStreamerInfo::ReadBufferSkip<TVirtualArray>(TBuffer &b, const TVirtualArray &arr, const TCompInfo *compinfo, Int_t kase,
1695  TStreamerElement *aElement, Int_t narr,
1696  Int_t eoffset);
1697 
1698 template Int_t TStreamerInfo::ReadBufferConv<char**>(TBuffer &b, char** const &arr, const TCompInfo *compinfo, Int_t kase,
1699  TStreamerElement *aElement, Int_t narr,
1700  Int_t eoffset);
1701 template Int_t TStreamerInfo::ReadBufferConv<TVirtualCollectionProxy>(TBuffer &b, const TVirtualCollectionProxy &arr, const TCompInfo *compinfo, Int_t kase,
1702  TStreamerElement *aElement, Int_t narr,
1703  Int_t eoffset);
1704 template Int_t TStreamerInfo::ReadBufferConv<TVirtualArray>(TBuffer &b, const TVirtualArray &arr, const TCompInfo *compinfo, Int_t kase,
1705  TStreamerElement *aElement, Int_t narr,
1706  Int_t eoffset);
1707 
1708 template Int_t TStreamerInfo::ReadBufferArtificial<char**>(TBuffer &b, char** const &arr,
1709  TStreamerElement *aElement, Int_t narr,
1710  Int_t eoffset);
1711 template Int_t TStreamerInfo::ReadBufferArtificial<TVirtualCollectionProxy>(TBuffer &b, const TVirtualCollectionProxy &arr,
1712  TStreamerElement *aElement, Int_t narr,
1713  Int_t eoffset);
1714 template Int_t TStreamerInfo::ReadBufferArtificial<TVirtualArray>(TBuffer &b, const TVirtualArray &arr,
1715  TStreamerElement *aElement, Int_t narr,
1716  Int_t eoffset);
1717 
1718 template Int_t TStreamerInfo::ReadBuffer<char**>(TBuffer &b, char** const &arr,
1719  TCompInfo *const*const compinfo, Int_t first, Int_t last,
1720  Int_t narr, Int_t eoffset, Int_t arrayMode);
1721 template Int_t TStreamerInfo::ReadBuffer<TVirtualCollectionProxy>(TBuffer &b, const TVirtualCollectionProxy &arr,
1722  TCompInfo *const*const compinfo, Int_t first, Int_t last,
1723  Int_t narr, Int_t eoffset, Int_t arrayMode);
1724 template Int_t TStreamerInfo::ReadBuffer<TVirtualArray>(TBuffer &b, const TVirtualArray &arr,
1725  TCompInfo *const*const compinfo, Int_t first, Int_t last,
1726  Int_t narr, Int_t eoffset, Int_t arrayMode);
1727 
1728 ////////////////////////////////////////////////////////////////////////////////
1729 /// The STL vector/list is deserialized from the buffer b
1730 
1732  Int_t nc, Int_t eoffset, Bool_t v7 /* = kTRUE */)
1733 {
1734  if (!nc && v7) return 0; // in version 6 of TStreamerInfo and below, we were calling ReadBuffer for empty collection.
1735  int ret = ReadBuffer(b, *cont,fCompFull,0,fNfulldata,nc,eoffset,1);
1736  return ret;
1737 }
1738 
1739 ////////////////////////////////////////////////////////////////////////////////
1740 /// Read for TClonesArray.
1741 /// Note: This is no longer used.
1742 
1744  Int_t nc, Int_t first, Int_t eoffset)
1745 {
1746  char **arr = (char **)clones->GetObjectRef(0);
1747  return ReadBuffer(b,arr,fCompFull,first==-1?0:first,first==-1?fNfulldata:first+1,nc,eoffset,1);
1748 }
Describe Streamer information for one class version.
Definition: TStreamerInfo.h:43
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:47
void SetBufferOffset(Int_t offset=0)
Definition: TBuffer.h:88
virtual UInt_t GetUniqueID() const
Return the unique object id.
Definition: TObject.cxx:382
XYZVector ans(TestRotation const &t, XYZVector const &v_in)
void PutObjectWithID(TObject *obj, UInt_t uid=0)
stores the object at the uid th slot in the table of objects The object uniqued is set as well as its...
Definition: TProcessID.cxx:344
Int_t ReadBufferSkip(TBuffer &b, const T &arrptr, const TCompInfo *compinfo, Int_t kase, TStreamerElement *aElement, Int_t narr, Int_t eoffset)
Skip an element.
void(* ReadRawFuncPtr_t)(char *, TBuffer &)
Definition: TSchemaRule.h:43
TClass * fNewClass
Not Owned.
Definition: TStreamerInfo.h:58
virtual void * Allocate(UInt_t n, Bool_t forceDelete)=0
The concrete implementation of TBuffer for writing/reading to/from a ROOT file or socket...
Definition: TBufferFile.h:47
Version_t fOldVersion
! Version of the TStreamerInfo object read from the file
long long Long64_t
Definition: RtypesCore.h:69
short Version_t
Definition: RtypesCore.h:61
float Float_t
Definition: RtypesCore.h:53
Equal to TDataType&#39;s kchar.
TVirtualStreamerInfo * GetConversionStreamerInfo(const char *onfile_classname, Int_t version) const
Return a Conversion StreamerInfo from the class &#39;classname&#39; for version number &#39;version&#39; to this clas...
Definition: TClass.cxx:6637
virtual TClass * GetValueClass() const =0
TObject * GetParent() const
Return pointer to parent of this buffer.
Definition: TBuffer.cxx:231
double T(double x)
Definition: ChebyshevPol.h:34
#define SkipCFloat16(name)
unsigned short UShort_t
Definition: RtypesCore.h:36
Bool_t TestBit(UInt_t f) const
Definition: TObject.h:159
virtual TClass * GetClassPointer() const
Returns a pointer to the TClass of this element.
#define ConvCBasicType(name, stream)
TVirtualStreamerInfo * GetStreamerInfo(Int_t version=0) const
returns a pointer to the TVirtualStreamerInfo object for version If the object does not exist...
Definition: TClass.cxx:4360
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
Definition: TFile.h:46
virtual void Commit(void *)=0
virtual void ReadCharStar(char *&s)=0
Buffer base class used for serializing objects.
Definition: TBuffer.h:40
#define ReadBasicTypeLoop(name)
#define R__ASSERT(e)
Definition: TError.h:96
virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss)=0
Basic string class.
Definition: TString.h:129
TVirtualCollectionProxy * GetCollectionProxy() const
Return the proxy describing the collection (if any).
Definition: TClass.cxx:2814
Bool_t IsStartingWithTObject() const
Returns true if this class inherits from TObject and if the start of the TObject parts is at the very...
Definition: TClass.cxx:5566
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
Cache the value in memory than is not part of the object but is accessible via a SchemaRule.
virtual UShort_t GetPidOffset() const =0
TObject ** GetObjectRef() const
Definition: TObjArray.h:68
TCompInfo ** fCompFull
![fElements->GetEntries()]
#define ConvCBasicArray(name, ReadArrayFunc)
void DeleteArray(void *ary, Bool_t dtorOnly=kFALSE)
Explicitly call operator delete[] for an array.
Definition: TClass.cxx:5180
Int_t Length() const
Definition: TBuffer.h:94
Persistent Reference link to a TObject A TRef is a lightweight object pointing to any TObject...
Definition: TRef.h:32
virtual const char * ClassName() const
Returns name of class to which the object belongs.
Definition: TObject.cxx:135
char * GetObjectAt(UInt_t ind) const
Definition: TVirtualArray.h:38
Double_t x[n]
Definition: legend1.C:17
Int_t GetVersion() const
Definition: TFile.h:216
virtual TProcessID * ReadProcessID(UShort_t pidf)=0
Return the current Process-ID.
Definition: TBuffer.cxx:313
void Class()
Definition: Class.C:29
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
virtual void SetStreamerElementNumber(TStreamerElement *elem, Int_t comp_type)=0
Int_t ReadBufferClones(TBuffer &b, TClonesArray *clones, Int_t nc, Int_t first, Int_t eoffset)
Read for TClonesArray.
#define SkipCBasicArray(name, ReadArrayFunc)
TMemberStreamer * fStreamer
Not Owned.
Definition: TStreamerInfo.h:60
EState GetState() const
Definition: TClass.h:433
Int_t fNfulldata
!number of elements
Definition: TStreamerInfo.h:98
void * NewArray(Long_t nElements, ENewType defConstructor=kClassNew) const
Return a pointer to a newly allocated array of objects of this class.
Definition: TClass.cxx:4888
A TProcessID identifies a ROOT job in a unique way in time and space.
Definition: TProcessID.h:69
virtual void ls(Option_t *option="") const
Print the content of the element.
double Double32_t
Definition: RtypesCore.h:56
virtual void SkipObjectAny()=0
virtual void SetUniqueID(UInt_t uid)
Set the unique object id.
Definition: TObject.cxx:698
virtual Version_t ReadVersionForMemberWise(const TClass *cl=0)=0
TClass * fClass
!pointer to class
#define DOLOOP
#define SkipCDouble32(name)
Int_t ReadBufferConv(TBuffer &b, const T &arrptr, const TCompInfo *compinfo, Int_t kase, TStreamerElement *aElement, Int_t narr, Int_t eoffset)
Convert elements of a TClonesArray.
TRandom2 r(17)
Wrapper around an object and giving indirect access to its content even if the object is not of a cla...
Definition: TVirtualArray.h:26
virtual void ReadFastArrayDouble32(Double_t *d, Int_t n, TStreamerElement *ele=0)=0
SVector< double, 2 > v
Definition: Dict.h:5
Int_t ReadBuffer(TBuffer &b, const T &arrptr, TCompInfo *const *const compinfo, Int_t first, Int_t last, Int_t narr=1, Int_t eoffset=0, Int_t mode=0)
Deserialize information from buffer b into object at pointer if (arrayMode & 1) ptr is a pointer to a...
Int_t ReadBufferArtificial(TBuffer &b, const T &arrptr, TStreamerElement *aElement, Int_t narr, Int_t eoffset)
Handle Artificial StreamerElement.
virtual void ReadFastArrayFloat16(Float_t *f, Int_t n, TStreamerElement *ele=0)=0
unsigned int UInt_t
Definition: RtypesCore.h:42
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:873
Int_t Size() const
Return size of object of this class.
Definition: TClass.cxx:5348
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
#define ReadBasicArrayLoop(name)
static TStreamerElement *& CurrentElement()
#define ReadBasicPointerLoop(name)
TClass * fClass
Not Owned.
Definition: TStreamerInfo.h:57
virtual void ReadFastArray(Bool_t *b, Int_t n)=0
void Streamer(void *obj, TBuffer &b, const TClass *onfile_class=0) const
Definition: TClass.h:530
const Bool_t kFALSE
Definition: RtypesCore.h:92
PyObject * fType
#define SkipCBasicType(name)
virtual void ReadFloat16(Float_t *f, TStreamerElement *ele=0)=0
long Long_t
Definition: RtypesCore.h:50
virtual void DecrementLevel(TVirtualStreamerInfo *)=0
Wrapper around an object and giving indirect access to its content even if the object is not of a cla...
TClassRef fClass
void(* ReadFuncPtr_t)(char *, TVirtualObject *)
Definition: TSchemaRule.h:42
double f(double x)
double Double_t
Definition: RtypesCore.h:55
virtual const char * GetFullName() const
Return element name including dimensions, if any Note that this function stores the name into a stati...
unsigned long long ULong64_t
Definition: RtypesCore.h:70
unsigned long ULong_t
Definition: RtypesCore.h:51
static RooMathCoreReg dummy
virtual Bool_t IsBase() const
Return kTRUE if the element represent a base class.
#define ReadBasicPointer(name)
virtual void SetTObjectOffset(Int_t tobjoffset)
TClassRef fClass
Definition: TVirtualArray.h:28
#define ReadBasicType(name)
Mother of all ROOT objects.
Definition: TObject.h:37
virtual void ReadDouble32(Double_t *d, TStreamerElement *ele=0)=0
char Char_t
Definition: RtypesCore.h:29
static TStreamerElement * GetCurrentElement()
static function returning a pointer to the current TStreamerElement fgElement points to the current T...
An array of clone (identical) objects.
Definition: TClonesArray.h:32
const char * GetTypeName() const
Definition: file.py:1
TClass * GetNewClass() const
const Int_t kMaxInt
Definition: RtypesCore.h:103
ROOT::TSchemaRule::ReadFuncPtr_t GetReadFunc()
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
if object is referenced by a TRef or TRefArray
Definition: TObject.h:61
#define SkipCBasicPointer(name, ReadArrayFunc)
R__EXTERN Int_t gDebug
Definition: Rtypes.h:83
#define ConvCBasicPointer(name, ReadArrayFunc)
#define ReadBasicArray(name)
unsigned char UChar_t
Definition: RtypesCore.h:34
Definition: first.py:1
virtual void IncrementLevel(TVirtualStreamerInfo *info)=0
ROOT::TSchemaRule::ReadRawFuncPtr_t GetReadRawFunc()
virtual const char * GetName() const
Returns name of object.
Definition: TObject.cxx:364
Int_t ReadBufferSTL(TBuffer &b, TVirtualCollectionProxy *cont, Int_t nc, Int_t eoffset, Bool_t v7=kTRUE)
The STL vector/list is deserialized from the buffer b.
const Int_t n
Definition: legend1.C:16
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
Definition: TObject.cxx:859
virtual Version_t ReadVersion(UInt_t *start=0, UInt_t *bcnt=0, const TClass *cl=0)=0
void * New(ENewType defConstructor=kClassNew, Bool_t quiet=kFALSE) const
Return a pointer to a newly allocated object of this class.
Definition: TClass.cxx:4706