Abstract Base class for graph observers. More...
#include <ogdf/basic/GraphObserver.h>
Public Member Functions | |
GraphObserver () | |
Constructs instance of GraphObserver class. | |
GraphObserver (const Graph *G) | |
Constructs instance of GraphObserver class. | |
virtual | ~GraphObserver () |
Destroys the instance, unregisters it from watched graph. | |
virtual void | cleared ()=0 |
Called by watched graph when its clear function is called Has to be implemented by derived classes. | |
virtual void | edgeAdded (edge e)=0 |
Called by watched graph when an edge is added Has to be implemented by derived classes. | |
virtual void | edgeDeleted (edge e)=0 |
Called by watched graph when an edge is deleted Has to be implemented by derived classes. | |
const Graph * | getGraph () const |
virtual void | nodeAdded (node v)=0 |
Called by watched graph when a node is added Has to be implemented by derived classes. | |
virtual void | nodeDeleted (node v)=0 |
Called by watched graph when a node is deleted Has to be implemented by derived classes. | |
void | reregister (const Graph *pG) |
Associates observer instance with graph G . | |
Protected Attributes | |
ListIterator< GraphObserver * > | m_itGList |
watched graph | |
const Graph * | m_pGraph |
Friends | |
class | Graph |
Abstract Base class for graph observers.
If a class needs to keep track of changes in a graph like addition or deletion of nodes or edges, you can derive it from GraphObserver and override the notification methods nodeDeleted, nodeAdded, edgeDeleted, edgeAdded.
Definition at line 57 of file GraphObserver.h.
|
inline |
Constructs instance of GraphObserver class.
Definition at line 62 of file GraphObserver.h.
Constructs instance of GraphObserver class.
G | is the graph to be watched |
Definition at line 68 of file GraphObserver.h.
|
inlinevirtual |
Destroys the instance, unregisters it from watched graph.
Definition at line 71 of file GraphObserver.h.
Called by watched graph when its clear function is called Has to be implemented by derived classes.
Implemented in ogdf::ClusterGraph, and ogdf::PlanRepInc.
Called by watched graph when an edge is added Has to be implemented by derived classes.
Implemented in ogdf::PlanRepInc, and ogdf::ClusterGraph.
Called by watched graph when an edge is deleted Has to be implemented by derived classes.
Implemented in ogdf::PlanRepInc, and ogdf::ClusterGraph.
Definition at line 108 of file GraphObserver.h.
Called by watched graph when a node is added Has to be implemented by derived classes.
Implemented in ogdf::ClusterGraph, and ogdf::PlanRepInc.
Called by watched graph when a node is deleted Has to be implemented by derived classes.
Implemented in ogdf::ClusterGraph, and ogdf::PlanRepInc.
Associates observer instance with graph G
.
Definition at line 78 of file GraphObserver.h.
Definition at line 58 of file GraphObserver.h.
|
protected |
watched graph
Definition at line 112 of file GraphObserver.h.
Definition at line 111 of file GraphObserver.h.