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{
171 if (fBase) fBase->Delete(opt);
172 delete fBase; fBase = nullptr;
173
174 for (auto dm: fData)
175 delete dm;
176 fData.clear();
177
178 if (fEnums) fEnums->Delete(opt);
179 delete fEnums; fEnums = nullptr;
180
181 if (gErrorIgnoreLevel==-2) printf("Delete the protoClass %s \n",GetName());
182}
183
184////////////////////////////////////////////////////////////////////////////////
185/// Move data from this TProtoClass into cl.
186/// Returns 'false' if nothing was done. This can happen in the case where
187/// there is more than one dictionary for the same entity. Note having
188/// duplicate dictionary is acceptable for namespace or STL collections.
189
191 if (cl->fRealData || cl->fBase.load() || cl->fData.load() || cl->fEnums.load() || cl->fCanSplit >= 0 ||
192 cl->fProperty != (-1)) {
193
195 // The class has dictionary, has gone through some initialization and is now being requested
196 // to be filled by a TProtoClass.
197 // This can be due to:
198 // (a) A duplicate dictionary for a class (with or without a rootpcm associated with)
199 // (b) The TClass was created before the registration of the rootpcm ** and ** it was
200 // attempted to be used before this registration
201
202 // This is technically an error
203 // but we either already warned that there is a 2nd dictionary for the class (in TClassTable::Add)
204 // or this is the same (but now emptied) TProtoClass instance as before.
205 // We return false, since we are doing no actual change to the TClass instance and thus
206 // if a caller was hoping for 'improvement' in the state of the TClass instance, it did not
207 // happen.
208 return kFALSE;
209
210 if (cl->GetCollectionType() != ROOT::kNotSTL) {
211 // We are in the case of collection, duplicate dictionary are allowed
212 // (and even somewhat expected since they can be auto asked for).
213 // They do not always have a TProtoClass for them. In particular
214 // the one that are pre-generated in the ROOT build (in what was once
215 // called the cintdlls) do not have a pcms, neither does vector<string>
216 // which is part of libCore proper.
217 if (gDebug > 0)
218 Info("FillTClass", "Returning w/o doing anything. %s is a STL collection.",cl->GetName());
219 return kFALSE;
220 }
221 if (cl->fProperty != -1 && (cl->fProperty & kIsNamespace)) {
222 if (gDebug > 0)
223 Info("FillTClass", "Returning w/o doing anything. %s is a namespace.",cl->GetName());
224 return kFALSE;
225 }
226 Error("FillTClass", "TClass %s already initialized!", cl->GetName());
227 return kFALSE;
228 }
229 if (cl->fHasRootPcmInfo) {
230 Fatal("FillTClass", "Filling TClass %s a second time but none of the info is in the TClass instance ... ", cl->GetName());
231 }
232 if (gDebug > 1) Info("FillTClass","Loading TProtoClass for %s - %s",cl->GetName(),GetName());
233
234 if (fPRealData.size() > 0) {
235
236 // A first loop to retrieve the mother classes before starting to
237 // fill this TClass instance. This is done in order to avoid recursions
238 // for example in presence of daughter and mother class present in two
239 // dictionaries compiled in two different libraries which are not linked
240 // one with each other.
241 for (auto &element : fPRealData) {
242 // if (element->IsA() == TObjString::Class()) {
243 if (element.IsAClass() ) {
244 if (gDebug > 1) Info("","Treating beforehand mother class %s",GetClassName(element.fClassIndex));
246
247 TClass::GetClass(GetClassName(element.fClassIndex));
248 }
249 }
250 }
251
252
253 //this->Dump();
254
255 // Copy only the TClass bits.
256 // not bit 13 and below and not bit 24 and above, just Bits 14 - 23
257 UInt_t newbits = TestBits(0x00ffc000);
258 cl->ResetBit(0x00ffc000);
259 cl->SetBit(newbits);
260
261 cl->fName = this->fName;
262 cl->fTitle = this->fTitle;
263 cl->fBase = fBase;
264
265 // fill list of data members in TClass
266 //if (cl->fData) { cl->fData->Delete(); delete cl->fData; }
267 cl->fData = new TListOfDataMembers(fData);
268 // for (auto * dataMember : fData) {
269 // //printf("add data member for class %s - member %s \n",GetName(), dataMember->GetName() );
270 // cl->fData->Add(dataMember);
271 // }
272 // // set loaded bit to true to avoid re-loading the data members
273 // cl->fData->SetIsLoaded();*
274
275 //cl->fData = (TListOfDataMembers*)fData;
276
277 // The TDataMember were passed along.
278 fData.clear();
279
280 // We need to fill enums one by one to initialise the internal map which is
281 // transient
282 {
283 auto temp = cl->fEnums.load() ? cl->fEnums.load() :
285 if (fEnums) {
286 for (TObject* enumAsTObj : *fEnums){
287 temp->Add((TEnum*) enumAsTObj);
288 }
289 // We did not transfer the container itself, let remove it from memory without deleting its content.
290 fEnums->Clear();
291 delete fEnums;
292 fEnums = nullptr;
293 }
294 cl->fEnums = temp;
295 }
296
297 if (cl->fSizeof != -1 && cl->fSizeof != fSizeof) {
298 Error("FillTClass",
299 "For %s the sizeof provided by GenerateInitInstance (%d) is different from the one provided by TProtoClass (%d)",
300 cl->GetName(), cl->fSizeof, fSizeof);
301 } else
302 cl->fSizeof = fSizeof;
303 cl->fCheckSum = fCheckSum;
304 cl->fCanSplit = fCanSplit;
305 cl->fProperty = fProperty;
308
309 // Update pointers to TClass
310 if (cl->fBase.load()) {
311 for (auto base: *cl->fBase) {
312 ((TBaseClass*)base)->SetClass(cl);
313 }
314 }
315 if (cl->fData) {
316 for (auto dm: *cl->fData) {
317 ((TDataMember*)dm)->SetClass(cl);
318 }
319 ((TListOfDataMembers*)cl->fData)->SetClass(cl);
320 }
321 if (cl->fEnums.load()) {
322 for (auto en: *cl->fEnums) {
323 ((TEnum*)en)->SetClass(cl);
324 }
325 ((TListOfEnums*)cl->fEnums)->SetClass(cl);
326 }
327
328
329 TClass* currentRDClass = cl;
330 TRealData * prevRealData = nullptr;
331 int prevLevel = 0;
332 bool first = true;
333 if (fPRealData.size() > 0) {
334 size_t element_next_idx = 0;
335 for (auto &element : fPRealData) {
336 ++element_next_idx;
337 //if (element->IsA() == TObjString::Class()) {
338 if (element.IsAClass() ) {
339 // We now check for the TClass entry, w/o loading. Indeed we did that above.
340 // If the class is not found, it means that really it was not selected and we
341 // replace it with an empty placeholder with the status of kForwardDeclared.
342 // Interactivity will be of course possible but if IO is attempted, a warning
343 // will be issued.
345
346 const char *classname = GetClassName(element.fClassIndex);
347
348 // Disable autoparsing which might be triggered by the use of ResolvedTypedef
349 // and the fallback new TClass() below.
350 currentRDClass = TClass::GetClass(classname, false /* Load */ );
351 //printf("element is a class - name %s - index %d %s \n ",currentRDClass->GetName(), element.fClassIndex, GetClassName(element.fClassIndex) );
352 if (!currentRDClass && !element.TestFlag(TProtoRealData::kIsTransient)) {
353
354 if (TClassEdit::IsStdPair(classname) && element.fDMIndex == 0 && fPRealData.size() > element_next_idx) {
355 size_t hint_offset = fPRealData[element_next_idx].fOffset - element.fOffset;
356 size_t hint_size = 0;
357 // Now find the size.
358 size_t end = element_next_idx + 1;
359 while (end < fPRealData.size() && fPRealData[end].fLevel > element.fLevel)
360 ++end;
361 if (end < fPRealData.size()) {
362 hint_size = fPRealData[end].fOffset - element.fOffset;
363 } else {
364 hint_size = fSizeof - element.fOffset;
365 }
366 currentRDClass = TClass::GetClass(classname, true, false, hint_offset, hint_size);
367 }
368 if (!currentRDClass) {
369 if (gDebug > 1)
370 Info("FillTClass()",
371 "Cannot find TClass for %s; Creating an empty one in the kForwardDeclared state.", classname);
372 currentRDClass = new TClass(classname, 1, TClass::kForwardDeclared, true /*silent*/);
373 }
374 }
375 }
376 //else {
377 if (!currentRDClass) continue;
378 //TProtoRealData* prd = (TProtoRealData*)element;
379 // pass a previous real data only if depth
380
381 if (TRealData* rd = element.CreateRealData(currentRDClass, cl,prevRealData, prevLevel)) {
382 if (first) {
383 //LM: need to do here because somehow fRealData is destroyed when calling TClass::GetListOfDataMembers()
384 if (cl->fRealData) {
385 Info("FillTClass","Real data for class %s is not empty - make a new one",cl->GetName() );
386 delete cl->fRealData;
387 }
388 cl->fRealData = new TList(); // FIXME: this should really become a THashList!
389 first = false;
390 }
391
392 cl->fRealData->AddLast(rd);
393 prevRealData = rd;
394 prevLevel = element.fLevel;
395
396 }
397 //}
398 }
399 }
400 else {
401 if (cl->fRealData) {
402 Info("FillTClas","Real data for class %s is not empty - make a new one. Class has no Proto-realdata",cl->GetName() );
403 delete cl->fRealData;
404 }
405 cl->fRealData = new TList(); // FIXME: this should really become a THashList!
406 }
407
408 cl->SetStreamerImpl();
409
410 // set to zero in order not to delete when protoclass is deleted
411 fBase = nullptr;
412 //fData = 0;
413 fEnums = nullptr;
414
415 fPRealData.clear();
416 fPRealData.shrink_to_fit(); // to reset the underlying allocate space
417
418 // if (fPRealData) fPRealData->Delete();
419 // delete fPRealData;
420 // fPRealData = 0;
421
423 return kTRUE;
424}
425
426////////////////////////////////////////////////////////////////////////////////
427
429 //TNamed(rd->GetDataMember()->GetName(), rd->GetName()),
430 //TNamed(),
431 //fName(rd->GetDataMember()->GetName()),
432 //fTitle(rd->GetName()),
433 fOffset(rd->GetThisOffset()),
434 fDMIndex(-1),
435 fLevel(0),
436 fClassIndex(-1),
437 fStatusFlag(0)
438{
439 TDataMember * dm = rd->GetDataMember();
440 assert(rd->GetDataMember());
441 TClass * cl = dm->GetClass();
442 assert(cl != nullptr);
443 fDMIndex = DataMemberIndex(cl,dm->GetName());
444 //printf("Index of data member %s for class %s is %d \n",dm->GetName(), cl->GetName() , fDMIndex);
445 TString fullDataMemberName = rd->GetName(); // full data member name (e.g. fXaxis.fNbins)
446 fLevel = fullDataMemberName.CountChar('.');
447
448 if (fullDataMemberName.Contains("*") ) SetFlag(kIsPointer);
449
450 // Initialize this from a TRealData object.
451 SetFlag(kIsObject, rd->IsObject());
453}
454
455////////////////////////////////////////////////////////////////////////////////
456/// Destructor to pin vtable.
457///if (gErrorIgnoreLevel==-2) printf("destroy real data %s - ",GetName());
458
460{
461}
462
463////////////////////////////////////////////////////////////////////////////////
464/// Create a TRealData from this, with its data member coming from dmClass.
465/// find data member from protoclass
466
468 TClass* parent, TRealData *prevData, int prevLevel) const
469{
470
471 //TDataMember* dm = (TDataMember*)dmClass->GetListOfDataMembers()->FindObject(fName);
472 TDataMember* dm = TProtoClass::FindDataMember(dmClass, fDMIndex);
473
474 if (!dm && dmClass->GetState()!=TClass::kForwardDeclared && !dmClass->fIsSyntheticPair) {
475 ::Error("CreateRealData",
476 "Cannot find data member # %d of class %s for parent %s!", fDMIndex, dmClass->GetName(),
477 parent->GetName());
478 return nullptr;
479 }
480
481 // here I need to re-construct the realdata full name (e.g. fAxis.fNbins)
482
483 TString realMemberName;
484 // keep an empty name if data member is not found
485 if (dm) realMemberName = dm->GetName();
486 else if (dmClass->fIsSyntheticPair) {
487 realMemberName = (fDMIndex == 0) ? "first" : "second";
488 }
489 if (TestFlag(kIsPointer) )
490 realMemberName = TString("*")+realMemberName;
491 else if (dm){
492 if (dm->GetArrayDim() > 0) {
493 // in case of array (like fMatrix[2][2] we need to add max index )
494 // this only in case of it os not a pointer
495 for (int idim = 0; idim < dm->GetArrayDim(); ++idim)
496 realMemberName += TString::Format("[%d]",dm->GetMaxIndex(idim) );
497 } else if (TClassEdit::IsStdArray(dm->GetTypeName())) {
498 std::string typeNameBuf;
499 Int_t ndim = dm->GetArrayDim();
500 std::array<Int_t, 5> maxIndices; // 5 is the maximum supported in TStreamerElement::SetMaxIndex
502 typeNameBuf,
503 maxIndices,
504 ndim);
505 for (Int_t idim = 0; idim < ndim; ++idim) {
506 realMemberName += TString::Format("[%d]",maxIndices[idim] );
507 }
508 }
509 }
510
511 if (prevData && fLevel > 0 ) {
512 if (fLevel-prevLevel == 1) // I am going down 1 level
513 realMemberName = TString::Format("%s.%s",prevData->GetName(), realMemberName.Data() );
514 else if (fLevel <= prevLevel) { // I am at the same level
515 // need to strip out prev name
516 std::string prevName = prevData->GetName();
517 // we strip the prev data member name from the full name
518 std::string parentName;
519 for (int i = 0; i < prevLevel-fLevel+1; ++i) {
520 parentName = prevName.substr(0, prevName.find_last_of(".") );
521 prevName = parentName;
522 }
523
524 // now we need to add the current name
525 realMemberName = TString::Format("%s.%s",parentName.c_str(), realMemberName.Data() );
526 }
527 }
528
529 //printf("adding new realdata for class %s : %s - %s %d %d \n",dmClass->GetName(), realMemberName.Data(), dm->GetName(),fLevel, fDMIndex );
530
531 TRealData* rd = new TRealData(realMemberName, fOffset, dm);
532 if (TestFlag(kIsTransient)) {
534 }
535 rd->SetIsObject(TestFlag(kIsObject) );
536 return rd;
537}
538
539////////////////////////////////////////////////////////////////////////////////
540
542{
543 TList * dmList = cl->GetListOfDataMembers();
544
545 // we cannot use IndexOf because order is guaranteed only for non-static data member
546 Int_t index = 0;
547 for ( auto * obj : *dmList) {
548 TDataMember * dm = (TDataMember *) obj;
549 if (!dm ) continue;
550 if (dm->Property() & kIsStatic) continue;
551 if ( TString(dm->GetName()) == TString(name) )
552 return index;
553 index++;
554 }
555 ::Error("TProtoClass::DataMemberIndex","data member %s is not found in class %s",name, cl->GetName());
556 dmList->ls();
557 return -1;
558}
559////////////////////////////////////////////////////////////////////////////////
560
562{
563 TList * dmList = cl->GetListOfDataMembers(false);
564
565 // we cannot use IndexOf because order is guaranteed only for non-static data member
566 Int_t i = 0;
567 for ( auto * obj : *dmList) {
568 TDataMember * dm = (TDataMember *) obj;
569 if (!dm ) continue;
570 if (dm->Property() & kIsStatic) continue;
571 if (i == index)
572 return dm;
573 i++;
574 }
576 ::Error("TProtoClass::FindDataMember","data member with index %d is not found in class %s",index,cl->GetName());
577 return nullptr;
578}
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:81
EState GetState() const
Definition: TClass.h:486
ROOT::ESTLType GetCollectionType() const
Return the 'type' of the STL the TClass is representing.
Definition: TClass.cxx:2887
EState fState
cached of the streaming method to use
Definition: TClass.h:275
Int_t fStreamerType
saved info to call Streamer
Definition: TClass.h:274
TList * fRealData
Definition: TClass.h:201
std::atomic< TList * > fBase
Definition: TClass.h:202
Bool_t fIsSyntheticPair
Indicates whether this class can be split or not. Values are -1, 0, 1, 2.
Definition: TClass.h:251
std::atomic< UInt_t > fCheckSum
Definition: TClass.h:220
Int_t fCanSplit
Definition: TClass.h:247
std::atomic< TListOfEnums * > fEnums
Definition: TClass.h:206
Bool_t HasInterpreterInfo() const
Definition: TClass.h:408
std::atomic< Long_t > fProperty
Definition: TClass.h:253
void BuildRealData(void *pointer=nullptr, Bool_t isTransient=kFALSE)
Build a full list of persistent data members.
Definition: TClass.cxx:2031
TList * GetListOfDataMembers(Bool_t load=kTRUE)
Return list containing the TDataMembers of a class.
Definition: TClass.cxx:3759
TList * GetListOfRealData() const
Definition: TClass.h:451
Longptr_t fOffsetStreamer
Properties that can only be evaluated at run-time.
Definition: TClass.h:273
Int_t fSizeof
Definition: TClass.h:244
std::atomic< TListOfDataMembers * > fData
Definition: TClass.h:203
ClassInfo_t * GetClassInfo() const
Definition: TClass.h:431
TVirtualCollectionProxy * GetCollectionProxy() const
Return the proxy describing the collection (if any).
Definition: TClass.cxx:2898
void SetStreamerImpl()
Internal routine to set fStreamerImpl based on the value of fStreamerType.
Definition: TClass.cxx:6204
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:6075
@ kHasTClassInit
Definition: TClass.h:128
@ kForwardDeclared
Definition: TClass.h:125
Long_t fClassProperty
Property See TClass::Property() for details.
Definition: TClass.h:254
std::atomic< Bool_t > fHasRootPcmInfo
C++ Property of the class (is abstract, has virtual table, etc.)
Definition: TClass.h:257
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:2969
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:41
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
Definition: TObject.h:201
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
Definition: TObject.cxx:768
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:963
virtual void Fatal(const char *method, const char *msgfmt,...) const
Issue fatal error message.
Definition: TObject.cxx:991
Int_t TestBits(UInt_t f) const
Definition: TObject.h:202
void ResetBit(UInt_t f)
Definition: TObject.h:200
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
Definition: TObject.cxx:937
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:509
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:2345
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.