Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TClassTree.cxx
Go to the documentation of this file.
1// @(#)root/gpad:$Id$
2// Author: Rene Brun 01/12/98
3
4/*************************************************************************
5 * Copyright (C) 1995-2000, 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#include "RConfigure.h"
13
14#include "TROOT.h"
15#include "TBuffer.h"
16#include "TClassTree.h"
17#include "TClassTable.h"
18#include "TClass.h"
19#include "TBaseClass.h"
20#include "TDataMember.h"
21#include "TDataType.h"
22#include "TMethod.h"
23#include "TMethodArg.h"
24#include "TVirtualPad.h"
25#include "TPaveClass.h"
26#include "TArrow.h"
27#include "TSystem.h"
28#include "TObjString.h"
29#include "strlcpy.h"
30#include "snprintf.h"
31
32#include <fstream>
33#include <algorithm>
34
36const Int_t kUsedByData = BIT(11);
37const Int_t kUsedByFunc = BIT(12);
38const Int_t kUsedByCode = BIT(13);
40const Int_t kUsingData = BIT(15);
41const Int_t kUsingFunc = BIT(16);
42const Int_t kUsingCode = BIT(17);
43const Int_t kUsingClass = BIT(18);
45const Int_t kIsaPointer = BIT(20);
46const Int_t kIsBasic = BIT(21);
47
49
50/** \class TClassTree
51\ingroup gpad
52
53Draw inheritance tree and their relations for a list of classes.
54
55The following options are supported
56 - Direct inheritance (default)
57 - Multiple inheritance
58 - Composition
59 - References by data members and member functions
60 - References from Code
61
62The list of classes is specified:
63 - either in the TClassTree constructor as a second argument
64 - or the parameter to TClassTree::Draw
65
66Note that the ClassTree viewer can also be started from the canvas
67pull down menu "Classes".
68
69In the list of classes, class names are separated by a ":"
70wildcarding is supported.
71The following formats are supported, eg in TClassTree::Draw
72 1. `Draw("ClassA")`
73 - Draw inheritance tree for ClassA
74 - Show all classes referenced by ClassA
75 2. `Draw("*ClassB")`
76 - Draw inheritance tree for ClassB
77 and all the classes deriving from ClassB
78 3. `Draw(">ClassC")`
79 - Draw inheritance tree for ClassC
80 - Show classes referencing ClassC
81 4. `Draw("ClassD<")`
82 - Draw inheritance tree for ClassD
83 - Show classes referenced by ClassD
84 - Show all classes referencing ClassD
85 5. `Draw("Cla*")`
86 - Draw inheritance tree for all classes with name starting with "Cla"
87 - Show classes referenced by these classes
88 6. `Draw("ClassA:ClassB<")`
89 - Draw inheritance tree for ClassA
90 - Show all classes referenced by ClassA
91 - Draw inheritance tree for ClassB
92 - Show classes referenced by ClassB
93 - Show all classes referencing ClassB
94
95Example: `Draw("TTree<")`
96 - Draw inheritance tree for the Root class TTree
97 - Show all classes referenced by TTree
98 - Show all classes using TTree
99
100By default, only direct inheritance is drawn.
101Use TClassTree::ShowLinks(option) to show additional references
102 - option = "H" to show links to embedded classes
103 - option = "M" to show multiple inheritance
104 - option = "R" to show pointers to other classes from data members
105 - option = "C" to show classes used by the code(implementation) of a class
106
107The following picture is produced directly by:
108~~~ {.cpp}
109 TClassTree ct("ct","*TH1")
110~~~
111It shows all the classes derived from the base class TH1.
112
113\image html gpad_classtree1.png
114
115The TClassTree class uses the services of the class TPaveClass to
116show the class names. By clicking with the right mouse button in
117one TPaveClass object, one can invoke the following functions of TClassTree:
118 - ShowLinks(option) with by default option = "HMR"
119 - Draw(classes). By default the class drawn is the one being pointed
120 - ShowClassesUsedBy(classes) (by default the pointed class)
121 - ShowClassesUsing(classes) (by default the pointed class)
122
123The following picture has been generated with the following statements
124~~~ {.cpp}
125 TClassTree tc1("tc1","TH1");
126 tc1.ShowLinks("HMR");
127~~~
128
129\image html gpad_classtree2.png
130
131Note that in case of embedded classes or pointers to classes,
132the corresponding dashed lines or arrows respectively start
133in the TPaveClass object at an X position reflecting the position
134in the list of data members.
135
136 - References by data members to other classes are show with a full red line
137 - Multiple inheritance is shown with a dashed blue line
138 - "Has a" relation is shown with a dotted cyan line
139 - References from code is shown by a full green line
140
141Use TClassTree::SetSourceDir to specify the search path for source files.
142By default the search path includes the current directory and the subdirectory `src`.
143
144The first time TClassTree::Draw is invoked, all the classes in the
145current application are processed, including the parsing of the code
146to find all classes referenced by the include statements.
147This process may take a few seconds. The following commands will be
148much faster.
149
150A TClassTree object may be saved in a Root file.
151This object can be processed later by a Root program that ignores
152the original classes. This interesting possibility allows to send
153the class structure of an application to a colleague who does not have
154your classes.
155
156Example:
157~~~ {.cpp}
158 TFile f("myClasses.root","recreate")
159 TClassTree *ct = new TClassTree("ct","ATLF*")
160 ct->Write();
161~~~
162You can send at this point the file myClass.root to a colleague who can
163run the following Root basic session
164~~~ {.cpp}
165 TFile f("myClass.root"); //connect the file
166 tt.ls(); //to list all classes and titles
167 tt.Draw("ATLFDisplay") //show class ATLFDisplay with all its dependencies
168~~~
169At this point, one has still access to all the classes present
170in the original session and select any combination of these classes
171to be displayed.
172*/
173
174////////////////////////////////////////////////////////////////////////////////
175/// TClassTree default constructor.
176
178{
179 SetLabelDx();
180 SetYoffset(0);
181 SetSourceDir(".:src");
182}
183
184////////////////////////////////////////////////////////////////////////////////
185/// TClassTree constructor.
186
187TClassTree::TClassTree(const char *name, const char *classes)
188 :TNamed(name,classes)
189{
190 SetLabelDx();
191 SetYoffset(0);
192 SetSourceDir(".:src");
193
194 // draw list of classes (if specified)
195 if (classes && strlen(classes)) {
196 fClasses = classes;
197 Draw();
198 }
199}
200
201////////////////////////////////////////////////////////////////////////////////
202/// TClassTree default destructor.
203
205{
206 for (Int_t i=0;i<fNclasses;i++) {
207 //delete fOptions[i];
208 if (fLinks[i]) fLinks[i]->Delete();
209 //delete fLinks[i];
210 //if (fDerived[i]) {delete [] fDerived[i]; fDerived[i] = 0;}
211 }
212 delete [] fCnames;
213 delete [] fCtitles;
214 delete [] fCstatus;
215 delete [] fParents;
216 delete [] fCparent;
217 delete [] fCpointer;
218 delete [] fOptions;
219 delete [] fLinks;
220 delete [] fDerived;
221 delete [] fNdata;
222}
223
224////////////////////////////////////////////////////////////////////////////////
225/// Draw the inheritance tree and relations for the list of classes
226/// see this class header for the syntax and examples
227
228void TClassTree::Draw(const char *classes)
229{
230 if (!gPad) {
231 gROOT->MakeDefCanvas();
232 }
233 Init();
234 if (classes && strlen(classes)) fClasses = classes;
235 for (Int_t i=0;i<fNclasses;i++) {
236 fCstatus[i] = 0;
237 fCparent[i] = -1;
238 }
239 Paint();
240}
241
242////////////////////////////////////////////////////////////////////////////////
243/// Find class number corresponding to classname in list of local classes
244
245Int_t TClassTree::FindClass(const char *classname)
246{
247 for (Int_t i=0;i<fNclasses;i++) {
248 if(!fCnames[i]->CompareTo(classname)) return i;
249 }
250 return -1;
251}
252
253////////////////////////////////////////////////////////////////////////////////
254/// Select all classes used/referenced by the class number iclass
255
257{
258 fCstatus[iclass] = 1;
259 Int_t i;
260 TObjString *os;
261 TList *los = fLinks[iclass];
262 TIter next(los);
263 while ((os = (TObjString*)next())) {
264 i = FindClass(os->GetName());
265 if (i < 0) continue;
266 if (fCstatus[i]) continue;
267 Int_t udata = os->TestBit(kUsedByData);
268 Int_t ufunc = os->TestBit(kUsedByFunc);
269 Int_t ucode = os->TestBit(kUsedByCode);
270 Int_t uclass = os->TestBit(kUsedByClass);
271 if (udata || ufunc || ucode || uclass) {
272 fCstatus[i] = 1;
273 }
274 }
275}
276
277////////////////////////////////////////////////////////////////////////////////
278/// Select all classes using/referencing the class number iclass
279
281{
282 // loop on all classes
283 fCstatus[iclass] = 1;
284 Int_t i;
285 TObjString *os;
286 TList *los = fLinks[iclass];
287 TIter next(los);
288 while ((os = (TObjString*)next())) {
289 i = FindClass(os->GetName());
290 if (i < 0) continue;
291 if (fCstatus[i]) continue;
292 Int_t udata = os->TestBit(kUsingData);
293 Int_t ufunc = os->TestBit(kUsingFunc);
294 Int_t ucode = os->TestBit(kUsingCode);
295 Int_t uclass = os->TestBit(kUsingClass);
296 if (udata || ufunc || ucode || uclass) {
297 fCstatus[i] = 1;
298 }
299 }
300}
301
302////////////////////////////////////////////////////////////////////////////////
303/// Search the TPaveClass object in the pad with label=classname
304/// returns the x and y position of the center of the pave.
305
306void TClassTree::FindClassPosition(const char *classname, Float_t &x, Float_t &y)
307{
308 TIter next(gPad->GetListOfPrimitives());
309 TObject *obj;
311 while((obj=next())) {
312 if (obj->InheritsFrom(TPaveClass::Class())) {
313 pave = (TPaveClass*)obj;
314 if (!strcmp(pave->GetLabel(),classname)) {
315 x = 0.5*(pave->GetX1() + pave->GetX2());
316 y = 0.5*(pave->GetY1() + pave->GetY2());
317 return;
318 }
319 }
320 }
321 x = y = 0;
322}
323
324////////////////////////////////////////////////////////////////////////////////
325/// Initialize the data structures
326
328{
329 if (fNclasses) return;
330
331 // fill the classes structures
332 gClassTable->Init();
333 fNclasses = gClassTable->Classes(); //number of classes in the application
334 fCnames = new TString*[fNclasses]; //class names
335 fCtitles = new TString*[fNclasses]; //class titles (given in ClassDef)
336 fCstatus = new Int_t[fNclasses]; //=0 if not used in current expression
337 fParents = new Int_t[fNclasses]; //parent number of classes (permanent)
338 fCparent = new Int_t[fNclasses]; //parent number of classes (local to expression)
339 fNdata = new Int_t[fNclasses]; //number of data members per class
340 fCpointer = new TClass*[fNclasses]; //pointers to the TClass
341 fOptions = new TString*[fNclasses]; //options per class
342 fLinks = new TList*[fNclasses]; //list of classes referencing/referenced
343 fDerived = new char*[fNclasses]; //derivation matrix
344
345 Int_t i,j;
346 for (i=0;i<fNclasses;i++) {
347 fCnames[i] = new TString(gClassTable->Next());
348 fCpointer[i] = TClass::GetClass(fCnames[i]->Data());
349 fCtitles[i] = new TString(fCpointer[i]->GetTitle());
350 fCstatus[i] = 0;
351 fOptions[i] = new TString("ID");
352 fLinks[i] = new TList();
353 fDerived[i] = new char[fNclasses];
354 }
356 TClass *cl;
357 for (i=0;i<fNclasses;i++) {
359 if (lm) fNdata[i] = lm->GetSize();
360 else fNdata[i] = 0;
361 // build derivation matrix
362 char *derived = fDerived[i];
363 for (j=0;j<fNclasses;j++) {
364 derived[j] = 0;
365 if (fCpointer[i]->InheritsFrom(fCpointer[j])) {
366 derived[j] = 1;
367 }
368 }
369 //build list of class parent
370 fParents[i] = -1;
372 if (!lb) continue;
373 clbase = (TBaseClass*)lb->First();
374 if (!clbase) continue;
375 cl = (TClass*)clbase->GetClassPointer();
376 for (j=0;j<fNclasses;j++) {
377 if(cl == fCpointer[j]) {
378 fParents[i] = j;
379 break;
380 }
381 }
382 }
383 //now the real & hard stuff
384 for (i=0;i<fNclasses;i++) {
385 ScanClasses(i);
386 }
387}
388
389////////////////////////////////////////////////////////////////////////////////
390/// list classes names and titles
391
393{
394 char line[500];
395 for (Int_t i=0;i<fNclasses;i++) {
396 snprintf(line,500,"%s%s",fCnames[i]->Data(),"...........................");
397 snprintf(&line[30],460,"%s",fCtitles[i]->Data());
398 line[79] = 0;
399 printf("%5d %s\n",i,line);
400 }
401}
402
403////////////////////////////////////////////////////////////////////////////////
404/// set bit abit in class classname in list los
405
406TObjString *TClassTree::Mark(const char *classname, TList *los, Int_t abit)
407{
408 if (!los) return nullptr;
409 TObjString *os = (TObjString*)los->FindObject(classname);
410 if (!os) {
411 os = new TObjString(classname);
412 los->Add(os);
413 }
414 os->SetBit(abit);
415 return os;
416}
417
418////////////////////////////////////////////////////////////////////////////////
419/// Draw the current class setting in fClasses and fStatus
420
422{
423 //delete primitives belonging to a previous paint
424 if (gPad) {
425 TIter next(gPad->GetListOfPrimitives());
426 TObject *obj;
427 while((obj=next())) {
428 if (obj->TestBit(kIsClassTree)) delete obj;
429 }
430 }
431
433 if (nch == 0) return;
434 char *classes = new char[nch+1];
435 fNsons.resize(fNclasses, 0);
436 fNtsons.resize(fNclasses, 0);
437 strlcpy(classes,GetClasses(),nch+1);
438 Int_t i,j;
439 char *derived;
440 char *ptr = strtok(classes,":");
441 //mark referenced classes
442 while (ptr) {
443 nch = strlen(ptr);
444 if (ptr[0] == '*') {
445 j = FindClass(&ptr[1]);
446 if (j >= 0) {
447 for (i=0;i<fNclasses;i++) {
448 derived = fDerived[i];
449 if(derived[j]) fCstatus[i] = 1;
450 }
451 }
452 } else if (ptr[0] == '>') {
453 for (i=0;i<fNclasses;i++) {
454 if(fCnames[i]->Contains(&ptr[1])) {
456 fCstatus[i] = 2;
457 break;
458 }
459 }
460 } else if (ptr[nch-1] == '<') {
461 ptr[nch-1] = 0;
462 for (i=0;i<fNclasses;i++) {
463 if(fCnames[i]->Contains(ptr)) {
466 fCstatus[i] = 2;
467 break;
468 }
469 }
470 } else if (ptr[nch-1] == '*') {
471 ptr[nch-1] = 0;
472 for (i=0;i<fNclasses;i++) {
473 if(fCnames[i]->Contains(ptr)) fCstatus[i] = 1;
474 }
475 } else {
476 for (i=0;i<fNclasses;i++) {
477 if(!fCnames[i]->CompareTo(ptr)) {
479 fCstatus[i] = 2;
480 break;
481 }
482 }
483 }
484 ptr = strtok(nullptr, ":");
485 }
486 //mark base classes of referenced classes
487 for (i=0;i<fNclasses;i++) {
488 fNsons[i] = fNtsons[i] = 0;
489 }
490 for (i=0;i<fNclasses;i++) {
491 if (fCstatus[i] == 0) continue;
492 derived = fDerived[i];
493 for (j=0;j<fNclasses;j++) {
494 if (j == i) continue;
495 if(derived[j]) {
496 fCstatus[j] = 1;
497 }
498 }
499 }
500 //find parent class number for selected classes
501 for (i=0;i<fNclasses;i++) {
502 if (fCstatus[i] == 0) continue;
503 j = fParents[i];
504 if (j >=0 ) {
505 fCparent[i] = j;
506 fNsons[j]++;
507 }
508 }
509 //compute total number of sons for each node
510 Int_t maxlev = 1;
511 Int_t icl,ip;
512 for (i=0;i<fNclasses;i++) {
513 if (fCstatus[i] == 0) continue;
514 if (fNsons[i] != 0) continue;
515 icl = i;
516 Int_t nlevel = 1;
517 while (fCparent[icl] >= 0) {
518 nlevel++;
519 if (nlevel > maxlev) maxlev = nlevel;
520 ip = fCparent[icl];
521 fNtsons[ip]++;
522 icl = ip;
523 }
524 }
525
526 //compute levels, number and list of sons
527 Int_t ndiv=0;
528 Int_t nmore = 0;
529 for (i=0;i<fNclasses;i++) {
530 if (fCstatus[i] == 0) continue;
531 if (fCparent[i] < 0) {
532 ndiv += fNtsons[i]+1;
533 nmore++;
534 }
535 }
536 ndiv++;
537
538 // We are now ready to draw the active nodes
539 Float_t xmin = gPad->GetX1();
540 Float_t xmax = gPad->GetX2();
541 Float_t ymin = gPad->GetY1();
542 Float_t ymax = gPad->GetY2();
543 Float_t ytop = gYsize/20;
544 gXsize = xmax - xmin;
545 gYsize = ymax - ymin;
546 gDy = (gYsize-ytop)/(ndiv);
547 if (gDy > gYsize/10.) gDy = gYsize/10.;
548 gDx = 0.9*gXsize/5;
549 if (maxlev > 5) gDx = 0.97*gXsize/maxlev;
550 Float_t y = ymax -ytop;
552 if (gLabdx > 0.95*gDx) gLabdx = 0.95*gDx;
553 gLabdy = 0.3*gDy;
554 gDxx = 0.5*gXsize/26.;
557 Int_t dxpixels = gPad->XtoAbsPixel(gLabdx) - gPad->XtoAbsPixel(0);
558 Int_t dypixels = gPad->YtoAbsPixel(0) - gPad->YtoAbsPixel(gLabdy);
559 gCsize = dxpixels/(10.*dypixels);
560 gCsize = std::max(gCsize,Float_t(0.75));
561 gCsize = std::min(gCsize,Float_t(1.1));
562 // draw classes level 0
563 for (i=0;i<fNclasses;i++) {
564 if (fCstatus[i] == 0) continue;
565 if (fCparent[i] < 0) {
566 y -= gDy+0.5*fNtsons[i]*gDy;
567 if (!fCnames[i]->CompareTo("TObject")) y += ymore;
568 PaintClass(i,xleft,y);
569 y -= 0.5*fNtsons[i]*gDy;
570 }
571 }
572
573 // show all types of links corresponding to selected options
574 if (fShowCod) ShowCod();
575 if (fShowHas) ShowHas();
576 if (fShowMul) ShowMul();
577 if (fShowRef) ShowRef();
578
579 nch = strlen(GetClasses());
580 xmax = 0.3;
581 if (nch > 20) xmax = 0.5;
582 if (nch > 50) xmax = 0.7;
583 if (nch > 70) xmax = 0.9;
584 TPaveClass *ptitle = new TPaveClass(xmin +0.1*gXsize/26.
585 ,ymin+gYsize-0.9*gYsize/20.
587 ,ymin+gYsize-0.1*gYsize/26.
588 ,GetClasses(),this);
589 ptitle->SetFillColor(42);
590 ptitle->SetBit(kIsClassTree);
591 ptitle->Draw();
592
593 //cleanup
594 delete [] classes;
595 fNsons.clear();
596 fNtsons.clear();
597}
598
599////////////////////////////////////////////////////////////////////////////////
600/// Paint one class level
601
603{
604 Float_t u[2],yu=0,yl=0;
605 Int_t ns = fNsons[iclass];
606 u[0] = xleft;
607 u[1] = u[0]+gDxx;
608 if(ns != 0) u[1] = u[0]+gDx;
609 TLine *line = new TLine(u[0],y,u[1],y);
611 line->Draw();
612 Int_t icobject = FindClass("TObject");
613 TPaveClass *label = new TPaveClass(xleft+gDxx,y-gLabdy,xleft+gLabdx,y+gLabdy,fCnames[iclass]->Data(),this);
614 char *derived = fDerived[iclass];
615 if (icobject >= 0 && !derived[icobject]) label->SetFillColor(30);
616 if (fCstatus[iclass] > 1) label->SetFillColor(kYellow);
617 label->SetTextSize(gCsize);
618 label->SetBit(kIsClassTree);
619 label->SetToolTipText(fCtitles[iclass]->Data(),500);
620 label->Draw();
621 if (ns == 0) return;
622
623 // drawing sons
624 y += 0.5*fNtsons[iclass]*gDy;
625 Int_t first =0;
626 for (Int_t i=0;i<fNclasses;i++) {
627 if(fCparent[i] != iclass) continue;
628 if (fNtsons[i] > 1) y -= 0.5*fNtsons[i]*gDy;
629 else y -= 0.5*gDy;
630 if (!first) {first=1; yu = y;}
631 PaintClass(i,u[1],y);
632 yl = y;
633 if (fNtsons[i] > 1) y -= 0.5*fNtsons[i]*gDy;
634 else y -= 0.5*gDy;
635 }
636 if (ns == 1) return;
637 line = new TLine(u[1],yl,u[1],yu);
639 line->Draw();
640}
641
642////////////////////////////////////////////////////////////////////////////////
643/// save current configuration in a Root file
644/// if filename is blank, the name of the file will be the current objectname.root
645/// all the current settings are preserved
646/// the Root file produced can be looked at by a another Root session
647/// with no access to the original classes.
648/// By default a message is printed. Specify option "Q" to remove the message
649
651{
652 if (gDirectory) gDirectory->SaveObjectAs(this,filename,option);
653}
654
655////////////////////////////////////////////////////////////////////////////////
656/// Select all classes used by/referenced/referencing the class number iclass
657/// and build the list of these classes
658
660{
661 Int_t ic, icl;
662 TList *los = fLinks[iclass];
663 TList *losref = nullptr;
664 TObjString *os;
665
666 // scan list of data members
667 // =========================
668 TClass *cl = fCpointer[iclass];
669 TDataMember *dm;
671 if (lm) {
672 TIter next(lm);
673 Int_t imember = 0;
674 while ((dm = (TDataMember *) next())) {
675 imember++;
676 ic = FindClass(dm->GetTypeName());
677 if (ic < 0 || ic == iclass) continue;
678 losref = fLinks[ic];
679 os = Mark(fCnames[ic]->Data(),los,kUsedByData);
680 if (os) {
681 os->SetBit(kIsaPointer,dm->IsaPointer());
682 os->SetBit(kIsBasic,dm->IsBasic());
683 os->SetUniqueID(imember);
684 }
685 Mark(fCnames[iclass]->Data(),losref,kUsingData);
686 }
687 }
688
689 // scan base classes
690 // =================
691 char *derived = fDerived[iclass];
693 Int_t numb = 0;
694 TList *lb = fCpointer[iclass]->GetListOfBases();
695 if (lb) {
696 TIter nextb(lb);
697 while ((clbase = (TBaseClass*)nextb())) {
698 numb++;
699 if (numb == 1) continue;
700 ic = FindClass(clbase->GetName());
701 derived[ic] = 2;
702 }
703 for (ic=0;ic<fNclasses;ic++) {
704 if (ic == iclass) continue;
705 if (derived[ic]) {
706 losref = fLinks[ic];
707 Mark(fCnames[ic]->Data(),los,kUsedByClass);
708 Mark(fCnames[iclass]->Data(),losref,kUsingClass);
709 }
710 }
711 }
712
713 // scan member functions
714 // =====================
715 char *star, *cref;
718 TList *lf = cl->GetListOfMethods();
719 if (lf) {
720 TIter nextm(lf);
722 while ((method = (TMethod*) nextm())) {
723 // check return type
724 name = method->GetReturnTypeName();
725 star = strstr((char*)name.Data(),"*");
726 if (star) *star = 0;
727 cref = strstr((char*)name.Data(),"&");
728 if (cref) *cref = 0;
729 ic = FindClass(name);
730 if (ic < 0 || ic == iclass) continue;
731 losref = fLinks[ic];
732 Mark(fCnames[ic]->Data(),los,kUsedByFunc);
733 Mark(fCnames[iclass]->Data(),losref,kUsingFunc);
734
735 // now loop on all method arguments
736 // ================================
737 TIter nexta(method->GetListOfMethodArgs());
738 while ((methodarg = (TMethodArg*) nexta())) {
739 name = methodarg->GetTypeName();
740 star = strstr((char*)name.Data(),"*");
741 if (star) *star = 0;
742 cref = strstr((char*)name.Data(),"&");
743 if (cref) *cref = 0;
744 ic = FindClass(name);
745 if (ic < 0 || ic == iclass) continue;
746 losref = fLinks[ic];
747 Mark(fCnames[ic]->Data(),los,kUsedByFunc);
748 Mark(fCnames[iclass]->Data(),losref,kUsingFunc);
749 }
750 }
751 }
752
753 // Look into the source code to search the list of includes
754 // here we assume that include file names are classes file names
755 // we stop reading the code when
756 // - a class member function is found
757 // - any class constructor is found
758 if (!cl->GetImplFileName() || !cl->GetImplFileName()[0])
759 return;
760
763 if (!sourceName) return;
764 Int_t ncn = strlen(fCnames[iclass]->Data())+2;
765 char *cname = new char[ncn+1];
766 snprintf(cname,ncn,"%s::",fCnames[iclass]->Data());
767 // open source file
768 std::ifstream sourceFile;
769 sourceFile.open( sourceName, std::ios::in );
770 Int_t nlines = 0;
771 if( sourceFile.good() ) {
772 const Int_t kMAXLEN=1500;
773 char line[kMAXLEN];
774 while( !sourceFile.eof() ) {
775 sourceFile.getline( line, kMAXLEN-1 );
776 if( sourceFile.eof() ) break;
777 Int_t nblank = strspn(line," ");
778 if (!strncmp(&line[nblank],"//",2)) continue;
779 char *cc = strstr(line,"::");
780 if (cc) {
781 *cc = 0;
782 if (!strncmp(&line[nblank],cname,ncn)) break; //reach class member function
784 if (!strncmp(&line[nblank],cc+2,nl)) break; //reach any class constructor
785 }
786 nlines++; if (nlines > 1000) break;
787 char *inc = strstr(line,"#include");
788 if (inc) {
789 char *ch = strstr(line,".h");
790 if (!ch) continue;
791 *ch = 0;
792 char *start = strstr(line,"<");
793 if (!start) start = strstr(line,"\"");
794 if (!start) continue;
795 start++;
796 while ((start < ch) && (*start == ' ')) start++;
797 icl = FindClass(start);
798 if (icl < 0 || icl == iclass) continue;
799 // mark this include being used by this class
800 losref = fLinks[icl];
801 Mark(fCnames[icl]->Data(),los,kUsedByCode1);
802 Mark(fCnames[icl]->Data(),los,kUsedByCode);
803 Mark(fCnames[iclass]->Data(),losref,kUsingCode);
804 // and also the base classes of the class in the include
806 for (ic=0;ic<fNclasses;ic++) {
807 if (ic == icl) continue;
808 if (derived[ic]) {
809 losref = fLinks[ic];
810 Mark(fCnames[ic]->Data(),los,kUsedByCode);
811 Mark(fCnames[iclass]->Data(),losref,kUsingCode);
812 }
813 }
814 }
815 }
816 }
817 delete [] cname;
818 delete [] sourceName;
819 sourceFile.close();
820}
821
822////////////////////////////////////////////////////////////////////////////////
823/// Set the list of classes for which the hierarchy is to be drawn
824/// See Paint for the syntax
825
826void TClassTree::SetClasses(const char *classes, Option_t *)
827{
828 if (!classes) return;
829 fClasses = classes;
830 for (Int_t i=0;i<fNclasses;i++) {
831 fCstatus[i] = 0;
832 fCparent[i] = -1;
833 }
834 if (gPad) Paint();
835}
836
837////////////////////////////////////////////////////////////////////////////////
838/// Set the size along x of the TPaveLabel showing the class name
839
845
846////////////////////////////////////////////////////////////////////////////////
847/// Set the offset at the top of the picture
848/// The default offset is computed automatically taking into account
849/// classes not inheriting from TObject.
850
852{
854 if (gPad) Paint();
855}
856
857////////////////////////////////////////////////////////////////////////////////
858/// mark classes used by the list of classes in classes
859
860void TClassTree::ShowClassesUsedBy(const char *classes)
861{
862 Int_t i,j;
863 Int_t nch = strlen(classes);
864 char *ptr = new char[nch+1];
865 strlcpy(ptr,classes,nch+1);
866 if (ptr[0] == '*') {
867 i = FindClass(&ptr[1]);
868 if (i >= 0) {
869 char *derived = fDerived[i];
870 for (j=0;j<fNclasses;j++) {
872 }
873 }
874 } else if (ptr[nch-1] == '*') {
875 ptr[nch-1] = 0;
876 for (j=0;j<fNclasses;j++) {
877 if(fCnames[j]->Contains(ptr)) FindClassesUsedBy(j);
878 }
879 } else {
880 for (j=0;j<fNclasses;j++) {
881 if(!fCnames[j]->CompareTo(ptr)) FindClassesUsedBy(j);
882 }
883 }
884 delete [] ptr;
885 if (gPad) Paint();
886}
887
888////////////////////////////////////////////////////////////////////////////////
889/// mark classes using any class in the list of classes in classes
890
891void TClassTree::ShowClassesUsing(const char *classes)
892{
893 Int_t i,j;
894 Int_t nch = strlen(classes);
895 char *ptr = new char[nch+1];
896 strlcpy(ptr,classes,nch+1);
897 if (ptr[0] == '*') {
898 i = FindClass(&ptr[1]);
899 if (i >= 0) {
900 char *derived = fDerived[i];
901 for (j=0;j<fNclasses;j++) {
903 }
904 }
905 } else if (ptr[nch-1] == '*') {
906 ptr[nch-1] = 0;
907 for (j=0;j<fNclasses;j++) {
908 if(fCnames[j]->Contains(ptr)) FindClassesUsing(j);
909 }
910 } else {
911 for (j=0;j<fNclasses;j++) {
912 if(!fCnames[j]->CompareTo(ptr)) FindClassesUsing(j);
913 }
914 }
915 delete [] ptr;
916 if (gPad) Paint();
917}
918
919////////////////////////////////////////////////////////////////////////////////
920/// Draw the Code References relationships
921
923{
924 TIter next(gPad->GetListOfPrimitives());
925 TObject *obj;
926 TObjString *os;
928 Int_t ic,icl;
929 Float_t x,y,x1,y1;
930 //iterate on all TPaveClass objects in the pad
931 while((obj=next())) {
932 if (obj->InheritsFrom(TPaveClass::Class())) {
933 pave = (TPaveClass*)obj;
934 icl = FindClass(pave->GetLabel());
935 if (icl < 0) continue;
936 char *derived = fDerived[icl];
937 x = 0.5*(pave->GetX1() + pave->GetX2());
938 y = 0.5*(pave->GetY1() + pave->GetY2());
940 //iterate on all classes in the list of classes of this class
941 while((os=(TObjString*)nextos())) {
942 if (!os->TestBit(kUsedByCode1)) continue;
943 ic = FindClass(os->GetName());
944 if (derived[ic]) continue;
945 FindClassPosition(os->GetName(),x1,y1);
946 if (x1 == 0 || y1 == 0) continue; //may be pointed class was not drawn
947 TArrow *arrow = new TArrow(x,y,x1,y1,0.008,"|>");
948 arrow->SetLineColor(kGreen);
949 arrow->SetFillColor(kGreen);
950 arrow->SetBit(kIsClassTree);
951 arrow->Draw();
952 }
953 }
954 }
955}
956
957////////////////////////////////////////////////////////////////////////////////
958/// Draw the "Has a" relationships
959
961{
962 TIter next(gPad->GetListOfPrimitives());
963 TObject *obj;
964 TObjString *os;
966 Int_t icl;
967 Float_t y,x1,y1,dx;
968 //iterate on all TPaveClass objects in the pad
969 while((obj=next())) {
970 if (obj->InheritsFrom(TPaveClass::Class())) {
971 pave = (TPaveClass*)obj;
972 icl = FindClass(pave->GetLabel());
973 if (icl < 0) continue;
974 y = 0.5*(pave->GetY1() + pave->GetY2());
976 if (nmembers == 0) continue;
977 dx = (pave->GetX2() - pave->GetX1())/nmembers;
979 //iterate on all classes in the list of classes of this class
980 while((os=(TObjString*)nextos())) {
981 if (!os->TestBit(kUsedByData)) continue;
982 if (os->TestBit(kIsaPointer)) continue;
983 if (os->TestBit(kIsBasic)) continue;
984 FindClassPosition(os->GetName(),x1,y1);
985 if (x1 == 0 || y1 == 0) continue; //may be base class was not drawn
986 Int_t imember = os->GetUniqueID();
987 TLine *line = new TLine(pave->GetX1()+(imember+0.5)*dx,y,x1,y1);
988 line->SetLineStyle(3);
989 line->SetLineColor(6);
991 line->Draw();
992 }
993 }
994 }
995}
996
997////////////////////////////////////////////////////////////////////////////////
998/// Set link options in the ClassTree object
999///
1000/// - "C" show References from code
1001/// - "H" show Has a relations
1002/// - "M" show Multiple Inheritance
1003/// - "R" show References from data members
1004
1006{
1007 TString opt = option;
1008 opt.ToUpper();
1010 if (opt.Contains("C")) fShowCod = 1;
1011 if (opt.Contains("H")) fShowHas = 1;
1012 if (opt.Contains("M")) fShowMul = 1;
1013 if (opt.Contains("R")) fShowRef = 1;
1014 if (gPad) Paint();
1015}
1016
1017////////////////////////////////////////////////////////////////////////////////
1018/// Draw the Multiple inheritance relationships
1019
1021{
1022 TIter next(gPad->GetListOfPrimitives());
1023 TObject *obj;
1024 TObjString *os;
1026 Int_t ic,icl;
1027 Float_t x,y,x1,y1;
1028 //iterate on all TPaveClass objects in the pad
1029 while((obj=next())) {
1030 if (obj->InheritsFrom(TPaveClass::Class())) {
1031 pave = (TPaveClass*)obj;
1032 icl = FindClass(pave->GetLabel());
1033 if (icl < 0) continue;
1034 char *derived = fDerived[icl];
1035 x = 0.5*(pave->GetX1() + pave->GetX2());
1036 y = 0.5*(pave->GetY1() + pave->GetY2());
1038 //iterate on all classes in the list of classes of this class
1039 while((os=(TObjString*)nextos())) {
1040 if (!os->TestBit(kUsedByClass)) continue;
1041 ic = FindClass(os->GetName());
1042 if (derived[ic] != 2) continue; //keep only multiple inheritance
1043 FindClassPosition(os->GetName(),x1,y1);
1044 if (x1 == 0 || y1 == 0) continue; //may be base class was not drawn
1045 TLine *line = new TLine(x,y,x1,y1);
1047 line->SetLineStyle(2);
1049 line->Draw();
1050 }
1051 }
1052 }
1053}
1054
1055////////////////////////////////////////////////////////////////////////////////
1056/// Draw the References relationships (other than inheritance or composition)
1057
1059{
1060 TIter next(gPad->GetListOfPrimitives());
1061 TObject *obj;
1062 TObjString *os;
1064 Int_t ic,icl;
1065 Float_t y,x1,y1,dx;
1066 Int_t icc = FindClass("TClass");
1067 //iterate on all TPaveClass objects in the pad
1068 while((obj=next())) {
1069 if (obj->InheritsFrom(TPaveClass::Class())) {
1070 pave = (TPaveClass*)obj;
1071 icl = FindClass(pave->GetLabel());
1072 if (icl < 0) continue;
1073 y = 0.5*(pave->GetY1() + pave->GetY2());
1075 if (nmembers == 0) continue;
1076 dx = (pave->GetX2() - pave->GetX1())/nmembers;
1078 //iterate on all classes in the list of classes of this class
1079 while((os=(TObjString*)nextos())) {
1080 if (!os->TestBit(kUsedByData)) continue;
1081 ic = FindClass(os->GetName());
1082 if (!os->TestBit(kIsaPointer)) continue;
1083 if (os->TestBit(kIsBasic)) continue;
1084 if (ic == icc) continue; // do not show relations with TClass
1085 FindClassPosition(os->GetName(),x1,y1);
1086 if (x1 == 0 || y1 == 0) continue; //may be pointed class was not drawn
1087 Int_t imember = os->GetUniqueID();
1088 TArrow *arrow = new TArrow(pave->GetX1()+(imember+0.5)*dx,y,x1,y1,0.008,"|>");
1089 arrow->SetLineColor(kRed);
1090 arrow->SetFillColor(kRed);
1091 arrow->SetBit(kIsClassTree);
1092 arrow->Draw();
1093 }
1094 }
1095 }
1096}
1097
1098////////////////////////////////////////////////////////////////////////////////
1099/// Stream an object of class TClassTree.
1100/// the status of the object is saved and can be replayed in a subsequent session
1101
1103{
1104 Int_t i;
1105 if (R__b.IsReading()) {
1106 Version_t R__v = R__b.ReadVersion(); if (R__v) { }
1109 R__b >> fYoffset;
1110 R__b >> fLabelDx;
1111 R__b >> fNclasses;
1112 R__b >> fShowCod;
1113 R__b >> fShowMul;
1114 R__b >> fShowHas;
1115 R__b >> fShowRef;
1116 fCnames = new TString*[fNclasses];
1117 fCtitles = new TString*[fNclasses];
1118 fCstatus = new Int_t[fNclasses];
1119 fParents = new Int_t[fNclasses];
1120 fCparent = new Int_t[fNclasses];
1121 fNdata = new Int_t[fNclasses];
1122 fCpointer = new TClass*[fNclasses];
1123 fOptions = new TString*[fNclasses];
1124 fLinks = new TList*[fNclasses];
1125 fDerived = new char*[fNclasses];
1126 for (i=0;i<fNclasses;i++) {
1127 R__b >> fCstatus[i];
1128 R__b >> fParents[i];
1129 R__b >> fNdata[i];
1130 fCnames[i] = new TString();
1131 fCtitles[i] = new TString();
1132 fOptions[i] = new TString();
1133 fCnames[i]->Streamer(R__b);
1134 fCtitles[i]->Streamer(R__b);
1135 fOptions[i]->Streamer(R__b);
1136 fLinks[i] = new TList();
1137 fLinks[i]->Streamer(R__b);
1138 fDerived[i] = new char[fNclasses];
1139 R__b.ReadFastArray(fDerived[i],fNclasses);
1140 }
1142 } else {
1143 R__b.WriteVersion(TClassTree::IsA());
1146 R__b << fYoffset;
1147 R__b << fLabelDx;
1148 R__b << fNclasses;
1149 R__b << fShowCod;
1150 R__b << fShowMul;
1151 R__b << fShowHas;
1152 R__b << fShowRef;
1153 for (i=0;i<fNclasses;i++) {
1154 R__b << fCstatus[i];
1155 R__b << fParents[i];
1156 R__b << fNdata[i];
1157 fCnames[i]->Streamer(R__b);
1158 fCtitles[i]->Streamer(R__b);
1159 fOptions[i]->Streamer(R__b);
1160 fLinks[i]->Streamer(R__b);
1161 R__b.WriteFastArray(fDerived[i],fNclasses);
1162 }
1164 }
1165}
int Int_t
Signed integer 4 bytes (int)
Definition RtypesCore.h:59
short Version_t
Class version identifier (short)
Definition RtypesCore.h:79
float Float_t
Float 4 bytes (float)
Definition RtypesCore.h:71
const char Option_t
Option string (const char)
Definition RtypesCore.h:80
#define BIT(n)
Definition Rtypes.h:91
@ kRed
Definition Rtypes.h:67
@ kGreen
Definition Rtypes.h:67
@ kBlue
Definition Rtypes.h:67
@ kYellow
Definition Rtypes.h:67
R__EXTERN TClassTable * gClassTable
const Int_t kIsBasic
const Int_t kUsingCode
const Int_t kUsingData
const Int_t kIsaPointer
const Int_t kUsedByCode1
const Int_t kUsingClass
static Float_t gDx
const Int_t kUsingFunc
const Int_t kUsedByData
static Float_t gYsize
static Float_t gLabdx
const Int_t kUsedByCode
static Float_t gDy
static Float_t gLabdy
const Int_t kUsedByFunc
static Float_t gDxx
const Int_t kUsedByClass
static Float_t gXsize
const Int_t kIsClassTree
static Float_t gCsize
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
#define gDirectory
Definition TDirectory.h:385
Option_t Option_t option
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h offset
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char cname
Option_t Option_t TPoint TPoint const char x1
Option_t Option_t TPoint TPoint const char y1
char name[80]
Definition TGX11.cxx:110
float xmin
float ymin
float xmax
float ymax
#define gROOT
Definition TROOT.h:414
@ kReadPermission
Definition TSystem.h:55
R__EXTERN TSystem * gSystem
Definition TSystem.h:572
#define gPad
#define snprintf
Definition civetweb.c:1579
Draw all kinds of Arrows.
Definition TArrow.h:29
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
Definition TAttFill.h:38
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
Definition TAttLine.h:44
virtual void SetLineColor(Color_t lcolor)
Set the line color.
Definition TAttLine.h:42
virtual void SetTextSize(Float_t tsize=1)
Set the text size.
Definition TAttText.h:49
Each class (see TClass) has a linked list of its base class(es).
Definition TBaseClass.h:33
virtual void SetToolTipText(const char *text, Long_t delayms=1000)
Set tool tip text associated with this box.
Definition TBox.cxx:726
Buffer base class used for serializing objects.
Definition TBuffer.h:43
static char * Next()
Returns next class from sorted class table.
static void Init()
virtual void ShowClassesUsedBy(const char *classes)
mark classes used by the list of classes in classes
virtual void ShowHas()
Draw the "Has a" relationships.
TClass * IsA() const override
Definition TClassTree.h:78
virtual void ShowLinks(Option_t *option="HMR")
Set link options in the ClassTree object.
char ** fDerived
![fNclasses] table to indicate if i derives from j
Definition TClassTree.h:37
virtual void ScanClasses(Int_t iclass)
Select all classes used by/referenced/referencing the class number iclass and build the list of these...
virtual void SetClasses(const char *classes, Option_t *option="ID")
Set the list of classes for which the hierarchy is to be drawn See Paint for the syntax.
Int_t * fCstatus
[fNclasses] classes status
Definition TClassTree.h:33
Int_t fNclasses
current number of classes
Definition TClassTree.h:28
virtual void PaintClass(Int_t iclass, Float_t xleft, Float_t y)
Paint one class level.
virtual void FindClassesUsing(Int_t iclass)
Select all classes using/referencing the class number iclass.
Int_t * fParents
[fNclasses] parent number of classes (permanent)
Definition TClassTree.h:35
Int_t fShowRef
if 1 show classes relationship other than inheritance
Definition TClassTree.h:32
virtual void Init()
Initialize the data structures.
void Paint(Option_t *option="") override
Draw the current class setting in fClasses and fStatus.
void ls(Option_t *option="") const override
list classes names and titles
TString ** fOptions
![fNclasses] List of options per class
Definition TClassTree.h:41
std::vector< Int_t > fNtsons
! internal variable, used during painting
Definition TClassTree.h:45
Int_t fShowHas
if 1 show "has a" relationship
Definition TClassTree.h:31
Int_t fShowCod
if 1 show classes referenced by implementation
Definition TClassTree.h:29
void SaveAs(const char *filename="", Option_t *option="") const override
save current configuration in a Root file if filename is blank, the name of the file will be the curr...
Int_t * fCparent
!parent number of classes (temporary)
Definition TClassTree.h:36
TString fSourceDir
Concatenated source directories.
Definition TClassTree.h:42
virtual Int_t FindClass(const char *classname)
Find class number corresponding to classname in list of local classes.
std::vector< Int_t > fNsons
! internal variable, used during painting
Definition TClassTree.h:44
TString ** fCtitles
![fNclasses] class titles
Definition TClassTree.h:40
virtual void SetLabelDx(Float_t labeldx=0.15)
Set the size along x of the TPaveLabel showing the class name.
virtual void SetYoffset(Float_t offset=0)
Set the offset at the top of the picture The default offset is computed automatically taking into acc...
void Streamer(TBuffer &) override
Stream an object of class TClassTree.
virtual void SetSourceDir(const char *dir="src")
Definition TClassTree.h:71
Float_t fLabelDx
width along x of TPaveLabels in per cent of pad
Definition TClassTree.h:27
~TClassTree() override
TClassTree default destructor.
virtual void FindClassPosition(const char *classname, Float_t &x, Float_t &y)
Search the TPaveClass object in the pad with label=classname returns the x and y position of the cent...
virtual void ShowRef()
Draw the References relationships (other than inheritance or composition)
virtual void ShowCod()
Draw the Code References relationships.
TList ** fLinks
![fNclasses] for each class, the list of referenced(ing) classes
Definition TClassTree.h:43
virtual void ShowMul()
Draw the Multiple inheritance relationships.
virtual void ShowClassesUsing(const char *classes)
mark classes using any class in the list of classes in classes
TClassTree()
TClassTree default constructor.
Float_t fYoffset
offset at top of picture in per cent of pad
Definition TClassTree.h:26
TClass ** fCpointer
![fNclasses] pointers to the TClass objects
Definition TClassTree.h:38
void Draw(const char *classes="") override
Draw the inheritance tree and relations for the list of classes see this class header for the syntax ...
virtual void FindClassesUsedBy(Int_t iclass)
Select all classes used/referenced by the class number iclass.
TString fClasses
List of classes to be drawn.
Definition TClassTree.h:25
TObjString * Mark(const char *classname, TList *los, Int_t abit)
set bit abit in class classname in list los
Int_t fShowMul
if 1 show multiple inheritance
Definition TClassTree.h:30
TString ** fCnames
![fNclasses] class names
Definition TClassTree.h:39
const char * GetClasses() const
Definition TClassTree.h:65
Int_t * fNdata
[fNclasses] Number of data members per class
Definition TClassTree.h:34
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition TClass.h:84
TList * GetListOfMethods(Bool_t load=kTRUE)
Return list containing the TMethods of a class.
Definition TClass.cxx:3839
TList * GetListOfDataMembers(Bool_t load=kTRUE)
Return list containing the TDataMembers of a class.
Definition TClass.cxx:3797
const char * GetImplFileName() const
Definition TClass.h:468
TList * GetListOfBases()
Return list containing the TBaseClass(es) of a class.
Definition TClass.cxx:3663
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:2973
All ROOT classes may have RTTI (run time type identification) support added.
Definition TDataMember.h:31
Bool_t IsBasic() const
Return true if data member is a basic type, e.g. char, int, long...
Bool_t IsaPointer() const
Return true if data member is a pointer.
const char * GetTypeName() const
Get the decayed type name of this data member, removing const and volatile qualifiers,...
Use the TLine constructor to create a simple line.
Definition TLine.h:22
A doubly linked list.
Definition TList.h:38
void Streamer(TBuffer &) override
Stream all objects in the collection to or from the I/O buffer.
Definition TList.cxx:1323
void Delete(Option_t *option="") override
Remove all objects from the list AND delete all heap based objects.
Definition TList.cxx:600
Each ROOT method (see TMethod) has a linked list of its arguments.
Definition TMethodArg.h:36
Each ROOT class (see TClass) has a linked list of methods.
Definition TMethod.h:38
The TNamed class is the base class for all named ROOT classes.
Definition TNamed.h:29
void Streamer(TBuffer &) override
Stream an object of class TObject.
const char * GetTitle() const override
Returns title of object.
Definition TNamed.h:50
Collectable string class.
Definition TObjString.h:28
Mother of all ROOT objects.
Definition TObject.h:41
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
Definition TObject.h:202
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
Definition TObject.cxx:881
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
Definition TObject.cxx:543
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
Definition TObject.cxx:293
A TPaveLabel specialized to process classes inside a TClassTree.
Definition TPaveClass.h:23
static TClass * Class()
void Draw(Option_t *option="") override
Draw this pavelabel with its current attributes.
Basic string class.
Definition TString.h:138
const char * Data() const
Definition TString.h:384
void ToUpper()
Change string to upper case.
Definition TString.cxx:1202
virtual void Streamer(TBuffer &)
Stream a string object.
Definition TString.cxx:1418
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition TString.h:641
virtual const char * UnixPathName(const char *unixpathname)
Convert from a local pathname to a Unix pathname.
Definition TSystem.cxx:1073
virtual const char * BaseName(const char *pathname)
Base name of a file name. Base name of /user/root is root.
Definition TSystem.cxx:944
virtual char * Which(const char *search, const char *file, EAccessMode mode=kFileExists)
Find location of file in a search path.
Definition TSystem.cxx:1559
TLine * line
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
th1 Draw()