ROSE  0.9.6a
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SimpleDirectedGraph Class Reference

#include <SimpleDirectedGraph.h>

Inheritance diagram for SimpleDirectedGraph:

Public Types

enum  TraverseDirection {
  FORWARD = 1,
  BACKWARD = 2,
  FORWARD = 1,
  BACKWARD = 2
}
 This enum determines which direction to travel during a reachability pass. More...
 
enum  TraverseDirection {
  FORWARD = 1,
  BACKWARD = 2,
  FORWARD = 1,
  BACKWARD = 2
}
 This enum determines which direction to travel during a reachability pass. More...
 

Public Member Functions

 ~SimpleDirectedGraph ()
 
std::set
< SimpleDirectedGraphNode * > 
getNodes ()
 get all the nodes in the graph More...
 
virtual void addNode (SimpleDirectedGraphNode *node)
 Add a node to the graph. More...
 
virtual void addLink (SimpleDirectedGraphNode *from, SimpleDirectedGraphNode *to)
 Add a link to the graph between "from" and to "to". More...
 
bool nodeExists (SimpleDirectedGraphNode *node)
 Check if a node containing data is in the graph. More...
 
bool linkExists (SimpleDirectedGraphNode *from, SimpleDirectedGraphNode *to)
 Check if a dependence is in the graph. More...
 
void printGraph ()
 
virtual void writeDot (char *filename)
 
std::set
< SimpleDirectedGraphNode * > 
getReachable (SimpleDirectedGraphNode *start, TraverseDirection dir)
 
 SimpleDirectedGraph ()
 
virtual ~SimpleDirectedGraph ()
 
std::set
< SimpleDirectedGraphNode * > 
getNodes ()
 get all the nodes in the graph More...
 
virtual void addNode (SimpleDirectedGraphNode *node)
 Add a node to the graph. More...
 
virtual void removeNode (SimpleDirectedGraphNode *node)
 
virtual void removeLink (SimpleDirectedGraphNode *from, SimpleDirectedGraphNode *to)
 Remove a linkt between "from" and "to". More...
 
virtual void addLink (SimpleDirectedGraphNode *from, SimpleDirectedGraphNode *to)
 Add a link to the graph between "from" and to "to". More...
 
bool nodeExists (SimpleDirectedGraphNode *node)
 Check if a node containing data is in the graph. More...
 
bool linkExists (SimpleDirectedGraphNode *from, SimpleDirectedGraphNode *to)
 Check if a dependence is in the graph. More...
 
void printGraph ()
 
virtual void writeDot (char *filename)
 
std::set
< SimpleDirectedGraphNode * > 
getReachable (SimpleDirectedGraphNode *start, TraverseDirection dir)
 

Protected Member Functions

virtual void _displayData (SimpleDirectedGraphNode *node, std::ostream &os)
 
virtual void _displayData (SimpleDirectedGraphNode *node, std::ostream &os)
 

Protected Attributes

std::set
< SimpleDirectedGraphNode * > 
_nodes
 

Detailed Description

This provides some simple support mechanisms to create a graph of SimpleDirectedGraphNodes.

Definition at line 78 of file dominatorTreesAndDominanceFrontiers/SimpleDirectedGraph.h.

Member Enumeration Documentation

This enum determines which direction to travel during a reachability pass.

Enumerator
FORWARD 

Reachability via successor edges

BACKWARD 

Reachability via predecessor edges

FORWARD 

Reachability via successor edges

BACKWARD 

Reachability via predecessor edges

Definition at line 174 of file dominatorTreesAndDominanceFrontiers/SimpleDirectedGraph.h.

This enum determines which direction to travel during a reachability pass.

Enumerator
FORWARD 

Reachability via successor edges

BACKWARD 

Reachability via predecessor edges

FORWARD 

Reachability via successor edges

BACKWARD 

Reachability via predecessor edges

Definition at line 199 of file staticInterproceduralSlicing/SimpleDirectedGraph.h.

Constructor & Destructor Documentation

SimpleDirectedGraph::~SimpleDirectedGraph ( )
inline
SimpleDirectedGraph::SimpleDirectedGraph ( )
inline
virtual SimpleDirectedGraph::~SimpleDirectedGraph ( )
inlinevirtual

Member Function Documentation

std::set<SimpleDirectedGraphNode *> SimpleDirectedGraph::getNodes ( )
inline

get all the nodes in the graph

Definition at line 85 of file dominatorTreesAndDominanceFrontiers/SimpleDirectedGraph.h.

References _nodes.

virtual void SimpleDirectedGraph::addNode ( SimpleDirectedGraphNode node)
inlinevirtual

Add a node to the graph.

Definition at line 88 of file dominatorTreesAndDominanceFrontiers/SimpleDirectedGraph.h.

References _nodes.

virtual void SimpleDirectedGraph::addLink ( SimpleDirectedGraphNode from,
SimpleDirectedGraphNode to 
)
inlinevirtual

Add a link to the graph between "from" and to "to".

Definition at line 93 of file dominatorTreesAndDominanceFrontiers/SimpleDirectedGraph.h.

References SimpleDirectedGraphNode::addPredecessor(), and SimpleDirectedGraphNode::addSuccessor().

bool SimpleDirectedGraph::nodeExists ( SimpleDirectedGraphNode node)
inline

Check if a node containing data is in the graph.

Definition at line 102 of file dominatorTreesAndDominanceFrontiers/SimpleDirectedGraph.h.

References _nodes.

bool SimpleDirectedGraph::linkExists ( SimpleDirectedGraphNode from,
SimpleDirectedGraphNode to 
)
inline

Check if a dependence is in the graph.

Definition at line 107 of file dominatorTreesAndDominanceFrontiers/SimpleDirectedGraph.h.

References SimpleDirectedGraphNode::hasSuccessor().

void SimpleDirectedGraph::printGraph ( )
inline
virtual void SimpleDirectedGraph::writeDot ( char *  filename)
inlinevirtual
virtual void SimpleDirectedGraph::_displayData ( SimpleDirectedGraphNode node,
std::ostream &  os 
)
inlineprotectedvirtual

This virtual function can be overriden to control how data is presented by printGraph(). It defaults to simply outputting the data onto os.

Reimplemented in DominatorTreesAndDominanceFrontiers::ControlFlowGraph, and DominatorTreesAndDominanceFrontiers::ControlFlowGraph.

Definition at line 233 of file dominatorTreesAndDominanceFrontiers/SimpleDirectedGraph.h.

References SimpleDirectedGraphNode::writeOut().

Referenced by printGraph(), and writeDot().

std::set<SimpleDirectedGraphNode *> SimpleDirectedGraph::getNodes ( )
inline

get all the nodes in the graph

Definition at line 92 of file staticInterproceduralSlicing/SimpleDirectedGraph.h.

References _nodes.

virtual void SimpleDirectedGraph::addNode ( SimpleDirectedGraphNode node)
inlinevirtual

Add a node to the graph.

Definition at line 95 of file staticInterproceduralSlicing/SimpleDirectedGraph.h.

References _nodes.

virtual void SimpleDirectedGraph::removeNode ( SimpleDirectedGraphNode node)
inlinevirtual

Definition at line 98 of file staticInterproceduralSlicing/SimpleDirectedGraph.h.

References _nodes.

virtual void SimpleDirectedGraph::removeLink ( SimpleDirectedGraphNode from,
SimpleDirectedGraphNode to 
)
inlinevirtual
virtual void SimpleDirectedGraph::addLink ( SimpleDirectedGraphNode from,
SimpleDirectedGraphNode to 
)
inlinevirtual

Add a link to the graph between "from" and to "to".

Definition at line 115 of file staticInterproceduralSlicing/SimpleDirectedGraph.h.

References SimpleDirectedGraphNode::addPredecessor(), and SimpleDirectedGraphNode::addSuccessor().

bool SimpleDirectedGraph::nodeExists ( SimpleDirectedGraphNode node)
inline

Check if a node containing data is in the graph.

Definition at line 127 of file staticInterproceduralSlicing/SimpleDirectedGraph.h.

References _nodes.

bool SimpleDirectedGraph::linkExists ( SimpleDirectedGraphNode from,
SimpleDirectedGraphNode to 
)
inline

Check if a dependence is in the graph.

Definition at line 132 of file staticInterproceduralSlicing/SimpleDirectedGraph.h.

References SimpleDirectedGraphNode::hasSuccessor().

void SimpleDirectedGraph::printGraph ( )
inline

Definition at line 136 of file staticInterproceduralSlicing/SimpleDirectedGraph.h.

References _displayData(), and _nodes.

virtual void SimpleDirectedGraph::writeDot ( char *  filename)
inlinevirtual
virtual void SimpleDirectedGraph::_displayData ( SimpleDirectedGraphNode node,
std::ostream &  os 
)
inlineprotectedvirtual

This virtual function can be overriden to control how data is presented by printGraph(). It defaults to simply outputting the data onto os.

Reimplemented in DominatorTreesAndDominanceFrontiers::ControlFlowGraph, and DominatorTreesAndDominanceFrontiers::ControlFlowGraph.

Definition at line 258 of file staticInterproceduralSlicing/SimpleDirectedGraph.h.

References SimpleDirectedGraphNode::writeOut().

Member Data Documentation

std::set< SimpleDirectedGraphNode * > SimpleDirectedGraph::_nodes
protected

The documentation for this class was generated from the following files: