51 if (className.
Index(
"const ")==0) className.
Remove(0,6);
72 if (!element)
return nullptr;
79 if (!rdCounter)
return nullptr;
84 if (!element)
return nullptr;
88 if (cl==
nullptr)
return nullptr;
93 if (cl==
nullptr)
return nullptr;
120 const Double_t kPi =3.14159265358979323846 ;
122 if (!comments)
return;
123 const char *left = strstr(comments,
"[");
125 const char *right = strstr(left,
"]");
127 const char *comma = strstr(left,
",");
128 if (!comma || comma > right) {
130 left = strstr(right,
"[");
132 right = strstr(left,
"]");
134 comma = strstr(left,
",");
135 if (!comma || comma >right)
return;
138 const char *comma2 =
nullptr;
139 if (comma) comma2 = strstr(comma+1,
",");
140 if (comma2 > right) comma2 =
nullptr;
143 TString sbits(comma2+1,right-comma2-1);
144 sscanf(sbits.
Data(),
"%d",&nbits);
145 if (nbits < 2 || nbits > 32) {
146 ::Error(
"GetRange",
"Illegal specification for the number of bits; %d. reset to 32.",nbits);
151 TString range(left+1,right-left-1);
152 TString sxmin(left+1,comma-left-1);
166 TString sxmax(comma+1,right-comma-1);
181 if (nbits < 32) bigint = 1<<nbits;
182 else bigint = 0xffffffff;
223 if (typeName && !strcmp(typeName,
"BASE")) {
269 static TClassRef clonesArray(
"TClonesArray");
306 if (typeName !=
"TRef" && typeName !=
"TRefArray") {
313 if (!cl || !cl->HasDataMemberInfo())
316 if (cl->GetCollectionProxy())
319 if (!cl->IsTObject())
321 if (!cl->InheritsFrom(
"TRef") && !cl->InheritsFrom(
"TRefArray"))
330 char *action = (
char*)strstr(
GetTitle(),
"EXEC:");
331 if (!action)
return 0;
332 Int_t nch = strlen(action)+1;
333 char *caction =
new char[nch];
334 strlcpy(caction,action+5,nch);
335 char *blank = (
char*)strchr(caction,
' ');
336 if (blank) *blank = 0;
370 sequenceType.
Clear();
371 auto test_bit = [
this, &sequenceType](
unsigned bit,
const char *
name) {
373 if (!sequenceType.
IsNull()) sequenceType +=
",";
374 sequenceType +=
name;
405 return dt->GetAlignOf();
406 Error(
"TStreamerElement::GetAlignment",
"Cannot determine alignment for type %d (bare type %d) for element %s",
408 return alignof(std::max_align_t);
495 if (sequenceType.
Length()) {
497 sequenceType +=
") ";
499 printf(
" %-14s %-15s offset=%3d type=%2d",
524 if (dim < 0 || dim > 4)
return;
618 if (classname == newClass->
GetName()) {
803 if (sequenceType.
Length()) {
805 sequenceType +=
") ";
831 (*extstrm)(
b, pointer);
839 (*extstrm)(
b, pointer);
924 (*extstrm)(
b, pointer);
933 (*extstrm)(
b, pointer);
1005 return sizeof(
void *);
1104 return dt->GetAlignOf();
1105 Error(
"TStreamerLoop::GetAlignment",
"Cannot determine alignment for type %d (bare type %d) for element %s",
fType,
1107 return alignof(std::max_align_t);
1129 return sizeof(
void*);
1347 Int_t classSize = 8;
1349 classSize = cl->
Size();
1458 Int_t classSize = 8;
1460 classSize = cl->
Size();
1524 Int_t offset,
const char *typeName)
1572 return sizeof(
void *);
1627 Int_t offset,
const char *typeName)
1675 return sizeof(
void *);
1799 || strcmp(
name,typeName)==0) {
1817 if (enumdesc ||
gCling->ClassInfo_IsEnum(arglist.
fElements[1].c_str())) {
1818 fCtype = enumdesc ? enumdesc->GetUnderlyingType() : 3;
1831 const char *typeName,
const char *trueType,
Bool_t dmPointer)
1834 const char *t = trueType;
1835 if (!t || !*t) t = typeName;
1843 || strcmp(
name,typeName)==0) {
1849 Fatal(
"TStreamerSTL",
"For %s, the type name (%s) is seemingly not a template (template argument not found)",
name, t);
1853 const std::string& inside_type = arglist.
fElements[1];
1854 std::string inside = (inside_type.find(
"const ")==0) ? inside_type.substr(6) : inside_type;
1859 bool isPointer =
false;
1862 while (intype.back() ==
'*') {
1886 if (enumdesc ||
gCling->ClassInfo_IsEnum(intype.c_str())) {
1887 fCtype = enumdesc ? enumdesc->GetUnderlyingType() : 3;
1891 if (intype !=
"string") {
1898 Warning(
"TStreamerSTL",
"For %s we could not find any information about the type %s %d %s",
1943 if ( type_name[strlen(type_name)-1]==
'*' )
return kTRUE;
1974 if (!
fNewClass && proxy && proxy->GetValueClass() ==
nullptr) {
1977 if ( arglist.
fElements[1].size() >= 2 ) {
1979 if (enumdesc ||
gCling->ClassInfo_IsEnum(arglist.
fElements[1].c_str())) {
1981 if (proxy->HasPointers())
2006 Error(
"GetSize",
"Could not find the TClass for %s.\n"
2007 "This is likely to have been a typedef, if possible please declare it in CINT to work around the issue\n",
fTypeName.Data());
2047 if (sequenceType.
Length()) {
2049 sequenceType +=
") ";
2051 printf(
" %-14s %-15s offset=%3d type=%2d",
2055 printf(
" stl=%d ctype=%d %s%-20s\n",
2119 }
else if (
fTypeName.BeginsWith(
"std::multimap") ||
fTypeName.BeginsWith(
"multimap")) {
2150 for(
int i = 0; i < 5; ++i)
2179 const char *typeName,
Bool_t dmPointer)
2221 return sizeof(string);
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
unsigned short UShort_t
Unsigned Short integer 2 bytes (unsigned short).
int Int_t
Signed integer 4 bytes (int).
short Version_t
Class version identifier (short).
unsigned char UChar_t
Unsigned Character 1 byte (unsigned char).
unsigned long ULongptr_t
Unsigned integer large enough to hold a pointer (platform-dependent).
char Char_t
Character 1 byte (char).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
unsigned long ULong_t
Unsigned long integer 4 bytes (unsigned long). Size depends on architecture.
long Long_t
Signed long integer 4 bytes (long). Size depends on architecture.
bool Bool_t
Boolean (0=false, 1=true) (bool).
short Short_t
Signed Short integer 2 bytes (short).
double Double_t
Double 8 bytes.
long long Long64_t
Portable signed long integer 8 bytes.
unsigned long long ULong64_t
Portable unsigned long integer 8 bytes.
float Float_t
Float 4 bytes (float).
const char Option_t
Option string (const char).
Error("WriteTObject","The current directory (%s) is not associated with a file. The object (%s) has not been written.", GetName(), objname)
externTInterpreter * gCling
externTVirtualMutex * gInterpreterMutex
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,...
static TString ExtractClassName(const TString &type_name)
#define R__LOCKGUARD(mutex)
void(* ReadFuncPtr_t)(char *, TVirtualObject *)
void(* ReadRawFuncPtr_t)(char *, TBuffer &)
Buffer base class used for serializing objects.
virtual Version_t ReadVersion(UInt_t *start=nullptr, UInt_t *bcnt=nullptr, const TClass *cl=nullptr)=0
virtual void ClassBegin(const TClass *, Version_t=-1)=0
TObject * GetParent() const
Return pointer to parent of this buffer.
virtual void ClassEnd(const TClass *)=0
virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss)=0
virtual void ReadFastArray(Bool_t *b, Int_t n)=0
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=nullptr)=0
virtual void ClassMember(const char *, const char *=nullptr, Int_t=-1, Int_t=-1)=0
void SetBufferOffset(Int_t offset=0)
virtual Int_t ReadStaticArray(Bool_t *b)=0
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
TClassRef is used to implement a permanent reference to a TClass object.
virtual void SetOnFileClass(const TClass *cl)
static DictFuncPtr_t GetDict(const char *cname)
Given the class name returns the Dictionary() function of a class (uses hash of name).
TClass instances represent classes, structs and namespaces in the ROOT type system.
Bool_t CanSplit() const
Return true if the data member of this TClass can be saved separately.
size_t GetClassAlignment() const
Return the alignment requirement (in bytes) for objects of this class.
Bool_t HasInterpreterInfo() const
TList * GetListOfRealData() const
Int_t Size() const
Return size of object of this class.
TVirtualCollectionProxy * GetCollectionProxy() const
Return the proxy describing the collection (if any).
const char * GetDeclFileName() const
Return name of the file containing the declaration of this class.
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.
All ROOT classes may have RTTI (run time type identification) support added.
TClass * GetClass() const
Basic data type descriptor (datatype information is obtained from CINT).
TString GetTypeName()
Get basic type of typedef, e,g.: "class TDirectory*" -> "TDirectory".
static TDataType * GetDataType(EDataType type)
Given a EDataType type, get the TDataType* that represents it.
static TEnum * GetEnum(const std::type_info &ti, ESearchAction sa=kALoadAndInterpLookup)
TObject * FindObject(const char *name) const override
Find an object in this list using its name.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
const char * GetName() const override
Returns name of object.
void Streamer(TBuffer &) override
Stream an object of class TObject.
const char * GetTitle() const override
Returns title of object.
virtual void SetName(const char *name)
Set the name of the TNamed.
TObject * FindObject(const char *name) const override
Find an object in this collection using its name.
Bool_t TestBit(UInt_t f) const
virtual UInt_t GetUniqueID() const
Return the unique object id.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual void Fatal(const char *method, const char *msgfmt,...) const
Issue fatal error message.
virtual void SetUniqueID(UInt_t uid)
Set the unique object id.
The TRealData class manages the effective list of all data members for a given class.
TDataMember * GetDataMember() const
static Int_t AddExec(const char *name)
If Exec with name does not exist in the list of Execs, it is created.
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)
Setup the fStreamerFunc and fStreamerinfo.
UInt_t & fBaseCheckSum
!checksum of the base class (used during memberwise streaming)
Bool_t IsBase() const override
Return kTRUE if the element represent a base class.
std::size_t GetAlignment() const override
Returns the alignment of the base class in bytes.
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
!pointer to base class
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 convertion streamer member function.
TStreamerBase(const TStreamerBase &)=delete
void Init(TVirtualStreamerInfo *obj=nullptr) override
Setup the element.
void Streamer(TBuffer &) override
Stream an object of class TStreamerBase.
TClass * fNewBaseClass
!pointer to new base class if renamed
TVirtualStreamerInfo * fStreamerInfo
!Pointer to the current StreamerInfo for the baset class.
ClassStreamerFunc_t fStreamerFunc
!Pointer to a wrapper around a custom streamer member function.
virtual ~TStreamerBasicPointer()
TStreamerBasicPointer dtor.
ULongptr_t GetMethod() const override
return offset of counter
TStreamerBasicPointer(const TStreamerBasicPointer &)=delete
TStreamerBasicPointer()
Default ctor.
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
!pointer to basic type counter
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
Int_t fCounter
!value of data member when referenced by an array
ULongptr_t GetMethod() const override
return address of counter
TStreamerBasicType()
Default ctor.
void Streamer(TBuffer &) override
Stream an object of class TStreamerBasicType.
virtual ~TStreamerBasicType()
TStreamerBasicType dtor.
Describe one element (data member) to be Streamed.
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 fOffset
!element offset in class
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 and updates fClassObject.
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
!base offset for TObject if the element inherits from it
Double_t fXmax
!Maximum of data member if a range is specified [xmin,xmax,nbits]
TClass * GetNewClass() const
Int_t GetArrayLength() const
virtual void SetStreamer(TMemberStreamer *streamer)
set pointer to Streamer function for this element
TMemberStreamer * fStreamer
!pointer to element Streamer
TStreamerElement(const TStreamerElement &)=delete
void ls(Option_t *option="") const override
Print the content of the element.
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
!Conversion factor if a range is specified fFactor = (1<<nbits/(xmax-xmin)
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)
Double_t fXmin
!Minimum of data member if a range is specified [xmin,xmax,nbits]
TClass * fClassObject
!pointer to class of object
const char * GetTypeNameBasic() const
Return type name of this element in case the type name is not a standard basic type,...
virtual Bool_t IsBase() const
Return kTRUE if the element represent a base class.
virtual Int_t GetExecID() const
Returns the TExec id for the EXEC instruction in the comment field of a TRef data member.
TClass * fNewClass
!new element class when reading
virtual void SetMaxIndex(Int_t dim, Int_t max)
set maximum index for array with dimension dim
virtual std::size_t GetAlignment() const
Returns the alignment of this element in bytes.
void GetSequenceType(TString &type) const
Fill type with the string representation of sequence information including 'cached',...
Int_t fNewType
!new element type when reading
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
!pointer to basic type counter
virtual ~TStreamerLoop()
TStreamerLoop dtor.
ULongptr_t GetMethod() const override
return address of counter
void Streamer(TBuffer &) override
Stream an object of class TStreamerLoop.
std::size_t GetAlignment() const override
Returns the alignment of this element in bytes.
TStreamerLoop()
Default ctor.
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.
TStreamerObjectAnyPointer()
Default ctor.
virtual ~TStreamerObjectAny()
TStreamerObjectAny dtor.
Int_t GetSize() const override
Returns size of anyclass in bytes.
TClass * IsA() const override
const char * GetInclude() const override
Return the proper include for this element.
TStreamerObjectAny()
Default ctor.
void Init(TVirtualStreamerInfo *obj=nullptr) override
Setup the element.
std::size_t GetAlignment() const override
Returns the alignment of the object (non-TObject) class in bytes.
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.
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
void Streamer(TBuffer &) override
Stream an object of class TStreamerObject.
TStreamerObject()
Default ctor.
std::size_t GetAlignment() const override
Returns the alignment of the object class in bytes.
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.
TClass * GetClassPointer() const override
Returns a pointer to the TClass of 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.
std::size_t GetAlignment() const override
Returns the alignment of the STL container in bytes.
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
TStreamerSTL(const TStreamerSTL &)=delete
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.
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.
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.
void ToLower()
Change string to lower-case.
TSubString Strip(EStripType s=kTrailing, char c=' ') const
Return a substring of self stripped at beginning and/or end.
void Clear()
Clear string without changing its capacity.
const char * Data() const
TString & ReplaceAll(const TString &s1, const TString &s2)
TString & Prepend(const char *cs)
TString & Remove(Ssiz_t pos)
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
Defines a common interface to inspect/change the contents of an object that represents a collection.
virtual EDataType GetType() const =0
If the value type is a fundamental data type, return its type (see enumeration EDataType).
virtual TClass * GetValueClass() const =0
If the value type is a user-defined class, return a pointer to the TClass representing the value type...
virtual Int_t GetCollectionType() const =0
Return the type of the proxied collection (see enumeration TClassEdit::ESTLType).
virtual Bool_t HasPointers() const =0
Return true if the content is of type 'pointer to'.
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.
virtual TObjArray * GetElements() const =0
virtual TClass * GetClass() const =0
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)
std::vector< std::string > fElements
void ShortType(std::string &answer, int mode)
Return the absolute type of typeDesc into the string answ.