Logo ROOT   6.08/07
Reference Guide
TProtoClass.cxx
Go to the documentation of this file.
1 // @(#)root/meta:$
2 // Author: Axel Naumann 2014-05-02
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2014, 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 /** \class TProtoClass
13 Persistent version of a TClass.
14 */
15 
16 #include "TProtoClass.h"
17 
18 #include "TBaseClass.h"
19 #include "TClass.h"
20 #include "TClassEdit.h"
21 #include "TDataMember.h"
22 #include "TEnum.h"
23 #include "TInterpreter.h"
24 #include "TList.h"
25 #include "TListOfDataMembers.h"
26 #include "TListOfEnums.h"
27 #include "TRealData.h"
28 #include "TError.h"
29 
30 #include <cassert>
31 
32 ////////////////////////////////////////////////////////////////////////////////
33 /// Initialize a TProtoClass from a TClass.
34 
36  TNamed(*cl), fBase(cl->GetListOfBases()),
37  fEnums(cl->GetListOfEnums()), fSizeof(cl->Size()), fCheckSum(cl->fCheckSum),
38  fCanSplit(cl->fCanSplit), fStreamerType(cl->fStreamerType), fProperty(cl->fProperty),
39  fClassProperty(cl->fClassProperty)
40 {
41  if (cl->Property() & kIsNamespace){
42  //fData=new TListOfDataMembers();
43  fEnums=nullptr;
44  //fPRealData=nullptr;
46  return;
47  }
48  TListOfEnums *enums = dynamic_cast<TListOfEnums*>(fEnums);
49  if (enums && !enums->fIsLoaded) {
50  // Make sure all the enum information is loaded
51  enums->Load();
52  }
53  // initialize list of data members (fData)
54  TList * dataMembers = cl->GetListOfDataMembers();
55  if (dataMembers && dataMembers->GetSize() > 0) {
56  fData.reserve(dataMembers->GetSize() );
57  for (auto * obj : *dataMembers) {
58  TDataMember * dm = dynamic_cast<TDataMember*>(obj);
59  fData.push_back(dm);
60  }
61  }
62 
63  fPRealData.reserve(100);
64 
65  if (!cl->GetCollectionProxy()) {
66  // Build the list of RealData before we access it:
67  cl->BuildRealData(0, true /*isTransient*/);
68  // The data members are ordered as follows:
69  // - this class's data members,
70  // - foreach base: base class's data members.
71  // fPRealData encodes all TProtoRealData objects with a
72  // TObjString to signal a new class.
73  TClass* clCurrent = cl;
74  fDepClasses.push_back(cl->GetName() );
75  TRealData* precRd = nullptr;
76  for (auto realDataObj: *cl->GetListOfRealData()) {
77  TRealData *rd = (TRealData*)realDataObj;
78  if (!precRd) precRd = rd;
79  TClass* clRD = rd->GetDataMember()->GetClass();
80  TProtoRealData protoRealData(rd);
81  if (clRD != clCurrent) {
82  // here I have a new class
83  fDepClasses.push_back(clRD->GetName() );
84  clCurrent = clRD;
85  protoRealData.fClassIndex = fDepClasses.size()-1;
86  //protoRealData.fClass = clRD->GetName();
87  //TObjString *clstr = new TObjString(clRD->GetName());
88  if (rd->TestBit(TRealData::kTransient)) {
89  //clstr->SetBit(TRealData::kTransient);
90  protoRealData.SetFlag(TProtoRealData::kIsTransient,true);
91  }
92  else
93  protoRealData.SetFlag(TProtoRealData::kIsTransient,false);
94 
95  // fPRealData->AddLast(clstr);
96  precRd = rd;
97  }
98  //fPRealData->AddLast(new TProtoRealData(rd));
99  fPRealData.push_back(protoRealData);
100  }
101 
102  if (gDebug > 2) {
103  for (auto data : fPRealData) {
104  // const auto classType = dataPtr->IsA();
105  // const auto dataName = data.fName;
106  // const auto dataClass = data.fClass;
107  // Info("TProtoClass","Data is a protorealdata: %s - class %s - transient %d", dataName.Data(),dataClass.Data(),data.fIsTransient);
108  //if (!dataClass.IsNull()
109  // if (classType == TProtoRealData::Class())
110  // Info("TProtoClass","Data is a protorealdata: %s", dataPtrName);
111  // if (classType == TObjString::Class())
112  // Info("TProtoClass","Data is a objectstring: %s", dataPtrName);
113  // if (dataPtr->TestBit(TRealData::kTransient))
114  // Info("TProtoClass","And is transient");
115  }
116  }
117  }
118 
119  // this crashes
122 }
123 
124 // // conversion of a new TProtoClass from an old TProtoClass
125 // //______________________________________________________________________________
126 // TProtoClass::TProtoClass(TProtoClassOld * pc):
127 // TNamed(pc->GetName(),pc->GetTitle()), fBase(pc->fBase),
128 // fEnums(pc->fEnums), fSizeof(pc->fSizeof), fCanSplit(pc->fCanSplit),
129 // fStreamerType(pc->fStreamerType), fProperty(pc->fProperty),
130 // fClassProperty(pc->fClassProperty), fOffsetStreamer( pc->fOffsetStreamer)
131 // {
132 
133 // fBase = (pc->fBase) ? (TList*) pc->fBase->Clone() : 0;
134 // //fData = (pc->fData) ? (TList*) pc->fData->Clone() : 0;
135 // fEnums = (pc->fEnums) ? (TList*) pc->fEnums->Clone() : 0;
136 
137 // // initialize list of data members (fData)
138 // TList * dataMembers = pc->fData;
139 // if (dataMembers && dataMembers->GetSize() > 0) {
140 // fData.reserve(dataMembers->GetSize() );
141 // for (auto * obj : *dataMembers) {
142 // TDataMember * dm = dynamic_cast<TDataMember*>(obj);
143 // if (dm) {
144 // TDataMember * dm2 = (TDataMember *) dm->Clone();
145 // if (dm2) fData.push_back(dm2);
146 // }
147 // }
148 // }
149 
150 // fPRealData.reserve(100);
151 
152 // TString className;
153 // for (auto dataPtr : *(pc->fPRealData) ) {
154 
155 // const auto classType = dataPtr->IsA();
156 // if (classType == TObjString::Class()) {
157 // className = dataPtr->GetName();
158 // }
159 // else if (classType == TProtoClass::TProtoRealData::Class()) {
160 // TProtoRealData protoRealData;
161 // TProtoClass::TProtoRealData * oldData= ( TProtoClass::TProtoRealData * )dataPtr;
162 // TClass * cl = TClass::GetClass(className);
163 // //protoRealData.fName = dataPtr->GetName();
164 // //TObject * obj = cl->GetListOfDataMembers()->FindObject( );
165 // protoRealData.fDMIndex = DataMemberIndex(cl, dataPtr->GetName() );
166 // // protoRealData.fTitle = dataPtr->GetTitle();
167 // //protoRealData.fClass = className;
168 // className.Clear();
169 // protoRealData.fIsTransient = dataPtr->TestBit(TRealData::kTransient);
170 // protoRealData.fOffset = oldData->GetOffset();
171 // protoRealData.fIsObject = dataPtr->TestBit(BIT(15));
172 // fPRealData.push_back(protoRealData);
173 // }
174 // }
175 // }
176 
177 ////////////////////////////////////////////////////////////////////////////////
178 /// Destructor.
179 
181 {
182  Delete();
183 }
184 
185 ////////////////////////////////////////////////////////////////////////////////
186 /// Delete the containers that are usually owned by their TClass.
187 /// if (fPRealData) fPRealData->Delete(opt);
188 /// delete fPRealData; fPRealData = 0;
189 
190 void TProtoClass::Delete(Option_t* opt /*= ""*/) {
191  if (fBase) fBase->Delete(opt);
192  delete fBase; fBase = 0;
193 
194  for (auto dm: fData) {
195  delete dm;
196  }
197 
198  if (fEnums) fEnums->Delete(opt);
199  delete fEnums; fEnums = 0;
200 
201  if (gErrorIgnoreLevel==-2) printf("Delete the protoClass %s \n",GetName());
202 }
203 
204 ////////////////////////////////////////////////////////////////////////////////
205 /// Move data from this TProtoClass into cl.
206 /// Returns 'false' if nothing was done. This can happen in the case where
207 /// there is more than one dictionary for the same entity. Note having
208 /// duplicate dictionary is acceptable for namespace or STL collections.
209 
211  if (cl->fRealData || cl->fBase || cl->fData || cl->fEnums.load()
212  || cl->fSizeof != -1 || cl->fCanSplit >= 0
213  || cl->fProperty != (-1) ) {
214 
215  if (cl->GetCollectionType() != ROOT::kNotSTL) {
216  // We are in the case of collection, duplicate dictionary are allowed
217  // (and even somewhat excepted since they can be auto asked for).
218  // They do not always have a TProtoClass for them. In particular
219  // the one that are pre-generated in the ROOT build (in what was once
220  // called the cintdlls) do not have a pcms, neither does vector<string>
221  // which is part of libCore proper.
222  if (gDebug > 0)
223  Info("FillTClass", "Returning w/o doing anything. %s is a STL collection.",cl->GetName());
224  return kFALSE;
225  }
226  if (cl->Property() & kIsNamespace) {
227  if (gDebug > 0)
228  Info("FillTClass", "Returning w/o doing anything. %s is a namespace.",cl->GetName());
229  return kFALSE;
230  }
231  Error("FillTClass", "TClass %s already initialized!", cl->GetName());
232  return kFALSE;
233  }
234  if (gDebug > 1) Info("FillTClass","Loading TProtoClass for %s - %s",cl->GetName(),GetName());
235 
236  if (fPRealData.size() > 0) {
237 
238  // A first loop to retrieve the mother classes before starting to
239  // fill this TClass instance. This is done in order to avoid recursions
240  // for example in presence of daughter and mother class present in two
241  // dictionaries compiled in two different libraries which are not linked
242  // one with each other.
243  for (auto element: fPRealData) {
244  //if (element->IsA() == TObjString::Class()) {
245  if (element.IsAClass() ) {
246  if (gDebug > 1) Info("","Treating beforehand mother class %s",GetClassName(element.fClassIndex));
247  //int autoloadingOldval=gInterpreter->SetClassAutoloading(false);
249 
250  TClass::GetClass(GetClassName(element.fClassIndex));
251 
252  //gInterpreter->SetClassAutoloading(autoloadingOldval);
253  }
254  }
255  }
256 
257 
258  //this->Dump();
259 
260  // Copy only the TClass bits.
261  // not bit 13 and below and not bit 24 and above, just Bits 14 - 23
262  UInt_t newbits = TestBits(0x00ffc000);
263  cl->ResetBit(0x00ffc000);
264  cl->SetBit(newbits);
265 
266  cl->fName = this->fName;
267  cl->fTitle = this->fTitle;
268  cl->fBase = fBase;
269 
270  // fill list of data members in TClass
271  //if (cl->fData) { cl->fData->Delete(); delete cl->fData; }
272  cl->fData = new TListOfDataMembers(fData);
273  // for (auto * dataMember : fData) {
274  // //printf("add data member for class %s - member %s \n",GetName(), dataMember->GetName() );
275  // cl->fData->Add(dataMember);
276  // }
277  // // set loaded bit to true to avoid re-loading the data members
278  // cl->fData->SetIsLoaded();*
279 
280  //cl->fData = (TListOfDataMembers*)fData;
281 
282  // The TDataMember were passed along.
283  fData.clear();
284 
285  // We need to fill enums one by one to initialise the internal map which is
286  // transient
287  {
288  auto temp = new TListOfEnums();
289  if (fEnums) {
290  for (TObject* enumAsTObj : *fEnums){
291  temp->Add((TEnum*) enumAsTObj);
292  }
293  // We did not transfer the container itself, let remove it from memory without deleting its content.
294  fEnums->Clear();
295  delete fEnums;
296  fEnums = nullptr;
297  }
298  cl->fEnums = temp;
299  }
300 
301  cl->fSizeof = fSizeof;
302  cl->fCheckSum = fCheckSum;
303  cl->fCanSplit = fCanSplit;
304  cl->fProperty = fProperty;
307 
308  // Update pointers to TClass
309  if (cl->fBase) {
310  for (auto base: *cl->fBase) {
311  ((TBaseClass*)base)->SetClass(cl);
312  }
313  }
314  if (cl->fData) {
315  for (auto dm: *cl->fData) {
316  ((TDataMember*)dm)->SetClass(cl);
317  }
318  ((TListOfDataMembers*)cl->fData)->SetClass(cl);
319  }
320  if (cl->fEnums.load()) {
321  for (auto en: *cl->fEnums) {
322  ((TEnum*)en)->SetClass(cl);
323  }
324  ((TListOfEnums*)cl->fEnums)->SetClass(cl);
325  }
326 
327 
328  TClass* currentRDClass = cl;
329  TRealData * prevRealData = 0;
330  int prevLevel = 0;
331  bool first = true;
332  if (fPRealData.size() > 0) {
333  for (auto element: fPRealData) {
334  //if (element->IsA() == TObjString::Class()) {
335  if (element.IsAClass() ) {
336  // We now check for the TClass entry, w/o loading. Indeed we did that above.
337  // If the class is not found, it means that really it was not selected and we
338  // replace it with an empty placeholder with the status of kForwardDeclared.
339  // Interactivity will be of course possible but if IO is attempted, a warning
340  // will be issued.
342 
343  // Disable autoparsing which might be triggered by the use of ResolvedTypedef
344  // and the fallback new TClass() below.
345  currentRDClass = TClass::GetClass(GetClassName(element.fClassIndex), false /* Load */ );
346  //printf("element is a class - name %s - index %d %s \n ",currentRDClass->GetName(), element.fClassIndex, GetClassName(element.fClassIndex) );
347  if (!currentRDClass && !element.TestFlag(TProtoRealData::kIsTransient)) {
348  if (gDebug>1)
349  Info("FillTClass()",
350  "Cannot find TClass for %s; Creating an empty one in the kForwardDeclared state.",
351  GetClassName(element.fClassIndex));
352  currentRDClass = new TClass(GetClassName(element.fClassIndex),1,TClass::kForwardDeclared, true /*silent*/);
353  }
354  }
355  //else {
356  if (!currentRDClass) continue;
357  //TProtoRealData* prd = (TProtoRealData*)element;
358  // pass a previous real data only if depth
359 
360  if (TRealData* rd = element.CreateRealData(currentRDClass, cl,prevRealData, prevLevel)) {
361  if (first) {
362  //LM: need to do here because somehow fRealData is destroyed when calling TClass::GetListOfDataMembers()
363  if (cl->fRealData) {
364  Info("FillTClass","Real data for class %s is not empty - make a new one",cl->GetName() );
365  delete cl->fRealData;
366  }
367  cl->fRealData = new TList(); // FIXME: this should really become a THashList!
368  first = false;
369  }
370 
371  cl->fRealData->AddLast(rd);
372  prevRealData = rd;
373  prevLevel = element.fLevel;
374 
375  }
376  //}
377  }
378  }
379  else {
380  if (cl->fRealData) {
381  Info("FillTClas","Real data for class %s is not empty - make a new one. Class has no Proto-realdata",cl->GetName() );
382  delete cl->fRealData;
383  }
384  cl->fRealData = new TList(); // FIXME: this should really become a THashList!
385  }
386 
387  cl->SetStreamerImpl();
388 
389  // set to zero in order not to delete when protoclass is deleted
390  fBase = 0;
391  //fData = 0;
392  fEnums = 0;
393 
394  fPRealData.clear();
395  fPRealData.shrink_to_fit(); // to reset the underlying allocate space
396 
397  // if (fPRealData) fPRealData->Delete();
398  // delete fPRealData;
399  // fPRealData = 0;
400 
401  return kTRUE;
402 }
403 
404 ////////////////////////////////////////////////////////////////////////////////
405 
407  //TNamed(rd->GetDataMember()->GetName(), rd->GetName()),
408  //TNamed(),
409  //fName(rd->GetDataMember()->GetName()),
410  //fTitle(rd->GetName()),
411  fOffset(rd->GetThisOffset()),
412  fDMIndex(-1),
413  fLevel(0),
414  fClassIndex(-1),
415  fStatusFlag(0)
416 {
417  TDataMember * dm = rd->GetDataMember();
418  TClass * cl = dm->GetClass();
419  assert(cl != NULL);
420  fDMIndex = DataMemberIndex(cl,dm->GetName());
421  //printf("Index of data member %s for class %s is %d \n",dm->GetName(), cl->GetName() , fDMIndex);
422  TString fullDataMemberName = rd->GetName(); // full data member name (e.g. fXaxis.fNbins)
423  fLevel = fullDataMemberName.CountChar('.');
424 
425  if (fullDataMemberName.Contains("*") ) SetFlag(kIsPointer);
426 
427  // Initialize this from a TRealData object.
428  SetFlag(kIsObject, rd->IsObject());
430 }
431 
432 ////////////////////////////////////////////////////////////////////////////////
433 /// Destructor to pin vtable.
434 ///if (gErrorIgnoreLevel==-2) printf("destroy real data %s - ",GetName());
435 
437 {
438 }
439 
440 ////////////////////////////////////////////////////////////////////////////////
441 /// Create a TRealData from this, with its data member coming from dmClass.
442 /// find data member from protoclass
443 
445  TClass* parent, TRealData *prevData, int prevLevel) const
446 {
447 
448  //TDataMember* dm = (TDataMember*)dmClass->GetListOfDataMembers()->FindObject(fName);
450 
451  if (!dm && dmClass->GetState()!=TClass::kForwardDeclared) {
452  ::Error("CreateRealData",
453  "Cannot find data member # %d of class %s for parent %s!", fDMIndex, dmClass->GetName(),
454  parent->GetName());
455  return nullptr;
456  }
457 
458  // here I need to re-construct the realdata full name (e.g. fAxis.fNbins)
459 
460  TString realMemberName;
461  // keep an empty name if data member is not found
462  if (dm) realMemberName = dm->GetName();
463  if (TestFlag(kIsPointer) )
464  realMemberName = TString("*")+realMemberName;
465  else if (dm){
466  if (dm->GetArrayDim() > 0) {
467  // in case of array (like fMatrix[2][2] we need to add max index )
468  // this only in case of it os not a pointer
469  for (int idim = 0; idim < dm->GetArrayDim(); ++idim)
470  realMemberName += TString::Format("[%d]",dm->GetMaxIndex(idim) );
471  } else if (TClassEdit::IsStdArray(dm->GetTypeName())) {
472  std::string typeNameBuf;
473  Int_t ndim = dm->GetArrayDim();
474  std::array<Int_t, 5> maxIndices; // 5 is the maximum supported in TStreamerElement::SetMaxIndex
476  typeNameBuf,
477  maxIndices,
478  ndim);
479  for (Int_t idim = 0; idim < ndim; ++idim) {
480  realMemberName += TString::Format("[%d]",maxIndices[idim] );
481  }
482  }
483  }
484 
485  if (prevData && fLevel > 0 ) {
486  if (fLevel-prevLevel == 1) // I am going down 1 level
487  realMemberName = TString::Format("%s.%s",prevData->GetName(), realMemberName.Data() );
488  else if (fLevel <= prevLevel) { // I am at the same level
489  // need to strip out prev name
490  std::string prevName = prevData->GetName();
491  // we strip the prev data member name from the full name
492  std::string parentName;
493  for (int i = 0; i < prevLevel-fLevel+1; ++i) {
494  parentName = prevName.substr(0, prevName.find_last_of(".") );
495  prevName = parentName;
496  }
497 
498  // now we need to add the current name
499  realMemberName = TString::Format("%s.%s",parentName.c_str(), realMemberName.Data() );
500  }
501  }
502 
503  //printf("adding new realdata for class %s : %s - %s %d %d \n",dmClass->GetName(), realMemberName.Data(), dm->GetName(),fLevel, fDMIndex );
504 
505  TRealData* rd = new TRealData(realMemberName, fOffset, dm);
506  if (TestFlag(kIsTransient)) {
507  rd->SetBit(TRealData::kTransient);
508  }
509  rd->SetIsObject(TestFlag(kIsObject) );
510  return rd;
511 }
512 
513 ////////////////////////////////////////////////////////////////////////////////
514 
516 {
517  TList * dmList = cl->GetListOfDataMembers();
518 
519  // we cannot use IndexOf because order is guaranteed only for non-static data member
520  Int_t index = 0;
521  for ( auto * obj : *dmList) {
522  TDataMember * dm = (TDataMember *) obj;
523  if (!dm ) continue;
524  if (dm->Property() & kIsStatic) continue;
525  if ( TString(dm->GetName()) == TString(name) )
526  return index;
527  index++;
528  }
529  ::Error("TProtoClass::DataMemberIndex","data member %s is not found in class %s",name, cl->GetName());
530  dmList->ls();
531  return -1;
532 }
533 ////////////////////////////////////////////////////////////////////////////////
534 
536 {
537  TList * dmList = cl->GetListOfDataMembers(false);
538 
539  // we cannot use IndexOf because order is guaranteed only for non-static data member
540  Int_t i = 0;
541  for ( auto * obj : *dmList) {
542  TDataMember * dm = (TDataMember *) obj;
543  if (!dm ) continue;
544  if (dm->Property() & kIsStatic) continue;
545  if (i == index)
546  return dm;
547  i++;
548  }
550  ::Error("TProtoClass::FindDataMember","data member with index %d is not found in class %s",index,cl->GetName());
551  return nullptr;
552 }
TString fTitle
Definition: TNamed.h:37
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:51
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.
Definition: TEnum.h:42
virtual void Delete(Option_t *option="")
Remove all objects from the list AND delete all heap based objects.
Definition: TList.cxx:405
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
Definition: TObject.cxx:899
Long_t fProperty
Definition: TProtoClass.h:81
Bool_t fIsLoaded
Holder of TEnum for unloaded Enums.
Definition: TListOfEnums.h:48
R__EXTERN Int_t gErrorIgnoreLevel
Definition: TError.h:107
const char Option_t
Definition: RtypesCore.h:62
All ROOT classes may have RTTI (run time type identification) support added.
Definition: TDataMember.h:33
const char * Size
Definition: TXMLSetup.cxx:56
const char * GetClassName(Int_t index) const
Definition: TProtoClass.h:88
std::atomic< TListOfEnums * > fEnums
Definition: TClass.h:185
Bool_t TestBit(UInt_t f) const
Definition: TObject.h:157
const char * GetTypeName() const
Get type of data member, e,g.: "class TDirectory*" -> "TDirectory".
UInt_t fCheckSum
Definition: TProtoClass.h:78
TList * GetListOfDataMembers(Bool_t load=kTRUE)
Return list containing the TDataMembers of a class.
Definition: TClass.cxx:3570
Int_t TestBits(UInt_t f) const
Definition: TObject.h:158
Basic string class.
Definition: TString.h:137
TVirtualCollectionProxy * GetCollectionProxy() const
Return the proxy describing the collection (if any).
Definition: TClass.cxx:2822
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kFALSE
Definition: Rtypes.h:92
#define gInterpreter
Definition: TInterpreter.h:517
Int_t fStreamerType
saved info to call Streamer
Definition: TClass.h:236
TList * fEnums
Definition: TProtoClass.h:73
Int_t fStreamerType
Definition: TProtoClass.h:80
Bool_t TestFlag(UInt_t f) const
Definition: TProtoClass.h:60
virtual void AddLast(TObject *obj)
Add object at the end of the list.
Definition: TList.cxx:137
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
Definition: TObject.cxx:739
void Delete(Option_t *opt="")
Delete the containers that are usually owned by their TClass.
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString...
Definition: TString.cxx:2335
Bool_t FillTClass(TClass *pcl)
Move data from this TProtoClass into cl.
std::atomic< TList * > fBase
Definition: TClass.h:182
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:33
std::vector< TDataMember * > fData
Definition: TProtoClass.h:75
virtual ~TProtoRealData()
Destructor to pin vtable.
Long_t Property() const
Get property description word. For meaning of bits see EProperty.
EState GetState() const
Definition: TClass.h:443
bool IsStdArray(std::string_view name)
Definition: TClassEdit.h:180
Int_t fCanSplit
Definition: TProtoClass.h:79
TList * fRealData
Definition: TClass.h:181
Int_t GetMaxIndex(Int_t dim) const
Return maximum index for array dimension "dim".
A doubly linked list.
Definition: TList.h:47
void BuildRealData(void *pointer=0, Bool_t isTransient=kFALSE)
Build a full list of persistent data members.
Definition: TClass.cxx:1951
Int_t fCanSplit
Definition: TClass.h:225
virtual ~TProtoClass()
Destructor.
Int_t fSizeof
Definition: TProtoClass.h:77
TDataMember * GetDataMember() const
Definition: TRealData.h:57
unsigned int UInt_t
Definition: RtypesCore.h:42
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:925
The TRealData class manages the effective list of all data members for a given class.
Definition: TRealData.h:34
Int_t GetArrayDim() const
Return number of array dimensions.
The ROOT global object gROOT contains a list of all defined classes.
Definition: TClass.h:81
ROOT::ESTLType GetCollectionType() const
Return the &#39;type&#39; of the STL the TClass is representing.
Definition: TClass.cxx:2811
Long_t Property() const
Set TObject::fBits and fStreamerType to cache information about the class.
Definition: TClass.cxx:5683
TString fName
Definition: TNamed.h:36
Each class (see TClass) has a linked list of its base class(es).
Definition: TBaseClass.h:35
Int_t fSizeof
Definition: TClass.h:223
Long_t fClassProperty
Definition: TProtoClass.h:82
void SetFlag(UInt_t f, Bool_t on=kTRUE)
Definition: TProtoClass.h:61
Long_t fOffsetStreamer
Indicates whether GetClassVersion has been called.
Definition: TClass.h:235
TList * GetListOfRealData() const
Definition: TClass.h:405
void SetStreamerImpl()
Internal routine to set fStreamerImpl based on the value of fStreamerType.
Definition: TClass.cxx:5785
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:2893
std::atomic< Long_t > fProperty
Indicates whether this class can be split or not.
Definition: TClass.h:226
void Load()
Load all the DataMembers known to the interpreter for the scope &#39;fClass&#39; into this collection...
TList * fBase
Definition: TProtoClass.h:72
Long_t fClassProperty
Property.
Definition: TClass.h:227
Mother of all ROOT objects.
Definition: TObject.h:37
std::atomic< UInt_t > fCheckSum
Definition: TClass.h:199
TListOfDataMembers * fData
Definition: TClass.h:183
A collection of TEnum objects designed for fast access given a DeclId_t and for keep track of TEnum t...
Definition: TListOfEnums.h:36
std::vector< TString > fDepClasses
Definition: TProtoClass.h:76
#define NULL
Definition: Rtypes.h:82
Long_t fOffsetStreamer
Definition: TProtoClass.h:83
R__EXTERN Int_t gDebug
Definition: Rtypes.h:128
void ResetBit(UInt_t f)
Definition: TObject.h:156
Definition: first.py:1
static TDataMember * FindDataMember(TClass *cl, Int_t index)
virtual Int_t GetSize() const
Definition: TCollection.h:95
virtual const char * GetName() const
Returns name of object.
Definition: TRealData.h:56
const Bool_t kTRUE
Definition: Rtypes.h:91
TClass * GetClass() const
Definition: TDataMember.h:73
bool GetStdArrayProperties(const char *typeName, std::string &typeNameBuf, std::array< int, 5 > &maxIndices, int &ndim)
Bool_t IsObject() const
Definition: TRealData.h:60
char name[80]
Definition: TGX11.cxx:109
static Int_t DataMemberIndex(TClass *cl, const char *name)
void CalculateStreamerOffset() const
Calculate the offset between an object of this class to its base class TObject.
Definition: TClass.cxx:2103
TRealData * CreateRealData(TClass *currentClass, TClass *parent, TRealData *parentData, int prevLevel) const
Create a TRealData from this, with its data member coming from dmClass.
const char * Data() const
Definition: TString.h:349
std::vector< TProtoRealData > fPRealData
Definition: TProtoClass.h:74