180 if (!fInfo && !
fClass)
return;
212 if (strcmp(name,
"unsigned char") != 0 &&
213 strncmp(name,
"unsigned short",
sizeof (
"unsigned short")) != 0 &&
214 strcmp(name,
"unsigned int") != 0 &&
215 strncmp(name,
"unsigned long",
sizeof (
"unsigned long")) != 0)
256 const char *
ptr1 = 0;
266 if ((opt_ptr=strstr(cmt,
"*OPTION={"))) {
271 ptr1 = strtok(opt_ptr ,
"{}");
273 Fatal(
"TDataMember",
"Internal error, found \"*OPTION={\" but not \"{}\" in %s.",
GetTitle());
276 ptr1 = strtok((
char*)0,
"{}");
278 Fatal(
"TDataMember",
"Internal error, found \"*OPTION={\" but not \"{}\" in %s.",
GetTitle());
283 strlcpy(opt,ptr1,2048);
294 ptr1=strtok((
char*) (cnt++ ? 0:opt),
";");
296 Int_t nch = strlen(ptr1)+1;
298 strlcpy(tok,ptr1,nch);
299 tokens[token_cnt]=tok;
305 for (i=0;i<token_cnt;i++) {
307 if (strstr(tokens[i],
"GetMethod")) {
308 ptr1 = strtok(tokens[i],
"\"");
310 Fatal(
"TDataMember",
"Internal error, found \"GetMethod\" but not \"\\\"\" in %s.",
GetTitle());
313 ptr1 = strtok(0,
"\"");
315 Fatal(
"TDataMember",
"Internal error, found \"GetMethod\" but not \"\\\"\" in %s.",
GetTitle());
326 if (strstr(tokens[i],
"SetMethod")) {
327 ptr1 = strtok(tokens[i],
"\"");
329 Fatal(
"TDataMember",
"Internal error, found \"SetMethod\" but not \"\\\"\" in %s.",
GetTitle());
332 ptr1 = strtok((
char*)0,
"\"");
334 Fatal(
"TDataMember",
"Internal error, found \"SetMethod\" but not \"\\\"\" in %s.",
GetTitle());
348 for (i=0;i<token_cnt;i++) {
349 if (strstr(tokens[i],
"Items")) {
350 ptr1 = strtok(tokens[i],
"()");
352 Fatal(
"TDataMember",
"Internal error, found \"Items\" but not \"()\" in %s.",
GetTitle());
355 ptr1 = strtok((
char*)0,
"()");
357 Fatal(
"TDataMember",
"Internal error, found \"Items\" but not \"()\" in %s.",
GetTitle());
362 strlcpy(opts,ptr1,2048);
371 ptr1 = strtok(opt_cnt++ ? (
char*)0:opts,
",");
393 Bool_t islabel = (ptr1[0]==
'\"');
394 ptr2 = strtok((
char*)ptr1,
"=\"");
395 ptr3 = strtok(0,
"=\"");
432 for (i=0;i<token_cnt;i++)
if(tokens[i])
delete [] tokens[i];
438 TIter iEnumConst(enumDict->GetConstants());
442 enumConst->GetName(),enumConst->GetName());
465 fInfo(
gCling->DataMemberInfo_FactoryCopy(dm.fInfo)),
467 fDataType(dm.fDataType),
469 fSTLCont(dm.fSTLCont),
470 fProperty(dm.fProperty),
471 fArrayDim(dm.fArrayDim),
472 fArrayMaxIndex( dm.fArrayDim ? new
Int_t[dm.fArrayDim] : 0),
473 fArrayIndex(dm.fArrayIndex),
474 fTypeName(dm.fTypeName),
475 fFullTypeName(dm.fFullTypeName),
476 fTrueTypeName(dm.fTrueTypeName),
479 fOptions(dm.fOptions ? (
TList*)dm.fOptions->Clone() : 0)
589 if (dim < 0 || dim >=
fArrayDim)
return -1;
645 char *rdmc = (
char*)rdm->GetName();
648 if (this->
IsaPointer() && rdmc[0] ==
'*') rdmc++;
650 if (rdm->GetDataMember() !=
this)
continue;
651 if (strcmp(rdmc,
GetName()) == 0) {
652 offset = rdm->GetThisOffset();
655 if (strcmp(rdm->GetName(),
GetName()) == 0) {
656 if (rdm->IsObject()) {
657 offset = rdm->GetThisOffset();
661 if (strstr(rdm->GetName(),dmbracket.
Data())) {
662 offset = rdm->GetThisOffset();
696 if ( cl)
return cl->
Size();
753 DataMemberInfo_t *info
825 const char *dataname =
GetName();
828 gettername.
Form(
"Get%s", dataname+1);
831 gettername.
Form(
"Is%s", dataname+1);
834 gettername.
Form(
"Has%s", dataname+1);
871 const char *dataname =
GetName();
874 settername.
Form(
"Set%s", dataname+1);
875 if (strstr(settername,
"Is")) settername.
Form(
"Set%s", dataname+3);
928 void TDataMember::Streamer(
TBuffer& b) {
954 Long_t tglmask,
const char *
name,
const char *label)
void Init(bool afterReading)
Routines called by the constructor and Update to reset the member's information.
virtual const char * GetTitle() const
Returns title of object.
TMethodCall * SetterMethod(TClass *cl)
Return a TMethodCall method responsible for setting the value of data member.
virtual const char * DataMemberInfo_Title(DataMemberInfo_t *) const
A collection of TDataMember objects designed for fast access given a DeclId_t and for keep track of T...
The TEnum class implements the enum type.
TMethodCall * GetterMethod(TClass *cl=0)
Return a TMethodCall method responsible for getting the value of data member.
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
virtual void Delete(Option_t *option="")
Remove all objects from the list AND delete all heap based objects.
ClassImp(TSeqCollection) Int_t TSeqCollection TIter next(this)
Return index of object in collection.
Int_t GetUnitSize() const
Get the sizeof the underlying type of the data member (i.e.
Bool_t UpdateInterpreterStateMarker()
the Cling ID of the transaction that last updated the object
virtual Long_t DataMemberInfo_TypeProperty(DataMemberInfo_t *) const
All ROOT classes may have RTTI (run time type identification) support added.
R__EXTERN TVirtualMutex * gInterpreterMutex
const char * GetParams() const
TDictionary & operator=(const TDictionary &other)
virtual void SetName(const char *name)
Change (i.e.
virtual void DataMemberInfo_Delete(DataMemberInfo_t *) const
Buffer base class used for serializing objects.
TMethodCall * fValueSetter
method that returns a value;
TList * GetListOfDataMembers(Bool_t load=kTRUE)
Return list containing the TDataMembers of a class.
TDataType * GetDataType() const
Bool_t IsaPointer() const
Return true if data member is a pointer.
virtual TObject * FindObject(const char *name) const
Find an object in this list using its name.
TDataMember * fDataMember
const char * GetMethodName() const
Int_t GetMaxIndex(Int_t dim) const
Return maximum index for array dimension "dim".
const char * GetFullTypeName() const
Get full type description of data member, e,g.: "class TDirectory*".
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
const char * GetArrayIndex() const
If the data member is pointer and has a valid array size in its comments GetArrayIndex returns a stri...
TMethodCall * fValueGetter
TList * GetListOfRealData() const
Bool_t IsValid()
Return true if this data member object is pointing to a currently loaded data member.
virtual TObject * Clone(const char *newname="") const
Make a clone of an collection using the Streamer facility.
const char * Data() const
virtual void Fatal(const char *method, const char *msgfmt,...) const
Issue fatal error message.
const char * GetTrueTypeName() const
Get full type description of data member, e,g.: "class TDirectory*".
ClassImp(TDataMember) TDataMember
Default TDataMember ctor.
void Init(TClassEdit::TInterpreterLookupHelper *helper)
virtual const char * DataMemberInfo_TypeName(DataMemberInfo_t *) const
void Clear()
Clear string without changing its capacity.
TString & Append(const char *cs)
TClass * fClass
pointer to the foreign object
TClass * fClass
pointer to CINT data member info
virtual bool Update(DataMemberInfo_t *info)
Update the TFunction to reflect the new info.
virtual ~TDataMember()
TDataMember dtor deletes adopted CINT DataMemberInfo object.
Method or function calling interface.
virtual const char * TypeName(const char *s)=0
virtual int DataMemberInfo_MaxIndex(DataMemberInfo_t *, Int_t) const
std::string GetLong64_Name(const char *original)
Replace 'long long' and 'unsigned long long' by 'Long64_t' and 'ULong64_t'.
ROOT::ESTLType UnderlyingIsSTLCont(std::string_view type)
Return the type of STL collection, if any, that is the underlying type of the given type...
TDataMember & operator=(const TDataMember &)
assignment operator
TCppMethod_t GetMethod(TCppScope_t scope, TCppIndex_t imeth)
void BuildRealData(void *pointer=0, Bool_t isTransient=kFALSE)
Build a full list of persistent data members.
const char * GetTypeName() const
Get type of data member, e,g.: "class TDirectory*" -> "TDirectory".
TList * fOptions
method which sets value;
Long_t GetOffset() const
Get offset from "this".
TClass * GetClass() const
This class defines an abstract interface that must be implemented by all classes that contain diction...
void Update(TDictionary *member)
Move the member or data member to the expect set of list.
virtual const char * DataMemberInfo_Name(DataMemberInfo_t *) const
ClassInfo_t * GetClassInfo() const
virtual TObject * Remove(TObject *obj)
Remove object from the list.
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
char * Form(const char *fmt,...)
Short_t GetDeclFileLine() const
virtual int DataMemberInfo_ArrayDim(DataMemberInfo_t *) const
Bool_t IsEnum() const
Return true if data member is an enum.
The TRealData class manages the effective list of all data members for a given class.
virtual const char * GetName() const
Returns name of object.
The TEnumConstant class implements the constants of the enum type.
The ROOT global object gROOT contains a list of all defined classes.
DeclId_t GetDeclId() const
Global variables class (global variables are obtained from CINT).
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=0)=0
Long_t fValue
Data member to which this option belongs.
Long_t GetOffsetCint() const
Get offset from "this" using the information in CINT only.
virtual void * GetAddress() const
Return address of global.
virtual Long_t DataMemberInfo_Property(DataMemberInfo_t *) const
TDataType * fDataType
pointer to the class
#define R__LOCKGUARD(mutex)
virtual const char * DataMemberInfo_ValidArrayIndex(DataMemberInfo_t *) const
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.
virtual const char * DataMemberInfo_TypeTrueName(DataMemberInfo_t *) const
Mother of all ROOT objects.
Int_t Size() const
Get size of basic typedef'ed type.
TList * GetOptions() const
Returns list of options - list of TOptionListItems.
Int_t GetArrayDim() const
Return number of array dimensions.
Int_t IsSTLContainer()
The return type is defined in TDictionary (kVector, kList, etc.)
virtual Long_t DataMemberInfo_Offset(DataMemberInfo_t *) const
Long_t fOffset
pointer to data basic type descriptor
static TEnum * GetEnum(const std::type_info &ti, ESearchAction sa=kALoadAndInterpLookup)
virtual void Add(TObject *obj)
Bool_t IsBasic() const
Return true if data member is a basic type, e.g. char, int, long...
Long_t Property() const
Get property description word. For meaning of bits see EProperty.
TDataMember(const TDataMember &)
copy constructor
R__EXTERN TInterpreter * gCling
virtual void SetTitle(const char *title="")
Change (i.e. set) the title of the TNamed.
virtual DataMemberInfo_t * DataMemberInfo_FactoryCopy(DataMemberInfo_t *) const
virtual Bool_t DataMemberInfo_IsValid(DataMemberInfo_t *) const
Int_t Size() const
Return size of object of this class.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.