Logo ROOT  
Reference Guide
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Loading...
Searching...
No Matches
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 "TList.h"
32#include "TRef.h"
33#include "TInterpreter.h"
34#include "TError.h"
35#include "TObjArray.h"
36#include "TVirtualMutex.h"
38#include "strlcpy.h"
39#include "snprintf.h"
40
41#include <string>
42
43using std::string;
44
45const Int_t kMaxLen = 1024;
46
51
53{
54 TString className = type_name.Strip(TString::kTrailing, '*');
55 if (className.Index("const ")==0) className.Remove(0,6);
56 return className;
57}
58////////////////////////////////////////////////////////////////////////////////
59/// Helper function to initialize the 'index/counter' value of
60/// the Pointer streamerElements. If directive is a StreamerInfo and it correspond to the
61/// same class a 'countClass' the streamerInfo is used instead of the current StreamerInfo of the TClass
62/// for 'countClass'.
63
65{
66 TStreamerBasicType *counter = nullptr;
67
69
70 if (directive) {
71
72 if (directive->GetClass() == cl) {
73 // The info we have been passed is indeed describing the counter holder, just look there.
74
75 TStreamerElement *element = (TStreamerElement *)directive->GetElements()->FindObject(countName);
76 if (!element) return nullptr;
77 if (element->IsA() != TStreamerBasicType::Class()) return nullptr;
78 counter = (TStreamerBasicType*)element;
79
80 } else {
81 if (directive->GetClass()->GetListOfRealData()) {
82 TRealData* rdCounter = (TRealData*) directive->GetClass()->GetListOfRealData()->FindObject(countName);
83 if (!rdCounter) return nullptr;
84 TDataMember *dmCounter = rdCounter->GetDataMember();
85 cl = dmCounter->GetClass();
86 } else {
87 TStreamerElement *element = (TStreamerElement *)directive->GetElements()->FindObject(countName);
88 if (!element) return nullptr;
89 if (element->IsA() != TStreamerBasicType::Class()) return nullptr;
90 cl = directive->GetClass();
91 }
92 if (cl==nullptr) return nullptr;
94 }
95 } else {
96
97 if (cl==nullptr) return nullptr;
99 }
100
101 //at this point the counter may be declared to be skipped
102 if (counter) {
104 }
105 return counter;
106}
107
108////////////////////////////////////////////////////////////////////////////////
109/// Parse comments to search for a range specifier of the style:
110/// [xmin,xmax] or [xmin,xmax,nbits]
111/// [0,1]
112/// [-10,100];
113/// [-pi,pi], [-pi/2,pi/4],[-2pi,2*pi]
114/// [-10,100,16]
115/// [0,0,8]
116/// if nbits is not specified, or nbits <2 or nbits>32 it is set to 32
117/// if (xmin==0 and xmax==0 and nbits <=16) the double word will be converted
118/// to a float and its mantissa truncated to nbits significative bits.
119///
120/// see comments in TBufferFile::WriteDouble32.
121
122static void GetRange(const char *comments, Double_t &xmin, Double_t &xmax, Double_t &factor)
123{
124 const Double_t kPi =3.14159265358979323846 ;
125 factor = xmin = xmax = 0;
126 if (!comments) return;
127 const char *left = strstr(comments,"[");
128 if (!left) return;
129 const char *right = strstr(left,"]");
130 if (!right) return;
131 const char *comma = strstr(left,",");
132 if (!comma || comma > right) {
133 //may be first bracket was a dimension specifier
134 left = strstr(right,"[");
135 if (!left) return;
136 right = strstr(left,"]");
137 if (!right) return;
138 comma = strstr(left,",");
139 if (!comma || comma >right) return;
140 }
141 //search if nbits is specified
142 const char *comma2 = nullptr;
143 if (comma) comma2 = strstr(comma+1,",");
144 if (comma2 > right) comma2 = nullptr;
145 Int_t nbits = 32;
146 if (comma2) {
147 TString sbits(comma2+1,right-comma2-1);
148 sscanf(sbits.Data(),"%d",&nbits);
149 if (nbits < 2 || nbits > 32) {
150 ::Error("GetRange","Illegal specification for the number of bits; %d. reset to 32.",nbits);
151 nbits = 32;
152 }
153 right = comma2;
154 }
155 TString range(left+1,right-left-1);
156 TString sxmin(left+1,comma-left-1);
157 sxmin.ToLower();
158 sxmin.ReplaceAll(" ","");
159 if (sxmin.Contains("pi")) {
160 if (sxmin.Contains("2pi")) xmin = 2*kPi;
161 else if (sxmin.Contains("2*pi")) xmin = 2*kPi;
162 else if (sxmin.Contains("twopi")) xmin = 2*kPi;
163 else if (sxmin.Contains("pi/2")) xmin = kPi/2;
164 else if (sxmin.Contains("pi/4")) xmin = kPi/4;
165 else if (sxmin.Contains("pi")) xmin = kPi;
166 if (sxmin.Contains("-")) xmin = -xmin;
167 } else {
168 sscanf(sxmin.Data(),"%lg",&xmin);
169 }
170 TString sxmax(comma+1,right-comma-1);
171 sxmax.ToLower();
172 sxmax.ReplaceAll(" ","");
173 if (sxmax.Contains("pi")) {
174 if (sxmax.Contains("2pi")) xmax = 2*kPi;
175 else if (sxmax.Contains("2*pi")) xmax = 2*kPi;
176 else if (sxmax.Contains("twopi")) xmax = 2*kPi;
177 else if (sxmax.Contains("pi/2")) xmax = kPi/2;
178 else if (sxmax.Contains("pi/4")) xmax = kPi/4;
179 else if (sxmax.Contains("pi")) xmax = kPi;
180 if (sxmax.Contains("-")) xmax = -xmax;
181 } else {
182 sscanf(sxmax.Data(),"%lg",&xmax);
183 }
185 if (nbits < 32) bigint = 1<<nbits;
186 else bigint = 0xffffffff;
187 if (xmin < xmax) factor = bigint/(xmax-xmin);
188 if (xmin >= xmax && nbits <15) xmin = nbits+0.1;
189}
190
192
193////////////////////////////////////////////////////////////////////////////////
194/// Default ctor.
195
197{
198 // clang-format off
200 fSize = 0;
202 fArrayDim = 0;
203 fArrayLength = 0;
204 fStreamer = nullptr;
205 fOffset = 0;
206 fClassObject = (TClass*)(-1);
207 fNewClass = nullptr;
208 fTObjectOffset = 0;
209 fFactor = 0;
210 fXmin = 0;
211 fXmax = 0;
212 // clang-format on
213 for (Int_t i=0;i<5;i++) fMaxIndex[i] = 0;
214}
215
216////////////////////////////////////////////////////////////////////////////////
217/// Create a TStreamerElement object.
218
219TStreamerElement::TStreamerElement(const char *name, const char *title, Int_t offset, Int_t dtype, const char *typeName)
220 : TNamed(name,title)
221{
222 fOffset = offset;
223 fType = dtype;
224 fSize = 0;
225 fNewType = fType;
226 fArrayDim = 0;
227 fArrayLength = 0;
228 if (typeName && !strcmp(typeName, "BASE")) {
229 // TStreamerBase case; fTypeName should stay "BASE".
230 fTypeName = typeName;
231 } else {
232 //must protect call into the interpreter
235 }
236 fStreamer = nullptr;
237 fClassObject = (TClass*)(-1);
238 fNewClass = nullptr;
239 fTObjectOffset = 0;
240 fFactor = 0;
241 fXmin = 0;
242 fXmax = 0;
243 for (Int_t i=0;i<5;i++) fMaxIndex[i] = 0;
244 if (fTypeName == "Float16_t" || fTypeName == "Float16_t*") {
246 if (fFactor > 0 || fXmin > 0) SetBit(kHasRange);
247 }
248 if (fTypeName == "Double32_t" || fTypeName == "Double32_t*") {
250 if (fFactor > 0 || fXmin > 0) SetBit(kHasRange);
251 }
252}
253
254////////////////////////////////////////////////////////////////////////////////
255/// TStreamerElement dtor.
256
260
261
262////////////////////////////////////////////////////////////////////////////////
263/// Returns true if the element cannot be split, false otherwise.
264/// An element cannot be split if the corresponding class member has
265/// the special characters "||" as the first characters in the
266/// comment field.
267
269{
270 if (GetTitle()[0] != 0 && strspn(GetTitle(),"||") == 2) return kTRUE;
271 TClass *cl = GetClassPointer();
272 if (!cl) return kFALSE; //basic type
273
274 static TClassRef clonesArray("TClonesArray");
275 if (IsaPointer() && cl != clonesArray && !cl->GetCollectionProxy()) return kTRUE;
276
277 switch(fType) {
283 return kTRUE;
284 }
285
286 if ( !cl->CanSplit() ) return kTRUE;
287
288 return kFALSE;
289}
290
291////////////////////////////////////////////////////////////////////////////////
292/// Returns a pointer to the TClass of this element.
293
295{
296 if (fClassObject!=(TClass*)(-1)) return fClassObject;
297
300 ((TStreamerElement*)this)->fClassObject = TClass::GetClass(className, kTRUE, quiet);
301 return fClassObject;
302}
303
304////////////////////////////////////////////////////////////////////////////////
305/// Returns the TExec id for the EXEC instruction in the comment field
306/// of a TRef data member.
307
309{
310 //check if element is a TRef or TRefArray
311 if (strncmp(fTypeName.Data(),"TRef",4) != 0) return 0;
312
313 //if the UniqueID of this element has already been set, we assume
314 //that it contains the exec id of a TRef object.
315 if (GetUniqueID()) return GetUniqueID();
316
317 //check if an Exec is specified in the comment field
318 char *action = (char*)strstr(GetTitle(),"EXEC:");
319 if (!action) return 0;
320 Int_t nch = strlen(action)+1;
321 char *caction = new char[nch];
323 char *blank = (char*)strchr(caction,' ');
324 if (blank) *blank = 0;
325 //we have found the Exec name in the comment
326 //we register this Exec to the list of Execs.
328 delete [] caction;
329 //we save the Exec index as the uniqueid of this STreamerElement
330 const_cast<TStreamerElement*>(this)->SetUniqueID(index+1);
331 return index+1;
332}
333
334////////////////////////////////////////////////////////////////////////////////
335/// Return element name including dimensions, if any
336/// Note that this function stores the name into a static array.
337/// You should copy the result.
338
340{
342 char cdim[20];
343 name = GetName();
344 for (Int_t i=0;i<fArrayDim;i++) {
345 snprintf(cdim,19,"[%d]",fMaxIndex[i]);
346 name += cdim;
347 }
348 return name;
349}
350
351////////////////////////////////////////////////////////////////////////////////
352/// Fill type with the string representation of sequence
353/// information including 'cached','repeat','write' or
354/// 'nodelete'.
355
357{
358 sequenceType.Clear();
359 auto test_bit = [this, &sequenceType](unsigned bit, const char *name) {
360 if (TestBit(bit)) {
361 if (!sequenceType.IsNull()) sequenceType += ",";
363 }
364 };
365
371}
372
373////////////////////////////////////////////////////////////////////////////////
374/// Returns size of this element in bytes.
375
377{
378 return fSize;
379}
380
381////////////////////////////////////////////////////////////////////////////////
382/// Return the local streamer object.
383
388
389////////////////////////////////////////////////////////////////////////////////
390/// Return type name of this element
391/// in case the type name is not a standard basic type, return
392/// the basic type name known to CINT.
393
395{
396 TDataType *dt = gROOT->GetType(fTypeName.Data());
397 if (fType < 1 || fType > 55) return fTypeName.Data();
398 if (dt && dt->GetType() > 0) return fTypeName.Data();
399 Int_t dtype = fType%20;
401}
402
403////////////////////////////////////////////////////////////////////////////////
404/// Initliaze the element.
405
413
414////////////////////////////////////////////////////////////////////////////////
415/// The early 3.00/00 and 3.01/01 versions used to store
416/// dm->GetTypeName instead of dm->GetFullTypename
417/// if this case is detected, the element type name is modified.
418
420{
421 //if (!IsaPointer()) return kFALSE;
422 if (!strstr(newTypeName,fTypeName.Data())) return kFALSE;
423 //if (!strstr(fTypeName.Data(),newTypeName)) return kFALSE;
425 return kTRUE;
426}
427
428////////////////////////////////////////////////////////////////////////////////
429/// Return kTRUE if the element represent a base class.
430
432{
433 return kFALSE;
434}
435
436////////////////////////////////////////////////////////////////////////////////
437/// Return kTRUE if the element represent an entity that is not written
438/// to the disk (transient members, cache allocator/deallocator, etc.)
439
441{
443 // if (((const TStreamerArtificial*)this)->GetWriteFunc() == 0)
444 return kTRUE;
445 }
451
452 return kFALSE;
453}
454
455////////////////////////////////////////////////////////////////////////////////
456/// Print the content of the element.
457
459{
460 TString temp(GetTypeName());
461 if (IsaPointer() && !fTypeName.Contains("*")) temp += "*";
462
465 if (sequenceType.Length()) {
466 sequenceType.Prepend(" (");
467 sequenceType += ") ";
468 }
469 printf(" %-14s %-15s offset=%3d type=%2d",
470 temp.Data(),GetFullName(),fOffset,fType);
472 printf(" newtype=%2d", fNewType);
473 printf(" %s%-20s\n",
474 sequenceType.Data(), GetTitle());
475}
476
477////////////////////////////////////////////////////////////////////////////////
478/// Set number of array dimensions.
479
486
487////////////////////////////////////////////////////////////////////////////////
488///set maximum index for array with dimension dim
489
491{
492 if (dim < 0 || dim > 4) return;
493 fMaxIndex[dim] = max;
494 if (fArrayLength == 0) fArrayLength = max;
495 else fArrayLength *= max;
496}
497
498////////////////////////////////////////////////////////////////////////////////
499///set pointer to Streamer function for this element
500
505
506////////////////////////////////////////////////////////////////////////////////
507/// Stream an object of class TStreamerElement.
508
510{
512 if (R__b.IsReading()) {
513 Version_t R__v = R__b.ReadVersion(&R__s, &R__c);
514 //NOTE that when reading, one cannot use Class()->ReadBuffer
515 // TBuffer::Class methods used for reading streamerinfos from SQL database
516 // Any changes of class structure should be reflected by them starting from version 4
517
518 R__b.ClassBegin(TStreamerElement::Class(), R__v);
519 R__b.ClassMember("TNamed");
521 R__b.ClassMember("fType","Int_t");
522 R__b >> fType;
523 R__b.ClassMember("fSize","Int_t");
524 R__b >> fSize;
525 R__b.ClassMember("fArrayLength","Int_t");
527 R__b.ClassMember("fArrayDim","Int_t");
528 R__b >> fArrayDim;
529 R__b.ClassMember("fMaxIndex","Int_t", 5);
530 if (R__v == 1) R__b.ReadStaticArray(fMaxIndex);
531 else R__b.ReadFastArray(fMaxIndex,5);
532 R__b.ClassMember("fTypeName","TString");
533 fTypeName.Streamer(R__b);
534 if (fType==11&&(fTypeName=="Bool_t"||fTypeName=="bool")) fType = 18;
535 if (R__v > 1) {
536 SetUniqueID(0);
537 //check if element is a TRef or TRefArray
538 GetExecID();
539 }
541 // In TStreamerElement v2, fSize was holding the size of
542 // the underlying data type. In later version it contains
543 // the full length of the data member.
544 TDataType *type = gROOT->GetType(GetTypeName());
545 if (type && fArrayLength) fSize = fArrayLength * type->Size();
546 }
547 if (R__v == 3) {
548 R__b >> fXmin;
549 R__b >> fXmax;
550 R__b >> fFactor;
551 if (fFactor > 0) SetBit(kHasRange);
552 }
553 if (R__v > 3) {
555 }
556 //R__b.CheckByteCount(R__s, R__c, TStreamerElement::IsA());
557 R__b.ClassEnd(TStreamerElement::Class());
558 R__b.SetBufferOffset(R__s+R__c+sizeof(UInt_t));
559
562 } else {
563 R__b.WriteClassBuffer(TStreamerElement::Class(),this);
564 }
565}
566
567////////////////////////////////////////////////////////////////////////////////
568///function called by the TClass constructor when replacing an emulated class
569///by the real class
570
572{
573 if (fClassObject == oldClass) {
577 }
578 } else if (fClassObject == nullptr) {
579 // Well since some emulated class is replaced by a real class, we can
580 // assume a new library has been loaded. If this is the case, we should
581 // check whether the class now exist (this would be the case for example
582 // for reading STL containers).
583
585
586 if (classname == newClass->GetName()) {
590 }
591 } else if (TClassTable::GetDict(classname)) {
592 fClassObject = (TClass*)-1;
593 GetClassPointer(); //force fClassObject
596 }
597 }
598 }
599}
600
601//______________________________________________________________________________
602
603//////////////////////////////////////////////////////////////////////////
604// //
605// TStreamerBase implement the streamer of the base class //
606// //
607//////////////////////////////////////////////////////////////////////////
608
610
611////////////////////////////////////////////////////////////////////////////////
612
614 // Abuse TStreamerElement data member that is not used by TStreamerBase
615 fBaseCheckSum( *( (UInt_t*)&(fMaxIndex[1]) ) ),
616 fStreamerFunc(nullptr), fConvStreamerFunc(nullptr), fStreamerInfo(nullptr)
617{
618 // Default ctor.
619
620 fBaseClass = (TClass*)(-1);
621 fBaseVersion = 0;
622 fNewBaseClass = nullptr;
623}
624
625////////////////////////////////////////////////////////////////////////////////
626
628 : TStreamerElement(name,title,offset,TVirtualStreamerInfo::kBase,"BASE"),
629 // Abuse TStreamerElement data member that is not used by TStreamerBase
630 fBaseCheckSum( *( (UInt_t*)&(fMaxIndex[1]) ) ),
631 fStreamerFunc(nullptr), fConvStreamerFunc(nullptr), fStreamerInfo(nullptr)
632
633{
634 // Create a TStreamerBase object.
635
636 if (strcmp(name,"TObject") == 0) fType = TVirtualStreamerInfo::kTObject;
637 if (strcmp(name,"TNamed") == 0) fType = TVirtualStreamerInfo::kTNamed;
638 fNewType = fType;
640 if (fBaseClass) {
641 if (fBaseClass->IsVersioned()) {
643 } else {
644 fBaseVersion = -1;
645 }
647 } else {
648 fBaseVersion = 0;
649 }
650 fNewBaseClass = nullptr;
652}
653
654////////////////////////////////////////////////////////////////////////////////
655/// TStreamerBase dtor
656
660
661////////////////////////////////////////////////////////////////////////////////
662/// Returns a pointer to the TClass of this element.
663
665{
666 if (fBaseClass!=(TClass*)(-1)) return fBaseClass;
667 ((TStreamerBase*)this)->fBaseClass = TClass::GetClass(GetName());
668 return fBaseClass;
669}
670
671////////////////////////////////////////////////////////////////////////////////
672/// Returns size of baseclass in bytes.
673
675{
676 TClass *cl = GetClassPointer();
677 if (cl) return cl->Size();
678 return 0;
679}
680
681////////////////////////////////////////////////////////////////////////////////
682/// Setup the element.
683
688
696
697////////////////////////////////////////////////////////////////////////////////
698/// Setup the fStreamerFunc and fStreamerinfo
699
724
725////////////////////////////////////////////////////////////////////////////////
726/// Return kTRUE if the element represent a base class.
727
729{
730 return kTRUE;
731}
732
733////////////////////////////////////////////////////////////////////////////////
734/// Return the proper include for this element.
735
736const char *TStreamerBase::GetInclude() const
737{
739 IncludeNameBuffer().Form("\"%s\"",fBaseClass->GetDeclFileName());
740 } else {
741 std::string shortname( TClassEdit::ShortType( GetName(), 1 ) );
742 IncludeNameBuffer().Form("\"%s.h\"",shortname.c_str());
743 }
744 return IncludeNameBuffer();
745}
746
747////////////////////////////////////////////////////////////////////////////////
748/// Print the content of the element.
749
751{
754 if (sequenceType.Length()) {
755 sequenceType.Prepend(" (");
756 sequenceType += ") ";
757 }
758 printf(" %-14s %-15s offset=%3d type=%2d %s%-20s\n",GetFullName(),GetTypeName(),fOffset,fType,sequenceType.Data(),GetTitle());
759}
760
761////////////////////////////////////////////////////////////////////////////////
762/// Read the content of the buffer.
763
765{
766 if (fConvStreamerFunc) {
767 // We have a custom Streamer member function, we must use it.
769 } else if (fStreamerFunc) {
770 // We have a custom Streamer member function, we must use it.
771 fStreamerFunc(b,pointer+fOffset);
772 } else {
773 // We don't have a custom Streamer member function. That still doesn't mean
774 // that there is no streamer - it could be an external one:
775 // If the old base class has an adopted streamer we take that
776 // one instead of the new base class:
777 if( fNewBaseClass ) {
779 if (extstrm) {
780 // The new base class has an adopted streamer:
781 extstrm->SetOnFileClass(fBaseClass);
782 (*extstrm)(b, pointer);
783 } else {
784 b.ReadClassBuffer( fNewBaseClass, pointer+fOffset, fBaseClass );
785 }
786 } else {
788 if (extstrm) {
789 // The class has an adopted streamer:
790 (*extstrm)(b, pointer);
791 } else {
792 b.ReadClassBuffer( fBaseClass, pointer+fOffset );
793 }
794 }
795 }
796 return 0;
797}
798
799////////////////////////////////////////////////////////////////////////////////
800/// Stream an object of class TStreamerBase.
801
803{
805 if (R__b.IsReading()) {
806 Version_t R__v = R__b.ReadVersion(&R__s, &R__c);
807
808 R__b.ClassBegin(TStreamerBase::Class(), R__v);
809
810 R__b.ClassMember("TStreamerElement");
812 // If the class owning the TStreamerElement and the base class are not
813 // loaded, on the file their streamer info might be in the following
814 // order (derived class,base class) and hence the base class is not
815 // yet emulated.
816 fBaseClass = (TClass*)-1;
817 fNewBaseClass = nullptr;
818 // Eventually we need a v3 that stores directly fBaseCheckSum (and
819 // a version of TStreamerElement should not stored fMaxIndex)
820 if (R__v > 2) {
821 R__b.ClassMember("fBaseVersion","Int_t");
823 } else {
824 // could have been: fBaseVersion = GetClassPointer()->GetClassVersion();
827 }
828 R__b.ClassEnd(TStreamerBase::Class());
829 R__b.SetBufferOffset(R__s+R__c+sizeof(UInt_t));
830 } else {
831 R__b.WriteClassBuffer(TStreamerBase::Class(),this);
832 }
833}
834
835////////////////////////////////////////////////////////////////////////////////
836///Function called by the TClass constructor when replacing an emulated class
837///by the real class.
838
840{
842
843 if (fBaseClass == oldClass) {
846 } else if (fBaseClass == nullptr) {
847 if (fName == newClass->GetName()) {
850 } else if (TClassTable::GetDict(fName)) {
853 }
854 }
855}
856
857////////////////////////////////////////////////////////////////////////////////
858/// Write the base class into the buffer.
859
861{
862 if (fStreamerFunc) {
863 // We have a custom Streamer member function, we must use it.
864 fStreamerFunc(b,pointer+fOffset);
865 } else {
866 // We don't have a custom Streamer member function. That still doesn't mean
867 // that there is no streamer - it could be an external one:
868 // If the old base class has an adopted streamer we take that
869 // one instead of the new base class:
870 if (fNewBaseClass) {
872 if (extstrm) {
873 // The new base class has an adopted streamer:
874 extstrm->SetOnFileClass(fBaseClass);
875 (*extstrm)(b, pointer);
876 return 0;
877 } else {
879 return 0;
880 }
881 } else {
883 if (extstrm) {
884 (*extstrm)(b, pointer);
885 return 0;
886 } else {
888 return 0;
889 }
890 }
891 }
892 return 0;
893}
894
895//______________________________________________________________________________
896
897//////////////////////////////////////////////////////////////////////////
898// //
899// TStreamerBasicPointer implements the streamering of pointer to //
900// fundamental types. //
901// //
902//////////////////////////////////////////////////////////////////////////
903
905
906////////////////////////////////////////////////////////////////////////////////
907/// Default ctor.
908
909TStreamerBasicPointer::TStreamerBasicPointer() : fCountVersion(0),fCountName(),fCountClass(),fCounter(nullptr)
910{
911 fCounter = nullptr;
912}
913
914////////////////////////////////////////////////////////////////////////////////
915/// Create a TStreamerBasicPointer object.
916
917TStreamerBasicPointer::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)
918 : TStreamerElement(name,title,offset,dtype,typeName)
919{
923 fCountVersion = countVersion; //currently unused
924 Init();
925// printf("BasicPointer Init:%s, countName=%s, countClass=%s, countVersion=%d, fCounter=%x\n",
926// name,countName,countClass,countVersion,fCounter);
927}
928
929////////////////////////////////////////////////////////////////////////////////
930/// TStreamerBasicPointer dtor.
931
935
936////////////////////////////////////////////////////////////////////////////////
937/// return offset of counter
938
940{
941 if (!fCounter) ((TStreamerBasicPointer*)this)->Init();
942 if (!fCounter) return 0;
943 // FIXME: does not suport multiple inheritance for counter in base class.
944 // This is wrong in case counter is not in the same class or one of
945 // the left most (non virtual) base classes. For the other we would
946 // really need to use the object coming from the list of real data.
947 // (and even that need analysis for virtual base class).
948 return (ULongptr_t)fCounter->GetOffset();
949}
950
951////////////////////////////////////////////////////////////////////////////////
952/// Returns size of basicpointer in bytes.
953
955{
956 if (fArrayLength) return fArrayLength*sizeof(void *);
957 return sizeof(void *);
958}
959
960////////////////////////////////////////////////////////////////////////////////
961/// Setup the element.
962/// If directive is a StreamerInfo and it correspond to the
963/// same class a 'countClass' the streamerInfo is used instead of the current StreamerInfo of the TClass
964/// for 'countClass'.
965
970
971////////////////////////////////////////////////////////////////////////////////
972/// Set number of array dimensions.
973
975{
976 fArrayDim = dim;
977 //if (dim) fType += TVirtualStreamerInfo::kOffsetL;
978 fNewType = fType;
979}
980
981////////////////////////////////////////////////////////////////////////////////
982/// Stream an object of class TStreamerBasicPointer.
983
985{
987 if (R__b.IsReading()) {
988 Version_t R__v = R__b.ReadVersion(&R__s, &R__c);
989 if (R__v > 1) {
990 R__b.ReadClassBuffer(TStreamerBasicPointer::Class(), this, R__v, R__s, R__c);
991 //Init();
992 //fCounter = InitCounter( fCountClass, fCountName );
993 return;
994 }
995 //====process old versions before automatic schema evolution
1000 R__b.SetBufferOffset(R__s+R__c+sizeof(UInt_t));
1001 } else {
1002 R__b.WriteClassBuffer(TStreamerBasicPointer::Class(),this);
1003 }
1004}
1005
1006
1007//______________________________________________________________________________
1008
1009//////////////////////////////////////////////////////////////////////////
1010// //
1011// TStreamerLoop implement streaming of a few construct that require //
1012// looping over the data member and are not convered by other case //
1013// (most deprecated). //
1014// //
1015//////////////////////////////////////////////////////////////////////////
1016
1018
1019////////////////////////////////////////////////////////////////////////////////
1020/// Default ctor.
1021
1022TStreamerLoop::TStreamerLoop() : fCountVersion(0),fCountName(),fCountClass(),fCounter(nullptr)
1023{
1024}
1025
1026////////////////////////////////////////////////////////////////////////////////
1027/// Create a TStreamerLoop object.
1028
1029TStreamerLoop::TStreamerLoop(const char *name, const char *title, Int_t offset, const char *countName, const char *countClass, Int_t countVersion, const char *typeName)
1030 : TStreamerElement(name,title,offset,TVirtualStreamerInfo::kStreamLoop,typeName)
1031{
1034 fCountVersion = countVersion; //currently unused
1035 Init();
1036}
1037
1038////////////////////////////////////////////////////////////////////////////////
1039/// TStreamerLoop dtor.
1040
1044
1045////////////////////////////////////////////////////////////////////////////////
1046/// return address of counter
1047
1049{
1050 //if (!fCounter) {
1051 // Init();
1052 // if (!fCounter) return 0;
1053 //}
1054 if (!fCounter) return 0;
1055 return (ULongptr_t)fCounter->GetOffset();
1056}
1057
1058////////////////////////////////////////////////////////////////////////////////
1059/// Returns size of counter in bytes.
1060
1062{
1063 if (fArrayLength) return fArrayLength*sizeof(void*);
1064 return sizeof(void*);
1065}
1066
1067////////////////////////////////////////////////////////////////////////////////
1068/// Setup the element.
1069/// If directive is a StreamerInfo and it correspond to the
1070/// same class a 'countClass' the streamerInfo is used instead of the current StreamerInfo of the TClass
1071/// for 'countClass'.
1072
1077
1078////////////////////////////////////////////////////////////////////////////////
1079/// Return the proper include for this element.
1080
1081const char *TStreamerLoop::GetInclude() const
1082{
1083 IncludeNameBuffer().Form("<%s>","TString.h"); //to be generalized
1084 return IncludeNameBuffer();
1085}
1086
1087////////////////////////////////////////////////////////////////////////////////
1088/// Stream an object of class TStreamerLoop.
1089
1091{
1092 UInt_t R__s, R__c;
1093 if (R__b.IsReading()) {
1094 Version_t R__v = R__b.ReadVersion(&R__s, &R__c);
1095 if (R__v > 1) {
1096 R__b.ReadClassBuffer(TStreamerLoop::Class(), this, R__v, R__s, R__c);
1097 //Init();
1098 return;
1099 }
1100 //====process old versions before automatic schema evolution
1105 R__b.SetBufferOffset(R__s+R__c+sizeof(UInt_t));
1106 } else {
1107 R__b.WriteClassBuffer(TStreamerLoop::Class(),this);
1108 }
1109}
1110
1111
1112//______________________________________________________________________________
1113
1114//////////////////////////////////////////////////////////////////////////
1115// //
1116// TStreamerBasicType implement streaming of fundamental types (int, //
1117// float, etc.). //
1118// //
1119//////////////////////////////////////////////////////////////////////////
1120
1122
1123////////////////////////////////////////////////////////////////////////////////
1124/// Default ctor.
1125
1127{
1128}
1129
1130////////////////////////////////////////////////////////////////////////////////
1131/// Create a TStreamerBasicType object.
1132
1133TStreamerBasicType::TStreamerBasicType(const char *name, const char *title, Int_t offset, Int_t dtype, const char *typeName)
1134 : TStreamerElement(name,title,offset,dtype,typeName),fCounter(0)
1135{
1136}
1137
1138////////////////////////////////////////////////////////////////////////////////
1139/// TStreamerBasicType dtor.
1140
1144
1145////////////////////////////////////////////////////////////////////////////////
1146/// return address of counter
1147
1154
1155////////////////////////////////////////////////////////////////////////////////
1156/// Returns size of this element in bytes.
1157
1159{
1160 return fSize;
1161}
1162
1163////////////////////////////////////////////////////////////////////////////////
1164/// Stream an object of class TStreamerBasicType.
1165
1167{
1168 UInt_t R__s, R__c;
1169 if (R__b.IsReading()) {
1170 Version_t R__v = R__b.ReadVersion(&R__s, &R__c);
1171 if (R__v > 1) {
1172 R__b.ReadClassBuffer(TStreamerBasicType::Class(), this, R__v, R__s, R__c);
1173 } else {
1174 //====process old versions before automatic schema evolution
1176 R__b.CheckByteCount(R__s, R__c, TStreamerBasicType::IsA());
1177 }
1178 Int_t type = fType;
1181 }
1182 switch(type) {
1183 // basic types
1184 case TVirtualStreamerInfo::kBool: fSize = sizeof(Bool_t); break;
1185 case TVirtualStreamerInfo::kShort: fSize = sizeof(Short_t); break;
1186 case TVirtualStreamerInfo::kInt: fSize = sizeof(Int_t); break;
1187 case TVirtualStreamerInfo::kLong: fSize = sizeof(Long_t); break;
1188 case TVirtualStreamerInfo::kLong64: fSize = sizeof(Long64_t); break;
1189 case TVirtualStreamerInfo::kFloat: fSize = sizeof(Float_t); break;
1190 case TVirtualStreamerInfo::kFloat16: fSize = sizeof(Float_t); break;
1191 case TVirtualStreamerInfo::kDouble: fSize = sizeof(Double_t); break;
1192 case TVirtualStreamerInfo::kDouble32: fSize = sizeof(Double_t); break;
1193 case TVirtualStreamerInfo::kUChar: fSize = sizeof(UChar_t); break;
1194 case TVirtualStreamerInfo::kUShort: fSize = sizeof(UShort_t); break;
1195 case TVirtualStreamerInfo::kUInt: fSize = sizeof(UInt_t); break;
1196 case TVirtualStreamerInfo::kULong: fSize = sizeof(ULong_t); break;
1197 case TVirtualStreamerInfo::kULong64: fSize = sizeof(ULong64_t); break;
1198 case TVirtualStreamerInfo::kBits: fSize = sizeof(UInt_t); break;
1199 case TVirtualStreamerInfo::kCounter: fSize = sizeof(Int_t); break;
1200 case TVirtualStreamerInfo::kChar: fSize = sizeof(Char_t); break;
1201 case TVirtualStreamerInfo::kCharStar: fSize = sizeof(Char_t*); break;
1202 default: return; // If we don't change the size let's not remultiply it.
1203 }
1205 } else {
1206 R__b.WriteClassBuffer(TStreamerBasicType::Class(),this);
1207 }
1208}
1209
1210
1211
1212//______________________________________________________________________________
1213
1214//////////////////////////////////////////////////////////////////////////
1215// //
1216// TStreamerObject implements streaming of embedded objects whose type //
1217// inherits from TObject. //
1218// //
1219//////////////////////////////////////////////////////////////////////////
1220
1222
1223////////////////////////////////////////////////////////////////////////////////
1224/// Default ctor.
1225
1229
1230////////////////////////////////////////////////////////////////////////////////
1231/// Create a TStreamerObject object.
1232
1233TStreamerObject::TStreamerObject(const char *name, const char *title, Int_t offset, const char *typeName)
1234 : TStreamerElement(name,title,offset,0,typeName)
1235{
1237 if (strcmp(typeName,"TObject") == 0) fType = TVirtualStreamerInfo::kTObject;
1238 if (strcmp(typeName,"TNamed") == 0) fType = TVirtualStreamerInfo::kTNamed;
1239 fNewType = fType;
1240 Init();
1241}
1242
1243////////////////////////////////////////////////////////////////////////////////
1244/// TStreamerObject dtor.
1245
1249
1250////////////////////////////////////////////////////////////////////////////////
1251/// Setup the element.
1252
1260
1261////////////////////////////////////////////////////////////////////////////////
1262/// Return the proper include for this element.
1263
1265{
1266 TClass *cl = GetClassPointer();
1267 if (cl && cl->HasInterpreterInfo()) {
1268 IncludeNameBuffer().Form("\"%s\"",cl->GetDeclFileName());
1269 } else {
1270 std::string shortname( TClassEdit::ShortType( GetTypeName(), 1 ) );
1271 IncludeNameBuffer().Form("\"%s.h\"",shortname.c_str());
1272 }
1273 return IncludeNameBuffer();
1274}
1275
1276////////////////////////////////////////////////////////////////////////////////
1277/// Returns size of object class in bytes.
1278
1280{
1281 TClass *cl = GetClassPointer();
1282 Int_t classSize = 8;
1283 if (cl) classSize = cl->Size();
1285 return classSize;
1286}
1287
1288////////////////////////////////////////////////////////////////////////////////
1289/// Stream an object of class TStreamerObject.
1290
1292{
1293 UInt_t R__s, R__c;
1294 if (R__b.IsReading()) {
1295 Version_t R__v = R__b.ReadVersion(&R__s, &R__c);
1296 if (R__v > 1) {
1297 R__b.ReadClassBuffer(TStreamerObject::Class(), this, R__v, R__s, R__c);
1298 return;
1299 }
1300 //====process old versions before automatic schema evolution
1302 R__b.CheckByteCount(R__s, R__c, TStreamerObject::IsA());
1303 } else {
1304 R__b.WriteClassBuffer(TStreamerObject::Class(),this);
1305 }
1306}
1307
1308
1309//______________________________________________________________________________
1310
1311//////////////////////////////////////////////////////////////////////////
1312// //
1313// TStreamerObjectAny implement streaming of embedded object not //
1314// inheriting from TObject. //
1315// //
1316//////////////////////////////////////////////////////////////////////////
1317
1319
1320////////////////////////////////////////////////////////////////////////////////
1321/// Default ctor.
1322
1326
1327////////////////////////////////////////////////////////////////////////////////
1328/// Create a TStreamerObjectAny object.
1329
1330TStreamerObjectAny::TStreamerObjectAny(const char *name, const char *title, Int_t offset, const char *typeName)
1331 : TStreamerElement(name,title,offset,TVirtualStreamerInfo::kAny,typeName)
1332{
1333 Init();
1334}
1335
1336////////////////////////////////////////////////////////////////////////////////
1337/// TStreamerObjectAny dtor.
1338
1342
1343////////////////////////////////////////////////////////////////////////////////
1344/// Setup the element.
1345
1353
1354////////////////////////////////////////////////////////////////////////////////
1355/// Return the proper include for this element.
1356
1358{
1359 TClass *cl = GetClassPointer();
1360 if (cl && cl->HasInterpreterInfo()) {
1361 IncludeNameBuffer().Form("\"%s\"",cl->GetDeclFileName());
1362 } else {
1363 std::string shortname( TClassEdit::ShortType( GetTypeName(), 1 ) );
1364 IncludeNameBuffer().Form("\"%s.h\"",shortname.c_str());
1365 }
1366 return IncludeNameBuffer();
1367}
1368
1369////////////////////////////////////////////////////////////////////////////////
1370/// Returns size of anyclass in bytes.
1371
1373{
1374 TClass *cl = GetClassPointer();
1375 Int_t classSize = 8;
1376 if (cl) classSize = cl->Size();
1378 return classSize;
1379}
1380
1381////////////////////////////////////////////////////////////////////////////////
1382/// Stream an object of class TStreamerObjectAny.
1383
1385{
1386 UInt_t R__s, R__c;
1387 if (R__b.IsReading()) {
1388 Version_t R__v = R__b.ReadVersion(&R__s, &R__c);
1389 if (R__v > 1) {
1390 R__b.ReadClassBuffer(TStreamerObjectAny::Class(), this, R__v, R__s, R__c);
1391 return;
1392 }
1393 //====process old versions before automatic schema evolution
1395 R__b.CheckByteCount(R__s, R__c, TStreamerObjectAny::IsA());
1396 } else {
1397 R__b.WriteClassBuffer(TStreamerObjectAny::Class(),this);
1398 }
1399}
1400
1401
1402
1403//______________________________________________________________________________
1404
1405//////////////////////////////////////////////////////////////////////////
1406// //
1407// TStreamerObjectPointer implements streaming of pointer to object //
1408// inheriting from TObject. //
1409// //
1410//////////////////////////////////////////////////////////////////////////
1411
1413
1414////////////////////////////////////////////////////////////////////////////////
1415/// Default ctor.
1416
1420
1421////////////////////////////////////////////////////////////////////////////////
1422/// Create a TStreamerObjectPointer object.
1423
1425 Int_t offset, const char *typeName)
1426 : TStreamerElement(name,title,offset,TVirtualStreamerInfo::kObjectP,typeName)
1427{
1428 if (strncmp(title,"->",2) == 0) fType = TVirtualStreamerInfo::kObjectp;
1429 fNewType = fType;
1430 Init();
1431}
1432
1433////////////////////////////////////////////////////////////////////////////////
1434/// TStreamerObjectPointer dtor.
1435
1439
1440////////////////////////////////////////////////////////////////////////////////
1441/// Setup the element.
1442
1450
1451////////////////////////////////////////////////////////////////////////////////
1452/// Return the proper include for this element.
1453
1455{
1456 TClass *cl = GetClassPointer();
1457 if (cl && cl->HasInterpreterInfo()) {
1458 IncludeNameBuffer().Form("\"%s\"",cl->GetDeclFileName());
1459 } else {
1460 std::string shortname( TClassEdit::ShortType( GetTypeName(), 1 ) );
1461 IncludeNameBuffer().Form("\"%s.h\"",shortname.c_str());
1462 }
1463
1464 return IncludeNameBuffer();
1465}
1466
1467////////////////////////////////////////////////////////////////////////////////
1468/// Returns size of objectpointer in bytes.
1469
1471{
1472 if (fArrayLength) return fArrayLength*sizeof(void *);
1473 return sizeof(void *);
1474}
1475
1476////////////////////////////////////////////////////////////////////////////////
1477/// Set number of array dimensions.
1478
1480{
1481 fArrayDim = dim;
1482 //if (dim) fType += TVirtualStreamerInfo::kOffsetL;
1483 fNewType = fType;
1484}
1485
1486////////////////////////////////////////////////////////////////////////////////
1487/// Stream an object of class TStreamerObjectPointer.
1488
1490{
1491 UInt_t R__s, R__c;
1492 if (R__b.IsReading()) {
1493 Version_t R__v = R__b.ReadVersion(&R__s, &R__c);
1494 if (R__v > 1) {
1495 R__b.ReadClassBuffer(TStreamerObjectPointer::Class(), this, R__v, R__s, R__c);
1496 return;
1497 }
1498 //====process old versions before automatic schema evolution
1500 R__b.CheckByteCount(R__s, R__c, TStreamerObjectPointer::IsA());
1501 } else {
1502 R__b.WriteClassBuffer(TStreamerObjectPointer::Class(),this);
1503 }
1504}
1505
1506
1507//______________________________________________________________________________
1508
1509//////////////////////////////////////////////////////////////////////////
1510// //
1511// TStreamerObjectPointerAny implements streaming of pointer to object //
1512// not inheriting from TObject. //
1513// //
1514//////////////////////////////////////////////////////////////////////////
1515
1517
1518////////////////////////////////////////////////////////////////////////////////
1519/// Default ctor.
1520
1524
1525////////////////////////////////////////////////////////////////////////////////
1526/// Create a TStreamerObjectAnyPointer object.
1527
1529 Int_t offset, const char *typeName)
1530 : TStreamerElement(name,title,offset,TVirtualStreamerInfo::kAnyP,typeName)
1531{
1532 if (strncmp(title,"->",2) == 0) fType = TVirtualStreamerInfo::kAnyp;
1533 fNewType = fType;
1534 Init();
1535}
1536
1537////////////////////////////////////////////////////////////////////////////////
1538/// TStreamerObjectAnyPointer dtor.
1539
1543
1544////////////////////////////////////////////////////////////////////////////////
1545/// Setup the element.
1546
1554
1555////////////////////////////////////////////////////////////////////////////////
1556/// Return the proper include for this element.
1557
1559{
1560 TClass *cl = GetClassPointer();
1561 if (cl && cl->HasInterpreterInfo()) {
1562 IncludeNameBuffer().Form("\"%s\"",cl->GetDeclFileName());
1563 } else {
1564 std::string shortname( TClassEdit::ShortType( GetTypeName(), 1 ) );
1565 IncludeNameBuffer().Form("\"%s.h\"",shortname.c_str());
1566 }
1567
1568 return IncludeNameBuffer();
1569}
1570
1571////////////////////////////////////////////////////////////////////////////////
1572/// Returns size of objectpointer in bytes.
1573
1575{
1576 if (fArrayLength) return fArrayLength*sizeof(void *);
1577 return sizeof(void *);
1578}
1579
1580////////////////////////////////////////////////////////////////////////////////
1581/// Set number of array dimensions.
1582
1584{
1585 fArrayDim = dim;
1586 //if (dim) fType += TVirtualStreamerInfo::kOffsetL;
1587 fNewType = fType;
1588}
1589
1590////////////////////////////////////////////////////////////////////////////////
1591/// Stream an object of class TStreamerObjectAnyPointer.
1592
1594{
1595 if (R__b.IsReading()) {
1596 R__b.ReadClassBuffer(TStreamerObjectAnyPointer::Class(), this);
1597 } else {
1598 R__b.WriteClassBuffer(TStreamerObjectAnyPointer::Class(),this);
1599 }
1600}
1601
1602
1603//______________________________________________________________________________
1604
1605//////////////////////////////////////////////////////////////////////////
1606// //
1607// TSreamerString implements streaming of TString. //
1608// //
1609//////////////////////////////////////////////////////////////////////////
1610
1612
1613////////////////////////////////////////////////////////////////////////////////
1614/// Default ctor.
1615
1619
1620////////////////////////////////////////////////////////////////////////////////
1621/// Create a TStreamerString object.
1622
1623TStreamerString::TStreamerString(const char *name, const char *title, Int_t offset)
1624 : TStreamerElement(name,title,offset,TVirtualStreamerInfo::kTString,"TString")
1625{
1626}
1627
1628////////////////////////////////////////////////////////////////////////////////
1629/// TStreamerString dtor.
1630
1634
1635////////////////////////////////////////////////////////////////////////////////
1636/// Return the proper include for this element.
1637
1639{
1640 IncludeNameBuffer().Form("<%s>","TString.h");
1641 return IncludeNameBuffer();
1642}
1643
1644////////////////////////////////////////////////////////////////////////////////
1645/// Returns size of anyclass in bytes.
1646
1648{
1649 if (fArrayLength) return fArrayLength*sizeof(TString);
1650 return sizeof(TString);
1651}
1652
1653////////////////////////////////////////////////////////////////////////////////
1654/// Stream an object of class TStreamerString.
1655
1657{
1658 UInt_t R__s, R__c;
1659 if (R__b.IsReading()) {
1660 Version_t R__v = R__b.ReadVersion(&R__s, &R__c);
1661 if (R__v > 1) {
1662 R__b.ReadClassBuffer(TStreamerString::Class(), this, R__v, R__s, R__c);
1663 return;
1664 }
1665 //====process old versions before automatic schema evolution
1667 R__b.CheckByteCount(R__s, R__c, TStreamerString::IsA());
1668 } else {
1669 R__b.WriteClassBuffer(TStreamerString::Class(),this);
1670 }
1671}
1672
1673//______________________________________________________________________________
1674
1675//////////////////////////////////////////////////////////////////////////
1676// //
1677// TStreamerSTL implements streamer of STL container. //
1678// //
1679//////////////////////////////////////////////////////////////////////////
1680
1682
1683////////////////////////////////////////////////////////////////////////////////
1684/// Default ctor.
1685
1686TStreamerSTL::TStreamerSTL() : fSTLtype(0),fCtype(0)
1687{
1688}
1689
1690////////////////////////////////////////////////////////////////////////////////
1691/// Create a TStreamerSTL object.
1692
1693TStreamerSTL::TStreamerSTL(const char *name, const char *title, Int_t offset,
1694 const char *typeName, const TVirtualCollectionProxy &proxy, Bool_t dmPointer)
1695 : TStreamerElement(name,title,offset,ROOT::kSTLany,typeName)
1696{
1698
1699 if (name==typeName /* intentional pointer comparison */
1700 || strcmp(name,typeName)==0) {
1701 // We have a base class.
1702 fName = fTypeName;
1703 }
1704 fSTLtype = proxy.GetCollectionType();
1705 fCtype = 0;
1706
1708
1709 if (fSTLtype == ROOT::kSTLbitset) {
1710 // Nothing to check
1711 } else if (proxy.GetValueClass()) {
1712 if (proxy.HasPointers()) fCtype = TVirtualStreamerInfo::kObjectp;
1714 } else {
1715 fCtype = proxy.GetType();
1716 if (proxy.HasPointers()) fCtype += TVirtualStreamerInfo::kOffsetP;
1717 }
1719}
1720
1721////////////////////////////////////////////////////////////////////////////////
1722/// Create a TStreamerSTL object.
1723
1724TStreamerSTL::TStreamerSTL(const char *name, const char *title, Int_t offset,
1725 const char *typeName, const char *trueType, Bool_t dmPointer)
1726 : TStreamerElement(name,title,offset,ROOT::kSTLany,typeName)
1727{
1728 const char *t = trueType;
1729 if (!t || !*t) t = typeName;
1730
1731 std::string answer;
1734 fTypeName = answer;
1735
1736 if (name==typeName /* intentional pointer comparison */
1737 || strcmp(name,typeName)==0) {
1738 // We have a base class.
1739 fName = fTypeName;
1740 }
1741
1742 if (arglist.fElements.size() < 2) {
1743 Fatal("TStreamerSTL","For %s, the type name (%s) is seemingly not a template (template argument not found)", name, t);
1744 return;
1745 }
1746
1747 const std::string& inside_type = arglist.fElements[1];
1748 std::string inside = (inside_type.find("const ")==0) ? inside_type.substr(6) : inside_type;
1749
1750 // Let's treat the unique_ptr case
1752
1753 bool isPointer = false;
1754 // The incoming name is normalized (it comes from splitting the name of a TClass),
1755 // so all we need to do is drop the last trailing star (if any) and record that information.
1756 while (intype.back() == '*') {
1757 isPointer = true;
1758 intype.pop_back();
1759 }
1760
1761 fSTLtype = TClassEdit::STLKind(arglist.fElements[0]);
1762 fCtype = 0;
1763 if (fSTLtype == ROOT::kNotSTL) { return; }
1765
1766 TDataType *dt = (TDataType*)gROOT->GetListOfTypes()->FindObject(intype.c_str());
1767 if (fSTLtype == ROOT::kSTLbitset) {
1768 // Nothing to check
1769 } else if (dt) {
1770 fCtype = dt->GetType();
1772 } else {
1773 // this could also be a nested enums ... which should work ... be let's see.
1774 TClass *cl = TClass::GetClass(intype.c_str());
1775 if (cl) {
1778 } else {
1779 if (gCling->ClassInfo_IsEnum(intype.c_str())) {
1781 } else {
1782 if (intype != "string") {
1783 // This case can happens when 'this' is a TStreamerElement for
1784 // a STL container containing something for which we do not have
1785 // a TVirtualStreamerInfo (This happens in particular is the collection
1786 // objects themselves are always empty) and we do not have the
1787 // dictionary/shared library for the container.
1788 if (GetClassPointer() && GetClassPointer()->IsLoaded()) {
1789 Warning("TStreamerSTL", "For %s we could not find any information about the type %s %d %s",
1790 fTypeName.Data(), arglist.fElements[1].c_str(), fSTLtype, arglist.fElements[0].c_str());
1791 }
1792 }
1793 }
1794 }
1795 }
1796
1798}
1799
1800////////////////////////////////////////////////////////////////////////////////
1801/// TStreamerSTL dtor.
1802
1806
1807////////////////////////////////////////////////////////////////////////////////
1808/// We can not split STL's which are inside a variable size array.
1809/// At least for now.
1810
1812{
1813 if (IsaPointer()) {
1814 if (GetTitle()[0]=='[') return kTRUE; // can not split variable size array
1815 return kTRUE;
1816 }
1817
1818 if (GetArrayDim()>=1 && GetArrayLength()>1) return kTRUE;
1819
1821
1822 return kFALSE;
1823}
1824
1825////////////////////////////////////////////////////////////////////////////////
1826/// Return true if the data member is a pointer.
1827
1829{
1830 const char *type_name = GetTypeName();
1831 if ( type_name[strlen(type_name)-1]=='*' ) return kTRUE;
1832 else return kFALSE;
1833}
1834
1835
1836////////////////////////////////////////////////////////////////////////////////
1837/// Return kTRUE if the element represent a base class.
1838
1840{
1841 TString ts(GetName());
1842
1843 if (strcmp(ts.Data(),GetTypeName())==0) return kTRUE;
1844 if (strcmp(ts.Data(),GetTypeNameBasic())==0) return kTRUE;
1845 return kFALSE;
1846}
1847////////////////////////////////////////////////////////////////////////////////
1848/// Returns size of STL container in bytes.
1849
1851{
1852 // Since the STL collection might or might not be emulated and that the
1853 // sizeof the object depends on this, let's just always retrieve the
1854 // current size!
1855 TClass *cl = GetClassPointer();
1856 UInt_t size = 0;
1857 if (cl==nullptr) {
1858 if (!TestBit(kWarned)) {
1859 Error("GetSize","Could not find the TClass for %s.\n"
1860 "This is likely to have been a typedef, if possible please declare it in CINT to work around the issue\n",fTypeName.Data());
1861 const_cast<TStreamerSTL*>(this)->SetBit(kWarned);
1862 }
1863 } else {
1864 size = cl->Size();
1865 }
1866
1867 if (fArrayLength) return fArrayLength*size;
1868 return size;
1869}
1870
1871////////////////////////////////////////////////////////////////////////////////
1872/// Print the content of the element.
1873
1875{
1877 TString cdim;
1878 name = GetName();
1879 for (Int_t i=0;i<fArrayDim;i++) {
1880 cdim.Form("[%d]",fMaxIndex[i]);
1881 name += cdim;
1882 }
1885 if (sequenceType.Length()) {
1886 sequenceType.Prepend(" (");
1887 sequenceType += ") ";
1888 }
1889 printf(" %-14s %-15s offset=%3d type=%2d",
1890 GetTypeName(), name.Data(), fOffset, fType);
1892 printf(" newtype=%2d", fNewType);
1893 printf(" stl=%d ctype=%d %s%-20s\n",
1894 fSTLtype, fCtype, sequenceType.Data(), GetTitle());
1895}
1896
1897////////////////////////////////////////////////////////////////////////////////
1898/// Return the proper include for this element.
1899
1900const char *TStreamerSTL::GetInclude() const
1901{
1902 if (fSTLtype == ROOT::kSTLvector) IncludeNameBuffer().Form("<%s>","vector");
1903 else if (fSTLtype == ROOT::kSTLlist) IncludeNameBuffer().Form("<%s>","list");
1904 else if (fSTLtype == ROOT::kSTLforwardlist) IncludeNameBuffer().Form("<%s>","forward_list");
1905 else if (fSTLtype == ROOT::kSTLdeque) IncludeNameBuffer().Form("<%s>","deque");
1906 else if (fSTLtype == ROOT::kSTLmap) IncludeNameBuffer().Form("<%s>","map");
1907 else if (fSTLtype == ROOT::kSTLmultimap) IncludeNameBuffer().Form("<%s>","map");
1908 else if (fSTLtype == ROOT::kSTLset) IncludeNameBuffer().Form("<%s>","set");
1909 else if (fSTLtype == ROOT::kSTLmultiset) IncludeNameBuffer().Form("<%s>","set");
1910 else if (fSTLtype == ROOT::kSTLunorderedset) IncludeNameBuffer().Form("<%s>","unordered_set");
1911 else if (fSTLtype == ROOT::kSTLunorderedmultiset) IncludeNameBuffer().Form("<%s>","unordered_set");
1912 else if (fSTLtype == ROOT::kSTLunorderedmap) IncludeNameBuffer().Form("<%s>","unordered_map");
1913 else if (fSTLtype == ROOT::kSTLunorderedmultimap) IncludeNameBuffer().Form("<%s>","unordered_map");
1914 else if (fSTLtype == ROOT::kSTLbitset) IncludeNameBuffer().Form("<%s>","bitset");
1915 return IncludeNameBuffer();
1916}
1917
1918////////////////////////////////////////////////////////////////////////////////
1919/// Set pointer to Streamer function for this element
1920/// NOTE: we do not take ownership
1921
1926
1927////////////////////////////////////////////////////////////////////////////////
1928/// Stream an object of class TStreamerSTL.
1929
1931{
1932 UInt_t R__s, R__c;
1933 if (R__b.IsReading()) {
1934 Version_t R__v = R__b.ReadVersion(&R__s, &R__c);
1935 if (R__v > 2) {
1936 R__b.ReadClassBuffer(TStreamerSTL::Class(), this, R__v, R__s, R__c);
1937 } else {
1938 //====process old versions before automatic schema evolution
1940 R__b >> fSTLtype;
1941 R__b >> fCtype;
1942 R__b.CheckByteCount(R__s, R__c, TStreamerSTL::IsA());
1943 }
1944 // In old versions (prior to v6.24/02) the value of fArrayDim was not stored properly.
1945 if (fArrayDim == 0 && fArrayLength > 0) {
1946 while(fArrayDim < 5 && fMaxIndex[fArrayDim] != 0) {
1947 ++fArrayDim;
1948 }
1949 }
1951 // For a long time those where inverted in TStreamerElement
1952 // compared to the other definitions. When we moved to version '4',
1953 // this got standardized, but we now need to fix it.
1954
1955 if (fTypeName.BeginsWith("std::set") || fTypeName.BeginsWith("set")) {
1957 } else if (fTypeName.BeginsWith("std::multimap") || fTypeName.BeginsWith("multimap")) {
1959 }
1960 }
1961
1964 if (GetArrayLength() > 0) {
1966 }
1967 if (R__b.GetParent()) { // Avoid resetting during a cloning.
1969 SetBit(kDoNotDelete); // For backward compatibility
1970 } else if ( fSTLtype == ROOT::kSTLmap || fSTLtype == ROOT::kSTLmultimap) {
1971 // Here we would like to set the bit only if one of the element of the pair is a pointer,
1972 // however we have no easy to determine this short of parsing the class name.
1973 SetBit(kDoNotDelete); // For backward compatibility
1974 }
1975 }
1976 return;
1977 } else {
1978 // To enable forward compatibility we actually save with the old value
1979 TStreamerSTL tmp;
1980 // Hand coded copy constructor since the 'normal' one are intentionally
1981 // deleted.
1982 tmp.fName = fName;
1983 tmp.fTitle = fTitle;
1985 tmp.fSize = fSize;
1986 tmp.fArrayDim = fArrayDim;
1987 tmp.fArrayLength = fArrayLength;
1988 for(int i = 0; i < 5; ++i)
1989 tmp.fMaxIndex[i] = fMaxIndex[i];
1990 tmp.fTypeName = fTypeName;
1991 tmp.fSTLtype = fSTLtype;
1992 tmp.fCtype = fCtype;
1993 R__b.WriteClassBuffer(TStreamerSTL::Class(), &tmp);
1994 }
1995}
1996
1997//______________________________________________________________________________
1998
1999//////////////////////////////////////////////////////////////////////////
2000// //
2001// TStreamerSTLstring implements streaming std::string. //
2002// //
2003//////////////////////////////////////////////////////////////////////////
2004
2006
2007////////////////////////////////////////////////////////////////////////////////
2008/// Default ctor.
2009
2013
2014////////////////////////////////////////////////////////////////////////////////
2015/// Create a TStreamerSTLstring object.
2016
2018 const char *typeName, Bool_t dmPointer)
2019 : TStreamerSTL()
2020{
2021 SetName(name);
2022 SetTitle(title);
2023
2024 if (dmPointer) {
2026 } else {
2028 }
2029
2030 fNewType = fType;
2031 fOffset = offset;
2034 fTypeName= typeName;
2035
2036}
2037
2038////////////////////////////////////////////////////////////////////////////////
2039/// TStreamerSTLstring dtor.
2040
2044
2045////////////////////////////////////////////////////////////////////////////////
2046/// Return the proper include for this element.
2047
2049{
2050 IncludeNameBuffer() = "<string>";
2051 return IncludeNameBuffer();
2052}
2053
2054////////////////////////////////////////////////////////////////////////////////
2055/// Returns size of anyclass in bytes.
2056
2058{
2059 if (fArrayLength) return fArrayLength*sizeof(string);
2060 return sizeof(string);
2061}
2062
2063////////////////////////////////////////////////////////////////////////////////
2064/// Stream an object of class TStreamerSTLstring.
2065
2067{
2068 UInt_t R__s, R__c;
2069 if (R__b.IsReading()) {
2070 Version_t R__v = R__b.ReadVersion(&R__s, &R__c);
2071 if (R__v > 1) {
2072 R__b.ReadClassBuffer(TStreamerSTLstring::Class(), this, R__v, R__s, R__c);
2073 return;
2074 }
2075 //====process old versions before automatic schema evolution
2077 R__b.CheckByteCount(R__s, R__c, TStreamerSTLstring::IsA());
2078 } else {
2079 R__b.WriteClassBuffer(TStreamerSTLstring::Class(),this);
2080 }
2081}
2082
2083//______________________________________________________________________________
2084
2085///////////////////////////////////////////////////////////////////////////////
2086// //
2087// TStreamerArtificial implements StreamerElement injected by a TSchemaRule. //
2088// //
2089///////////////////////////////////////////////////////////////////////////////
2090
2092
2094{
2095 // Avoid streaming the synthetic/artificial streamer elements.
2096
2097 // Intentionally, nothing to do at all.
2098 return;
2099}
2100
2102{
2103 // Return the read function if any.
2104
2105 return fReadFunc;
2106}
2107
2109{
2110 // Return the raw read function if any.
2111
2112 return fReadRawFunc;
2113}
#define b(i)
Definition RSha256.hxx:100
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
bool Bool_t
Definition RtypesCore.h:63
unsigned short UShort_t
Definition RtypesCore.h:40
int Int_t
Definition RtypesCore.h:45
short Version_t
Definition RtypesCore.h:65
unsigned char UChar_t
Definition RtypesCore.h:38
char Char_t
Definition RtypesCore.h:37
unsigned long ULong_t
Definition RtypesCore.h:55
long Long_t
Definition RtypesCore.h:54
unsigned int UInt_t
Definition RtypesCore.h:46
unsigned long ULongptr_t
Definition RtypesCore.h:76
float Float_t
Definition RtypesCore.h:57
short Short_t
Definition RtypesCore.h:39
constexpr Bool_t kFALSE
Definition RtypesCore.h:94
double Double_t
Definition RtypesCore.h:59
long long Long64_t
Definition RtypesCore.h:69
unsigned long long ULong64_t
Definition RtypesCore.h:70
constexpr Bool_t kTRUE
Definition RtypesCore.h:93
const char Option_t
Definition RtypesCore.h:66
#define ClassImp(name)
Definition Rtypes.h:382
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
EDataType
Definition TDataType.h:28
const Int_t kMaxLen
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
Definition TError.cxx:185
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h offset
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
char name[80]
Definition TGX11.cxx:110
float xmin
float xmax
R__EXTERN TVirtualMutex * gInterpreterMutex
R__EXTERN TInterpreter * gCling
#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:40
void(* ReadRawFuncPtr_t)(char *, TBuffer &)
Definition TSchemaRule.h:41
Buffer base class used for serializing objects.
Definition TBuffer.h:43
TClassRef is used to implement a permanent reference to a TClass object.
Definition TClassRef.h:28
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:81
UInt_t GetCheckSum(ECheckSum code=kCurrentCheckSum) const
Call GetCheckSum with validity check.
Definition TClass.cxx:6592
Bool_t CanSplit() const
Return true if the data member of this TClass can be saved separately.
Definition TClass.cxx:2388
ClassStreamerFunc_t GetStreamerFunc() const
Get a wrapper/accessor function around this class custom streamer (member function).
Definition TClass.cxx:3008
TClassStreamer * GetStreamer() const
Return the Streamer Class allowing streaming (if any).
Definition TClass.cxx:2983
Bool_t HasInterpreterInfo() const
Definition TClass.h:410
Int_t Size() const
Return size of object of this class.
Definition TClass.cxx:5786
Bool_t IsTObject() const
Return kTRUE is the class inherits from TObject.
Definition TClass.cxx:6020
ClassConvStreamerFunc_t GetConvStreamerFunc() const
Get a wrapper/accessor function around this class custom conversion streamer (member function).
Definition TClass.cxx:3016
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:4681
Int_t GetBaseClassOffset(const TClass *toBase, void *address=nullptr, bool isDerivedObject=true)
Definition TClass.cxx:2860
TVirtualCollectionProxy * GetCollectionProxy() const
Return the proxy describing the collection (if any).
Definition TClass.cxx:2966
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:7173
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:7280
Bool_t IsVersioned() const
Definition TClass.h:522
TVirtualStreamerInfo * FindStreamerInfo(TObjArray *arr, UInt_t checksum) const
Find the TVirtualStreamerInfo in the StreamerInfos corresponding to checksum.
Definition TClass.cxx:7153
Version_t GetClassVersion() const
Definition TClass.h:420
const char * GetDeclFileName() const
Return name of the file containing the declaration of this class.
Definition TClass.cxx:3545
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:3037
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:6866
All ROOT classes may have RTTI (run time type identification) support added.
Definition TDataMember.h:31
Basic data type descriptor (datatype information is obtained from CINT).
Definition TDataType.h:44
TString GetTypeName()
Get basic type of typedef, e,g.: "class TDirectory*" -> "TDirectory".
virtual Bool_t ClassInfo_IsEnum(const char *) const
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
const char * GetName() const override
Returns name of object.
Definition TNamed.h:47
void Streamer(TBuffer &) override
Stream an object of class TObject.
const char * GetTitle() const override
Returns title of object.
Definition TNamed.h:48
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
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
Definition TObject.h:199
virtual UInt_t GetUniqueID() const
Return the unique object id.
Definition TObject.cxx:462
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
Definition TObject.cxx:979
static TClass * Class()
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
Definition TObject.cxx:786
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition TObject.cxx:993
virtual void Fatal(const char *method, const char *msgfmt,...) const
Issue fatal error message.
Definition TObject.cxx:1021
virtual void SetUniqueID(UInt_t uid)
Set the unique object id.
Definition TObject.cxx:797
void ResetBit(UInt_t f)
Definition TObject.h:198
The TRealData class manages the effective list of all data members for a given class.
Definition TRealData.h:30
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:339
void Streamer(TBuffer &) override
Stream an object of class TObject.
ROOT::TSchemaRule::ReadRawFuncPtr_t GetReadRawFunc()
ROOT::TSchemaRule::ReadRawFuncPtr_t fReadRawFunc
ROOT::TSchemaRule::ReadFuncPtr_t GetReadFunc()
ROOT::TSchemaRule::ReadFuncPtr_t fReadFunc
Int_t GetSize() const override
Returns size of baseclass in bytes.
void InitStreaming(Bool_t isTransient)
Error message in case of checksum/version mismatch.
Bool_t IsBase() const override
Return kTRUE if the element represent a base class.
Int_t WriteBuffer(TBuffer &b, char *pointer)
Write the base class into the buffer.
virtual ~TStreamerBase()
TStreamerBase dtor.
const char * GetInclude() const override
Return the proper include for this element.
TClass * fBaseClass
checksum of the base class (used during memberwise streaming)
TClass * GetClassPointer() const override
Returns a pointer to the TClass of this element.
void ls(Option_t *option="") const override
Print the content of the element.
void Update(const TClass *oldClass, TClass *newClass) override
Function called by the TClass constructor when replacing an emulated class by the real class.
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.
static TClass * Class()
void Init(TVirtualStreamerInfo *obj=nullptr) override
Setup the element.
void Streamer(TBuffer &) override
Stream an object of class TStreamerBase.
TClass * fNewBaseClass
pointer to base class
TVirtualStreamerInfo * fStreamerInfo
Pointer to a wrapper around a custom convertion streamer member function.
ClassStreamerFunc_t fStreamerFunc
pointer to new base class if renamed
virtual ~TStreamerBasicPointer()
TStreamerBasicPointer dtor.
ULongptr_t GetMethod() const override
return offset of counter
static TClass * Class()
TStreamerBasicPointer()
pointer to basic type counter
void SetArrayDim(Int_t dim) override
Set number of array dimensions.
void Init(TVirtualStreamerInfo *obj=nullptr) override
Setup the element.
void Streamer(TBuffer &) override
Stream an object of class TStreamerBasicPointer.
TStreamerBasicType * fCounter
Int_t GetSize() const override
Returns size of basicpointer in bytes.
Int_t GetSize() const override
Returns size of this element in bytes.
TClass * IsA() const override
static TClass * Class()
ULongptr_t GetMethod() const override
return address of counter
TStreamerBasicType()
value of data member when referenced by an array
void Streamer(TBuffer &) override
Stream an object of class TStreamerBasicType.
virtual ~TStreamerBasicType()
TStreamerBasicType dtor.
void Streamer(TBuffer &) override
Stream an object of class TStreamerElement.
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 void Init(TVirtualStreamerInfo *obj=nullptr)
Initliaze the element.
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
void ls(Option_t *option="") const override
Print the content of the element.
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.
TClass * IsA() const override
virtual void SetType(Int_t dtype)
Int_t GetOffset() const
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.
static TClass * Class()
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
const char * GetInclude() const override
Return the proper include for this element.
void Init(TVirtualStreamerInfo *obj=nullptr) override
Setup the element.
Int_t GetSize() const override
Returns size of counter in bytes.
TStreamerBasicType * fCounter
virtual ~TStreamerLoop()
TStreamerLoop dtor.
ULongptr_t GetMethod() const override
return address of counter
void Streamer(TBuffer &) override
Stream an object of class TStreamerLoop.
static TClass * Class()
TStreamerLoop()
pointer to basic type counter
static TClass * Class()
const char * GetInclude() const override
Return the proper include for this element.
void Streamer(TBuffer &) override
Stream an object of class TStreamerObjectAnyPointer.
void SetArrayDim(Int_t dim) override
Set number of array dimensions.
void Init(TVirtualStreamerInfo *obj=nullptr) override
Setup the element.
virtual ~TStreamerObjectAnyPointer()
TStreamerObjectAnyPointer dtor.
Int_t GetSize() const override
Returns size of objectpointer in bytes.
virtual ~TStreamerObjectAny()
TStreamerObjectAny dtor.
Int_t GetSize() const override
Returns size of anyclass in bytes.
TClass * IsA() const override
static TClass * Class()
const char * GetInclude() const override
Return the proper include for this element.
TStreamerObjectAny()
Default ctor.
void Init(TVirtualStreamerInfo *obj=nullptr) override
Setup the element.
void Streamer(TBuffer &) override
Stream an object of class TStreamerObjectAny.
TClass * IsA() const override
void Init(TVirtualStreamerInfo *obj=nullptr) override
Setup the element.
TStreamerObjectPointer()
Default ctor.
virtual ~TStreamerObjectPointer()
TStreamerObjectPointer dtor.
void Streamer(TBuffer &) override
Stream an object of class TStreamerObjectPointer.
Int_t GetSize() const override
Returns size of objectpointer in bytes.
static TClass * Class()
void SetArrayDim(Int_t dim) override
Set number of array dimensions.
const char * GetInclude() const override
Return the proper include for this element.
void Init(TVirtualStreamerInfo *obj=nullptr) override
Setup the element.
TClass * IsA() const override
static TClass * Class()
void Streamer(TBuffer &) override
Stream an object of class TStreamerObject.
TStreamerObject()
Default ctor.
virtual ~TStreamerObject()
TStreamerObject dtor.
Int_t GetSize() const override
Returns size of object class in bytes.
const char * GetInclude() const override
Return the proper include for this element.
Bool_t IsaPointer() const override
Return true if the data member is a pointer.
Int_t GetSize() const override
Returns size of STL container in bytes.
const char * GetInclude() const override
Return the proper include for this element.
static TClass * Class()
TStreamerSTL()
Default ctor.
void SetStreamer(TMemberStreamer *streamer) override
Set pointer to Streamer function for this element NOTE: we do not take ownership.
Bool_t CannotSplit() const override
We can not split STL's which are inside a variable size array.
void Streamer(TBuffer &) override
Stream an object of class TStreamerSTL.
TClass * IsA() const override
virtual ~TStreamerSTL()
TStreamerSTL dtor.
void ls(Option_t *option="") const override
Print the content of the element.
Bool_t IsBase() const override
Return kTRUE if the element represent a base class.
Int_t GetSize() const override
Returns size of anyclass in bytes.
virtual ~TStreamerSTLstring()
TStreamerSTLstring dtor.
void Streamer(TBuffer &) override
Stream an object of class TStreamerSTLstring.
static TClass * Class()
TClass * IsA() const override
TStreamerSTLstring()
Default ctor.
const char * GetInclude() const override
Return the proper include for this element.
TStreamerString()
Default ctor.
const char * GetInclude() const override
Return the proper include for this element.
static TClass * Class()
TClass * IsA() const override
Int_t GetSize() const override
Returns size of anyclass in bytes.
virtual ~TStreamerString()
TStreamerString dtor.
void Streamer(TBuffer &) override
Stream an object of class TStreamerString.
Basic string class.
Definition TString.h:139
const char * Data() const
Definition TString.h:376
@ kTrailing
Definition TString.h:276
TString & Remove(Ssiz_t pos)
Definition TString.h:685
virtual void Streamer(TBuffer &)
Stream a string object.
Definition TString.cxx:1412
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
Definition TString.h:651
Defines a common interface to inspect/change the contents of an object that represents a collection.
Abstract Interface class describing Streamer information for one class.
@ kUChar
Equal to TDataType's kchar.
static TStreamerBasicType * GetElementCounter(const char *countName, TClass *cl)
Get pointer to a TStreamerBasicType in TClass *cl static function.
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...
@ kSTLbitset
Definition ESTLType.h:37
@ kSTLmap
Definition ESTLType.h:33
@ kSTLunorderedmultiset
Definition ESTLType.h:43
@ kSTLstring
Definition ESTLType.h:49
@ kSTLset
Definition ESTLType.h:35
@ kSTLmultiset
Definition ESTLType.h:36
@ kSTLdeque
Definition ESTLType.h:32
@ kSTLvector
Definition ESTLType.h:30
@ 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.
std::string ResolveTypedef(const char *tname, bool resolveAll=false)
std::string ShortType(const char *typeDesc, int mode)
Return the absolute type of typeDesc.
std::string GetNameForIO(const std::string &templateInstanceName, TClassEdit::EModType mode=TClassEdit::kNone, bool *hasChanged=nullptr)
@ kDropStlDefault
Definition TClassEdit.h:82