Logo ROOT  
Reference Guide
TStreamerElement.cxx
Go to the documentation of this file.
1// @(#)root/meta:$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//////////////////////////////////////////////////////////////////////////
13// //
14// //
15//////////////////////////////////////////////////////////////////////////
16
17
18#include "TROOT.h"
19#include "TStreamerElement.h"
21#include "TBuffer.h"
22#include "TClass.h"
23#include "TClassEdit.h"
24#include "TClassStreamer.h"
25#include "TClassTable.h"
26#include "TBaseClass.h"
27#include "TDataMember.h"
28#include "TDataType.h"
29#include "TRealData.h"
30#include "ThreadLocalStorage.h"
31#include "TRef.h"
32#include "TInterpreter.h"
33#include "TError.h"
34#include "TObjArray.h"
35#include "TVirtualMutex.h"
37#include <iostream>
38
39#include <string>
40
41using namespace std;
42
43const Int_t kMaxLen = 1024;
44
46 TTHREAD_TLS_DECL_ARG(TString,includeName,kMaxLen);
47 return includeName;
48}
49
50static TString ExtractClassName(const TString &type_name)
51{
52 TString className = type_name.Strip(TString::kTrailing, '*');
53 if (className.Index("const ")==0) className.Remove(0,6);
54 return className;
55}
56////////////////////////////////////////////////////////////////////////////////
57/// Helper function to initialize the 'index/counter' value of
58/// the Pointer streamerElements. If directive is a StreamerInfo and it correspond to the
59/// same class a 'countClass' the streamerInfo is used instead of the current StreamerInfo of the TClass
60/// for 'countClass'.
61
62static TStreamerBasicType *InitCounter(const char *countClass, const char *countName, TVirtualStreamerInfo *directive)
63{
64 TStreamerBasicType *counter = 0;
65
66 TClass *cl = TClass::GetClass(countClass);
67
68 if (directive) {
69
70 if (directive->GetClass() == cl) {
71 // The info we have been passed is indeed describing the counter holder, just look there.
72
73 TStreamerElement *element = (TStreamerElement *)directive->GetElements()->FindObject(countName);
74 if (!element) return 0;
75 if (element->IsA() != TStreamerBasicType::Class()) return 0;
76 counter = (TStreamerBasicType*)element;
77
78 } else {
79 if (directive->GetClass()->GetListOfRealData()) {
80 TRealData* rdCounter = (TRealData*) directive->GetClass()->GetListOfRealData()->FindObject(countName);
81 if (!rdCounter) return 0;
82 TDataMember *dmCounter = rdCounter->GetDataMember();
83 cl = dmCounter->GetClass();
84 } else {
85 TStreamerElement *element = (TStreamerElement *)directive->GetElements()->FindObject(countName);
86 if (!element) return 0;
87 if (element->IsA() != TStreamerBasicType::Class()) return 0;
88 cl = directive->GetClass();
89 }
90 if (cl==0) return 0;
91 counter = TVirtualStreamerInfo::GetElementCounter(countName,cl);
92 }
93 } else {
94
95 if (cl==0) return 0;
96 counter = TVirtualStreamerInfo::GetElementCounter(countName,cl);
97 }
98
99 //at this point the counter may be declared to be skipped
100 if (counter) {
102 }
103 return counter;
104}
105
106////////////////////////////////////////////////////////////////////////////////
107/// Parse comments to search for a range specifier of the style:
108/// [xmin,xmax] or [xmin,xmax,nbits]
109/// [0,1]
110/// [-10,100];
111/// [-pi,pi], [-pi/2,pi/4],[-2pi,2*pi]
112/// [-10,100,16]
113/// [0,0,8]
114/// if nbits is not specified, or nbits <2 or nbits>32 it is set to 32
115/// if (xmin==0 and xmax==0 and nbits <=16) the double word will be converted
116/// to a float and its mantissa truncated to nbits significative bits.
117///
118/// see comments in TBufferFile::WriteDouble32.
119
120static void GetRange(const char *comments, Double_t &xmin, Double_t &xmax, Double_t &factor)
121{
122 const Double_t kPi =3.14159265358979323846 ;
123 factor = xmin = xmax = 0;
124 if (!comments) return;
125 const char *left = strstr(comments,"[");
126 if (!left) return;
127 const char *right = strstr(left,"]");
128 if (!right) return;
129 const char *comma = strstr(left,",");
130 if (!comma || comma > right) {
131 //may be first bracket was a dimension specifier
132 left = strstr(right,"[");
133 if (!left) return;
134 right = strstr(left,"]");
135 if (!right) return;
136 comma = strstr(left,",");
137 if (!comma || comma >right) return;
138 }
139 //search if nbits is specified
140 const char *comma2 = 0;
141 if (comma) comma2 = strstr(comma+1,",");
142 if (comma2 > right) comma2 = 0;
143 Int_t nbits = 32;
144 if (comma2) {
145 TString sbits(comma2+1,right-comma2-1);
146 sscanf(sbits.Data(),"%d",&nbits);
147 if (nbits < 2 || nbits > 32) {
148 ::Error("GetRange","Illegal specification for the number of bits; %d. reset to 32.",nbits);
149 nbits = 32;
150 }
151 right = comma2;
152 }
153 TString range(left+1,right-left-1);
154 TString sxmin(left+1,comma-left-1);
155 sxmin.ToLower();
156 sxmin.ReplaceAll(" ","");
157 if (sxmin.Contains("pi")) {
158 if (sxmin.Contains("2pi")) xmin = 2*kPi;
159 else if (sxmin.Contains("2*pi")) xmin = 2*kPi;
160 else if (sxmin.Contains("twopi")) xmin = 2*kPi;
161 else if (sxmin.Contains("pi/2")) xmin = kPi/2;
162 else if (sxmin.Contains("pi/4")) xmin = kPi/4;
163 else if (sxmin.Contains("pi")) xmin = kPi;
164 if (sxmin.Contains("-")) xmin = -xmin;
165 } else {
166 sscanf(sxmin.Data(),"%lg",&xmin);
167 }
168 TString sxmax(comma+1,right-comma-1);
169 sxmax.ToLower();
170 sxmax.ReplaceAll(" ","");
171 if (sxmax.Contains("pi")) {
172 if (sxmax.Contains("2pi")) xmax = 2*kPi;
173 else if (sxmax.Contains("2*pi")) xmax = 2*kPi;
174 else if (sxmax.Contains("twopi")) xmax = 2*kPi;
175 else if (sxmax.Contains("pi/2")) xmax = kPi/2;
176 else if (sxmax.Contains("pi/4")) xmax = kPi/4;
177 else if (sxmax.Contains("pi")) xmax = kPi;
178 if (sxmax.Contains("-")) xmax = -xmax;
179 } else {
180 sscanf(sxmax.Data(),"%lg",&xmax);
181 }
182 UInt_t bigint;
183 if (nbits < 32) bigint = 1<<nbits;
184 else bigint = 0xffffffff;
185 if (xmin < xmax) factor = bigint/(xmax-xmin);
186 if (xmin >= xmax && nbits <15) xmin = nbits+0.1;
187}
188
190
191////////////////////////////////////////////////////////////////////////////////
192/// Default ctor.
193
195{
196 fType = 0;
197 fSize = 0;
198 fNewType = 0;
199 fArrayDim = 0;
200 fArrayLength = 0;
201 fStreamer = 0;
202 fOffset = 0;
203 fClassObject = (TClass*)(-1);
204 fNewClass = 0;
205 fTObjectOffset = 0;
206 fFactor = 0;
207 fXmin = 0;
208 fXmax = 0;
209 for (Int_t i=0;i<5;i++) fMaxIndex[i] = 0;
210}
211
212////////////////////////////////////////////////////////////////////////////////
213/// Create a TStreamerElement object.
214
215TStreamerElement::TStreamerElement(const char *name, const char *title, Int_t offset, Int_t dtype, const char *typeName)
216 : TNamed(name,title)
217{
218 fOffset = offset;
219 fType = dtype;
220 fSize = 0;
221 fNewType = fType;
222 fArrayDim = 0;
223 fArrayLength = 0;
224 if (typeName && !strcmp(typeName, "BASE")) {
225 // TStreamerBase case; fTypeName should stay "BASE".
226 fTypeName = typeName;
227 } else {
228 //must protect call into the interpreter
231 }
232 fStreamer = 0;
233 fClassObject = (TClass*)(-1);
234 fNewClass = 0;
235 fTObjectOffset = 0;
236 fFactor = 0;
237 fXmin = 0;
238 fXmax = 0;
239 for (Int_t i=0;i<5;i++) fMaxIndex[i] = 0;
240 if (fTypeName == "Float16_t" || fTypeName == "Float16_t*") {
242 if (fFactor > 0 || fXmin > 0) SetBit(kHasRange);
243 }
244 if (fTypeName == "Double32_t" || fTypeName == "Double32_t*") {
246 if (fFactor > 0 || fXmin > 0) SetBit(kHasRange);
247 }
248}
249
250////////////////////////////////////////////////////////////////////////////////
251/// TStreamerElement dtor.
252
254{
255}
256
257
258////////////////////////////////////////////////////////////////////////////////
259/// Returns true if the element cannot be split, false otherwise.
260/// An element cannot be split if the corresponding class member has
261/// the special characters "||" as the first characters in the
262/// comment field.
263
265{
266 if (GetTitle()[0] != 0 && strspn(GetTitle(),"||") == 2) return kTRUE;
267 TClass *cl = GetClassPointer();
268 if (!cl) return kFALSE; //basic type
269
270 static TClassRef clonesArray("TClonesArray");
271 if (IsaPointer() && cl != clonesArray && !cl->GetCollectionProxy()) return kTRUE;
272
273 switch(fType) {
279 return kTRUE;
280 }
281
282 if ( !cl->CanSplit() ) return kTRUE;
283
284 return kFALSE;
285}
286
287////////////////////////////////////////////////////////////////////////////////
288/// Returns a pointer to the TClass of this element.
289
291{
292 if (fClassObject!=(TClass*)(-1)) return fClassObject;
293
296 ((TStreamerElement*)this)->fClassObject = TClass::GetClass(className, kTRUE, quiet);
297 return fClassObject;
298}
299
300////////////////////////////////////////////////////////////////////////////////
301/// Returns the TExec id for the EXEC instruction in the comment field
302/// of a TRef data member.
303
305{
306 //check if element is a TRef or TRefArray
307 if (strncmp(fTypeName.Data(),"TRef",4) != 0) return 0;
308
309 //if the UniqueID of this element has already been set, we assume
310 //that it contains the exec id of a TRef object.
311 if (GetUniqueID()) return GetUniqueID();
312
313 //check if an Exec is specified in the comment field
314 char *action = (char*)strstr(GetTitle(),"EXEC:");
315 if (!action) return 0;
316 Int_t nch = strlen(action)+1;
317 char *caction = new char[nch];
318 strlcpy(caction,action+5,nch);
319 char *blank = (char*)strchr(caction,' ');
320 if (blank) *blank = 0;
321 //we have found the Exec name in the comment
322 //we register this Exec to the list of Execs.
323 Int_t index = TRef::AddExec(caction);
324 delete [] caction;
325 //we save the Exec index as the uniqueid of this STreamerElement
326 const_cast<TStreamerElement*>(this)->SetUniqueID(index+1);
327 return index+1;
328}
329
330////////////////////////////////////////////////////////////////////////////////
331/// Return element name including dimensions, if any
332/// Note that this function stores the name into a static array.
333/// You should copy the result.
334
336{
337 TTHREAD_TLS_DECL_ARG(TString,name,kMaxLen);
338 char cdim[20];
339 name = GetName();
340 for (Int_t i=0;i<fArrayDim;i++) {
341 snprintf(cdim,19,"[%d]",fMaxIndex[i]);
342 name += cdim;
343 }
344 return name;
345}
346
347////////////////////////////////////////////////////////////////////////////////
348/// Fill type with the string representation of sequence
349/// information including 'cached','repeat','write' or
350/// 'nodelete'.
351
353{
354 sequenceType.Clear();
357 if (!first) sequenceType += ",";
358 first = kFALSE;
359 sequenceType += "wholeObject";
360 }
362 first = kFALSE;
363 sequenceType += "cached";
364 }
366 if (!first) sequenceType += ",";
367 first = kFALSE;
368 sequenceType += "repeat";
369 }
371 if (!first) sequenceType += ",";
372 first = kFALSE;
373 sequenceType += "nodelete";
374 }
376 if (!first) sequenceType += ",";
377 first = kFALSE;
378 sequenceType += "write";
379 }
380}
381
382////////////////////////////////////////////////////////////////////////////////
383/// Returns size of this element in bytes.
384
386{
387 return fSize;
388}
389
390////////////////////////////////////////////////////////////////////////////////
391/// Return the local streamer object.
392
394{
395 return fStreamer;
396}
397
398////////////////////////////////////////////////////////////////////////////////
399/// Return type name of this element
400/// in case the type name is not a standard basic type, return
401/// the basic type name known to CINT.
402
404{
405 TDataType *dt = gROOT->GetType(fTypeName.Data());
406 if (fType < 1 || fType > 55) return fTypeName.Data();
407 if (dt && dt->GetType() > 0) return fTypeName.Data();
408 Int_t dtype = fType%20;
409 return TDataType::GetTypeName((EDataType)dtype);
410}
411
412////////////////////////////////////////////////////////////////////////////////
413/// Initliaze the element.
414
416{
420 }
421}
422
423////////////////////////////////////////////////////////////////////////////////
424/// The early 3.00/00 and 3.01/01 versions used to store
425/// dm->GetTypeName instead of dm->GetFullTypename
426/// if this case is detected, the element type name is modified.
427
428Bool_t TStreamerElement::IsOldFormat(const char *newTypeName)
429{
430 //if (!IsaPointer()) return kFALSE;
431 if (!strstr(newTypeName,fTypeName.Data())) return kFALSE;
432 //if (!strstr(fTypeName.Data(),newTypeName)) return kFALSE;
433 fTypeName = newTypeName;
434 return kTRUE;
435}
436
437////////////////////////////////////////////////////////////////////////////////
438/// Return kTRUE if the element represent a base class.
439
441{
442 return kFALSE;
443}
444
445////////////////////////////////////////////////////////////////////////////////
446/// Return kTRUE if the element represent an entity that is not written
447/// to the disk (transient members, cache allocator/deallocator, etc.)
448
450{
452 // if (((const TStreamerArtificial*)this)->GetWriteFunc() == 0)
453 return kTRUE;
454 }
460
461 return kFALSE;
462}
463
464////////////////////////////////////////////////////////////////////////////////
465/// Print the content of the element.
466
468{
469 TString temp(GetTypeName());
470 if (IsaPointer() && !fTypeName.Contains("*")) temp += "*";
471
472 TString sequenceType;
473 GetSequenceType(sequenceType);
474 if (sequenceType.Length()) {
475 sequenceType.Prepend(" (");
476 sequenceType += ") ";
477 }
478 printf(" %-14s %-15s offset=%3d type=%2d %s%-20s\n",
479 temp.Data(),GetFullName(),fOffset,fType,sequenceType.Data(),
480 GetTitle());
481}
482
483////////////////////////////////////////////////////////////////////////////////
484/// Set number of array dimensions.
485
487{
488 fArrayDim = dim;
490 fNewType = fType;
491}
492
493////////////////////////////////////////////////////////////////////////////////
494///set maximum index for array with dimension dim
495
497{
498 if (dim < 0 || dim > 4) return;
499 fMaxIndex[dim] = max;
500 if (fArrayLength == 0) fArrayLength = max;
501 else fArrayLength *= max;
502}
503
504////////////////////////////////////////////////////////////////////////////////
505///set pointer to Streamer function for this element
506
508{
509 fStreamer = streamer;
510}
511
512////////////////////////////////////////////////////////////////////////////////
513/// Stream an object of class TStreamerElement.
514
515void TStreamerElement::Streamer(TBuffer &R__b)
516{
517 UInt_t R__s, R__c;
518 if (R__b.IsReading()) {
519 Version_t R__v = R__b.ReadVersion(&R__s, &R__c);
520 //NOTE that when reading, one cannot use Class()->ReadBuffer
521 // TBuffer::Class methods used for reading streamerinfos from SQL database
522 // Any changes of class structure should be reflected by them starting from version 4
523
525 R__b.ClassMember("TNamed");
526 TNamed::Streamer(R__b);
527 R__b.ClassMember("fType","Int_t");
528 R__b >> fType;
529 R__b.ClassMember("fSize","Int_t");
530 R__b >> fSize;
531 R__b.ClassMember("fArrayLength","Int_t");
532 R__b >> fArrayLength;
533 R__b.ClassMember("fArrayDim","Int_t");
534 R__b >> fArrayDim;
535 R__b.ClassMember("fMaxIndex","Int_t", 5);
536 if (R__v == 1) R__b.ReadStaticArray(fMaxIndex);
537 else R__b.ReadFastArray(fMaxIndex,5);
538 R__b.ClassMember("fTypeName","TString");
539 fTypeName.Streamer(R__b);
540 if (fType==11&&(fTypeName=="Bool_t"||fTypeName=="bool")) fType = 18;
541 if (R__v > 1) {
542 SetUniqueID(0);
543 //check if element is a TRef or TRefArray
544 GetExecID();
545 }
546 if (R__v <= 2 && this->IsA()==TStreamerBasicType::Class()) {
547 // In TStreamerElement v2, fSize was holding the size of
548 // the underlying data type. In later version it contains
549 // the full length of the data member.
550 TDataType *type = gROOT->GetType(GetTypeName());
551 if (type && fArrayLength) fSize = fArrayLength * type->Size();
552 }
553 if (R__v == 3) {
554 R__b >> fXmin;
555 R__b >> fXmax;
556 R__b >> fFactor;
557 if (fFactor > 0) SetBit(kHasRange);
558 }
559 if (R__v > 3) {
561 }
562 //R__b.CheckByteCount(R__s, R__c, TStreamerElement::IsA());
564 R__b.SetBufferOffset(R__s+R__c+sizeof(UInt_t));
565
568 } else {
570 }
571}
572
573////////////////////////////////////////////////////////////////////////////////
574///function called by the TClass constructor when replacing an emulated class
575///by the real class
576
577void TStreamerElement::Update(const TClass *oldClass, TClass *newClass)
578{
579 if (fClassObject == oldClass) {
580 fClassObject = newClass;
583 }
584 } else if (fClassObject == nullptr) {
585 // Well since some emulated class is replaced by a real class, we can
586 // assume a new library has been loaded. If this is the case, we should
587 // check whether the class now exist (this would be the case for example
588 // for reading STL containers).
589
591
592 if (classname == newClass->GetName()) {
593 fClassObject = newClass;
596 }
597 } else if (TClassTable::GetDict(classname)) {
598 fClassObject = (TClass*)-1;
599 GetClassPointer(); //force fClassObject
602 }
603 }
604 }
605}
606
607//______________________________________________________________________________
608
609//////////////////////////////////////////////////////////////////////////
610// //
611// TStreamerBase implement the streamer of the base class //
612// //
613//////////////////////////////////////////////////////////////////////////
614
616
617////////////////////////////////////////////////////////////////////////////////
618
620 // Abuse TStreamerElement data member that is not used by TStreamerBase
621 fBaseCheckSum( *( (UInt_t*)&(fMaxIndex[1]) ) ),
622 fStreamerFunc(0), fConvStreamerFunc(0), fStreamerInfo(0)
623{
624 // Default ctor.
625
626 fBaseClass = (TClass*)(-1);
627 fBaseVersion = 0;
628 fNewBaseClass = 0;
629}
630
631////////////////////////////////////////////////////////////////////////////////
632
633TStreamerBase::TStreamerBase(const char *name, const char *title, Int_t offset, Bool_t isTransient)
634 : TStreamerElement(name,title,offset,TVirtualStreamerInfo::kBase,"BASE"),
635 // Abuse TStreamerElement data member that is not used by TStreamerBase
636 fBaseCheckSum( *( (UInt_t*)&(fMaxIndex[1]) ) ),
637 fStreamerFunc(0), fConvStreamerFunc(0), fStreamerInfo(0)
638
639{
640 // Create a TStreamerBase object.
641
642 if (strcmp(name,"TObject") == 0) fType = TVirtualStreamerInfo::kTObject;
643 if (strcmp(name,"TNamed") == 0) fType = TVirtualStreamerInfo::kTNamed;
644 fNewType = fType;
646 if (fBaseClass) {
647 if (fBaseClass->IsVersioned()) {
649 } else {
650 fBaseVersion = -1;
651 }
653 } else {
654 fBaseVersion = 0;
655 }
656 fNewBaseClass = 0;
657 Init(isTransient);
658}
659
660////////////////////////////////////////////////////////////////////////////////
661/// TStreamerBase dtor
662
664{
665}
666
667////////////////////////////////////////////////////////////////////////////////
668/// Returns a pointer to the TClass of this element.
669
671{
672 if (fBaseClass!=(TClass*)(-1)) return fBaseClass;
673 ((TStreamerBase*)this)->fBaseClass = TClass::GetClass(GetName());
674 return fBaseClass;
675}
676
677////////////////////////////////////////////////////////////////////////////////
678/// Returns size of baseclass in bytes.
679
681{
682 TClass *cl = GetClassPointer();
683 if (cl) return cl->Size();
684 return 0;
685}
686
687////////////////////////////////////////////////////////////////////////////////
688/// Setup the element.
689
691{
692 Init(kFALSE);
693}
694
696{
698 if (!fBaseClass) return;
699
700 InitStreaming(isTransient);
701}
702
703////////////////////////////////////////////////////////////////////////////////
704/// Setup the fStreamerFunc and fStreamerinfo
705
707{
708 if (fNewBaseClass) {
711 if (fBaseVersion > 0 || fBaseCheckSum == 0) {
713 } else {
715 }
716 } else if (fBaseClass && fBaseClass != (TClass*)-1) {
719 if (fBaseVersion >= 0 || fBaseCheckSum == 0) {
721 } else {
723 }
724 } else {
725 fStreamerFunc = 0;
727 fStreamerInfo = 0;
728 }
729}
730
731////////////////////////////////////////////////////////////////////////////////
732/// Return kTRUE if the element represent a base class.
733
735{
736 return kTRUE;
737}
738
739////////////////////////////////////////////////////////////////////////////////
740/// Return the proper include for this element.
741
742const char *TStreamerBase::GetInclude() const
743{
746 } else {
747 std::string shortname( TClassEdit::ShortType( GetName(), 1 ) );
748 IncludeNameBuffer().Form("\"%s.h\"",shortname.c_str());
749 }
750 return IncludeNameBuffer();
751}
752
753////////////////////////////////////////////////////////////////////////////////
754/// Print the content of the element.
755
757{
758 TString sequenceType;
759 GetSequenceType(sequenceType);
760 if (sequenceType.Length()) {
761 sequenceType.Prepend(" (");
762 sequenceType += ") ";
763 }
764 printf(" %-14s %-15s offset=%3d type=%2d %s%-20s\n",GetFullName(),GetTypeName(),fOffset,fType,sequenceType.Data(),GetTitle());
765}
766
767////////////////////////////////////////////////////////////////////////////////
768/// Read the content of the buffer.
769
771{
772 if (fConvStreamerFunc) {
773 // We have a custom Streamer member function, we must use it.
775 } else if (fStreamerFunc) {
776 // We have a custom Streamer member function, we must use it.
777 fStreamerFunc(b,pointer+fOffset);
778 } else {
779 // We don't have a custom Streamer member function. That still doesn't mean
780 // that there is no streamer - it could be an external one:
781 // If the old base class has an adopted streamer we take that
782 // one instead of the new base class:
783 if( fNewBaseClass ) {
785 if (extstrm) {
786 // The new base class has an adopted streamer:
787 extstrm->SetOnFileClass(fBaseClass);
788 (*extstrm)(b, pointer);
789 } else {
790 b.ReadClassBuffer( fNewBaseClass, pointer+fOffset, fBaseClass );
791 }
792 } else {
794 if (extstrm) {
795 // The class has an adopted streamer:
796 (*extstrm)(b, pointer);
797 } else {
798 b.ReadClassBuffer( fBaseClass, pointer+fOffset );
799 }
800 }
801 }
802 return 0;
803}
804
805////////////////////////////////////////////////////////////////////////////////
806/// Stream an object of class TStreamerBase.
807
808void TStreamerBase::Streamer(TBuffer &R__b)
809{
810 UInt_t R__s, R__c;
811 if (R__b.IsReading()) {
812 Version_t R__v = R__b.ReadVersion(&R__s, &R__c);
813
814 R__b.ClassBegin(TStreamerBase::Class(), R__v);
815
816 R__b.ClassMember("TStreamerElement");
817 TStreamerElement::Streamer(R__b);
818 // If the class owning the TStreamerElement and the base class are not
819 // loaded, on the file their streamer info might be in the following
820 // order (derived class,base class) and hence the base class is not
821 // yet emulated.
822 fBaseClass = (TClass*)-1;
823 fNewBaseClass = 0;
824 // Eventually we need a v3 that stores directly fBaseCheckSum (and
825 // a version of TStreamerElement should not stored fMaxIndex)
826 if (R__v > 2) {
827 R__b.ClassMember("fBaseVersion","Int_t");
828 R__b >> fBaseVersion;
829 } else {
830 // could have been: fBaseVersion = GetClassPointer()->GetClassVersion();
833 }
835 R__b.SetBufferOffset(R__s+R__c+sizeof(UInt_t));
836 } else {
838 }
839}
840
841////////////////////////////////////////////////////////////////////////////////
842///Function called by the TClass constructor when replacing an emulated class
843///by the real class.
844
845void TStreamerBase::Update(const TClass *oldClass, TClass *newClass)
846{
847 TStreamerElement::Update(oldClass, newClass);
848
849 if (fBaseClass == oldClass) {
850 fBaseClass = newClass;
852 } else if (fBaseClass == nullptr) {
853 if (fName == newClass->GetName()) {
854 fBaseClass = newClass;
856 } else if (TClassTable::GetDict(fName)) {
859 }
860 }
861}
862
863////////////////////////////////////////////////////////////////////////////////
864/// Write the base class into the buffer.
865
867{
868 if (fStreamerFunc) {
869 // We have a custom Streamer member function, we must use it.
870 fStreamerFunc(b,pointer+fOffset);
871 } else {
872 // We don't have a custom Streamer member function. That still doesn't mean
873 // that there is no streamer - it could be an external one:
874 // If the old base class has an adopted streamer we take that
875 // one instead of the new base class:
876 if (fNewBaseClass) {
878 if (extstrm) {
879 // The new base class has an adopted streamer:
880 extstrm->SetOnFileClass(fBaseClass);
881 (*extstrm)(b, pointer);
882 return 0;
883 } else {
885 return 0;
886 }
887 } else {
889 if (extstrm) {
890 (*extstrm)(b, pointer);
891 return 0;
892 } else {
894 return 0;
895 }
896 }
897 }
898 return 0;
899}
900
901//______________________________________________________________________________
902
903//////////////////////////////////////////////////////////////////////////
904// //
905// TStreamerBasicPointer implements the streamering of pointer to //
906// fundamental types. //
907// //
908//////////////////////////////////////////////////////////////////////////
909
911
912////////////////////////////////////////////////////////////////////////////////
913/// Default ctor.
914
915TStreamerBasicPointer::TStreamerBasicPointer() : fCountVersion(0),fCountName(),fCountClass(),fCounter(0)
916{
917 fCounter = 0;
918}
919
920////////////////////////////////////////////////////////////////////////////////
921/// Create a TStreamerBasicPointer object.
922
923TStreamerBasicPointer::TStreamerBasicPointer(const char *name, const char *title, Int_t offset, Int_t dtype, const char *countName, const char *countClass, Int_t countVersion, const char *typeName)
924 : TStreamerElement(name,title,offset,dtype,typeName)
925{
927 fCountName = countName;
928 fCountClass = countClass;
929 fCountVersion = countVersion; //currently unused
930 Init();
931// printf("BasicPointer Init:%s, countName=%s, countClass=%s, countVersion=%d, fCounter=%x\n",
932// name,countName,countClass,countVersion,fCounter);
933}
934
935////////////////////////////////////////////////////////////////////////////////
936/// TStreamerBasicPointer dtor.
937
939{
940}
941
942////////////////////////////////////////////////////////////////////////////////
943/// return offset of counter
944
946{
947 if (!fCounter) ((TStreamerBasicPointer*)this)->Init();
948 if (!fCounter) return 0;
949 // FIXME: does not suport multiple inheritance for counter in base class.
950 // This is wrong in case counter is not in the same class or one of
951 // the left most (non virtual) base classes. For the other we would
952 // really need to use the object coming from the list of real data.
953 // (and even that need analysis for virtual base class).
954 return (ULong_t)fCounter->GetOffset();
955}
956
957////////////////////////////////////////////////////////////////////////////////
958/// Returns size of basicpointer in bytes.
959
961{
962 if (fArrayLength) return fArrayLength*sizeof(void *);
963 return sizeof(void *);
964}
965
966////////////////////////////////////////////////////////////////////////////////
967/// Setup the element.
968/// If directive is a StreamerInfo and it correspond to the
969/// same class a 'countClass' the streamerInfo is used instead of the current StreamerInfo of the TClass
970/// for 'countClass'.
971
973{
975}
976
977////////////////////////////////////////////////////////////////////////////////
978/// Set number of array dimensions.
979
981{
982 fArrayDim = dim;
983 //if (dim) fType += TVirtualStreamerInfo::kOffsetL;
984 fNewType = fType;
985}
986
987////////////////////////////////////////////////////////////////////////////////
988/// Stream an object of class TStreamerBasicPointer.
989
990void TStreamerBasicPointer::Streamer(TBuffer &R__b)
991{
992 UInt_t R__s, R__c;
993 if (R__b.IsReading()) {
994 Version_t R__v = R__b.ReadVersion(&R__s, &R__c);
995 if (R__v > 1) {
996 R__b.ReadClassBuffer(TStreamerBasicPointer::Class(), this, R__v, R__s, R__c);
997 //Init();
998 //fCounter = InitCounter( fCountClass, fCountName );
999 return;
1000 }
1001 //====process old versions before automatic schema evolution
1002 TStreamerElement::Streamer(R__b);
1003 R__b >> fCountVersion;
1004 fCountName.Streamer(R__b);
1005 fCountClass.Streamer(R__b);
1006 R__b.SetBufferOffset(R__s+R__c+sizeof(UInt_t));
1007 } else {
1009 }
1010}
1011
1012
1013//______________________________________________________________________________
1014
1015//////////////////////////////////////////////////////////////////////////
1016// //
1017// TStreamerLoop implement streaming of a few construct that require //
1018// looping over the data member and are not convered by other case //
1019// (most deprecated). //
1020// //
1021//////////////////////////////////////////////////////////////////////////
1022
1024
1025////////////////////////////////////////////////////////////////////////////////
1026/// Default ctor.
1027
1028TStreamerLoop::TStreamerLoop() : fCountVersion(0),fCountName(),fCountClass(),fCounter(0)
1029{
1030}
1031
1032////////////////////////////////////////////////////////////////////////////////
1033/// Create a TStreamerLoop object.
1034
1035TStreamerLoop::TStreamerLoop(const char *name, const char *title, Int_t offset, const char *countName, const char *countClass, Int_t countVersion, const char *typeName)
1036 : TStreamerElement(name,title,offset,TVirtualStreamerInfo::kStreamLoop,typeName)
1037{
1038 fCountName = countName;
1039 fCountClass = countClass;
1040 fCountVersion = countVersion; //currently unused
1041 Init();
1042}
1043
1044////////////////////////////////////////////////////////////////////////////////
1045/// TStreamerLoop dtor.
1046
1048{
1049}
1050
1051////////////////////////////////////////////////////////////////////////////////
1052/// return address of counter
1053
1055{
1056 //if (!fCounter) {
1057 // Init();
1058 // if (!fCounter) return 0;
1059 //}
1060 if (!fCounter) return 0;
1061 return (ULong_t)fCounter->GetOffset();
1062}
1063
1064////////////////////////////////////////////////////////////////////////////////
1065/// Returns size of counter in bytes.
1066
1068{
1069 if (fArrayLength) return fArrayLength*sizeof(void*);
1070 return sizeof(void*);
1071}
1072
1073////////////////////////////////////////////////////////////////////////////////
1074/// Setup the element.
1075/// If directive is a StreamerInfo and it correspond to the
1076/// same class a 'countClass' the streamerInfo is used instead of the current StreamerInfo of the TClass
1077/// for 'countClass'.
1078
1080{
1081 fCounter = InitCounter( fCountClass, fCountName, directive );
1082}
1083
1084////////////////////////////////////////////////////////////////////////////////
1085/// Return the proper include for this element.
1086
1087const char *TStreamerLoop::GetInclude() const
1088{
1089 IncludeNameBuffer().Form("<%s>","TString.h"); //to be generalized
1090 return IncludeNameBuffer();
1091}
1092
1093////////////////////////////////////////////////////////////////////////////////
1094/// Stream an object of class TStreamerLoop.
1095
1096void TStreamerLoop::Streamer(TBuffer &R__b)
1097{
1098 UInt_t R__s, R__c;
1099 if (R__b.IsReading()) {
1100 Version_t R__v = R__b.ReadVersion(&R__s, &R__c);
1101 if (R__v > 1) {
1102 R__b.ReadClassBuffer(TStreamerLoop::Class(), this, R__v, R__s, R__c);
1103 //Init();
1104 return;
1105 }
1106 //====process old versions before automatic schema evolution
1107 TStreamerElement::Streamer(R__b);
1108 R__b >> fCountVersion;
1109 fCountName.Streamer(R__b);
1110 fCountClass.Streamer(R__b);
1111 R__b.SetBufferOffset(R__s+R__c+sizeof(UInt_t));
1112 } else {
1114 }
1115}
1116
1117
1118//______________________________________________________________________________
1119
1120//////////////////////////////////////////////////////////////////////////
1121// //
1122// TStreamerBasicType implement streaming of fundamental types (int, //
1123// float, etc.). //
1124// //
1125//////////////////////////////////////////////////////////////////////////
1126
1128
1129////////////////////////////////////////////////////////////////////////////////
1130/// Default ctor.
1131
1133{
1134}
1135
1136////////////////////////////////////////////////////////////////////////////////
1137/// Create a TStreamerBasicType object.
1138
1139TStreamerBasicType::TStreamerBasicType(const char *name, const char *title, Int_t offset, Int_t dtype, const char *typeName)
1140 : TStreamerElement(name,title,offset,dtype,typeName),fCounter(0)
1141{
1142}
1143
1144////////////////////////////////////////////////////////////////////////////////
1145/// TStreamerBasicType dtor.
1146
1148{
1149}
1150
1151////////////////////////////////////////////////////////////////////////////////
1152/// return address of counter
1153
1155{
1158 return 0;
1159}
1160
1161////////////////////////////////////////////////////////////////////////////////
1162/// Returns size of this element in bytes.
1163
1165{
1166 return fSize;
1167}
1168
1169////////////////////////////////////////////////////////////////////////////////
1170/// Stream an object of class TStreamerBasicType.
1171
1172void TStreamerBasicType::Streamer(TBuffer &R__b)
1173{
1174 UInt_t R__s, R__c;
1175 if (R__b.IsReading()) {
1176 Version_t R__v = R__b.ReadVersion(&R__s, &R__c);
1177 if (R__v > 1) {
1178 R__b.ReadClassBuffer(TStreamerBasicType::Class(), this, R__v, R__s, R__c);
1179 } else {
1180 //====process old versions before automatic schema evolution
1181 TStreamerElement::Streamer(R__b);
1182 R__b.CheckByteCount(R__s, R__c, TStreamerBasicType::IsA());
1183 }
1184 Int_t type = fType;
1187 }
1188 switch(type) {
1189 // basic types
1190 case TVirtualStreamerInfo::kBool: fSize = sizeof(Bool_t); break;
1191 case TVirtualStreamerInfo::kShort: fSize = sizeof(Short_t); break;
1192 case TVirtualStreamerInfo::kInt: fSize = sizeof(Int_t); break;
1193 case TVirtualStreamerInfo::kLong: fSize = sizeof(Long_t); break;
1194 case TVirtualStreamerInfo::kLong64: fSize = sizeof(Long64_t); break;
1195 case TVirtualStreamerInfo::kFloat: fSize = sizeof(Float_t); break;
1196 case TVirtualStreamerInfo::kFloat16: fSize = sizeof(Float_t); break;
1197 case TVirtualStreamerInfo::kDouble: fSize = sizeof(Double_t); break;
1198 case TVirtualStreamerInfo::kDouble32: fSize = sizeof(Double_t); break;
1199 case TVirtualStreamerInfo::kUChar: fSize = sizeof(UChar_t); break;
1200 case TVirtualStreamerInfo::kUShort: fSize = sizeof(UShort_t); break;
1201 case TVirtualStreamerInfo::kUInt: fSize = sizeof(UInt_t); break;
1202 case TVirtualStreamerInfo::kULong: fSize = sizeof(ULong_t); break;
1203 case TVirtualStreamerInfo::kULong64: fSize = sizeof(ULong64_t); break;
1204 case TVirtualStreamerInfo::kBits: fSize = sizeof(UInt_t); break;
1205 case TVirtualStreamerInfo::kCounter: fSize = sizeof(Int_t); break;
1206 case TVirtualStreamerInfo::kChar: fSize = sizeof(Char_t); break;
1207 case TVirtualStreamerInfo::kCharStar: fSize = sizeof(Char_t*); break;
1208 default: return; // If we don't change the size let's not remultiply it.
1209 }
1211 } else {
1213 }
1214}
1215
1216
1217
1218//______________________________________________________________________________
1219
1220//////////////////////////////////////////////////////////////////////////
1221// //
1222// TStreamerObject implements streaming of embedded objects whose type //
1223// inherits from TObject. //
1224// //
1225//////////////////////////////////////////////////////////////////////////
1226
1228
1229////////////////////////////////////////////////////////////////////////////////
1230/// Default ctor.
1231
1233{
1234}
1235
1236////////////////////////////////////////////////////////////////////////////////
1237/// Create a TStreamerObject object.
1238
1239TStreamerObject::TStreamerObject(const char *name, const char *title, Int_t offset, const char *typeName)
1240 : TStreamerElement(name,title,offset,0,typeName)
1241{
1243 if (strcmp(typeName,"TObject") == 0) fType = TVirtualStreamerInfo::kTObject;
1244 if (strcmp(typeName,"TNamed") == 0) fType = TVirtualStreamerInfo::kTNamed;
1245 fNewType = fType;
1246 Init();
1247}
1248
1249////////////////////////////////////////////////////////////////////////////////
1250/// TStreamerObject dtor.
1251
1253{
1254}
1255
1256////////////////////////////////////////////////////////////////////////////////
1257/// Setup the element.
1258
1260{
1264 }
1265}
1266
1267////////////////////////////////////////////////////////////////////////////////
1268/// Return the proper include for this element.
1269
1271{
1272 TClass *cl = GetClassPointer();
1273 if (cl && cl->HasInterpreterInfo()) {
1274 IncludeNameBuffer().Form("\"%s\"",cl->GetDeclFileName());
1275 } else {
1276 std::string shortname( TClassEdit::ShortType( GetTypeName(), 1 ) );
1277 IncludeNameBuffer().Form("\"%s.h\"",shortname.c_str());
1278 }
1279 return IncludeNameBuffer();
1280}
1281
1282////////////////////////////////////////////////////////////////////////////////
1283/// Returns size of object class in bytes.
1284
1286{
1287 TClass *cl = GetClassPointer();
1288 Int_t classSize = 8;
1289 if (cl) classSize = cl->Size();
1290 if (fArrayLength) return fArrayLength*classSize;
1291 return classSize;
1292}
1293
1294////////////////////////////////////////////////////////////////////////////////
1295/// Stream an object of class TStreamerObject.
1296
1297void TStreamerObject::Streamer(TBuffer &R__b)
1298{
1299 UInt_t R__s, R__c;
1300 if (R__b.IsReading()) {
1301 Version_t R__v = R__b.ReadVersion(&R__s, &R__c);
1302 if (R__v > 1) {
1303 R__b.ReadClassBuffer(TStreamerObject::Class(), this, R__v, R__s, R__c);
1304 return;
1305 }
1306 //====process old versions before automatic schema evolution
1307 TStreamerElement::Streamer(R__b);
1308 R__b.CheckByteCount(R__s, R__c, TStreamerObject::IsA());
1309 } else {
1311 }
1312}
1313
1314
1315//______________________________________________________________________________
1316
1317//////////////////////////////////////////////////////////////////////////
1318// //
1319// TStreamerObjectAny implement streaming of embedded object not //
1320// inheriting from TObject. //
1321// //
1322//////////////////////////////////////////////////////////////////////////
1323
1325
1326////////////////////////////////////////////////////////////////////////////////
1327/// Default ctor.
1328
1330{
1331}
1332
1333////////////////////////////////////////////////////////////////////////////////
1334/// Create a TStreamerObjectAny object.
1335
1336TStreamerObjectAny::TStreamerObjectAny(const char *name, const char *title, Int_t offset, const char *typeName)
1337 : TStreamerElement(name,title,offset,TVirtualStreamerInfo::kAny,typeName)
1338{
1339 Init();
1340}
1341
1342////////////////////////////////////////////////////////////////////////////////
1343/// TStreamerObjectAny dtor.
1344
1346{
1347}
1348
1349////////////////////////////////////////////////////////////////////////////////
1350/// Setup the element.
1351
1353{
1357 }
1358}
1359
1360////////////////////////////////////////////////////////////////////////////////
1361/// Return the proper include for this element.
1362
1364{
1365 TClass *cl = GetClassPointer();
1366 if (cl && cl->HasInterpreterInfo()) {
1367 IncludeNameBuffer().Form("\"%s\"",cl->GetDeclFileName());
1368 } else {
1369 std::string shortname( TClassEdit::ShortType( GetTypeName(), 1 ) );
1370 IncludeNameBuffer().Form("\"%s.h\"",shortname.c_str());
1371 }
1372 return IncludeNameBuffer();
1373}
1374
1375////////////////////////////////////////////////////////////////////////////////
1376/// Returns size of anyclass in bytes.
1377
1379{
1380 TClass *cl = GetClassPointer();
1381 Int_t classSize = 8;
1382 if (cl) classSize = cl->Size();
1383 if (fArrayLength) return fArrayLength*classSize;
1384 return classSize;
1385}
1386
1387////////////////////////////////////////////////////////////////////////////////
1388/// Stream an object of class TStreamerObjectAny.
1389
1390void TStreamerObjectAny::Streamer(TBuffer &R__b)
1391{
1392 UInt_t R__s, R__c;
1393 if (R__b.IsReading()) {
1394 Version_t R__v = R__b.ReadVersion(&R__s, &R__c);
1395 if (R__v > 1) {
1396 R__b.ReadClassBuffer(TStreamerObjectAny::Class(), this, R__v, R__s, R__c);
1397 return;
1398 }
1399 //====process old versions before automatic schema evolution
1400 TStreamerElement::Streamer(R__b);
1401 R__b.CheckByteCount(R__s, R__c, TStreamerObjectAny::IsA());
1402 } else {
1404 }
1405}
1406
1407
1408
1409//______________________________________________________________________________
1410
1411//////////////////////////////////////////////////////////////////////////
1412// //
1413// TStreamerObjectPointer implements streaming of pointer to object //
1414// inheriting from TObject. //
1415// //
1416//////////////////////////////////////////////////////////////////////////
1417
1419
1420////////////////////////////////////////////////////////////////////////////////
1421/// Default ctor.
1422
1424{
1425}
1426
1427////////////////////////////////////////////////////////////////////////////////
1428/// Create a TStreamerObjectPointer object.
1429
1431 Int_t offset, const char *typeName)
1432 : TStreamerElement(name,title,offset,TVirtualStreamerInfo::kObjectP,typeName)
1433{
1434 if (strncmp(title,"->",2) == 0) fType = TVirtualStreamerInfo::kObjectp;
1435 fNewType = fType;
1436 Init();
1437}
1438
1439////////////////////////////////////////////////////////////////////////////////
1440/// TStreamerObjectPointer dtor.
1441
1443{
1444}
1445
1446////////////////////////////////////////////////////////////////////////////////
1447/// Setup the element.
1448
1450{
1454 }
1455}
1456
1457////////////////////////////////////////////////////////////////////////////////
1458/// Return the proper include for this element.
1459
1461{
1462 TClass *cl = GetClassPointer();
1463 if (cl && cl->HasInterpreterInfo()) {
1464 IncludeNameBuffer().Form("\"%s\"",cl->GetDeclFileName());
1465 } else {
1466 std::string shortname( TClassEdit::ShortType( GetTypeName(), 1 ) );
1467 IncludeNameBuffer().Form("\"%s.h\"",shortname.c_str());
1468 }
1469
1470 return IncludeNameBuffer();
1471}
1472
1473////////////////////////////////////////////////////////////////////////////////
1474/// Returns size of objectpointer in bytes.
1475
1477{
1478 if (fArrayLength) return fArrayLength*sizeof(void *);
1479 return sizeof(void *);
1480}
1481
1482////////////////////////////////////////////////////////////////////////////////
1483/// Set number of array dimensions.
1484
1486{
1487 fArrayDim = dim;
1488 //if (dim) fType += TVirtualStreamerInfo::kOffsetL;
1489 fNewType = fType;
1490}
1491
1492////////////////////////////////////////////////////////////////////////////////
1493/// Stream an object of class TStreamerObjectPointer.
1494
1495void TStreamerObjectPointer::Streamer(TBuffer &R__b)
1496{
1497 UInt_t R__s, R__c;
1498 if (R__b.IsReading()) {
1499 Version_t R__v = R__b.ReadVersion(&R__s, &R__c);
1500 if (R__v > 1) {
1501 R__b.ReadClassBuffer(TStreamerObjectPointer::Class(), this, R__v, R__s, R__c);
1502 return;
1503 }
1504 //====process old versions before automatic schema evolution
1505 TStreamerElement::Streamer(R__b);
1506 R__b.CheckByteCount(R__s, R__c, TStreamerObjectPointer::IsA());
1507 } else {
1509 }
1510}
1511
1512
1513//______________________________________________________________________________
1514
1515//////////////////////////////////////////////////////////////////////////
1516// //
1517// TStreamerObjectPointerAny implements streaming of pointer to object //
1518// not inheriting from TObject. //
1519// //
1520//////////////////////////////////////////////////////////////////////////
1521
1523
1524////////////////////////////////////////////////////////////////////////////////
1525/// Default ctor.
1526
1528{
1529}
1530
1531////////////////////////////////////////////////////////////////////////////////
1532/// Create a TStreamerObjectAnyPointer object.
1533
1535 Int_t offset, const char *typeName)
1536 : TStreamerElement(name,title,offset,TVirtualStreamerInfo::kAnyP,typeName)
1537{
1538 if (strncmp(title,"->",2) == 0) fType = TVirtualStreamerInfo::kAnyp;
1539 fNewType = fType;
1540 Init();
1541}
1542
1543////////////////////////////////////////////////////////////////////////////////
1544/// TStreamerObjectAnyPointer dtor.
1545
1547{
1548}
1549
1550////////////////////////////////////////////////////////////////////////////////
1551/// Setup the element.
1552
1554{
1558 }
1559}
1560
1561////////////////////////////////////////////////////////////////////////////////
1562/// Return the proper include for this element.
1563
1565{
1566 TClass *cl = GetClassPointer();
1567 if (cl && cl->HasInterpreterInfo()) {
1568 IncludeNameBuffer().Form("\"%s\"",cl->GetDeclFileName());
1569 } else {
1570 std::string shortname( TClassEdit::ShortType( GetTypeName(), 1 ) );
1571 IncludeNameBuffer().Form("\"%s.h\"",shortname.c_str());
1572 }
1573
1574 return IncludeNameBuffer();
1575}
1576
1577////////////////////////////////////////////////////////////////////////////////
1578/// Returns size of objectpointer in bytes.
1579
1581{
1582 if (fArrayLength) return fArrayLength*sizeof(void *);
1583 return sizeof(void *);
1584}
1585
1586////////////////////////////////////////////////////////////////////////////////
1587/// Set number of array dimensions.
1588
1590{
1591 fArrayDim = dim;
1592 //if (dim) fType += TVirtualStreamerInfo::kOffsetL;
1593 fNewType = fType;
1594}
1595
1596////////////////////////////////////////////////////////////////////////////////
1597/// Stream an object of class TStreamerObjectAnyPointer.
1598
1599void TStreamerObjectAnyPointer::Streamer(TBuffer &R__b)
1600{
1601 if (R__b.IsReading()) {
1603 } else {
1605 }
1606}
1607
1608
1609//______________________________________________________________________________
1610
1611//////////////////////////////////////////////////////////////////////////
1612// //
1613// TSreamerString implements streaming of TString. //
1614// //
1615//////////////////////////////////////////////////////////////////////////
1616
1618
1619////////////////////////////////////////////////////////////////////////////////
1620/// Default ctor.
1621
1623{
1624}
1625
1626////////////////////////////////////////////////////////////////////////////////
1627/// Create a TStreamerString object.
1628
1629TStreamerString::TStreamerString(const char *name, const char *title, Int_t offset)
1630 : TStreamerElement(name,title,offset,TVirtualStreamerInfo::kTString,"TString")
1631{
1632}
1633
1634////////////////////////////////////////////////////////////////////////////////
1635/// TStreamerString dtor.
1636
1638{
1639}
1640
1641////////////////////////////////////////////////////////////////////////////////
1642/// Return the proper include for this element.
1643
1645{
1646 IncludeNameBuffer().Form("<%s>","TString.h");
1647 return IncludeNameBuffer();
1648}
1649
1650////////////////////////////////////////////////////////////////////////////////
1651/// Returns size of anyclass in bytes.
1652
1654{
1655 if (fArrayLength) return fArrayLength*sizeof(TString);
1656 return sizeof(TString);
1657}
1658
1659////////////////////////////////////////////////////////////////////////////////
1660/// Stream an object of class TStreamerString.
1661
1662void TStreamerString::Streamer(TBuffer &R__b)
1663{
1664 UInt_t R__s, R__c;
1665 if (R__b.IsReading()) {
1666 Version_t R__v = R__b.ReadVersion(&R__s, &R__c);
1667 if (R__v > 1) {
1668 R__b.ReadClassBuffer(TStreamerString::Class(), this, R__v, R__s, R__c);
1669 return;
1670 }
1671 //====process old versions before automatic schema evolution
1672 TStreamerElement::Streamer(R__b);
1673 R__b.CheckByteCount(R__s, R__c, TStreamerString::IsA());
1674 } else {
1676 }
1677}
1678
1679//______________________________________________________________________________
1680
1681//////////////////////////////////////////////////////////////////////////
1682// //
1683// TStreamerSTL implements streamer of STL container. //
1684// //
1685//////////////////////////////////////////////////////////////////////////
1686
1688
1689////////////////////////////////////////////////////////////////////////////////
1690/// Default ctor.
1691
1692TStreamerSTL::TStreamerSTL() : fSTLtype(0),fCtype(0)
1693{
1694}
1695
1696////////////////////////////////////////////////////////////////////////////////
1697/// Create a TStreamerSTL object.
1698
1699TStreamerSTL::TStreamerSTL(const char *name, const char *title, Int_t offset,
1700 const char *typeName, const TVirtualCollectionProxy &proxy, Bool_t dmPointer)
1701 : TStreamerElement(name,title,offset,ROOT::kSTLany,typeName)
1702{
1704
1705 if (name==typeName /* intentional pointer comparison */
1706 || strcmp(name,typeName)==0) {
1707 // We have a base class.
1708 fName = fTypeName;
1709 }
1710 fSTLtype = proxy.GetCollectionType();
1711 fCtype = 0;
1712
1713 if (dmPointer) fSTLtype += TVirtualStreamerInfo::kOffsetP;
1714
1715 if (fSTLtype == ROOT::kSTLbitset) {
1716 // Nothing to check
1717 } else if (proxy.GetValueClass()) {
1720 } else {
1721 fCtype = proxy.GetType();
1723 }
1725}
1726
1727////////////////////////////////////////////////////////////////////////////////
1728/// Create a TStreamerSTL object.
1729
1730TStreamerSTL::TStreamerSTL(const char *name, const char *title, Int_t offset,
1731 const char *typeName, const char *trueType, Bool_t dmPointer)
1732 : TStreamerElement(name,title,offset,ROOT::kSTLany,typeName)
1733{
1734 const char *t = trueType;
1735 if (!t || !*t) t = typeName;
1736
1738
1739 if (name==typeName /* intentional pointer comparison */
1740 || strcmp(name,typeName)==0) {
1741 // We have a base class.
1742 fName = fTypeName;
1743 }
1744
1745 Int_t nch = strlen(t);
1746 char *s = new char[nch+1];
1747 strlcpy(s,t,nch+1);
1748 char *sopen = strchr(s,'<');
1749 if (sopen == 0) {
1750 Fatal("TStreamerSTL","For %s, the type name (%s) is seemingly not a template (template argument not found)", name, s);
1751 return;
1752 }
1753 *sopen = 0; sopen++;
1754 // We are looking for the first arguments of the STL container, because
1755 // this arguments can be a templates we need to count the < and >
1756 char* current=sopen;
1757 for(int count = 0; *current!='\0'; current++) {
1758 if (*current=='<') count++;
1759 if (*current=='>') {
1760 if (count==0) break;
1761 count--;
1762 }
1763 if (*current==',' && count==0) break;
1764 }
1765 char *sclose = current; *sclose = 0; sclose--;
1766 char *sconst = strstr(sopen,"const ");
1767 char *sbracket = strstr(sopen,"<");
1768 if (sconst && (sbracket==0 || sconst < sbracket)) {
1769 // the string "const" may be part of the classname!
1770 char *pconst = sconst-1;
1771 if (*pconst == ' ' || *pconst == '<' || *pconst == '*' || *pconst == '\0') sopen = sconst + 5;
1772 }
1774 fCtype = 0;
1775 if (fSTLtype == ROOT::kNotSTL) { delete [] s; return;}
1776 if (dmPointer) fSTLtype += TVirtualStreamerInfo::kOffsetP;
1777
1778 // find STL contained type
1779 while (*sopen==' ') sopen++;
1780 Bool_t isPointer = kFALSE;
1781 // Find stars outside of any template definitions in the
1782 // first template argument.
1783 char *star = strrchr(sopen,'>');
1784 if (star) star = strchr(star,'*');
1785 else star = strchr(sopen,'*');
1786 if (star) {
1787 isPointer = kTRUE;
1788 *star = 0;
1789 sclose = star - 1;
1790 }
1791 while (*sclose == ' ') {*sclose = 0; sclose--;}
1792
1793
1794 TDataType *dt = (TDataType*)gROOT->GetListOfTypes()->FindObject(sopen);
1795 if (fSTLtype == ROOT::kSTLbitset) {
1796 // Nothing to check
1797 } else if (dt) {
1798 fCtype = dt->GetType();
1799 if (isPointer) fCtype += TVirtualStreamerInfo::kOffsetP;
1800 } else {
1801 // this could also be a nested enums ... which should work ... be let's see.
1802 TClass *cl = TClass::GetClass(sopen);
1803 if (cl) {
1804 if (isPointer) fCtype = TVirtualStreamerInfo::kObjectp;
1806 } else {
1807 if (gCling->ClassInfo_IsEnum(sopen)) {
1808 if (isPointer) fCtype += TVirtualStreamerInfo::kOffsetP;
1809 } else {
1810 if(strcmp(sopen,"string")) {
1811 // This case can happens when 'this' is a TStreamerElement for
1812 // a STL container containing something for which we do not have
1813 // a TVirtualStreamerInfo (This happens in particular is the collection
1814 // objects themselves are always empty) and we do not have the
1815 // dictionary/shared library for the container.
1816 if (GetClassPointer() && GetClassPointer()->IsLoaded()) {
1817 Warning("TStreamerSTL","For %s we could not find any information about the type %s %d %s",fTypeName.Data(),sopen,fSTLtype,s);
1818 }
1819 }
1820 }
1821 }
1822 }
1823 delete [] s;
1824
1826}
1827
1828////////////////////////////////////////////////////////////////////////////////
1829/// TStreamerSTL dtor.
1830
1832{
1833}
1834
1835////////////////////////////////////////////////////////////////////////////////
1836/// We can not split STL's which are inside a variable size array.
1837/// At least for now.
1838
1840{
1841 if (IsaPointer()) {
1842 if (GetTitle()[0]=='[') return kTRUE; // can not split variable size array
1843 return kTRUE;
1844 }
1845
1846 if (GetArrayDim()>=1 && GetArrayLength()>1) return kTRUE;
1847
1849
1850 return kFALSE;
1851}
1852
1853////////////////////////////////////////////////////////////////////////////////
1854/// Return true if the data member is a pointer.
1855
1857{
1858 const char *type_name = GetTypeName();
1859 if ( type_name[strlen(type_name)-1]=='*' ) return kTRUE;
1860 else return kFALSE;
1861}
1862
1863
1864////////////////////////////////////////////////////////////////////////////////
1865/// Return kTRUE if the element represent a base class.
1866
1868{
1869 TString ts(GetName());
1870
1871 if (strcmp(ts.Data(),GetTypeName())==0) return kTRUE;
1872 if (strcmp(ts.Data(),GetTypeNameBasic())==0) return kTRUE;
1873 return kFALSE;
1874}
1875////////////////////////////////////////////////////////////////////////////////
1876/// Returns size of STL container in bytes.
1877
1879{
1880 // Since the STL collection might or might not be emulated and that the
1881 // sizeof the object depends on this, let's just always retrieve the
1882 // current size!
1883 TClass *cl = GetClassPointer();
1884 UInt_t size = 0;
1885 if (cl==0) {
1886 if (!TestBit(kWarned)) {
1887 Error("GetSize","Could not find the TClass for %s.\n"
1888 "This is likely to have been a typedef, if possible please declare it in CINT to work around the issue\n",fTypeName.Data());
1889 const_cast<TStreamerSTL*>(this)->SetBit(kWarned);
1890 }
1891 } else {
1892 size = cl->Size();
1893 }
1894
1895 if (fArrayLength) return fArrayLength*size;
1896 return size;
1897}
1898
1899////////////////////////////////////////////////////////////////////////////////
1900/// Print the content of the element.
1901
1903{
1905 TString cdim;
1906 name = GetName();
1907 for (Int_t i=0;i<fArrayDim;i++) {
1908 cdim.Form("[%d]",fMaxIndex[i]);
1909 name += cdim;
1910 }
1911 TString sequenceType;
1912 GetSequenceType(sequenceType);
1913 if (sequenceType.Length()) {
1914 sequenceType.Prepend(" (");
1915 sequenceType += ") ";
1916 }
1917 printf(" %-14s %-15s offset=%3d type=%2d %s,stl=%d, ctype=%d, %-20s\n",
1918 GetTypeName(),name.Data(),fOffset,fType,sequenceType.Data(),
1920}
1921
1922////////////////////////////////////////////////////////////////////////////////
1923/// Return the proper include for this element.
1924
1925const char *TStreamerSTL::GetInclude() const
1926{
1927 if (fSTLtype == ROOT::kSTLvector) IncludeNameBuffer().Form("<%s>","vector");
1928 else if (fSTLtype == ROOT::kSTLlist) IncludeNameBuffer().Form("<%s>","list");
1929 else if (fSTLtype == ROOT::kSTLforwardlist) IncludeNameBuffer().Form("<%s>","forward_list");
1930 else if (fSTLtype == ROOT::kSTLdeque) IncludeNameBuffer().Form("<%s>","deque");
1931 else if (fSTLtype == ROOT::kSTLmap) IncludeNameBuffer().Form("<%s>","map");
1932 else if (fSTLtype == ROOT::kSTLmultimap) IncludeNameBuffer().Form("<%s>","map");
1933 else if (fSTLtype == ROOT::kSTLset) IncludeNameBuffer().Form("<%s>","set");
1934 else if (fSTLtype == ROOT::kSTLmultiset) IncludeNameBuffer().Form("<%s>","set");
1935 else if (fSTLtype == ROOT::kSTLunorderedset) IncludeNameBuffer().Form("<%s>","unordered_set");
1936 else if (fSTLtype == ROOT::kSTLunorderedmultiset) IncludeNameBuffer().Form("<%s>","unordered_set");
1937 else if (fSTLtype == ROOT::kSTLunorderedmap) IncludeNameBuffer().Form("<%s>","unordered_map");
1938 else if (fSTLtype == ROOT::kSTLunorderedmultimap) IncludeNameBuffer().Form("<%s>","unordered_map");
1939 else if (fSTLtype == ROOT::kSTLbitset) IncludeNameBuffer().Form("<%s>","bitset");
1940 return IncludeNameBuffer();
1941}
1942
1943////////////////////////////////////////////////////////////////////////////////
1944/// Set pointer to Streamer function for this element
1945/// NOTE: we do not take ownership
1946
1948{
1949 fStreamer = streamer;
1950}
1951
1952////////////////////////////////////////////////////////////////////////////////
1953/// Stream an object of class TStreamerSTL.
1954
1955void TStreamerSTL::Streamer(TBuffer &R__b)
1956{
1957 UInt_t R__s, R__c;
1958 if (R__b.IsReading()) {
1959 Version_t R__v = R__b.ReadVersion(&R__s, &R__c);
1960 if (R__v > 2) {
1961 R__b.ReadClassBuffer(TStreamerSTL::Class(), this, R__v, R__s, R__c);
1962 } else {
1963 //====process old versions before automatic schema evolution
1964 TStreamerElement::Streamer(R__b);
1965 R__b >> fSTLtype;
1966 R__b >> fCtype;
1967 R__b.CheckByteCount(R__s, R__c, TStreamerSTL::IsA());
1968 }
1969 // In old versions (prior to v6.24/02) the value of fArrayDim was not stored properly.
1970 if (fArrayDim == 0 && fArrayLength > 0) {
1971 while(fArrayDim < 5 && fMaxIndex[fArrayDim] != 0) {
1972 ++fArrayDim;
1973 }
1974 }
1976 // For a long time those where inverted in TStreamerElement
1977 // compared to the other definitions. When we moved to version '4',
1978 // this got standardized, but we now need to fix it.
1979
1980 if (fTypeName.BeginsWith("std::set") || fTypeName.BeginsWith("set")) {
1982 } else if (fTypeName.BeginsWith("std::multimap") || fTypeName.BeginsWith("multimap")) {
1984 }
1985 }
1986
1989 if (GetArrayLength() > 0) {
1991 }
1992 if (R__b.GetParent()) { // Avoid resetting during a cloning.
1994 SetBit(kDoNotDelete); // For backward compatibility
1995 } else if ( fSTLtype == ROOT::kSTLmap || fSTLtype == ROOT::kSTLmultimap) {
1996 // Here we would like to set the bit only if one of the element of the pair is a pointer,
1997 // however we have no easy to determine this short of parsing the class name.
1998 SetBit(kDoNotDelete); // For backward compatibility
1999 }
2000 }
2001 return;
2002 } else {
2003 // To enable forward compatibility we actually save with the old value
2004 TStreamerSTL tmp;
2005 // Hand coded copy constructor since the 'normal' one are intentionally
2006 // deleted.
2007 tmp.fName = fName;
2008 tmp.fTitle = fTitle;
2010 tmp.fSize = fSize;
2011 tmp.fArrayDim = fArrayDim;
2013 for(int i = 0; i < 5; ++i)
2014 tmp.fMaxIndex[i] = fMaxIndex[i];
2015 tmp.fTypeName = fTypeName;
2016 tmp.fSTLtype = fSTLtype;
2017 tmp.fCtype = fCtype;
2019 }
2020}
2021
2022//______________________________________________________________________________
2023
2024//////////////////////////////////////////////////////////////////////////
2025// //
2026// TStreamerSTLstring implements streaming std::string. //
2027// //
2028//////////////////////////////////////////////////////////////////////////
2029
2031
2032////////////////////////////////////////////////////////////////////////////////
2033/// Default ctor.
2034
2036{
2037}
2038
2039////////////////////////////////////////////////////////////////////////////////
2040/// Create a TStreamerSTLstring object.
2041
2042TStreamerSTLstring::TStreamerSTLstring(const char *name, const char *title, Int_t offset,
2043 const char *typeName, Bool_t dmPointer)
2044 : TStreamerSTL()
2045{
2046 SetName(name);
2047 SetTitle(title);
2048
2049 if (dmPointer) {
2051 } else {
2053 }
2054
2055 fNewType = fType;
2056 fOffset = offset;
2059 fTypeName= typeName;
2060
2061}
2062
2063////////////////////////////////////////////////////////////////////////////////
2064/// TStreamerSTLstring dtor.
2065
2067{
2068}
2069
2070////////////////////////////////////////////////////////////////////////////////
2071/// Return the proper include for this element.
2072
2074{
2075 IncludeNameBuffer() = "<string>";
2076 return IncludeNameBuffer();
2077}
2078
2079////////////////////////////////////////////////////////////////////////////////
2080/// Returns size of anyclass in bytes.
2081
2083{
2084 if (fArrayLength) return fArrayLength*sizeof(string);
2085 return sizeof(string);
2086}
2087
2088////////////////////////////////////////////////////////////////////////////////
2089/// Stream an object of class TStreamerSTLstring.
2090
2091void TStreamerSTLstring::Streamer(TBuffer &R__b)
2092{
2093 UInt_t R__s, R__c;
2094 if (R__b.IsReading()) {
2095 Version_t R__v = R__b.ReadVersion(&R__s, &R__c);
2096 if (R__v > 1) {
2097 R__b.ReadClassBuffer(TStreamerSTLstring::Class(), this, R__v, R__s, R__c);
2098 return;
2099 }
2100 //====process old versions before automatic schema evolution
2101 TStreamerSTL::Streamer(R__b);
2102 R__b.CheckByteCount(R__s, R__c, TStreamerSTLstring::IsA());
2103 } else {
2105 }
2106}
2107
2108//______________________________________________________________________________
2109
2110///////////////////////////////////////////////////////////////////////////////
2111// //
2112// TStreamerArtificial implements StreamerElement injected by a TSchemaRule. //
2113// //
2114///////////////////////////////////////////////////////////////////////////////
2115
2117
2118void TStreamerArtificial::Streamer(TBuffer& /* R__b */)
2119{
2120 // Avoid streaming the synthetic/artificial streamer elements.
2121
2122 // Intentionally, nothing to do at all.
2123 return;
2124}
2125
2127{
2128 // Return the read function if any.
2129
2130 return fReadFunc;
2131}
2132
2134{
2135 // Return the raw read function if any.
2136
2137 return fReadRawFunc;
2138}
void Class()
Definition: Class.C:29
#define b(i)
Definition: RSha256.hxx:100
unsigned short UShort_t
Definition: RtypesCore.h:38
int Int_t
Definition: RtypesCore.h:43
short Version_t
Definition: RtypesCore.h:63
unsigned char UChar_t
Definition: RtypesCore.h:36
char Char_t
Definition: RtypesCore.h:31
unsigned int UInt_t
Definition: RtypesCore.h:44
const Bool_t kFALSE
Definition: RtypesCore.h:90
unsigned long ULong_t
Definition: RtypesCore.h:53
long Long_t
Definition: RtypesCore.h:52
bool Bool_t
Definition: RtypesCore.h:61
short Short_t
Definition: RtypesCore.h:37
double Double_t
Definition: RtypesCore.h:57
long long Long64_t
Definition: RtypesCore.h:71
unsigned long long ULong64_t
Definition: RtypesCore.h:72
float Float_t
Definition: RtypesCore.h:55
const Bool_t kTRUE
Definition: RtypesCore.h:89
const char Option_t
Definition: RtypesCore.h:64
#define ClassImp(name)
Definition: Rtypes.h:361
EDataType
Definition: TDataType.h:28
void Error(const char *location, const char *msgfmt,...)
char name[80]
Definition: TGX11.cxx:109
int type
Definition: TGX11.cxx:120
float xmin
Definition: THbookFile.cxx:93
float xmax
Definition: THbookFile.cxx:93
R__EXTERN TVirtualMutex * gInterpreterMutex
Definition: TInterpreter.h:41
R__EXTERN TInterpreter * gCling
Definition: TInterpreter.h:557
#define gROOT
Definition: TROOT.h:406
static TStreamerBasicType * InitCounter(const char *countClass, const char *countName, TVirtualStreamerInfo *directive)
Helper function to initialize the 'index/counter' value of the Pointer streamerElements.
static TString & IncludeNameBuffer()
static void GetRange(const char *comments, Double_t &xmin, Double_t &xmax, Double_t &factor)
Parse comments to search for a range specifier of the style: [xmin,xmax] or [xmin,...
const Int_t kMaxLen
static TString ExtractClassName(const TString &type_name)
#define R__LOCKGUARD(mutex)
#define snprintf
Definition: civetweb.c:1540
void(* ReadFuncPtr_t)(char *, TVirtualObject *)
Definition: TSchemaRule.h:42
void(* ReadRawFuncPtr_t)(char *, TBuffer &)
Definition: TSchemaRule.h:43
Buffer base class used for serializing objects.
Definition: TBuffer.h:42
virtual void ClassBegin(const TClass *, Version_t=-1)=0
virtual void ClassMember(const char *, const char *=0, Int_t=-1, Int_t=-1)=0
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=0)=0
TObject * GetParent() const
Return pointer to parent of this buffer.
Definition: TBuffer.cxx:262
virtual Version_t ReadVersion(UInt_t *start=0, UInt_t *bcnt=0, const TClass *cl=0)=0
virtual void ClassEnd(const TClass *)=0
virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss)=0
virtual void ReadFastArray(Bool_t *b, Int_t n)=0
Bool_t IsReading() const
Definition: TBuffer.h:85
void SetBufferOffset(Int_t offset=0)
Definition: TBuffer.h:92
virtual Int_t ReadStaticArray(Bool_t *b)=0
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
TClassRef is used to implement a permanent reference to a TClass object.
Definition: TClassRef.h:28
virtual void SetOnFileClass(const TClass *cl)
static DictFuncPtr_t GetDict(const char *cname)
Given the class name returns the Dictionary() function of a class (uses hash of name).
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition: TClass.h:80
UInt_t GetCheckSum(ECheckSum code=kCurrentCheckSum) const
Call GetCheckSum with validity check.
Definition: TClass.cxx:6429
Bool_t CanSplit() const
Return true if the data member of this TClass can be saved separately.
Definition: TClass.cxx:2300
ClassStreamerFunc_t GetStreamerFunc() const
Get a wrapper/accessor function around this class custom streamer (member function).
Definition: TClass.cxx:2919
TClassStreamer * GetStreamer() const
Return the Streamer Class allowing streaming (if any).
Definition: TClass.cxx:2894
Bool_t HasInterpreterInfo() const
Definition: TClass.h:407
TList * GetListOfRealData() const
Definition: TClass.h:450
Int_t Size() const
Return size of object of this class.
Definition: TClass.cxx:5667
Bool_t IsTObject() const
Return kTRUE is the class inherits from TObject.
Definition: TClass.cxx:5901
ClassConvStreamerFunc_t GetConvStreamerFunc() const
Get a wrapper/accessor function around this class custom conversion streamer (member function).
Definition: TClass.cxx:2927
Int_t GetBaseClassOffset(const TClass *toBase, void *address=0, bool isDerivedObject=true)
Definition: TClass.cxx:2771
TVirtualStreamerInfo * GetStreamerInfo(Int_t version=0, Bool_t isTransient=kFALSE) const
returns a pointer to the TVirtualStreamerInfo object for version If the object does not exist,...
Definition: TClass.cxx:4562
TVirtualCollectionProxy * GetCollectionProxy() const
Return the proxy describing the collection (if any).
Definition: TClass.cxx:2877
TVirtualStreamerInfo * GetConversionStreamerInfo(const char *onfile_classname, Int_t version) const
Return a Conversion StreamerInfo from the class 'classname' for version number 'version' to this clas...
Definition: TClass.cxx:7007
TVirtualStreamerInfo * FindConversionStreamerInfo(const char *onfile_classname, UInt_t checksum) const
Return a Conversion StreamerInfo from the class 'classname' for the layout represented by 'checksum' ...
Definition: TClass.cxx:7114
Bool_t IsVersioned() const
Definition: TClass.h:517
TVirtualStreamerInfo * FindStreamerInfo(TObjArray *arr, UInt_t checksum) const
Find the TVirtualStreamerInfo in the StreamerInfos corresponding to checksum.
Definition: TClass.cxx:6987
Version_t GetClassVersion() const
Definition: TClass.h:417
const char * GetDeclFileName() const
Return name of the file containing the declaration of this class.
Definition: TClass.cxx:3431
static TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE)
Static method returning pointer to TClass of the specified class name.
Definition: TClass.cxx:2948
Int_t WriteBuffer(TBuffer &b, void *pointer, const char *info="")
Function called by the Streamer functions to serialize object at p to buffer b.
Definition: TClass.cxx:6700
All ROOT classes may have RTTI (run time type identification) support added.
Definition: TDataMember.h:31
TClass * GetClass() const
Definition: TDataMember.h:75
Basic data type descriptor (datatype information is obtained from CINT).
Definition: TDataType.h:44
Int_t GetType() const
Definition: TDataType.h:68
TString GetTypeName()
Get basic type of typedef, e,g.
Definition: TDataType.cxx:149
virtual Bool_t ClassInfo_IsEnum(const char *) const
Definition: TInterpreter.h:413
virtual TObject * FindObject(const char *name) const
Find an object in this list using its name.
Definition: TList.cxx:577
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
Definition: TNamed.cxx:164
TString fTitle
Definition: TNamed.h:33
TString fName
Definition: TNamed.h:32
virtual void SetName(const char *name)
Set the name of the TNamed.
Definition: TNamed.cxx:140
virtual const char * GetTitle() const
Returns title of object.
Definition: TNamed.h:48
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:47
virtual TObject * FindObject(const char *name) const
Find an object in this collection using its name.
Definition: TObjArray.cxx:415
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
Definition: TObject.h:187
virtual UInt_t GetUniqueID() const
Return the unique object id.
Definition: TObject.cxx:375
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
Definition: TObject.cxx:877
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
Definition: TObject.cxx:694
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:891
virtual void Fatal(const char *method, const char *msgfmt,...) const
Issue fatal error message.
Definition: TObject.cxx:919
virtual void SetUniqueID(UInt_t uid)
Set the unique object id.
Definition: TObject.cxx:705
void ResetBit(UInt_t f)
Definition: TObject.h:186
The TRealData class manages the effective list of all data members for a given class.
Definition: TRealData.h:30
TDataMember * GetDataMember() const
Definition: TRealData.h:53
static Int_t AddExec(const char *name)
If Exec with name does not exist in the list of Execs, it is created.
Definition: TRef.cxx:340
ROOT::TSchemaRule::ReadRawFuncPtr_t GetReadRawFunc()
ROOT::TSchemaRule::ReadRawFuncPtr_t fReadRawFunc
ROOT::TSchemaRule::ReadFuncPtr_t GetReadFunc()
ROOT::TSchemaRule::ReadFuncPtr_t fReadFunc
void InitStreaming(Bool_t isTransient)
Error message in case of checksum/version mismatch.
UInt_t & fBaseCheckSum
Bool_t IsBase() const
Return kTRUE if the element represent a base class.
Int_t WriteBuffer(TBuffer &b, char *pointer)
Write the base class into the buffer.
virtual void Init(TVirtualStreamerInfo *obj=0)
Setup the element.
const char * GetInclude() const
Return the proper include for this element.
virtual ~TStreamerBase()
TStreamerBase dtor.
TClass * fBaseClass
checksum of the base class (used during memberwise streaming)
Int_t ReadBuffer(TBuffer &b, char *pointer)
Read the content of the buffer.
ClassConvStreamerFunc_t fConvStreamerFunc
Pointer to a wrapper around a custom streamer member function.
TClass * fNewBaseClass
pointer to base class
Int_t GetSize() const
Returns size of baseclass in bytes.
TVirtualStreamerInfo * fStreamerInfo
Pointer to a wrapper around a custom convertion streamer member function.
virtual void Update(const TClass *oldClass, TClass *newClass)
Function called by the TClass constructor when replacing an emulated class by the real class.
ClassStreamerFunc_t fStreamerFunc
pointer to new base class if renamed
virtual void ls(Option_t *option="") const
Print the content of the element.
virtual TClass * GetClassPointer() const
Returns a pointer to the TClass of this element.
virtual ~TStreamerBasicPointer()
TStreamerBasicPointer dtor.
void SetArrayDim(Int_t dim)
Set number of array dimensions.
Int_t GetSize() const
Returns size of basicpointer in bytes.
ULong_t GetMethod() const
return offset of counter
TStreamerBasicPointer()
pointer to basic type counter
virtual void Init(TVirtualStreamerInfo *obj=0)
Setup the element.
TStreamerBasicType * fCounter
Int_t GetSize() const
Returns size of this element in bytes.
ULong_t GetMethod() const
return address of counter
TStreamerBasicType()
value of data member when referenced by an array
virtual ~TStreamerBasicType()
TStreamerBasicType dtor.
TStreamerElement()
Default ctor.
virtual Int_t GetSize() const
Returns size of this element in bytes.
Int_t GetType() const
virtual Bool_t IsOldFormat(const char *newTypeName)
The early 3.00/00 and 3.01/01 versions used to store dm->GetTypeName instead of dm->GetFullTypename i...
virtual const char * GetFullName() const
Return element name including dimensions, if any Note that this function stores the name into a stati...
virtual TClass * GetClassPointer() const
Returns a pointer to the TClass of this element.
virtual void SetArrayDim(Int_t dim)
Set number of array dimensions.
virtual ~TStreamerElement()
TStreamerElement dtor.
Int_t GetArrayDim() const
TMemberStreamer * GetStreamer() const
Return the local streamer object.
Int_t fTObjectOffset
element offset in class
Double_t fXmax
Minimum of data member if a range is specified [xmin,xmax,nbits].
Int_t GetArrayLength() const
virtual void SetStreamer(TMemberStreamer *streamer)
set pointer to Streamer function for this element
TMemberStreamer * fStreamer
new element class when reading
TString fTypeName
new element type when reading
virtual Bool_t IsTransient() const
Return kTRUE if the element represent an entity that is not written to the disk (transient members,...
Double_t fFactor
Maximum of data member if a range is specified [xmin,xmax,nbits].
virtual Bool_t IsaPointer() const
virtual void Update(const TClass *oldClass, TClass *newClass)
function called by the TClass constructor when replacing an emulated class by the real class
const char * GetTypeName() const
virtual Bool_t CannotSplit() const
Returns true if the element cannot be split, false otherwise.
virtual void SetType(Int_t dtype)
Int_t GetOffset() const
virtual void Init(TVirtualStreamerInfo *obj=0)
Initliaze the element.
Double_t fXmin
pointer to element Streamer
const char * GetTypeNameBasic() const
Return type name of this element in case the type name is not a standard basic type,...
virtual Bool_t IsBase() const
Return kTRUE if the element represent a base class.
virtual Int_t GetExecID() const
Returns the TExec id for the EXEC instruction in the comment field of a TRef data member.
TClass * fNewClass
pointer to class of object
virtual void SetMaxIndex(Int_t dim, Int_t max)
set maximum index for array with dimension dim
void GetSequenceType(TString &type) const
Fill type with the string representation of sequence information including 'cached',...
Int_t fNewType
base offset for TObject if the element inherits from it
virtual void ls(Option_t *option="") const
Print the content of the element.
TStreamerBasicType * fCounter
virtual ~TStreamerLoop()
TStreamerLoop dtor.
ULong_t GetMethod() const
return address of counter
const char * GetInclude() const
Return the proper include for this element.
virtual void Init(TVirtualStreamerInfo *obj=0)
Setup the element.
Int_t GetSize() const
Returns size of counter in bytes.
TStreamerLoop()
pointer to basic type counter
Int_t GetSize() const
Returns size of objectpointer in bytes.
virtual void Init(TVirtualStreamerInfo *obj=0)
Setup the element.
virtual void SetArrayDim(Int_t dim)
Set number of array dimensions.
const char * GetInclude() const
Return the proper include for this element.
virtual ~TStreamerObjectAnyPointer()
TStreamerObjectAnyPointer dtor.
TStreamerObjectAnyPointer()
Default ctor.
virtual ~TStreamerObjectAny()
TStreamerObjectAny dtor.
Int_t GetSize() const
Returns size of anyclass in bytes.
TStreamerObjectAny()
Default ctor.
virtual void Init(TVirtualStreamerInfo *obj=0)
Setup the element.
const char * GetInclude() const
Return the proper include for this element.
virtual void SetArrayDim(Int_t dim)
Set number of array dimensions.
TStreamerObjectPointer()
Default ctor.
const char * GetInclude() const
Return the proper include for this element.
virtual ~TStreamerObjectPointer()
TStreamerObjectPointer dtor.
Int_t GetSize() const
Returns size of objectpointer in bytes.
virtual void Init(TVirtualStreamerInfo *obj=0)
Setup the element.
const char * GetInclude() const
Return the proper include for this element.
TStreamerObject()
Default ctor.
virtual void Init(TVirtualStreamerInfo *obj=0)
Setup the element.
virtual ~TStreamerObject()
TStreamerObject dtor.
Int_t GetSize() const
Returns size of object class in bytes.
const char * GetInclude() const
Return the proper include for this element.
Int_t GetSize() const
Returns size of STL container in bytes.
Bool_t CannotSplit() const
We can not split STL's which are inside a variable size array.
TStreamerSTL()
Default ctor.
virtual void ls(Option_t *option="") const
Print the content of the element.
Bool_t IsBase() const
Return kTRUE if the element represent a base class.
virtual ~TStreamerSTL()
TStreamerSTL dtor.
virtual void SetStreamer(TMemberStreamer *streamer)
Set pointer to Streamer function for this element NOTE: we do not take ownership.
Bool_t IsaPointer() const
Return true if the data member is a pointer.
const char * GetInclude() const
Return the proper include for this element.
virtual ~TStreamerSTLstring()
TStreamerSTLstring dtor.
Int_t GetSize() const
Returns size of anyclass in bytes.
TStreamerSTLstring()
Default ctor.
TStreamerString()
Default ctor.
Int_t GetSize() const
Returns size of anyclass in bytes.
const char * GetInclude() const
Return the proper include for this element.
virtual ~TStreamerString()
TStreamerString dtor.
Basic string class.
Definition: TString.h:131
Ssiz_t Length() const
Definition: TString.h:405
void ToLower()
Change string to lower-case.
Definition: TString.cxx:1125
TSubString Strip(EStripType s=kTrailing, char c=' ') const
Return a substring of self stripped at beginning and/or end.
Definition: TString.cxx:1106
void Clear()
Clear string without changing its capacity.
Definition: TString.cxx:1176
const char * Data() const
Definition: TString.h:364
TString & ReplaceAll(const TString &s1, const TString &s2)
Definition: TString.h:687
@ kTrailing
Definition: TString.h:262
TString & Prepend(const char *cs)
Definition: TString.h:656
TString & Remove(Ssiz_t pos)
Definition: TString.h:668
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Definition: TString.cxx:2289
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition: TString.h:619
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
Definition: TString.h:634
virtual EDataType GetType() const =0
virtual TClass * GetValueClass() const =0
virtual Int_t GetCollectionType() const =0
virtual Bool_t HasPointers() const =0
Abstract Interface class describing Streamer information for one class.
static TStreamerBasicType * GetElementCounter(const char *countName, TClass *cl)
Get pointer to a TStreamerBasicType in TClass *cl static function.
virtual TObjArray * GetElements() const =0
virtual TClass * GetClass() const =0
struct void * fTypeName
Definition: cppyy.h:9
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
Definition: StringConv.hxx:21
@ kSTLbitset
Definition: ESTLType.h:37
@ kSTLmap
Definition: ESTLType.h:33
@ kSTLunorderedmultiset
Definition: ESTLType.h:43
@ kSTLstring
Definition: ESTLType.h:48
@ kSTLset
Definition: ESTLType.h:35
@ kSTLmultiset
Definition: ESTLType.h:36
@ kSTLdeque
Definition: ESTLType.h:32
@ kSTLvector
Definition: ESTLType.h:30
@ kSTLany
Definition: ESTLType.h:47
@ kSTLunorderedmultimap
Definition: ESTLType.h:45
@ kSTLunorderedset
Definition: ESTLType.h:42
@ kSTLlist
Definition: ESTLType.h:31
@ kSTLforwardlist
Definition: ESTLType.h:41
@ kSTLunorderedmap
Definition: ESTLType.h:44
@ kNotSTL
Definition: ESTLType.h:29
@ kSTLmultimap
Definition: ESTLType.h:34
ROOT::ESTLType STLKind(std::string_view type)
Converts STL container name to number.
Definition: TClassEdit.cxx:511
std::string ResolveTypedef(const char *tname, bool resolveAll=false)
std::string ShortType(const char *typeDesc, int mode)
Return the absolute type of typeDesc.
@ kDropStlDefault
Definition: TClassEdit.h:81
static constexpr double s
Definition: first.py:1