Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TDocInfo.h
Go to the documentation of this file.
1// @(#)root/html:$Id$
2// Author: Nenad Buncic 18/10/95
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#ifndef ROOT_TDocInfo
13#define ROOT_TDocInfo
14
15#include "TClass.h"
16#include "THashList.h"
17#include "TNamed.h"
18#include "TROOT.h"
19#include <string>
20#include <set>
21
22class TDictionary;
23
24class TModuleDocInfo;
25//____________________________________________________________________
26//
27// Cache doc info for all known classes
28//
29class TClassDocInfo: public TObject {
30public:
31 // initialize the object
33 const char* htmlfilename = "",
34 const char* fsdecl = "", const char* fsimpl = "",
35 const char* decl = 0, const char* impl = 0):
36 fClass(cl), fModule(0), fHtmlFileName(htmlfilename),
37 fDeclFileName(decl ? decl : cl->GetDeclFileName()),
38 fImplFileName(impl ? impl : cl->GetImplFileName()),
39 fDeclFileSysName(fsdecl), fImplFileSysName(fsimpl),
40 fSelected(kTRUE) { }
41
43 const char* htmlfilename = "",
44 const char* fsdecl = "", const char* fsimpl = "",
45 const char* decl = 0, const char* impl = 0):
46 fClass(cl), fModule(0), fHtmlFileName(htmlfilename),
47 fDeclFileName(decl),
48 fImplFileName(impl),
49 fDeclFileSysName(fsdecl), fImplFileSysName(fsimpl),
50 fSelected(kTRUE) { }
51
53 {
54 // Required since we overload TObject::Hash.
56 }
57
58 TDictionary *GetClass() const { return fClass; }
59 virtual const char* GetName() const;
60 const char* GetHtmlFileName() const { return fHtmlFileName; }
61 const char* GetDeclFileName() const { return fDeclFileName; }
62 const char* GetImplFileName() const { return fImplFileName; }
63 const char* GetDeclFileSysName() const { return fDeclFileSysName; }
64 const char* GetImplFileSysName() const { return fImplFileSysName; }
65
66 void SetModule(TModuleDocInfo* module) { fModule = module; }
67 TModuleDocInfo* GetModule() const { return fModule; }
68
70 Bool_t IsSelected() const { return fSelected; }
72 || (fClass && !dynamic_cast<TClass*>(fClass)); }
73
74 void SetHtmlFileName(const char* name) { fHtmlFileName = name; }
75 void SetDeclFileName(const char* name) { fDeclFileName = name; }
76 void SetImplFileName(const char* name) { fImplFileName = name; }
77 void SetDeclFileSysName(const char* fsname) { fDeclFileSysName = fsname; }
78 void SetImplFileSysName(const char* fsname) { fImplFileSysName = fsname; }
79
80 ULong_t Hash() const;
81
83
84 virtual Bool_t IsSortable() const { return kTRUE; }
85 virtual Int_t Compare(const TObject* obj) const;
86
87private:
89
90 TDictionary* fClass; // class (or typedef) represented by this info object
91 TModuleDocInfo* fModule; // module this class is in
92 TString fHtmlFileName; // name of the HTML doc file
95 TString fDeclFileSysName; // file system's location of the header
96 TString fImplFileSysName; // file system's location of the source
97 TList fTypedefs; // typedefs to this class
98 Bool_t fSelected; // selected for doc output
99
100 ClassDef(TClassDocInfo,0); // info cache for class documentation
101};
102
103//____________________________________________________________________
104//
105// Cache doc info for all known modules
106//
107class TModuleDocInfo: public TNamed {
108public:
109 TModuleDocInfo(const char* name, TModuleDocInfo* super, const char* doc = ""):
110 TNamed(name, doc), fSuper(super), fSub(0), fSelected(kTRUE) {
111 if (super) super->GetSub().Add(this);
112 }
113 virtual ~TModuleDocInfo() { fSub.Clear("nodelete"); fClasses.Clear("nodelete"); }
114
115 void SetDoc(const char* doc) { SetTitle(doc); }
116 const char* GetDoc() const { return GetTitle(); }
117
119 Bool_t IsSelected() const { return fSelected; }
120
122 TList* GetClasses() { return &fClasses; }
123
124 TModuleDocInfo* GetSuper() const { return fSuper; }
125 THashList& GetSub() { return fSub; }
126
127private:
128 TModuleDocInfo* fSuper; // module containing this module
129 THashList fSub; // modules contained in this module
131 Bool_t fSelected; // selected for doc output
132
133 ClassDef(TModuleDocInfo,0); // documentation for a group of classes
134};
135
136//__________________________________________________________________________
137//
138// A library's documentation database:
139// dependencies and sub-modules
140//
141class TLibraryDocInfo: public TNamed {
142 public:
144 TLibraryDocInfo(const char* lib): TNamed(lib, "") {}
145
146 std::set<std::string>& GetDependencies() {return fDependencies;}
147 std::set<std::string>& GetModules() {return fModules;}
148 void AddDependency(const std::string& lib) {fDependencies.insert(lib);}
149 void AddModule(const std::string& module) {fModules.insert(module);}
150
151 private:
152 std::set<std::string> fDependencies; // dependencies on other libraries
153 std::set<std::string> fModules; // modules in the library
154
155 ClassDef(TLibraryDocInfo,0); // documentation for a library
156};
157
158
159#endif // ROOT_TDocInfo
int Int_t
Definition RtypesCore.h:45
constexpr Bool_t kTRUE
Definition RtypesCore.h:100
unsigned long ULong_t
Definition RtypesCore.h:55
#define ClassDef(name, id)
Definition Rtypes.h:337
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 Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t sel
char name[80]
Definition TGX11.cxx:110
ULong_t Hash() const
Return hash value for this object.
Definition TDocInfo.cxx:31
TString fDeclFileName
Definition TDocInfo.h:93
TDictionary * fClass
Definition TDocInfo.h:90
TString fImplFileSysName
Definition TDocInfo.h:96
const char * GetImplFileName() const
Definition TDocInfo.h:62
Bool_t HaveSource() const
Definition TDocInfo.h:71
TString fDeclFileSysName
Definition TDocInfo.h:95
const char * GetImplFileSysName() const
Definition TDocInfo.h:64
void SetDeclFileName(const char *name)
Definition TDocInfo.h:75
Bool_t fSelected
Definition TDocInfo.h:98
TModuleDocInfo * GetModule() const
Definition TDocInfo.h:67
TList fTypedefs
Definition TDocInfo.h:97
virtual Bool_t IsSortable() const
Definition TDocInfo.h:84
TString fImplFileName
Definition TDocInfo.h:94
void SetImplFileSysName(const char *fsname)
Definition TDocInfo.h:78
TString fHtmlFileName
Definition TDocInfo.h:92
virtual const char * GetName() const
Returns name of object.
Definition TDocInfo.cxx:25
void SetImplFileName(const char *name)
Definition TDocInfo.h:76
TClassDocInfo(TClass *cl, const char *htmlfilename="", const char *fsdecl="", const char *fsimpl="", const char *decl=0, const char *impl=0)
Definition TDocInfo.h:32
virtual Int_t Compare(const TObject *obj) const
Compare abstract method.
Definition TDocInfo.cxx:37
void SetModule(TModuleDocInfo *module)
Definition TDocInfo.h:66
void SetSelected(Bool_t sel=kTRUE)
Definition TDocInfo.h:69
virtual ~TClassDocInfo()
Definition TDocInfo.h:52
const char * GetHtmlFileName() const
Definition TDocInfo.h:60
void SetDeclFileSysName(const char *fsname)
Definition TDocInfo.h:77
Bool_t IsSelected() const
Definition TDocInfo.h:70
const char * GetDeclFileSysName() const
Definition TDocInfo.h:63
TClassDocInfo(TDictionary *cl, const char *htmlfilename="", const char *fsdecl="", const char *fsimpl="", const char *decl=0, const char *impl=0)
Definition TDocInfo.h:42
void SetHtmlFileName(const char *name)
Definition TDocInfo.h:74
TModuleDocInfo * fModule
Definition TDocInfo.h:91
TList & GetListOfTypedefs()
Definition TDocInfo.h:82
const char * GetDeclFileName() const
Definition TDocInfo.h:61
TDictionary * GetClass() const
Definition TDocInfo.h:58
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition TClass.h:81
This class defines an abstract interface that must be implemented by all classes that contain diction...
THashList implements a hybrid collection class consisting of a hash table and a list to store TObject...
Definition THashList.h:34
void Clear(Option_t *option="") override
Remove all objects from the list.
void AddDependency(const std::string &lib)
Definition TDocInfo.h:148
TLibraryDocInfo(const char *lib)
Definition TDocInfo.h:144
std::set< std::string > fDependencies
Definition TDocInfo.h:152
std::set< std::string > & GetDependencies()
Definition TDocInfo.h:146
std::set< std::string > & GetModules()
Definition TDocInfo.h:147
std::set< std::string > fModules
Definition TDocInfo.h:153
void AddModule(const std::string &module)
Definition TDocInfo.h:149
A doubly linked list.
Definition TList.h:38
void Clear(Option_t *option="") override
Remove all objects from the list.
Definition TList.cxx:402
void Add(TObject *obj) override
Definition TList.h:81
THashList & GetSub()
Definition TDocInfo.h:125
void SetDoc(const char *doc)
Definition TDocInfo.h:115
TModuleDocInfo * fSuper
Definition TDocInfo.h:128
void SetSelected(Bool_t sel=kTRUE)
Definition TDocInfo.h:118
void AddClass(TClassDocInfo *cl)
Definition TDocInfo.h:121
virtual ~TModuleDocInfo()
Definition TDocInfo.h:113
THashList fSub
Definition TDocInfo.h:129
TModuleDocInfo(const char *name, TModuleDocInfo *super, const char *doc="")
Definition TDocInfo.h:109
Bool_t fSelected
Definition TDocInfo.h:131
Bool_t IsSelected() const
Definition TDocInfo.h:119
const char * GetDoc() const
Definition TDocInfo.h:116
TModuleDocInfo * GetSuper() const
Definition TDocInfo.h:124
TList * GetClasses()
Definition TDocInfo.h:122
The TNamed class is the base class for all named ROOT classes.
Definition TNamed.h:29
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
Definition TNamed.cxx:164
const char * GetTitle() const override
Returns title of object.
Definition TNamed.h:48
Mother of all ROOT objects.
Definition TObject.h:41
Basic string class.
Definition TString.h:139
Ssiz_t Length() const
Definition TString.h:421
void CallRecursiveRemoveIfNeeded(TObject &obj)
call RecursiveRemove for obj if gROOT is valid and obj.TestBit(kMustCleanup) is true.
Definition TROOT.h:394