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