Logo ROOT  
Reference Guide
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 
22 class TDictionary;
23 
24 class TModuleDocInfo;
25 //____________________________________________________________________
26 //
27 // Cache doc info for all known classes
28 //
29 class TClassDocInfo: public TObject {
30 public:
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 
52  virtual ~TClassDocInfo()
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 
67  TModuleDocInfo* GetModule() const { return fModule; }
68 
69  void SetSelected(Bool_t sel = kTRUE) { fSelected = sel; }
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 
87 private:
88  TClassDocInfo();
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 //
107 class TModuleDocInfo: public TNamed {
108 public:
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 
118  void SetSelected(Bool_t sel = kTRUE) { fSelected = sel; }
119  Bool_t IsSelected() const { return fSelected; }
120 
121  void AddClass(TClassDocInfo* cl) { fClasses.Add(cl); }
122  TList* GetClasses() { return &fClasses; }
123 
124  TModuleDocInfo* GetSuper() const { return fSuper; }
125  THashList& GetSub() { return fSub; }
126 
127 private:
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 //
141 class 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
TClassDocInfo::fHtmlFileName
TString fHtmlFileName
Definition: TDocInfo.h:92
TClassDocInfo::GetDeclFileSysName
const char * GetDeclFileSysName() const
Definition: TDocInfo.h:63
TModuleDocInfo::GetSuper
TModuleDocInfo * GetSuper() const
Definition: TDocInfo.h:124
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
TClassDocInfo::SetDeclFileName
void SetDeclFileName(const char *name)
Definition: TDocInfo.h:75
TClassDocInfo::fImplFileName
TString fImplFileName
Definition: TDocInfo.h:94
TClassDocInfo::SetHtmlFileName
void SetHtmlFileName(const char *name)
Definition: TDocInfo.h:74
TModuleDocInfo::~TModuleDocInfo
virtual ~TModuleDocInfo()
Definition: TDocInfo.h:113
TModuleDocInfo::fSelected
Bool_t fSelected
Definition: TDocInfo.h:131
TClassDocInfo::fDeclFileName
TString fDeclFileName
Definition: TDocInfo.h:93
TNamed::GetTitle
virtual const char * GetTitle() const
Returns title of object.
Definition: TNamed.h:54
TClassDocInfo::fTypedefs
TList fTypedefs
Definition: TDocInfo.h:97
TNamed.h
TClassDocInfo::TClassDocInfo
TClassDocInfo(TClass *cl, const char *htmlfilename="", const char *fsdecl="", const char *fsimpl="", const char *decl=0, const char *impl=0)
Definition: TDocInfo.h:32
TClassDocInfo::GetListOfTypedefs
TList & GetListOfTypedefs()
Definition: TDocInfo.h:82
TClassDocInfo::GetDeclFileName
const char * GetDeclFileName() const
Definition: TDocInfo.h:61
TModuleDocInfo::TModuleDocInfo
TModuleDocInfo(const char *name, TModuleDocInfo *super, const char *doc="")
Definition: TDocInfo.h:109
TClassDocInfo::HaveSource
Bool_t HaveSource() const
Definition: TDocInfo.h:71
TClassDocInfo::GetName
virtual const char * GetName() const
Returns name of object.
Definition: TDocInfo.cxx:25
Int_t
int Int_t
Definition: RtypesCore.h:45
TLibraryDocInfo::TLibraryDocInfo
TLibraryDocInfo()
Definition: TDocInfo.h:143
TClassDocInfo::fImplFileSysName
TString fImplFileSysName
Definition: TDocInfo.h:96
TClassDocInfo::GetImplFileSysName
const char * GetImplFileSysName() const
Definition: TDocInfo.h:64
TString::Length
Ssiz_t Length() const
Definition: TString.h:410
TClass.h
TModuleDocInfo::GetDoc
const char * GetDoc() const
Definition: TDocInfo.h:116
TLibraryDocInfo::AddDependency
void AddDependency(const std::string &lib)
Definition: TDocInfo.h:148
TString
Definition: TString.h:136
TModuleDocInfo::SetDoc
void SetDoc(const char *doc)
Definition: TDocInfo.h:115
TClassDocInfo::fClass
TDictionary * fClass
Definition: TDocInfo.h:90
TLibraryDocInfo::GetModules
std::set< std::string > & GetModules()
Definition: TDocInfo.h:147
TClassDocInfo::SetDeclFileSysName
void SetDeclFileSysName(const char *fsname)
Definition: TDocInfo.h:77
bool
TModuleDocInfo::IsSelected
Bool_t IsSelected() const
Definition: TDocInfo.h:119
TClassDocInfo::fSelected
Bool_t fSelected
Definition: TDocInfo.h:98
TROOT.h
TLibraryDocInfo::TLibraryDocInfo
TLibraryDocInfo(const char *lib)
Definition: TDocInfo.h:144
TLibraryDocInfo
Definition: TDocInfo.h:141
TClassDocInfo::TClassDocInfo
TClassDocInfo(TDictionary *cl, const char *htmlfilename="", const char *fsdecl="", const char *fsimpl="", const char *decl=0, const char *impl=0)
Definition: TDocInfo.h:42
TClassDocInfo::Hash
ULong_t Hash() const
Return hash value for this object.
Definition: TDocInfo.cxx:31
TClassDocInfo::IsSortable
virtual Bool_t IsSortable() const
Definition: TDocInfo.h:84
TModuleDocInfo
Definition: TDocInfo.h:107
THashList
Definition: THashList.h:34
TNamed
Definition: TNamed.h:29
TClassDocInfo::GetClass
TDictionary * GetClass() const
Definition: TDocInfo.h:58
ULong_t
unsigned long ULong_t
Definition: RtypesCore.h:55
TModuleDocInfo::fSub
THashList fSub
Definition: TDocInfo.h:129
TNamed::SetTitle
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
Definition: TNamed.cxx:164
TLibraryDocInfo::fDependencies
std::set< std::string > fDependencies
Definition: TDocInfo.h:152
TLibraryDocInfo::AddModule
void AddModule(const std::string &module)
Definition: TDocInfo.h:149
TModuleDocInfo::GetClasses
TList * GetClasses()
Definition: TDocInfo.h:122
TClassDocInfo::GetModule
TModuleDocInfo * GetModule() const
Definition: TDocInfo.h:67
TClassDocInfo::fModule
TModuleDocInfo * fModule
Definition: TDocInfo.h:91
TModuleDocInfo::SetSelected
void SetSelected(Bool_t sel=kTRUE)
Definition: TDocInfo.h:118
TDictionary
Definition: TDictionary.h:162
TModuleDocInfo::fClasses
TList fClasses
Definition: TDocInfo.h:130
THashList.h
TClassDocInfo::GetImplFileName
const char * GetImplFileName() const
Definition: TDocInfo.h:62
TClassDocInfo::SetModule
void SetModule(TModuleDocInfo *module)
Definition: TDocInfo.h:66
TClassDocInfo::SetImplFileName
void SetImplFileName(const char *name)
Definition: TDocInfo.h:76
TClass
Definition: TClass.h:80
THashList::Clear
void Clear(Option_t *option="")
Remove all objects from the list.
Definition: THashList.cxx:189
TClassDocInfo::fDeclFileSysName
TString fDeclFileSysName
Definition: TDocInfo.h:95
TList::Add
virtual void Add(TObject *obj)
Definition: TList.h:87
TObject
Definition: TObject.h:37
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TLibraryDocInfo::fModules
std::set< std::string > fModules
Definition: TDocInfo.h:153
TList::Clear
virtual void Clear(Option_t *option="")
Remove all objects from the list.
Definition: TList.cxx:401
name
char name[80]
Definition: TGX11.cxx:110
TClassDocInfo::SetSelected
void SetSelected(Bool_t sel=kTRUE)
Definition: TDocInfo.h:69
TClassDocInfo::SetImplFileSysName
void SetImplFileSysName(const char *fsname)
Definition: TDocInfo.h:78
TLibraryDocInfo::GetDependencies
std::set< std::string > & GetDependencies()
Definition: TDocInfo.h:146
ROOT::CallRecursiveRemoveIfNeeded
void CallRecursiveRemoveIfNeeded(TObject &obj)
call RecursiveRemove for obj if gROOT is valid and obj.TestBit(kMustCleanup) is true.
Definition: TROOT.h:395
TModuleDocInfo::AddClass
void AddClass(TClassDocInfo *cl)
Definition: TDocInfo.h:121
launcher.module
module
Definition: launcher.py:31
TClassDocInfo::IsSelected
Bool_t IsSelected() const
Definition: TDocInfo.h:70
TClassDocInfo::GetHtmlFileName
const char * GetHtmlFileName() const
Definition: TDocInfo.h:60
TList
Definition: TList.h:44
TClassDocInfo::TClassDocInfo
TClassDocInfo()
TClassDocInfo::~TClassDocInfo
virtual ~TClassDocInfo()
Definition: TDocInfo.h:52
TModuleDocInfo::fSuper
TModuleDocInfo * fSuper
Definition: TDocInfo.h:128
TModuleDocInfo::GetSub
THashList & GetSub()
Definition: TDocInfo.h:125
TClassDocInfo
Definition: TDocInfo.h:29
TClassDocInfo::Compare
virtual Int_t Compare(const TObject *obj) const
Compare abstract method.
Definition: TDocInfo.cxx:37