aGrUM  0.16.0
mixedGraphListener.cpp
Go to the documentation of this file.
1 
30 
31 #ifdef GUM_NO_INLINE
33 #endif // GUM_NOINLINE
34 
35 namespace gum {
36 
38  GUM_CONS_CPY(MixedGraphListener);
39  GUM_ERROR(OperationNotAllowed, "No copy constructor for MixedGraphListener");
40  }
41 
43  GUM_OP_CPY(MixedGraphListener);
44  GUM_ERROR(OperationNotAllowed, "No copy operator for MixedGraphListener");
45  }
46 
48  if (!g) {
49  GUM_ERROR(OperationNotAllowed, "A graph listener need a graph to listen to");
50  }
51 
52  GUM_CONSTRUCTOR(MixedGraphListener);
53  _graph = g;
54 
56  (*_graph), onNodeAdded, (*this), MixedGraphListener::whenNodeAdded);
58  (*_graph), onNodeDeleted, (*this), MixedGraphListener::whenNodeDeleted);
59  GUM_CONNECT((*_graph), onArcAdded, (*this), MixedGraphListener::whenArcAdded);
61  (*_graph), onArcDeleted, (*this), MixedGraphListener::whenArcDeleted);
63  (*_graph), onEdgeAdded, (*this), MixedGraphListener::whenEdgeAdded);
65  (*_graph), onEdgeDeleted, (*this), MixedGraphListener::whenEdgeDeleted);
66  }
67 
69 
70 } // namespace gum
virtual void whenEdgeAdded(const void *src, NodeId id1, NodeId id2)=0
the action to take when a new edge is inserted into the graph
MixedGraph * _graph
the graph to listen to
MixedGraphListener & operator=(const MixedGraphListener &d)
copy operator (for the moment, this operation is forbidden)
virtual void whenArcAdded(const void *src, NodeId from, NodeId to)=0
the action to take when a new arc is inserted into the graph
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Definition: agrum.h:25
virtual void whenEdgeDeleted(const void *src, NodeId from, NodeId to)=0
the action to take when an edge has just been removed from the graph
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Abstract Base class for all mixed Graph Listener.
virtual void whenNodeAdded(const void *src, NodeId id)=0
the action to take when a new node is inserted into the graph
MixedGraphListener(MixedGraph *g)
default constructor
#define GUM_CONNECT(sender, signal, receiver, target)
Definition: listener.h:98
virtual void whenNodeDeleted(const void *src, NodeId id)=0
the action to take when a node has just been removed from the graph
virtual void whenArcDeleted(const void *src, NodeId from, NodeId to)=0
the action to take when an arc has just been removed from the graph
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
#define GUM_ERROR(type, msg)
Definition: exceptions.h:55
Base class for mixed graphs.
Definition: mixedGraph.h:127