Skip to content

SimpleDirectedGraphNode

This is a node in the directed graph. All the connectivity information for the graph is captured in this (by way of the successor and predecessor sets).

Synopsis

Declared in <src/midend/programAnalysis/staticInterproceduralSlicing/SimpleDirectedGraph.h>

class SimpleDirectedGraphNode;

Description

This is a much simpler graph mechanism than that provided by util/graphs. It places most of the onus of edge bookkeeping on the nodes themselves.

Member Functions

Name Description
~SimpleDirectedGraphNode
virtual ~SimpleDirectedGraphNode(); [destructor] [virtual]
Destructor
addPredecessor
void addPredecessor(SimpleDirectedGraphNode* n);
add an edge from n to the current node
addSuccessor
void addSuccessor(SimpleDirectedGraphNode* n);
add an edge from the current node to n
getPredecessors
std::set<SimpleDirectedGraphNode*> getPredecessors();
get the nodes which point to the current node
getSuccessors
std::set<SimpleDirectedGraphNode*> getSuccessors();
get the nodes which are pointed to by the current node
hasPredecessor
bool hasPredecessor(SimpleDirectedGraphNode* n);
test whether n is a predecessor of the current node
hasSuccessor
bool hasSuccessor(SimpleDirectedGraphNode* n);
test whether n is a successor of the current node
numPredecessors
int numPredecessors();
return the number of incoming edges
numSuccessors
int numSuccessors();
return the number of outgoing edges
removePredecessor
void removePredecessor(SimpleDirectedGraphNode* n);
removeSuccessor
void removeSuccessor(SimpleDirectedGraphNode* n);
writeOut
virtual void writeOut(std::ostream& os); [virtual]
virtual function to support displaying node information

Private Data Members

Name Description
_preds the set of neighbors connected by incoming edges
_succs the set of neighbors connected by outgoing edges

Derived Classes

Name Description
DependenceNode

Created with MrDocs