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 
32 {
33  public:
34  DotGfxHierarchyTable(const QCString &prefix="",ClassDef::CompoundType ct=ClassDef::Class);
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;
51  QCString m_prefix;
52  ClassDef::CompoundType m_classType;
53  std::vector<DotNode*> m_rootNodes;
54  DotNodeMap m_usedNodes;
55  std::vector<DotNode*> m_rootSubgraphs;
56  DotNode * m_rootSubgraphNode;
57 };
58 
59 using DotGfxHierarchyTablePtr = std::shared_ptr<DotGfxHierarchyTable>;
60 
61 #endif
A node in a dot graph.
Definition: dotnode.h:68
Text streaming class that buffers data.
Definition: textstream.h:34
Represents a graphical class hierarchy.
Definition: dotgfxhierarchytable.h:31
Definition: dotnode.h:150
A dot graph.
Definition: dotgraph.h:33
CompoundType
The various compound types.
Definition: classdef.h:107
This is an alternative implementation of QCString.
Definition: qcstring.h:93
A abstract class representing of a compound symbol.
Definition: classdef.h:103
Definition: classlist.h:26