Doxygen
DotCallGraph类 参考

Representation of an call graph 更多...

#include <dotcallgraph.h>

+ 类 DotCallGraph 继承关系图:
+ DotCallGraph 的协作图:

Public 成员函数

 DotCallGraph (const MemberDef *md, bool inverse)
 
 ~DotCallGraph ()
 
bool isTrivial () const
 
bool isTooBig () const
 
int numNodes () const
 
QCString writeGraph (TextStream &t, GraphOutputFormat gf, EmbeddedOutputFormat ef, const QCString &path, const QCString &fileName, const QCString &relPath, bool writeImageMap=TRUE, int graphId=-1)
 
- Public 成员函数 继承自 DotGraph
 DotGraph ()
 
virtual ~DotGraph ()
 

静态 Public 成员函数

static bool isTrivial (const MemberDef *md, bool inverse)
 

Protected 成员函数

virtual QCString getBaseName () const
 
virtual QCString getMapLabel () const
 
virtual void computeTheGraph ()
 
- Protected 成员函数 继承自 DotGraph
int getNextNodeNumber ()
 returns node numbers. 更多...
 
QCString writeGraph (TextStream &t, GraphOutputFormat gf, EmbeddedOutputFormat ef, const QCString &path, const QCString &fileName, const QCString &relPath, bool writeImageMap=TRUE, int graphId=-1)
 
virtual QCString absMapName () const
 
virtual QCString getImgAltText () const
 
QCString absBaseName () const
 
QCString absDotName () const
 
QCString imgName () const
 
QCString absImgName () const
 
QCString relImgName () const
 

Private 成员函数

void buildGraph (DotNode *n, const MemberDef *md, int distance)
 
void determineVisibleNodes (DotNodeDeque &queue, int &maxNodes)
 
void determineTruncatedNodes (DotNodeDeque &queue)
 

Private 属性

DotNodem_startNode
 
DotNodeMap m_usedNodes
 
bool m_inverse
 
QCString m_diskName
 
const Definitionm_scope
 

额外继承的成员函数

- 静态 Protected 成员函数 继承自 DotGraph
static void writeGraphHeader (TextStream &t, const QCString &title=QCString())
 
static void writeGraphFooter (TextStream &t)
 
static void computeGraph (DotNode *root, GraphType gt, GraphOutputFormat format, const QCString &rank, bool renderParents, bool backArrows, const QCString &title, QCString &graphStr)
 
- Protected 属性 继承自 DotGraph
GraphOutputFormat m_graphFormat = GOF_BITMAP
 
EmbeddedOutputFormat m_textFormat = EOF_Html
 
Dir m_dir
 
QCString m_fileName
 
QCString m_relPath
 
bool m_generateImageMap = false
 
int m_graphId = 0
 
QCString m_absPath
 
QCString m_baseName
 
QCString m_theGraph
 
bool m_regenerate = false
 
bool m_doNotAddImageToIndex = false
 
bool m_noDivTag = false
 
bool m_zoomable = true
 
bool m_urlOnly = false
 

详细描述

Representation of an call graph

在文件 dotcallgraph.h26 行定义.

构造及析构函数说明

◆ DotCallGraph()

DotCallGraph::DotCallGraph ( const MemberDef md,
bool  inverse 
)

在文件 dotcallgraph.cpp120 行定义.

121 {
122  m_inverse = inverse;
123  m_diskName = md->getOutputFileBase()+"_"+md->anchor();
124  m_scope = md->getOuterScope();
125  QCString uniqueId = getUniqueId(md);
126  QCString name;
127  if (Config_getBool(HIDE_SCOPE_NAMES))
128  {
129  name = md->name();
130  }
131  else
132  {
133  name = md->qualifiedName();
134  }
135  QCString tooltip = md->briefDescriptionAsTooltip();
137  linkToText(md->getLanguage(),name,FALSE),
138  tooltip,
139  uniqueId,
140  TRUE // root node
141  );
143  m_usedNodes.insert(std::make_pair(uniqueId.str(),m_startNode));
144  buildGraph(m_startNode,md,1);
145 
146  int maxNodes = Config_getInt(DOT_GRAPH_MAX_NODES);
147  DotNodeDeque openNodeQueue;
148  openNodeQueue.push_back(m_startNode);
149  determineVisibleNodes(openNodeQueue,maxNodes);
150  openNodeQueue.clear();
151  openNodeQueue.push_back(m_startNode);
152  determineTruncatedNodes(openNodeQueue);
153 }

引用了 MemberDef::anchor(), Definition::briefDescriptionAsTooltip(), buildGraph(), Config_getBool, Config_getInt, determineTruncatedNodes(), determineVisibleNodes(), FALSE, Definition::getLanguage(), DotGraph::getNextNodeNumber(), Definition::getOuterScope(), MemberDef::getOutputFileBase(), getUniqueId(), linkToText(), m_diskName, m_inverse, m_scope, m_startNode, m_usedNodes, Definition::name(), MemberDef::qualifiedName(), DotNode::setDistance(), QCString::str() , 以及 TRUE.

◆ ~DotCallGraph()

DotCallGraph::~DotCallGraph ( )

在文件 dotcallgraph.cpp155 行定义.

156 {
158 }

引用了 DotNode::deleteNodes() , 以及 m_startNode.

成员函数说明

◆ buildGraph()

void DotCallGraph::buildGraph ( DotNode n,
const MemberDef md,
int  distance 
)
private

在文件 dotcallgraph.cpp33 行定义.

34 {
35  auto refs = m_inverse ? md->getReferencedByMembers() : md->getReferencesMembers();
36  for (const auto &rmd : refs)
37  {
38  if (rmd->showInCallGraph())
39  {
40  QCString uniqueId = getUniqueId(rmd);
41  auto it = m_usedNodes.find(uniqueId.str());
42  if (it!=m_usedNodes.end()) // file is already a node in the graph
43  {
44  DotNode *bn = it->second;
45  n->addChild(bn,0,0);
46  bn->addParent(n);
47  bn->setDistance(distance);
48  }
49  else
50  {
51  QCString name;
52  if (Config_getBool(HIDE_SCOPE_NAMES))
53  {
54  name = rmd->getOuterScope()==m_scope ?
55  rmd->name() : rmd->qualifiedName();
56  }
57  else
58  {
59  name = rmd->qualifiedName();
60  }
61  QCString tooltip = rmd->briefDescriptionAsTooltip();
62  DotNode *bn = new DotNode(
64  linkToText(rmd->getLanguage(),name,FALSE),
65  tooltip,
66  uniqueId,
67  0 //distance
68  );
69  n->addChild(bn,0,0);
70  bn->addParent(n);
71  bn->setDistance(distance);
72  m_usedNodes.insert(std::make_pair(uniqueId.str(),bn));
73 
74  buildGraph(bn,rmd,distance+1);
75  }
76  }
77  }
78 }

引用了 DotNode::addChild(), DotNode::addParent(), Config_getBool, FALSE, DotGraph::getNextNodeNumber(), Definition::getReferencedByMembers(), Definition::getReferencesMembers(), getUniqueId(), linkToText(), m_inverse, m_scope, m_usedNodes, Definition::name(), DotNode::setDistance() , 以及 QCString::str().

被这些函数引用 DotCallGraph().

◆ computeTheGraph()

void DotCallGraph::computeTheGraph ( )
protectedvirtual

实现了 DotGraph.

在文件 dotcallgraph.cpp165 行定义.

166 {
167  computeGraph(
168  m_startNode,
169  CallGraph,
171  m_inverse ? "RL" : "LR",
172  FALSE,
173  m_inverse,
174  m_startNode->label(),
175  m_theGraph);
176 }

引用了 CallGraph, DotGraph::computeGraph(), FALSE, DotNode::label(), DotGraph::m_graphFormat, m_inverse, m_startNode , 以及 DotGraph::m_theGraph.

◆ determineTruncatedNodes()

void DotCallGraph::determineTruncatedNodes ( DotNodeDeque queue)
private

在文件 dotcallgraph.cpp99 行定义.

100 {
101  while (!queue.empty())
102  {
103  DotNode *n = queue.front();
104  queue.pop_front();
105  if (n->isVisible() && n->isTruncated()==DotNode::Unknown)
106  {
107  bool truncated = FALSE;
108  for (const auto &dn : n->children())
109  {
110  if (!dn->isVisible())
111  truncated = TRUE;
112  else
113  queue.push_back(dn);
114  }
115  n->markAsTruncated(truncated);
116  }
117  }
118 }

引用了 DotNode::children(), FALSE, DotNode::isTruncated(), DotNode::isVisible(), DotNode::markAsTruncated(), TRUE , 以及 DotNode::Unknown.

被这些函数引用 DotCallGraph().

◆ determineVisibleNodes()

void DotCallGraph::determineVisibleNodes ( DotNodeDeque queue,
int &  maxNodes 
)
private

在文件 dotcallgraph.cpp80 行定义.

81 {
82  while (!queue.empty() && maxNodes>0)
83  {
84  DotNode *n = queue.front();
85  queue.pop_front();
86  if (!n->isVisible() && n->distance()<=Config_getInt(MAX_DOT_GRAPH_DEPTH)) // not yet processed
87  {
88  n->markAsVisible();
89  maxNodes--;
90  // add direct children
91  for (const auto &dn : n->children())
92  {
93  queue.push_back(dn);
94  }
95  }
96  }
97 }

引用了 DotNode::children(), Config_getInt, DotNode::distance(), DotNode::isVisible() , 以及 DotNode::markAsVisible().

被这些函数引用 DotCallGraph().

◆ getBaseName()

QCString DotCallGraph::getBaseName ( ) const
protectedvirtual

实现了 DotGraph.

在文件 dotcallgraph.cpp160 行定义.

161 {
162  return m_diskName + (m_inverse ? "_icgraph" : "_cgraph");
163 }

引用了 m_diskName , 以及 m_inverse.

◆ getMapLabel()

QCString DotCallGraph::getMapLabel ( ) const
protectedvirtual

实现了 DotGraph.

在文件 dotcallgraph.cpp178 行定义.

179 {
180  return m_baseName;
181 }

引用了 DotGraph::m_baseName.

◆ isTooBig()

bool DotCallGraph::isTooBig ( ) const

在文件 dotcallgraph.cpp200 行定义.

201 {
202  return numNodes()>=Config_getInt(DOT_GRAPH_MAX_NODES);
203 }

引用了 Config_getInt , 以及 numNodes().

被这些函数引用 MemberDefImpl::_writeCallerGraph() , 以及 MemberDefImpl::_writeCallGraph().

◆ isTrivial() [1/2]

bool DotCallGraph::isTrivial ( ) const

◆ isTrivial() [2/2]

bool DotCallGraph::isTrivial ( const MemberDef md,
bool  inverse 
)
static

在文件 dotcallgraph.cpp210 行定义.

211 {
212  auto refs = inverse ? md->getReferencedByMembers() : md->getReferencesMembers();
213  for (const auto &rmd : refs)
214  {
215  if (rmd->showInCallGraph())
216  {
217  return FALSE;
218  }
219  }
220  return TRUE;
221 }

引用了 FALSE, Definition::getReferencedByMembers(), Definition::getReferencesMembers() , 以及 TRUE.

◆ numNodes()

int DotCallGraph::numNodes ( ) const

在文件 dotcallgraph.cpp205 行定义.

206 {
207  return (int)m_startNode->children().size();
208 }

引用了 DotNode::children() , 以及 m_startNode.

被这些函数引用 MemberDefImpl::_writeCallerGraph(), MemberDefImpl::_writeCallGraph() , 以及 isTooBig().

◆ writeGraph()

QCString DotCallGraph::writeGraph ( TextStream t,
GraphOutputFormat  gf,
EmbeddedOutputFormat  ef,
const QCString path,
const QCString fileName,
const QCString relPath,
bool  writeImageMap = TRUE,
int  graphId = -1 
)

在文件 dotcallgraph.cpp183 行定义.

191 {
192  return DotGraph::writeGraph(out, graphFormat, textFormat, path, fileName, relPath, generateImageMap, graphId);
193 }

引用了 DotGraph::writeGraph().

被这些函数引用 RTFGenerator::endCallGraph(), DocbookGenerator::endCallGraph(), LatexGenerator::endCallGraph() , 以及 HtmlGenerator::endCallGraph().

类成员变量说明

◆ m_diskName

QCString DotCallGraph::m_diskName
private

在文件 dotcallgraph.h65 行定义.

被这些函数引用 DotCallGraph() , 以及 getBaseName().

◆ m_inverse

bool DotCallGraph::m_inverse
private

在文件 dotcallgraph.h64 行定义.

被这些函数引用 buildGraph(), computeTheGraph(), DotCallGraph() , 以及 getBaseName().

◆ m_scope

const Definition* DotCallGraph::m_scope
private

在文件 dotcallgraph.h66 行定义.

被这些函数引用 buildGraph() , 以及 DotCallGraph().

◆ m_startNode

DotNode* DotCallGraph::m_startNode
private

在文件 dotcallgraph.h62 行定义.

被这些函数引用 computeTheGraph(), DotCallGraph(), isTrivial(), numNodes() , 以及 ~DotCallGraph().

◆ m_usedNodes

DotNodeMap DotCallGraph::m_usedNodes
private

在文件 dotcallgraph.h63 行定义.

被这些函数引用 buildGraph() , 以及 DotCallGraph().


该类的文档由以下文件生成:
DotCallGraph::m_inverse
bool m_inverse
Definition: dotcallgraph.h:64
DotGraph::computeGraph
static void computeGraph(DotNode *root, GraphType gt, GraphOutputFormat format, const QCString &rank, bool renderParents, bool backArrows, const QCString &title, QCString &graphStr)
Definition: dotgraph.cpp:305
DotNode::addChild
void addChild(DotNode *n, int edgeColor=EdgeInfo::Purple, int edgeStyle=EdgeInfo::Solid, const QCString &edgeLab=QCString(), const QCString &edgeURL=QCString(), int edgeLabCol=-1)
Definition: dotnode.cpp:281
DotGraph::m_theGraph
QCString m_theGraph
Definition: dotgraph.h:89
DotNode::Unknown
@ Unknown
Definition: dotnode.h:65
DotNode::setDistance
void setDistance(int distance)
Definition: dotnode.cpp:333
getUniqueId
static QCString getUniqueId(const MemberDef *md)
Definition: dotcallgraph.cpp:23
DotNode::markAsTruncated
void markAsTruncated(bool b=TRUE)
Definition: dotnode.h:108
Definition::getReferencedByMembers
virtual const MemberVector & getReferencedByMembers() const =0
QCString::str
std::string str() const
Definition: qcstring.h:442
DotNode::deleteNodes
static void deleteNodes(DotNode *node)
Definition: dotnode.cpp:347
DotNode::addParent
void addParent(DotNode *n)
Definition: dotnode.cpp:298
DotGraph::getNextNodeNumber
int getNextNodeNumber()
returns node numbers.
Definition: dotgraph.h:41
DotCallGraph::determineTruncatedNodes
void determineTruncatedNodes(DotNodeDeque &queue)
Definition: dotcallgraph.cpp:99
DotNode::markAsVisible
void markAsVisible(bool b=TRUE)
Definition: dotnode.h:107
Definition::getLanguage
virtual SrcLangExt getLanguage() const =0
Returns the programming language this definition was written in.
MemberDef::anchor
virtual QCString anchor() const =0
DotNode
A node in a dot graph
Definition: dotnode.h:56
DotCallGraph::determineVisibleNodes
void determineVisibleNodes(DotNodeDeque &queue, int &maxNodes)
Definition: dotcallgraph.cpp:80
Config_getInt
#define Config_getInt(name)
Definition: config.h:34
Definition::getReferencesMembers
virtual const MemberVector & getReferencesMembers() const =0
DotCallGraph::m_diskName
QCString m_diskName
Definition: dotcallgraph.h:65
DotCallGraph::m_startNode
DotNode * m_startNode
Definition: dotcallgraph.h:62
Definition::name
virtual QCString name() const =0
DotNode::label
QCString label() const
Definition: dotnode.h:89
DotGraph::m_graphFormat
GraphOutputFormat m_graphFormat
Definition: dotgraph.h:79
TRUE
#define TRUE
Definition: qcstring.h:36
DotNode::isTruncated
TruncState isTruncated() const
Definition: dotnode.h:92
DotNode::isVisible
bool isVisible() const
Definition: dotnode.h:91
DotGraph::writeGraph
QCString writeGraph(TextStream &t, GraphOutputFormat gf, EmbeddedOutputFormat ef, const QCString &path, const QCString &fileName, const QCString &relPath, bool writeImageMap=TRUE, int graphId=-1)
Definition: dotgraph.cpp:111
DotCallGraph::numNodes
int numNodes() const
Definition: dotcallgraph.cpp:205
linkToText
QCString linkToText(SrcLangExt lang, const QCString &link, bool isFileName)
Definition: util.cpp:2943
MemberDef::qualifiedName
virtual QCString qualifiedName() const =0
DotNodeDeque
Definition: dotnode.h:137
CallGraph
@ CallGraph
Definition: dotgraph.h:29
MemberDef::getOutputFileBase
virtual QCString getOutputFileBase() const =0
Config_getBool
#define Config_getBool(name)
Definition: config.h:33
DotNode::distance
int distance() const
Definition: dotnode.h:93
DotCallGraph::m_scope
const Definition * m_scope
Definition: dotcallgraph.h:66
Definition::getOuterScope
virtual Definition * getOuterScope() const =0
DotCallGraph::buildGraph
void buildGraph(DotNode *n, const MemberDef *md, int distance)
Definition: dotcallgraph.cpp:33
Definition::briefDescriptionAsTooltip
virtual QCString briefDescriptionAsTooltip() const =0
DotCallGraph::m_usedNodes
DotNodeMap m_usedNodes
Definition: dotcallgraph.h:63
DotGraph::m_baseName
QCString m_baseName
Definition: dotgraph.h:88
DotNode::children
const DotNodeRefVector & children() const
Definition: dotnode.h:109
FALSE
#define FALSE
Definition: qcstring.h:33
QCString
This is an alternative implementation of QCString.
Definition: qcstring.h:108