File indexing completed on 2025-01-18 10:11:38
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOT_TDocInfo
0013 #define ROOT_TDocInfo
0014
0015 #include "TClass.h"
0016 #include "THashList.h"
0017 #include "TNamed.h"
0018 #include "TROOT.h"
0019 #include <string>
0020 #include <set>
0021
0022 class TDictionary;
0023
0024 class TModuleDocInfo;
0025
0026
0027
0028
0029 class TClassDocInfo: public TObject {
0030 public:
0031
0032 TClassDocInfo(TClass* cl,
0033 const char* htmlfilename = "",
0034 const char* fsdecl = "", const char* fsimpl = "",
0035 const char* decl = 0, const char* impl = 0):
0036 fClass(cl), fModule(0), fHtmlFileName(htmlfilename),
0037 fDeclFileName(decl ? decl : cl->GetDeclFileName()),
0038 fImplFileName(impl ? impl : cl->GetImplFileName()),
0039 fDeclFileSysName(fsdecl), fImplFileSysName(fsimpl),
0040 fSelected(kTRUE) { }
0041
0042 TClassDocInfo(TDictionary* cl,
0043 const char* htmlfilename = "",
0044 const char* fsdecl = "", const char* fsimpl = "",
0045 const char* decl = 0, const char* impl = 0):
0046 fClass(cl), fModule(0), fHtmlFileName(htmlfilename),
0047 fDeclFileName(decl),
0048 fImplFileName(impl),
0049 fDeclFileSysName(fsdecl), fImplFileSysName(fsimpl),
0050 fSelected(kTRUE) { }
0051
0052 ~TClassDocInfo() override
0053 {
0054
0055 ROOT::CallRecursiveRemoveIfNeeded(*this);
0056 }
0057
0058 TDictionary *GetClass() const { return fClass; }
0059 const char* GetName() const override;
0060 const char* GetHtmlFileName() const { return fHtmlFileName; }
0061 const char* GetDeclFileName() const { return fDeclFileName; }
0062 const char* GetImplFileName() const { return fImplFileName; }
0063 const char* GetDeclFileSysName() const { return fDeclFileSysName; }
0064 const char* GetImplFileSysName() const { return fImplFileSysName; }
0065
0066 void SetModule(TModuleDocInfo* module) { fModule = module; }
0067 TModuleDocInfo* GetModule() const { return fModule; }
0068
0069 void SetSelected(Bool_t sel = kTRUE) { fSelected = sel; }
0070 Bool_t IsSelected() const { return fSelected; }
0071 Bool_t HaveSource() const { return fDeclFileSysName.Length()
0072 || (fClass && !dynamic_cast<TClass*>(fClass)); }
0073
0074 void SetHtmlFileName(const char* name) { fHtmlFileName = name; }
0075 void SetDeclFileName(const char* name) { fDeclFileName = name; }
0076 void SetImplFileName(const char* name) { fImplFileName = name; }
0077 void SetDeclFileSysName(const char* fsname) { fDeclFileSysName = fsname; }
0078 void SetImplFileSysName(const char* fsname) { fImplFileSysName = fsname; }
0079
0080 ULong_t Hash() const override;
0081
0082 TList& GetListOfTypedefs() { return fTypedefs; }
0083
0084 Bool_t IsSortable() const override { return kTRUE; }
0085 Int_t Compare(const TObject* obj) const override;
0086
0087 private:
0088 TClassDocInfo();
0089
0090 TDictionary* fClass;
0091 TModuleDocInfo* fModule;
0092 TString fHtmlFileName;
0093 TString fDeclFileName;
0094 TString fImplFileName;
0095 TString fDeclFileSysName;
0096 TString fImplFileSysName;
0097 TList fTypedefs;
0098 Bool_t fSelected;
0099
0100 ClassDefOverride(TClassDocInfo,0);
0101 };
0102
0103
0104
0105
0106
0107 class TModuleDocInfo: public TNamed {
0108 public:
0109 TModuleDocInfo(const char* name, TModuleDocInfo* super, const char* doc = ""):
0110 TNamed(name, doc), fSuper(super), fSub(0), fSelected(kTRUE) {
0111 if (super) super->GetSub().Add(this);
0112 }
0113 ~TModuleDocInfo() override { fSub.Clear("nodelete"); fClasses.Clear("nodelete"); }
0114
0115 void SetDoc(const char* doc) { SetTitle(doc); }
0116 const char* GetDoc() const { return GetTitle(); }
0117
0118 void SetSelected(Bool_t sel = kTRUE) { fSelected = sel; }
0119 Bool_t IsSelected() const { return fSelected; }
0120
0121 void AddClass(TClassDocInfo* cl) { fClasses.Add(cl); }
0122 TList* GetClasses() { return &fClasses; }
0123
0124 TModuleDocInfo* GetSuper() const { return fSuper; }
0125 THashList& GetSub() { return fSub; }
0126
0127 private:
0128 TModuleDocInfo* fSuper;
0129 THashList fSub;
0130 TList fClasses;
0131 Bool_t fSelected;
0132
0133 ClassDefOverride(TModuleDocInfo,0);
0134 };
0135
0136
0137
0138
0139
0140
0141 class TLibraryDocInfo: public TNamed {
0142 public:
0143 TLibraryDocInfo() {}
0144 TLibraryDocInfo(const char* lib): TNamed(lib, "") {}
0145
0146 std::set<std::string>& GetDependencies() {return fDependencies;}
0147 std::set<std::string>& GetModules() {return fModules;}
0148 void AddDependency(const std::string& lib) {fDependencies.insert(lib);}
0149 void AddModule(const std::string& module) {fModules.insert(module);}
0150
0151 private:
0152 std::set<std::string> fDependencies;
0153 std::set<std::string> fModules;
0154
0155 ClassDefOverride(TLibraryDocInfo,0);
0156 };
0157
0158
0159 #endif