Otawa  0.10
otawa::graph::Node Class Reference

The node from a directed graph. More...

#include <otawa/graph/Graph.h>

Inheritance diagram for otawa::graph::Node:
otawa::GenGraph< N, E >::GenNode otawa::ccg::Node otawa::ExeGraph< N >::ExeNode otawa::ParExeNode otawa::pfg::BB otawa::LiExeNode otawa::ParamExeNode

Classes

class  Predecessor
 This class allows to iterates on the predecessors of a node. More...
 
class  Successor
 This class allows to iterates on the successors of a node. More...
 

Public Member Functions

Graphgraph (void) const
 Get the container graph if any. More...
 
int index (void) const
 Get the index of the node in the graph. More...
 
bool hasSucc (void) const
 Test if the node has successors. More...
 
bool hasPred (void) const
 Test if the node has predecessors. More...
 
int countSucc (void) const
 Count the successors of the current node. More...
 
int countPred (void) const
 Count the predecessors of the current node. More...
 
bool isPredOf (const Node *node)
 Test if the current node is a predecessor of the given one. More...
 
bool isSuccOf (const Node *node)
 Test if the current node is a successor of the given one. More...
 

Protected Member Functions

 Node (Graph *graph=0)
 Build a new node. More...
 
virtual ~Node (void)
 

Private Member Functions

void unlink (void)
 Unlink the node, that is, remove its entering or leaving edges. More...
 

Private Attributes

Graph_graph
 
int idx
 
Edgeins
 
Edgeouts
 

Friends

class Graph
 
class Edge
 

Detailed Description

The node from a directed graph.

Constructor & Destructor Documentation

otawa::graph::Node::Node ( Graph graph = 0)
inlineprotected

Build a new node.

Parameters
graphContainer graph.

References otawa::graph::Graph::add().

otawa::graph::Node::~Node ( void  )
protectedvirtual

Member Function Documentation

int otawa::graph::Node::countPred ( void  ) const
inline

Count the predecessors of the current node.

Returns
Count of predecessors.

References otawa::cfgio::edge().

Referenced by otawa::GenGraph< N, E >::GenNode::countPred(), and otawa::GenGraph< N, E >::GenNode::isPredOf().

int otawa::graph::Node::countSucc ( void  ) const
inline

Count the successors of the current node.

Returns
Count of successors.

References otawa::cfgio::edge().

Referenced by otawa::GenGraph< N, E >::GenNode::countSucc().

Graph * otawa::graph::Node::graph ( void  ) const
inline

Get the container graph if any.

Returns
Container graph or null.

References _graph.

Referenced by otawa::graph::Edge::Edge(), and otawa::graph::Graph::remove().

bool otawa::graph::Node::hasPred ( void  ) const
inline

Test if the node has predecessors.

Returns
True if it has predecessors, false else.

References ins.

Referenced by otawa::GenGraph< N, E >::GenNode::hasPred().

bool otawa::graph::Node::hasSucc ( void  ) const
inline

Test if the node has successors.

Returns
True if it has successors, false else.

References outs.

Referenced by otawa::GenGraph< N, E >::GenNode::hasSucc().

int otawa::graph::Node::index ( void  ) const
inline

Get the index of the node in the graph.

Returns
Node index or -1.

References idx.

Referenced by otawa::GenGraph< N, E >::GenNode::index(), and otawa::graph::Graph::indexOf().

bool otawa::graph::Node::isPredOf ( const Node node)
inline

Test if the current node is a predecessor of the given one.

Parameters
nodeNode to test.
Returns
True if the current is a predecessor, false else.
bool otawa::graph::Node::isSuccOf ( const Node node)
inline

Test if the current node is a successor of the given one.

Parameters
nodeNode to test.
Returns
True if the current is a successor, false else.

Referenced by otawa::GenGraph< N, E >::GenNode::isSuccOf().

void otawa::graph::Node::unlink ( void  )
private

Unlink the node, that is, remove its entering or leaving edges.

Referenced by otawa::graph::Graph::remove().

Friends And Related Function Documentation

friend class Edge
friend
friend class Graph
friend

Member Data Documentation

Graph* otawa::graph::Node::_graph
private
int otawa::graph::Node::idx
private
Edge* otawa::graph::Node::ins
private
Edge * otawa::graph::Node::outs
private

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