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