Doxygen
dotgfxhierarchytable.h
浏览该文件的文档.
1 /******************************************************************************
2 *
3 * Copyright (C) 1997-2019 by Dimitri van Heesch.
4 *
5 * Permission to use, copy, modify, and distribute this software and its
6 * documentation under the terms of the GNU General Public License is hereby
7 * granted. No representations are made about the suitability of this software
8 * for any purpose. It is provided "as is" without express or implied warranty.
9 * See the GNU General Public License for more details.
10 *
11 * Documents produced by Doxygen are derivative works derived from the
12 * input used in their production; they are not affected by this license.
13 *
14 */
15 
16 #ifndef DOTGFXHIERARCHYTABLE_H
17 #define DOTGFXHIERARCHYTABLE_H
18 
19 #include <memory>
20 #include <string>
21 #include <unordered_map>
22 #include <vector>
23 
24 #include "classdef.h"
25 #include "dotgraph.h"
26 #include "dotnode.h"
27 
28 class ClassLinkedMap;
29 
30 /** Represents a graphical class hierarchy */
32 {
33  public:
35  void createGraph(DotNode *rootNode,TextStream &t,const QCString &path,
36  const QCString &fileName,int id);
37  void writeGraph(TextStream &t,const QCString &path, const QCString &fileName);
38  const std::vector<DotNode*> subGraphs() const { return m_rootSubgraphs; }
39 
40  protected:
41  virtual QCString getBaseName() const;
42  virtual QCString getMapLabel() const;
43  virtual void computeTheGraph();
44 
45  private:
46  void addHierarchy(DotNode *n,const ClassDef *cd,ClassDefSet &visited);
47  void addClassList(const ClassLinkedMap &cl,ClassDefSet &visited);
48 
49  using DotNodeMap = std::unordered_multimap< std::string, std::unique_ptr<DotNode> >;
50  int m_graphId;
53  std::vector<DotNode*> m_rootNodes;
55  std::vector<DotNode*> m_rootSubgraphs;
57 };
58 
59 using DotGfxHierarchyTablePtr = std::shared_ptr<DotGfxHierarchyTable>;
60 
61 #endif
DotGfxHierarchyTable::createGraph
void createGraph(DotNode *rootNode, TextStream &t, const QCString &path, const QCString &fileName, int id)
Definition: dotgfxhierarchytable.cpp:65
DotGfxHierarchyTable::addClassList
void addClassList(const ClassLinkedMap &cl, ClassDefSet &visited)
Definition: dotgfxhierarchytable.cpp:179
DotGfxHierarchyTable::m_rootNodes
std::vector< DotNode * > m_rootNodes
Definition: dotgfxhierarchytable.h:53
DotGfxHierarchyTable::m_classType
ClassDef::CompoundType m_classType
Definition: dotgfxhierarchytable.h:52
DotGfxHierarchyTable::m_usedNodes
DotNodeMap m_usedNodes
Definition: dotgfxhierarchytable.h:54
dotnode.h
DotGfxHierarchyTable::m_rootSubgraphNode
DotNode * m_rootSubgraphNode
Definition: dotgfxhierarchytable.h:56
ClassDef::CompoundType
CompoundType
The various compound types
Definition: classdef.h:107
DotGfxHierarchyTable::m_rootSubgraphs
std::vector< DotNode * > m_rootSubgraphs
Definition: dotgfxhierarchytable.h:55
DotGfxHierarchyTable::writeGraph
void writeGraph(TextStream &t, const QCString &path, const QCString &fileName)
Definition: dotgfxhierarchytable.cpp:75
TextStream
Text streaming class that buffers data.
Definition: textstream.h:33
ClassDef::Class
@ Class
Definition: classdef.h:107
DotGfxHierarchyTable::addHierarchy
void addHierarchy(DotNode *n, const ClassDef *cd, ClassDefSet &visited)
Definition: dotgfxhierarchytable.cpp:105
DotGfxHierarchyTable::DotGfxHierarchyTable
DotGfxHierarchyTable(const QCString &prefix="", ClassDef::CompoundType ct=ClassDef::Class)
Definition: dotgfxhierarchytable.cpp:226
DotNode
A node in a dot graph
Definition: dotnode.h:56
ClassDef
A abstract class representing of a compound symbol.
Definition: classdef.h:103
DotGfxHierarchyTable::computeTheGraph
virtual void computeTheGraph()
Definition: dotgfxhierarchytable.cpp:37
DotGfxHierarchyTable::getMapLabel
virtual QCString getMapLabel() const
Definition: dotgfxhierarchytable.cpp:60
DotNodeMap
Definition: dotnode.h:133
DotGfxHierarchyTablePtr
std::shared_ptr< DotGfxHierarchyTable > DotGfxHierarchyTablePtr
Definition: dotgfxhierarchytable.h:59
dotgraph.h
classdef.h
DotGfxHierarchyTable::m_graphId
int m_graphId
Definition: dotgfxhierarchytable.h:50
DotGfxHierarchyTable::m_prefix
QCString m_prefix
Definition: dotgfxhierarchytable.h:51
DotGfxHierarchyTable
Represents a graphical class hierarchy
Definition: dotgfxhierarchytable.h:31
DotGraph
A dot graph
Definition: dotgraph.h:32
DotGfxHierarchyTable::getBaseName
virtual QCString getBaseName() const
Definition: dotgfxhierarchytable.cpp:27
ClassLinkedMap
Definition: classlist.h:26
ClassDefSet
std::set< const ClassDef * > ClassDefSet
Definition: classdef.h:95
DotGfxHierarchyTable::subGraphs
const std::vector< DotNode * > subGraphs() const
Definition: dotgfxhierarchytable.h:38
QCString
This is an alternative implementation of QCString.
Definition: qcstring.h:108