Main Page | Class Hierarchy | Data Structures | File List | Data Fields | Globals

ObservableGraph Class Reference

#include <ObservableGraph.hpp>

Inheritance diagram for ObservableGraph:

Inheritance graph
[legend]
Collaboration diagram for ObservableGraph:

Collaboration graph
[legend]

Detailed Description

Graph implementing Subject.

The ObservableGraph inherits from the Graph and the Subject. Thus, it's nodes and edges can be modified from outside. Whenever a node or edge is added or removed, the ObservableGraph notifies it's observers. A notification also occurs when the ID of a node or edge changes.


Public Member Functions

 ObservableGraph ()
 Constructor.
 ObservableGraph (PropertyFacility *p)
 Initializes the graph.
 ObservableGraph (const ObservableGraph &g)
 Copy constructor.
virtual ~ObservableGraph ()
 Destructor.
virtual void node_id (Node n, const NodeID id)
 Set the ID of a node and invoke an update message.
virtual void edge_id (Edge e, const EdgeID id)
 Set the ID of an edge and invoke an update message.
virtual Node new_node (NodeID id="")
 Add a node to the graph and notify the observers.
virtual void del_node (Node n)
 Delete a node from the graph, notify the observers before and after the delete operation.
virtual Edge new_edge (Node u, Node v, EdgeID id="")
 Add an edge to the graph and notify the observers.
virtual void del_edge (Edge e)
 Delete an edge from the graph, notify the observers before and after the delete operation.
virtual void del_edge (Node u, Node v)
 Delete a(ll) directed (u,v) edge(s) from the graph, notify the observers before and after the delete operation.
virtual void add_nodes (int num, int start)
 Convenient method to add nodes to the graph.


Constructor & Destructor Documentation

ObservableGraph  ) 
 

Constructor.

ObservableGraph PropertyFacility p  ) 
 

Initializes the graph.

ObservableGraph const ObservableGraph g  ) 
 

Copy constructor.

~ObservableGraph  )  [virtual]
 

Destructor.


Member Function Documentation

void add_nodes int  num,
int  start
[virtual]
 

Convenient method to add nodes to the graph.

Parameters:
num Number of nodes to add
start Start of id sequence

Reimplemented from Graph.

void del_edge Node  u,
Node  v
[virtual]
 

Delete a(ll) directed (u,v) edge(s) from the graph, notify the observers before and after the delete operation.

See Graph::del_edge(u, v).

Parameters:
u The source node of the directed edge to delete
v The target node of the directed edge to delete

Reimplemented from Graph.

void del_edge Edge  e  )  [virtual]
 

Delete an edge from the graph, notify the observers before and after the delete operation.

See Graph::del_edge(e).

Parameters:
e The edge to delete

Reimplemented from Graph.

void del_node Node  n  )  [virtual]
 

Delete a node from the graph, notify the observers before and after the delete operation.

See Graph::del_node(n).

Parameters:
n The node to delete

Reimplemented from Graph.

void edge_id Edge  e,
const EdgeID  id
[virtual]
 

Set the ID of an edge and invoke an update message.

See Graph::edge_id(e, id).

Reimplemented from ConstGraph.

Edge new_edge Node  u,
Node  v,
EdgeID  id = ""
[virtual]
 

Add an edge to the graph and notify the observers.

See Graph::new_edge(u, v, id).

Parameters:
u The source node
v The target node
id The id of the new edge

Reimplemented from Graph.

Node new_node NodeID  id = ""  )  [virtual]
 

Add a node to the graph and notify the observers.

See Graph::new_node(id).

Parameters:
id The id of the new node

Reimplemented from Graph.

void node_id Node  n,
const NodeID  id
[virtual]
 

Set the ID of a node and invoke an update message.

See Graph::node_id(n, id).

Reimplemented from ConstGraph.


Generated on Sun Nov 5 12:06:28 2006 for Graph by  doxygen 1.4.1