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 */
31class DotGfxHierarchyTable final : public DotGraph
32{
33 public:
35 ~DotGfxHierarchyTable() override = default;
37
38 void createGraph(DotNode *rootNode,TextStream &t,const DString &path,
39 const DString &fileName,int id);
40 void writeGraph(TextStream &t,const DString &path, const DString &fileName);
41 const std::vector<DotNode*> subGraphs() const { return m_rootSubgraphs; }
42
43 protected:
44 DString getBaseName() const override;
45 DString 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:100
CompoundType
The various compound types.
Definition classdef.h:105
A String class for use with Doxygen wrapping std::string and adding some additional functionality off...
Definition dstring.h:88
std::vector< DotNode * > m_rootSubgraphs
void addClassList(const ClassLinkedMap &cl, ClassDefSet &visited)
DString getBaseName() const override
~DotGfxHierarchyTable() override=default
void addHierarchy(DotNode *n, const ClassDef *cd, ClassDefSet &visited)
void writeGraph(TextStream &t, const DString &path, const DString &fileName)
const std::vector< DotNode * > subGraphs() const
DString getMapLabel() const override
DotGfxHierarchyTable(const DString &prefix="", ClassDef::CompoundType ct=ClassDef::Class)
std::unordered_multimap< std::string, std::unique_ptr< DotNode > > DotNodeMap
ClassDef::CompoundType m_classType
std::vector< DotNode * > m_rootNodes
void createGraph(DotNode *rootNode, TextStream &t, const DString &path, const DString &fileName, int id)
DotGraph()
Definition dotgraph.h:38
friend class DotNode
Definition dotgraph.h:36
A node in a dot graph.
Definition dotnode.h:67
Text streaming class that buffers data.
Definition textstream.h:36
std::unordered_set< const ClassDef * > ClassDefSet
Definition classdef.h:91
#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