40 namespace std {}
using namespace std;
45 TTHREAD_TLS_DECL_ARG(TString,includeName,
kMaxLen);
69 if (!element)
return 0;
76 if (!rdCounter)
return 0;
81 if (!element)
return 0;
118 factor = xmin = xmax = 0;
119 if (!comments)
return;
120 const char *left = strstr(comments,
"[");
122 const char *right = strstr(left,
"]");
124 const char *comma = strstr(left,
",");
125 if (!comma || comma > right) {
127 left = strstr(right,
"[");
129 right = strstr(left,
"]");
131 comma = strstr(left,
",");
132 if (!comma || comma >right)
return;
135 const char *comma2 = 0;
136 if (comma) comma2 = strstr(comma+1,
",");
137 if (comma2 > right) comma2 = 0;
140 TString sbits(comma2+1,right-comma2-1);
141 sscanf(sbits.Data(),
"%d",&nbits);
142 if (nbits < 2 || nbits > 32) {
143 ::Error(
"GetRange",
"Illegal specification for the number of bits; %d. reset to 32.",nbits);
148 TString range(left+1,right-left-1);
149 TString sxmin(left+1,comma-left-1);
151 sxmin.ReplaceAll(
" ",
"");
152 if (sxmin.Contains(
"pi")) {
153 if (sxmin.Contains(
"2pi")) xmin = 2*kPi;
154 else if (sxmin.Contains(
"2*pi")) xmin = 2*kPi;
155 else if (sxmin.Contains(
"twopi")) xmin = 2*kPi;
156 else if (sxmin.Contains(
"pi/2")) xmin = kPi/2;
157 else if (sxmin.Contains(
"pi/4")) xmin = kPi/4;
158 else if (sxmin.Contains(
"pi")) xmin = kPi;
159 if (sxmin.Contains(
"-")) xmin = -xmin;
161 sscanf(sxmin.Data(),
"%lg",&
xmin);
163 TString sxmax(comma+1,right-comma-1);
165 sxmax.ReplaceAll(
" ",
"");
166 if (sxmax.Contains(
"pi")) {
167 if (sxmax.Contains(
"2pi")) xmax = 2*kPi;
168 else if (sxmax.Contains(
"2*pi")) xmax = 2*kPi;
169 else if (sxmax.Contains(
"twopi")) xmax = 2*kPi;
170 else if (sxmax.Contains(
"pi/2")) xmax = kPi/2;
171 else if (sxmax.Contains(
"pi/4")) xmax = kPi/4;
172 else if (sxmax.Contains(
"pi")) xmax = kPi;
173 if (sxmax.Contains(
"-")) xmax = -xmax;
175 sscanf(sxmax.Data(),
"%lg",&
xmax);
178 if (nbits < 32) bigint = 1<<nbits;
179 else bigint = 0xffffffff;
180 if (xmin < xmax) factor = bigint/(xmax-
xmin);
181 if (xmin >= xmax && nbits <15) xmin = nbits+0.1;
198 fClassObject = (
TClass*)(-1);
204 for (
Int_t i=0;i<5;i++) fMaxIndex[i] = 0;
219 if (typeName && !strcmp(typeName,
"BASE")) {
286 if (className.Index(
"const ")==0) className.Remove(0,6);
299 if (strncmp(
fTypeName.Data(),
"TRef",4) != 0)
return 0;
306 char *action = (
char*)strstr(
GetTitle(),
"EXEC:");
307 if (!action)
return 0;
308 Int_t nch = strlen(action)+1;
309 char *caction =
new char[nch];
310 strlcpy(caction,action+5,nch);
311 char *blank = (
char*)strchr(caction,
' ');
312 if (blank) *blank = 0;
318 const_cast<TStreamerElement*
>(
this)->
SetUniqueID(index+1);
346 sequenceType.Clear();
349 if (!first) sequenceType +=
",";
351 sequenceType +=
"wholeObject";
355 sequenceType +=
"cached";
358 if (!first) sequenceType +=
",";
360 sequenceType +=
"repeat";
363 if (!first) sequenceType +=
",";
365 sequenceType +=
"nodelete";
368 if (!first) sequenceType +=
",";
370 sequenceType +=
"write";
398 if (fType < 1 || fType > 55)
return fTypeName.Data();
464 TString sequenceType;
466 if (sequenceType.Length()) {
467 sequenceType.Prepend(
" (");
468 sequenceType +=
") ";
470 printf(
" %-14s %-15s offset=%3d type=%2d %s%-20s\n",
490 if (dim < 0 || dim > 4)
return;
507 void TStreamerElement::Streamer(
TBuffer &R__b)
518 TNamed::Streamer(R__b);
543 if (type && fArrayLength) fSize = fArrayLength * type->
Size();
604 fStreamerFunc(0), fConvStreamerFunc(0), fStreamerInfo(0)
608 fBaseClass = (
TClass*)(-1);
619 fStreamerFunc(0), fConvStreamerFunc(0), fStreamerInfo(0)
665 if (cl)
return cl->
Size();
735 TString sequenceType;
737 if (sequenceType.Length()) {
738 sequenceType.Prepend(
" (");
739 sequenceType +=
") ";
765 (*extstrm)(
b, pointer);
773 (*extstrm)(
b, pointer);
785 void TStreamerBase::Streamer(
TBuffer &R__b)
794 TStreamerElement::Streamer(R__b);
859 (*extstrm)(
b, pointer);
868 (*extstrm)(
b, pointer);
902 : TStreamerElement(name,title,offset,dtype,typeName)
941 return sizeof(
void *);
968 void TStreamerBasicPointer::Streamer(
TBuffer &R__b)
980 TStreamerElement::Streamer(R__b);
1048 return sizeof(
void*);
1074 void TStreamerLoop::Streamer(
TBuffer &R__b)
1085 TStreamerElement::Streamer(R__b);
1118 : TStreamerElement(name,title,offset,dtype,typeName),
fCounter(0)
1150 void TStreamerBasicType::Streamer(
TBuffer &R__b)
1159 TStreamerElement::Streamer(R__b);
1218 : TStreamerElement(name,title,offset,0,typeName)
1266 Int_t classSize = 8;
1267 if (cl) classSize = cl->
Size();
1275 void TStreamerObject::Streamer(
TBuffer &R__b)
1285 TStreamerElement::Streamer(R__b);
1359 Int_t classSize = 8;
1360 if (cl) classSize = cl->
Size();
1368 void TStreamerObjectAny::Streamer(
TBuffer &R__b)
1378 TStreamerElement::Streamer(R__b);
1409 Int_t offset,
const char *typeName)
1457 return sizeof(
void *);
1473 void TStreamerObjectPointer::Streamer(
TBuffer &R__b)
1483 TStreamerElement::Streamer(R__b);
1513 Int_t offset,
const char *typeName)
1561 return sizeof(
void *);
1577 void TStreamerObjectAnyPointer::Streamer(
TBuffer &R__b)
1634 return sizeof(TString);
1640 void TStreamerString::Streamer(
TBuffer &R__b)
1650 TStreamerElement::Streamer(R__b);
1679 : TStreamerElement(name,title,offset,
ROOT::
kSTLany,typeName)
1684 || strcmp(name,typeName)==0) {
1709 const char *typeName,
const char *trueType,
Bool_t dmPointer)
1710 : TStreamerElement(name,title,offset,
ROOT::
kSTLany,typeName)
1712 const char *t = trueType;
1713 if (!t || !*t) t = typeName;
1718 || strcmp(name,typeName)==0) {
1723 Int_t nch = strlen(t);
1724 char *s =
new char[nch+1];
1726 char *sopen = strchr(s,
'<');
1728 Fatal(
"TStreamerSTL",
"For %s, the type name (%s) is seemingly not a template (template argument not found)", name, s);
1731 *sopen = 0; sopen++;
1734 char* current=sopen;
1735 for(
int count = 0; *current!=
'\0'; current++) {
1736 if (*current==
'<') count++;
1737 if (*current==
'>') {
1738 if (count==0)
break;
1741 if (*current==
',' && count==0)
break;
1743 char *sclose = current; *sclose = 0; sclose--;
1744 char *sconst = strstr(sopen,
"const ");
1745 char *sbracket = strstr(sopen,
"<");
1746 if (sconst && (sbracket==0 || sconst < sbracket)) {
1748 char *pconst = sconst-1;
1749 if (*pconst ==
' ' || *pconst ==
'<' || *pconst ==
'*' || *pconst ==
'\0') sopen = sconst + 5;
1757 while (*sopen==
' ') sopen++;
1761 char *star = strrchr(sopen,
'>');
1762 if (star) star = strchr(star,
'*');
1763 else star = strchr(sopen,
'*');
1769 while (*sclose ==
' ') {*sclose = 0; sclose--;}
1788 if(strcmp(sopen,
"string")) {
1795 Warning(
"TStreamerSTL",
"For %s we could not find any information about the type %s %d %s",
fTypeName.Data(),sopen,
fSTLtype,s);
1837 if ( type_name[strlen(type_name)-1]==
'*' )
return kTRUE;
1865 Error(
"GetSize",
"Could not find the TClass for %s.\n" 1866 "This is likely to have been a typedef, if possible please declare it in CINT to work around the issue\n",
fTypeName.Data());
1889 TString sequenceType;
1891 if (sequenceType.Length()) {
1892 sequenceType.Prepend(
" (");
1893 sequenceType +=
") ";
1895 printf(
" %-14s %-15s offset=%3d type=%2d %s,stl=%d, ctype=%d, %-20s\n",
1933 void TStreamerSTL::Streamer(
TBuffer &R__b)
1942 TStreamerElement::Streamer(R__b);
1954 }
else if (
fTypeName.BeginsWith(
"std::multimap") ||
fTypeName.BeginsWith(
"multimap")) {
2004 const char *typeName,
Bool_t dmPointer)
2046 return sizeof(string);
2052 void TStreamerSTLstring::Streamer(
TBuffer &R__b)
2062 TStreamerSTL::Streamer(R__b);
2079 void TStreamerArtificial::Streamer(
TBuffer& )
2098 return fReadRawFunc;
virtual const char * GetName() const
Returns name of object.
virtual Bool_t IsTransient() const
Return kTRUE if the element represent an entity that is not written to the disk (transient members...
void SetBufferOffset(Int_t offset=0)
TStreamerBasicType()
value of data member when referenced by an array
virtual Int_t GetCollectionType() const =0
virtual UInt_t GetUniqueID() const
Return the unique object id.
virtual void Init(TVirtualStreamerInfo *obj=0)
Setup the element.
virtual ~TStreamerBase()
TStreamerBase dtor.
TStreamerSTL()
Default ctor.
Bool_t CanSplit() const
Return true if the data member of this TClass can be saved separately.
void(* ReadRawFuncPtr_t)(char *, TBuffer &)
const char * GetInclude() const
Return the proper include for this element.
const char * GetTypeNameBasic() const
Return type name of this element in case the type name is not a standard basic type, return the basic type name known to CINT.
virtual void ClassBegin(const TClass *, Version_t=-1)=0
Int_t fNewType
base offset for TObject if the element inherits from it
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
TString GetTypeName()
Get basic type of typedef, e,g.
Int_t GetSize() const
Returns size of this element in bytes.
const char * GetDeclFileName() const
ClassConvStreamerFunc_t fConvStreamerFunc
Pointer to a wrapper around a custom streamer member function.
This namespace contains pre-defined functions to be used in conjuction with TExecutor::Map and TExecu...
Int_t GetSize() const
Returns size of baseclass in bytes.
Int_t GetSize() const
Returns size of basicpointer in bytes.
Int_t GetSize() const
Returns size of object class in bytes.
virtual TClass * GetClass() const =0
TVirtualStreamerInfo * FindConversionStreamerInfo(const char *onfile_classname, UInt_t checksum) const
Return a Conversion StreamerInfo from the class 'classname' for the layout represented by 'checksum' ...
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...
virtual void ls(Option_t *option="") const
Print the content of the element.
virtual TClass * GetValueClass() const =0
Double_t fXmin
pointer to element Streamer
All ROOT classes may have RTTI (run time type identification) support added.
TObject * GetParent() const
Return pointer to parent of this buffer.
R__EXTERN TVirtualMutex * gInterpreterMutex
virtual void Init(TVirtualStreamerInfo *obj=0)
Setup the element.
Bool_t TestBit(UInt_t f) const
virtual TClass * GetClassPointer() const
Returns a pointer to the TClass of this element.
virtual void SetName(const char *name)
Set the name of the TNamed.
virtual void SetArrayDim(Int_t dim)
Set number of array dimensions.
TVirtualStreamerInfo * GetStreamerInfo(Int_t version=0) const
returns a pointer to the TVirtualStreamerInfo object for version If the object does not exist...
TMemberStreamer * GetStreamer() const
Return the local streamer object.
virtual ~TStreamerObjectAny()
TStreamerObjectAny dtor.
Buffer base class used for serializing objects.
Bool_t HasInterpreterInfo() const
TClassStreamer * GetStreamer() const
Return the Streamer Class allowing streaming (if any).
TStreamerSTLstring()
Default ctor.
virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss)=0
static TStreamerBasicType * InitCounter(const char *countClass, const char *countName, TVirtualStreamerInfo *directive)
Helper function to initialize the 'index/counter' value of the Pointer streamerElements.
const char * GetInclude() const
Return the proper include for this element.
Int_t GetArrayLength() const
TClass * fBaseClass
checksum of the base class (used during memberwise streaming)
virtual ~TStreamerObjectAnyPointer()
TStreamerObjectAnyPointer dtor.
virtual void Init(TVirtualStreamerInfo *obj=0)
Setup the element.
ClassStreamerFunc_t fStreamerFunc
pointer to new base class if renamed
const char * GetInclude() const
Return the proper include for this element.
virtual void SetArrayDim(Int_t dim)
Set number of array dimensions.
virtual ~TStreamerElement()
TStreamerElement dtor.
TStreamerString()
Default ctor.
Int_t GetArrayDim() const
virtual EDataType GetType() const =0
void GetSequenceType(TString &type) const
Fill type with the string representation of sequence information including 'cached','repeat','write' or 'nodelete'.
virtual Int_t ReadStaticArray(Bool_t *b)=0
virtual void SetMaxIndex(Int_t dim, Int_t max)
set maximum index for array with dimension dim
virtual ~TStreamerBasicType()
TStreamerBasicType dtor.
Bool_t IsaPointer() const
Return true if the data member is a pointer.
const char * GetInclude() const
Return the proper include for this element.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual TObject * FindObject(const char *name) const
Find an object in this list using its name.
virtual Bool_t CannotSplit() const
Returns true if the element cannot be split, false otherwise.
virtual void Init(TVirtualStreamerInfo *obj=0)
Setup the element.
Int_t GetBaseClassOffset(const TClass *toBase, void *address=0, bool isDerivedObject=true)
virtual void ClassMember(const char *, const char *=0, Int_t=-1, Int_t=-1)=0
Int_t GetSize() const
Returns size of objectpointer in bytes.
virtual void Init(TVirtualStreamerInfo *obj=0)
Setup the element.
virtual Int_t GetExecID() const
Returns the TExec id for the EXEC instruction in the comment field of a TRef data member...
const char * GetInclude() const
Return the proper include for this element.
TStreamerObject()
Default ctor.
The TNamed class is the base class for all named ROOT classes.
virtual TObject * FindObject(const char *name) const
Find an object in this collection using its name.
Bool_t IsLoaded() const
Return true if the shared library of this class is currently in the a process's memory.
std::string ResolveTypedef(const char *tname, bool resolveAll=false)
ROOT::ESTLType STLKind(std::string_view type)
Converts STL container name to number.
ClassConvStreamerFunc_t GetConvStreamerFunc() const
Get a wrapper/accessor function around this class custom conversion streamer (member function)...
static TString & IncludeNameBuffer()
Int_t GetSize() const
Returns size of anyclass in bytes.
virtual ~TStreamerObject()
TStreamerObject dtor.
virtual void ls(Option_t *option="") const
Print the content of the element.
Int_t WriteBuffer(TBuffer &b, void *pointer, const char *info="")
Function called by the Streamer functions to serialize object at p to buffer b.
virtual ~TStreamerString()
TStreamerString dtor.
virtual void SetOnFileClass(const TClass *cl)
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,xmax,nbits] [0,1] [-10,100]; [-pi,pi], [-pi/2,pi/4],[-2pi,2*pi] [-10,100,16] [0,0,8] if nbits is not specified, or nbits <2 or nbits>32 it is set to 32 if (xmin==0 and xmax==0 and nbits <=16) the double word will be converted to a float and its mantissa truncated to nbits significative bits.
static Int_t AddExec(const char *name)
If Exec with name does not exist in the list of Execs, it is created.
void Error(const char *location, const char *msgfmt,...)
virtual ~TStreamerBasicPointer()
TStreamerBasicPointer dtor.
virtual void Update(const TClass *oldClass, TClass *newClass)
function called by the TClass constructor when replacing an emulated class by the real class ...
Double_t fXmax
Minimum of data member if a range is specified [xmin,xmax,nbits].
virtual void SetStreamer(TMemberStreamer *streamer)
set pointer to Streamer function for this element
virtual void SetUniqueID(UInt_t uid)
Set the unique object id.
Bool_t IsBase() const
Return kTRUE if the element represent a base class.
TStreamerObjectAnyPointer()
Default ctor.
Int_t fTObjectOffset
element offset in class
virtual ~TStreamerSTLstring()
TStreamerSTLstring dtor.
TStreamerObjectPointer()
Default ctor.
TVirtualStreamerInfo * FindStreamerInfo(TObjArray *arr, UInt_t checksum) const
Find the TVirtualStreamerInfo in the StreamerInfos corresponding to checksum.
const char * GetInclude() const
Return the proper include for this element.
virtual void Update(const TClass *oldClass, TClass *newClass)
Function called by the TClass constructor when replacing an emulated class by the real class...
TStreamerBasicPointer()
pointer to basic type counter
Basic data type descriptor (datatype information is obtained from CINT).
virtual Bool_t HasPointers() const =0
TStreamerLoop()
pointer to basic type counter
TDataMember * GetDataMember() const
Int_t WriteBuffer(TBuffer &b, char *pointer)
Write the base class into the buffer.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
TStreamerElement()
Default ctor.
Int_t Size() const
Return size of object of this class.
ULong_t GetMethod() const
return offset of counter
virtual void Init(TVirtualStreamerInfo *obj=0)
Setup the element.
The TRealData class manages the effective list of all data members for a given class.
The ROOT global object gROOT contains a list of all defined classes.
virtual ~TStreamerObjectPointer()
TStreamerObjectPointer dtor.
virtual void ReadFastArray(Bool_t *b, Int_t n)=0
virtual void Init(TVirtualStreamerInfo *obj=0)
Initliaze the element.
Int_t GetSize() const
Returns size of objectpointer in bytes.
#define R__LOCKGUARD2(mutex)
virtual Bool_t ClassInfo_IsEnum(const char *) const
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=0)=0
Version_t GetClassVersion() const
void(* ReadFuncPtr_t)(char *, TVirtualObject *)
virtual ~TStreamerLoop()
TStreamerLoop dtor.
virtual void SetStreamer(TMemberStreamer *streamer)
Set pointer to Streamer function for this element NOTE: we do not take ownership. ...
virtual TObjArray * GetElements() const =0
virtual Bool_t IsaPointer() const
virtual const char * GetFullName() const
Return element name including dimensions, if any Note that this function stores the name into a stati...
ULong_t GetMethod() const
return address of counter
unsigned long long ULong64_t
virtual Int_t GetSize() const
Returns size of this element in bytes.
Bool_t IsBase() const
Return kTRUE if the element represent a base class.
TList * GetListOfRealData() const
virtual Bool_t IsBase() const
Return kTRUE if the element represent a base class.
virtual void SetType(Int_t dtype)
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...
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.
Int_t GetSize() const
Returns size of anyclass in bytes.
const char * GetInclude() const
Return the proper include for this element.
TClass * fNewClass
pointer to class of object
TMemberStreamer * fStreamer
new element class when reading
Int_t GetSize() const
Returns size of counter in bytes.
virtual void ls(Option_t *option="") const
Print the content of the element.
Int_t GetSize() const
Returns size of anyclass in bytes.
virtual void SetArrayDim(Int_t dim)
Set number of array dimensions.
Bool_t IsTObject() const
Return kTRUE is the class inherits from TObject.
void SetArrayDim(Int_t dim)
Set number of array dimensions.
const char * GetTypeName() const
virtual void ClassEnd(const TClass *)=0
const char * GetInclude() const
Return the proper include for this element.
Int_t Size() const
Get size of basic typedef'ed type.
Bool_t IsVersioned() const
Int_t GetSize() const
Returns size of STL container in bytes.
std::string ShortType(const char *typeDesc, int mode)
Return the absolute type of typeDesc.
ROOT::TSchemaRule::ReadFuncPtr_t GetReadFunc()
static TStreamerBasicType * GetElementCounter(const char *countName, TClass *cl)
Get pointer to a TStreamerBasicType in TClass *cl static function.
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
Int_t ReadBuffer(TBuffer &b, char *pointer)
Read the content of the buffer.
Double_t fFactor
Maximum of data member if a range is specified [xmin,xmax,nbits].
virtual void Init(TVirtualStreamerInfo *obj=0)
Setup the element.
ClassStreamerFunc_t GetStreamerFunc() const
Get a wrapper/accessor function around this class custom streamer (member function).
ROOT::TSchemaRule::ReadRawFuncPtr_t GetReadRawFunc()
UInt_t GetCheckSum(ECheckSum code=kCurrentCheckSum) const
Call GetCheckSum with validity check.
virtual TClass * GetClassPointer() const
Returns a pointer to the TClass of this element.
virtual void Fatal(const char *method, const char *msgfmt,...) const
Issue fatal error message.
TStreamerBasicType * fCounter
R__EXTERN TInterpreter * gCling
Abstract Interface class describing Streamer information for one class.
TClass * GetClass() const
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
virtual ~TStreamerSTL()
TStreamerSTL dtor.
TClass * fNewBaseClass
pointer to base class
TVirtualStreamerInfo * fStreamerInfo
Pointer to a wrapper around a custom convertion streamer member function.
const char * GetInclude() const
Return the proper include for this element.
void InitStreaming()
Error message in case of checksum/version mismatch.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
Bool_t CannotSplit() const
We can not split STL's which are inside a variable size array.
TStreamerObjectAny()
Default ctor.
virtual Version_t ReadVersion(UInt_t *start=0, UInt_t *bcnt=0, const TClass *cl=0)=0
TStreamerBasicType * fCounter
virtual const char * GetTitle() const
Returns title of object.
TString fTypeName
new element type when reading
ULong_t GetMethod() const
return address of counter