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