diff options
author | Dimitri van Heesch <doxygen@gmail.com> | 2020-11-15 10:03:44 (GMT) |
---|---|---|
committer | Dimitri van Heesch <doxygen@gmail.com> | 2020-11-15 10:03:44 (GMT) |
commit | fce7c2f8af2ccd04137c7db163333d0110241835 (patch) | |
tree | 3a212e159262f858d49cf109940b071a7df66cde /src/dotgfxhierarchytable.h | |
parent | 21432ebe4d5aa7811b663da78823385fd6ca0d37 (diff) | |
download | Doxygen-fce7c2f8af2ccd04137c7db163333d0110241835.zip Doxygen-fce7c2f8af2ccd04137c7db163333d0110241835.tar.gz Doxygen-fce7c2f8af2ccd04137c7db163333d0110241835.tar.bz2 |
Refactoring: Modernise DotGfxHierarchyTable
Diffstat (limited to 'src/dotgfxhierarchytable.h')
-rw-r--r-- | src/dotgfxhierarchytable.h | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/dotgfxhierarchytable.h b/src/dotgfxhierarchytable.h index 5a5bcad..d09298e 100644 --- a/src/dotgfxhierarchytable.h +++ b/src/dotgfxhierarchytable.h @@ -16,6 +16,12 @@ #ifndef DOTGFXHIERARCHYTABLE_H #define DOTGFXHIERARCHYTABLE_H +#include <memory> +#include <string> +#include <unordered_map> +#include <vector> +#include <set> + #include "classdef.h" #include "ftextstream.h" @@ -27,11 +33,10 @@ class DotGfxHierarchyTable : public DotGraph { public: DotGfxHierarchyTable(const char *prefix="",ClassDef::CompoundType ct=ClassDef::Class); - ~DotGfxHierarchyTable(); void createGraph(DotNode *rootNode,FTextStream &t,const char *path, const char *fileName,int id); void writeGraph(FTextStream &t,const char *path, const char *fileName); - const DotNodeList *subGraphs() const { return m_rootSubgraphs; } + const std::vector<DotNode*> subGraphs() const { return m_rootSubgraphs; } protected: virtual QCString getBaseName() const; @@ -39,15 +44,17 @@ class DotGfxHierarchyTable : public DotGraph virtual void computeTheGraph(); private: - void addHierarchy(DotNode *n,const ClassDef *cd,bool hide); - void addClassList(const ClassSDict *cl); + using ClassDefSet = std::set<const ClassDef*>; + void addHierarchy(DotNode *n,const ClassDef *cd,ClassDefSet &visited); + void addClassList(const ClassSDict *cl,ClassDefSet &visited); + using DotNodeMap = std::unordered_map< std::string, std::unique_ptr<DotNode> >; int m_graphId; QCString m_prefix; ClassDef::CompoundType m_classType; - QList<DotNode> *m_rootNodes; - QDict<DotNode> *m_usedNodes; - DotNodeList *m_rootSubgraphs; + std::vector<DotNode*> m_rootNodes; + DotNodeMap m_usedNodes; + std::vector<DotNode*> m_rootSubgraphs; DotNode * m_rootSubgraphNode; }; |