Doxygen
DotInclDepGraph类 参考

Representation of an include dependency graph 更多...

#include <dotincldepgraph.h>

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

Public 成员函数

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

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 成员函数

QCString diskName () const
 
void buildGraph (DotNode *n, const FileDef *fd, int distance)
 
void determineVisibleNodes (DotNodeDeque &queue, int &maxNodes)
 
void determineTruncatedNodes (DotNodeDeque &queue)
 

Private 属性

DotNodem_startNode
 
DotNodeMap m_usedNodes
 
QCString m_inclDepFileName
 
QCString m_inclByDepFileName
 
bool m_inverse
 

额外继承的成员函数

- 静态 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 include dependency graph

在文件 dotincldepgraph.h30 行定义.

构造及析构函数说明

◆ DotInclDepGraph()

DotInclDepGraph::DotInclDepGraph ( const FileDef fd,
bool  inverse 
)

在文件 dotincldepgraph.cpp123 行定义.

124 {
125  m_inverse = inverse;
126  ASSERT(fd!=0);
129  QCString tmp_url=fd->getReference()+"$"+fd->getOutputFileBase();
130  QCString tooltip = fd->briefDescriptionAsTooltip();
132  fd->docName(),
133  tooltip,
134  tmp_url,
135  TRUE); // root node
137  m_usedNodes.insert(std::make_pair(fd->absFilePath().str(),m_startNode));
138  buildGraph(m_startNode,fd,1);
139 
140  int maxNodes = Config_getInt(DOT_GRAPH_MAX_NODES);
141  DotNodeDeque openNodeQueue;
142  openNodeQueue.push_back(m_startNode);
143  determineVisibleNodes(openNodeQueue,maxNodes);
144  openNodeQueue.clear();
145  openNodeQueue.push_back(m_startNode);
146  determineTruncatedNodes(openNodeQueue);
147 }

引用了 FileDef::absFilePath(), ASSERT, Definition::briefDescriptionAsTooltip(), buildGraph(), Config_getInt, determineTruncatedNodes(), determineVisibleNodes(), FileDef::docName(), DotGraph::getNextNodeNumber(), FileDef::getOutputFileBase(), Definition::getReference(), FileDef::includedByDependencyGraphFileName(), FileDef::includeDependencyGraphFileName(), m_inclByDepFileName, m_inclDepFileName, m_inverse, m_startNode, m_usedNodes, DotNode::setDistance(), QCString::str() , 以及 TRUE.

◆ ~DotInclDepGraph()

DotInclDepGraph::~DotInclDepGraph ( )

在文件 dotincldepgraph.cpp149 行定义.

150 {
152 }

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

成员函数说明

◆ buildGraph()

void DotInclDepGraph::buildGraph ( DotNode n,
const FileDef fd,
int  distance 
)
private

在文件 dotincldepgraph.cpp22 行定义.

23 {
24  const IncludeInfoList &includeFiles = m_inverse ? fd->includedByFileList() : fd->includeFileList();
25  for (const auto &ii : includeFiles)
26  {
27  const FileDef *bfd = ii.fileDef;
28  QCString in = ii.includeName;
29  //printf(">>>> in='%s' bfd=%p\n",qPrint(ii->includeName),bfd);
30  bool doc=TRUE,src=FALSE;
31  if (bfd)
32  {
33  in = bfd->absFilePath();
34  doc = bfd->isLinkable() && !bfd->isHidden();
35  src = bfd->generateSourceFile();
36  }
37  if (doc || src || !Config_getBool(HIDE_UNDOC_RELATIONS))
38  {
39  QCString url="";
40  if (bfd) url=bfd->getOutputFileBase();
41  if (!doc && src)
42  {
43  url=bfd->getSourceFileBase();
44  }
45  auto it = m_usedNodes.find(in.str());
46  if (it!=m_usedNodes.end()) // file is already a node in the graph
47  {
48  DotNode *bn = it->second;
49  n->addChild(bn,0,0);
50  bn->addParent(n);
51  bn->setDistance(distance);
52  }
53  else
54  {
55  QCString tmp_url;
56  QCString tooltip;
57  if (bfd)
58  {
59  tmp_url=doc || src ? bfd->getReference()+"$"+url : QCString();
60  tooltip = bfd->briefDescriptionAsTooltip();
61  }
62  DotNode *bn = new DotNode(getNextNodeNumber(),// n
63  ii.includeName, // label
64  tooltip, // tip
65  tmp_url, // url
66  FALSE, // rootNode
67  0); // cd
68  n->addChild(bn,0,0);
69  bn->addParent(n);
70  m_usedNodes.insert(std::make_pair(in.str(),bn));
71  bn->setDistance(distance);
72 
73  if (bfd) buildGraph(bn,bfd,distance+1);
74  }
75  }
76  }
77 }

引用了 FileDef::absFilePath(), DotNode::addChild(), DotNode::addParent(), Definition::briefDescriptionAsTooltip(), Config_getBool, FALSE, FileDef::generateSourceFile(), DotGraph::getNextNodeNumber(), FileDef::getOutputFileBase(), Definition::getReference(), FileDef::getSourceFileBase(), FileDef::includedByFileList(), FileDef::includeFileList(), Definition::isHidden(), FileDef::isLinkable(), m_inverse, m_usedNodes, DotNode::setDistance(), QCString::str() , 以及 TRUE.

被这些函数引用 DotInclDepGraph().

◆ computeTheGraph()

void DotInclDepGraph::computeTheGraph ( )
protectedvirtual

◆ determineTruncatedNodes()

void DotInclDepGraph::determineTruncatedNodes ( DotNodeDeque queue)
private

在文件 dotincldepgraph.cpp98 行定义.

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

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

被这些函数引用 DotInclDepGraph().

◆ determineVisibleNodes()

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

在文件 dotincldepgraph.cpp79 行定义.

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

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

被这些函数引用 DotInclDepGraph().

◆ diskName()

QCString DotInclDepGraph::diskName ( ) const
private

◆ getBaseName()

QCString DotInclDepGraph::getBaseName ( ) const
protectedvirtual

实现了 DotGraph.

在文件 dotincldepgraph.cpp154 行定义.

155 {
156  if (m_inverse)
157  {
158  return m_inclByDepFileName;
159  }
160  else
161  {
162  return m_inclDepFileName;
163  }
164 }

引用了 m_inclByDepFileName, m_inclDepFileName , 以及 m_inverse.

◆ getMapLabel()

QCString DotInclDepGraph::getMapLabel ( ) const
protectedvirtual

实现了 DotGraph.

在文件 dotincldepgraph.cpp172 行定义.

173 {
174  if (m_inverse)
175  {
176  return escapeCharsInString(m_startNode->label(),FALSE) + "dep";
177  }
178  else
179  {
181  }
182 }

引用了 escapeCharsInString(), FALSE, DotNode::label(), m_inverse , 以及 m_startNode.

◆ isTooBig()

bool DotInclDepGraph::isTooBig ( ) const

在文件 dotincldepgraph.cpp201 行定义.

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

引用了 Config_getInt , 以及 numNodes().

被这些函数引用 FileDefImpl::writeIncludedByGraph() , 以及 FileDefImpl::writeIncludeGraph().

◆ isTrivial()

bool DotInclDepGraph::isTrivial ( ) const

在文件 dotincldepgraph.cpp196 行定义.

197 {
198  return m_startNode->children().empty();
199 }

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

被这些函数引用 generateXMLForFile(), FileDefImpl::writeIncludedByGraph() , 以及 FileDefImpl::writeIncludeGraph().

◆ numNodes()

int DotInclDepGraph::numNodes ( ) const

在文件 dotincldepgraph.cpp206 行定义.

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

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

被这些函数引用 isTooBig(), FileDefImpl::writeIncludedByGraph() , 以及 FileDefImpl::writeIncludeGraph().

◆ writeDocbook()

void DotInclDepGraph::writeDocbook ( TextStream t)

在文件 dotincldepgraph.cpp219 行定义.

220 {
221  for (const auto &kv : m_usedNodes)
222  {
223  kv.second->writeDocbook(t,FALSE);
224  }
225 }

引用了 FALSE , 以及 m_usedNodes.

◆ writeGraph()

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

在文件 dotincldepgraph.cpp184 行定义.

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

引用了 DotGraph::writeGraph().

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

◆ writeXML()

void DotInclDepGraph::writeXML ( TextStream t)

在文件 dotincldepgraph.cpp211 行定义.

212 {
213  for (const auto &kv : m_usedNodes)
214  {
215  kv.second->writeXML(t,FALSE);
216  }
217 }

引用了 FALSE , 以及 m_usedNodes.

被这些函数引用 generateXMLForFile().

类成员变量说明

◆ m_inclByDepFileName

QCString DotInclDepGraph::m_inclByDepFileName
private

在文件 dotincldepgraph.h58 行定义.

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

◆ m_inclDepFileName

QCString DotInclDepGraph::m_inclDepFileName
private

在文件 dotincldepgraph.h57 行定义.

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

◆ m_inverse

bool DotInclDepGraph::m_inverse
private

在文件 dotincldepgraph.h59 行定义.

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

◆ m_startNode

DotNode* DotInclDepGraph::m_startNode
private

在文件 dotincldepgraph.h55 行定义.

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

◆ m_usedNodes

DotNodeMap DotInclDepGraph::m_usedNodes
private

在文件 dotincldepgraph.h56 行定义.

被这些函数引用 buildGraph(), DotInclDepGraph(), writeDocbook() , 以及 writeXML().


该类的文档由以下文件生成:
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
FileDef::getSourceFileBase
virtual QCString getSourceFileBase() const =0
FileDef::generateSourceFile
virtual bool generateSourceFile() const =0
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
DotInclDepGraph::m_inclByDepFileName
QCString m_inclByDepFileName
Definition: dotincldepgraph.h:58
DotNode::markAsTruncated
void markAsTruncated(bool b=TRUE)
Definition: dotnode.h:108
QCString::str
std::string str() const
Definition: qcstring.h:442
DotNode::deleteNodes
static void deleteNodes(DotNode *node)
Definition: dotnode.cpp:347
Definition::isHidden
virtual bool isHidden() const =0
DotNode::addParent
void addParent(DotNode *n)
Definition: dotnode.cpp:298
DotGraph::getNextNodeNumber
int getNextNodeNumber()
returns node numbers.
Definition: dotgraph.h:41
FileDef::includedByFileList
virtual const IncludeInfoList & includedByFileList() const =0
FileDef::isLinkable
virtual bool isLinkable() const =0
FileDef::docName
virtual const QCString & docName() const =0
DotNode::markAsVisible
void markAsVisible(bool b=TRUE)
Definition: dotnode.h:107
DotInclDepGraph::numNodes
int numNodes() const
Definition: dotincldepgraph.cpp:206
DotNode
A node in a dot graph
Definition: dotnode.h:56
DotInclDepGraph::determineVisibleNodes
void determineVisibleNodes(DotNodeDeque &queue, int &maxNodes)
Definition: dotincldepgraph.cpp:79
Config_getInt
#define Config_getInt(name)
Definition: config.h:34
DotInclDepGraph::m_startNode
DotNode * m_startNode
Definition: dotincldepgraph.h:55
FileDef::includeDependencyGraphFileName
virtual QCString includeDependencyGraphFileName() const =0
DotInclDepGraph::m_inclDepFileName
QCString m_inclDepFileName
Definition: dotincldepgraph.h:57
DotInclDepGraph::buildGraph
void buildGraph(DotNode *n, const FileDef *fd, int distance)
Definition: dotincldepgraph.cpp:22
FileDef::includedByDependencyGraphFileName
virtual QCString includedByDependencyGraphFileName() const =0
DotNode::label
QCString label() const
Definition: dotnode.h:89
Dependency
@ Dependency
Definition: dotgraph.h:29
DotInclDepGraph::m_inverse
bool m_inverse
Definition: dotincldepgraph.h:59
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
DotInclDepGraph::m_usedNodes
DotNodeMap m_usedNodes
Definition: dotincldepgraph.h:56
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
Definition::getReference
virtual QCString getReference() const =0
DotNodeDeque
Definition: dotnode.h:137
IncludeInfoList
Definition: filedef.h:59
Config_getBool
#define Config_getBool(name)
Definition: config.h:33
DotNode::distance
int distance() const
Definition: dotnode.h:93
escapeCharsInString
QCString escapeCharsInString(const QCString &name, bool allowDots, bool allowUnderscore)
Definition: util.cpp:3442
FileDef::absFilePath
virtual QCString absFilePath() const =0
ASSERT
#define ASSERT(x)
Definition: qcstring.h:44
FileDef
A model of a file symbol.
Definition: filedef.h:73
Definition::briefDescriptionAsTooltip
virtual QCString briefDescriptionAsTooltip() const =0
DotInclDepGraph::determineTruncatedNodes
void determineTruncatedNodes(DotNodeDeque &queue)
Definition: dotincldepgraph.cpp:98
FileDef::getOutputFileBase
virtual QCString getOutputFileBase() const =0
DotNode::children
const DotNodeRefVector & children() const
Definition: dotnode.h:109
FALSE
#define FALSE
Definition: qcstring.h:33
FileDef::includeFileList
virtual const IncludeInfoList & includeFileList() const =0
QCString
This is an alternative implementation of QCString.
Definition: qcstring.h:108