30 TGlobal::TGlobal(DataMemberInfo_t *info) : TDictionary(), fInfo(info)
33 SetName(gCling->DataMemberInfo_Name(fInfo));
34 SetTitle(gCling->DataMemberInfo_Title(fInfo));
41 TGlobal::TGlobal(
const TGlobal &rhs) : TDictionary( ), fInfo(nullptr)
44 fInfo = gCling->DataMemberInfo_FactoryCopy(rhs.fInfo);
45 SetName(gCling->DataMemberInfo_Name(fInfo));
46 SetTitle(gCling->DataMemberInfo_Title(fInfo));
53 TGlobal &TGlobal::operator=(
const TGlobal &rhs)
56 gCling->DataMemberInfo_Delete(fInfo);
58 fInfo = gCling->DataMemberInfo_FactoryCopy(rhs.fInfo);
59 SetName(gCling->DataMemberInfo_Name(fInfo));
60 SetTitle(gCling->DataMemberInfo_Title(fInfo));
71 if (fInfo && gCling) gCling->DataMemberInfo_Delete(fInfo);
77 void *TGlobal::GetAddress()
const
79 return (
void *)gCling->DataMemberInfo_Offset(fInfo);
85 Int_t TGlobal::GetArrayDim()
const
88 return gCling->DataMemberInfo_ArrayDim(fInfo);
93 TDictionary::DeclId_t TGlobal::GetDeclId()
const
95 return gInterpreter->GetDeclId(fInfo);
101 Int_t TGlobal::GetMaxIndex(Int_t dim)
const
103 if (!fInfo)
return 0;
104 return gCling->DataMemberInfo_MaxIndex(fInfo,dim);
111 const char *TGlobal::GetTypeName()
const
113 if (!fInfo)
return nullptr;
114 return gCling->TypeName(gCling->DataMemberInfo_TypeName(fInfo));
120 const char *TGlobal::GetFullTypeName()
const
122 if (!fInfo)
return nullptr;
123 return gCling->DataMemberInfo_TypeName(fInfo);
131 Bool_t TGlobal::IsValid()
134 if (!fInfo && UpdateInterpreterStateMarker()) {
135 DeclId_t newId = gInterpreter->GetDataMember(0, fName);
137 DataMemberInfo_t *info = gInterpreter->DataMemberInfo_Factory(newId, 0);
148 Long_t TGlobal::Property()
const
150 if (!fInfo)
return 0;
151 return gCling->DataMemberInfo_Property(fInfo);
160 Bool_t TGlobal::Update(DataMemberInfo_t *info)
162 if (fInfo) gCling->DataMemberInfo_Delete(fInfo);
165 SetName(gCling->DataMemberInfo_Name(fInfo));
166 SetTitle(gCling->DataMemberInfo_Title(fInfo));
175 TGlobalMappedFunction::TGlobalMappedFunction(
const char *name,
const char *type, GlobalFunc_t funcPtr)
178 SetNameTitle(name, type);
185 TList& TGlobalMappedFunction::GetEarlyRegisteredGlobals()
188 static TList fEarlyRegisteredGlobals;
190 static bool earlyRegisteredGlobalsSetOwner
191 = (fEarlyRegisteredGlobals.SetOwner(kTRUE),
true);
192 (void) earlyRegisteredGlobalsSetOwner;
194 return fEarlyRegisteredGlobals;
201 void TGlobalMappedFunction::Add(TGlobalMappedFunction* gmf)
205 gROOT->GetListOfGlobals()->Add(gmf);
207 GetEarlyRegisteredGlobals().Add(gmf);