Doxygen
Loading...
Searching...
No Matches
dotgfxhierarchytable.h
Go to the documentation of this file.
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
28class ClassLinkedMap;
29
30/** Represents a graphical class hierarchy */
32{
33 public:
35 ~DotGfxHierarchyTable() override = default;
37
38 void createGraph(DotNode *rootNode,TextStream &t,const QCString &path,
39 const QCString &fileName,int id);
40 void writeGraph(TextStream &t,const QCString &path, const QCString &fileName);
41 const std::vector<DotNode*> subGraphs() const { return m_rootSubgraphs; }
42
43 protected:
44 QCString getBaseName() const override;
45 QCString getMapLabel() const override;
46 void computeTheGraph() override;
47
48 private:
49 void addHierarchy(DotNode *n,const ClassDef *cd,ClassDefSet &visited);
50 void addClassList(const ClassLinkedMap &cl,ClassDefSet &visited);
51
52 using DotNodeMap = std::unordered_multimap< std::string, std::unique_ptr<DotNode> >;
56 std::vector<DotNode*> m_rootNodes;
58 std::vector<DotNode*> m_rootSubgraphs;
60};
61
62using DotGfxHierarchyTablePtr = std::shared_ptr<DotGfxHierarchyTable>;
63
64#endif
constexpr auto prefix
Definition anchor.cpp:44
A abstract class representing of a compound symbol.
Definition classdef.h:104
CompoundType
The various compound types.
Definition classdef.h:109
std::vector< DotNode * > m_rootSubgraphs
QCString getMapLabel() const override
void addClassList(const ClassLinkedMap &cl, ClassDefSet &visited)
DotGfxHierarchyTable(const QCString &prefix="", ClassDef::CompoundType ct=ClassDef::Class)
~DotGfxHierarchyTable() override=default
void addHierarchy(DotNode *n, const ClassDef *cd, ClassDefSet &visited)
void writeGraph(TextStream &t, const QCString &path, const QCString &fileName)
const std::vector< DotNode * > subGraphs() const
void createGraph(DotNode *rootNode, TextStream &t, const QCString &path, const QCString &fileName, int id)
std::unordered_multimap< std::string, std::unique_ptr< DotNode > > DotNodeMap
ClassDef::CompoundType m_classType
QCString getBaseName() const override
std::vector< DotNode * > m_rootNodes
DotGraph()
Definition dotgraph.h:38
friend class DotNode
Definition dotgraph.h:36
A node in a dot graph.
Definition dotnode.h:68
This is an alternative implementation of QCString.
Definition qcstring.h:101
Text streaming class that buffers data.
Definition textstream.h:36
std::unordered_set< const ClassDef * > ClassDefSet
Definition classdef.h:95
#define NON_COPYABLE(cls)
Macro to help implementing the rule of 5 for a non-copyable & movable class.
Definition construct.h:37
std::shared_ptr< DotGfxHierarchyTable > DotGfxHierarchyTablePtr