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