Otawa  0.10
otawa::graph::Graph Class Reference

This class represents a full graph with nodes and edges. More...

#include <otawa/graph/Graph.h>

Inheritance diagram for otawa::graph::Graph:
otawa::GenGraph< LiExeNode, otawa::ExeGraph::ExeEdge > otawa::GenGraph< N, otawa::ExeGraph::ExeEdge > otawa::GenGraph< Node, Edge > otawa::GenGraph< otawa::ParamExeNode, otawa::ExeGraph::ExeEdge > otawa::GenGraph< otawa::ParExeNode, otawa::ParExeEdge > otawa::GenGraph< ParamExeNode, otawa::ExeGraph::ExeEdge > otawa::GenGraph< ParExeNode, ParExeEdge > otawa::GenGraph< N, E >

Classes

class  InIterator
 
class  Iterator
 A simple iterator on the nodes contained in a graph. More...
 
class  OutIterator
 

Public Types

typedef otawa::graph::NodeVertex
 
typedef otawa::graph::EdgeEdge
 

Public Member Functions

 ~Graph (void)
 
void remove (graph::Edge *edge)
 Destroy an edge. More...
 
int count (void) const
 
bool contains (Node *item) const
 
bool isEmpty (void) const
 
 operator bool (void) const
 
void clear (void)
 
void add (Node *node)
 Add new node. More...
 
template<template< class _ > class C>
void addAll (const C< Node * > &items)
 
void remove (Node *node)
 Remove a node from a graph. More...
 
template<template< class _ > class C>
void removeAll (const C< Node * > &items)
 
void remove (const Iterator &iter)
 
NodesinkOf (graph::Edge *edge) const
 
int outDegree (Node *vertex) const
 Get the out degree of the given vertex. More...
 
bool isSuccessorOf (Node *succ, Node *ref) const
 Test if the vertex succ is successor of the vertex ref. More...
 
NodesourceOf (graph::Edge *edge) const
 
int inDegree (Node *vertex) const
 Get the in degree of the given vertex. More...
 
bool isPredecessorOf (Node *prev, Node *ref) const
 Test if the vertex pred is predecessor of the vertex ref. More...
 
int indexOf (Node *vertex) const
 

Private Attributes

elm::genstruct::FragTable< Node * > nodes
 

Friends

class Node
 
class Edge
 

Detailed Description

This class represents a full graph with nodes and edges.

It is not usually used as is : it may be embedded in some other object representing a graph and the Node and Edge classes is redefined to be valued according the requirement of the represented graph.

Implemented concepts

Member Typedef Documentation

Constructor & Destructor Documentation

otawa::graph::Graph::~Graph ( void  )

References clear().

Member Function Documentation

void otawa::graph::Graph::add ( Node node)
template<template< class _ > class C>
void otawa::graph::Graph::addAll ( const C< Node * > &  items)
inline
void otawa::graph::Graph::clear ( void  )
bool otawa::graph::Graph::contains ( Node item) const
inline

References nodes.

int otawa::graph::Graph::count ( void  ) const
inline

References nodes.

int otawa::graph::Graph::inDegree ( Node vertex) const

Get the in degree of the given vertex.

Parameters
vertexVertex to compute out degree for.
Returns
Out degree of the vertex.

References otawa::cfgio::edge().

int otawa::graph::Graph::indexOf ( Node vertex) const
inline
bool otawa::graph::Graph::isEmpty ( void  ) const
inline

References nodes.

Referenced by operator bool().

bool otawa::graph::Graph::isPredecessorOf ( Node pred,
Node ref 
) const

Test if the vertex pred is predecessor of the vertex ref.

Parameters
predPredecessor vertex.
refReference vertex.
Returns
True if pred is predecessor, false else.

References otawa::cfgio::edge().

bool otawa::graph::Graph::isSuccessorOf ( Node succ,
Node ref 
) const

Test if the vertex succ is successor of the vertex ref.

Parameters
succSuccessor vertex.
refReference vertex.
Returns
True if succ is successor, false else.

References otawa::cfgio::edge().

otawa::graph::Graph::operator bool ( void  ) const
inline

References isEmpty().

int otawa::graph::Graph::outDegree ( Node vertex) const

Get the out degree of the given vertex.

Parameters
vertexVertex to compute out degree for.
Returns
Out degree of the vertex.

References otawa::cfgio::edge().

void otawa::graph::Graph::remove ( Node node)

Remove a node from a graph.

Parameters
nodeNode to remove.

References otawa::graph::Node::_graph, otawa::graph::Node::graph(), otawa::graph::Node::idx, and otawa::graph::Node::unlink().

void otawa::graph::Graph::remove ( const Iterator iter)
inline

References nodes.

template<template< class _ > class C>
void otawa::graph::Graph::removeAll ( const C< Node * > &  items)
inline
Node* otawa::graph::Graph::sinkOf ( graph::Edge edge) const
inline
Node* otawa::graph::Graph::sourceOf ( graph::Edge edge) const
inline

Friends And Related Function Documentation

friend class Edge
friend
friend class Node
friend

Member Data Documentation

elm::genstruct::FragTable<Node *> otawa::graph::Graph::nodes
private

Referenced by contains(), count(), isEmpty(), and remove().


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