aGrUM  0.16.0
undiGraphListener.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(UndiGraphListener);
39  GUM_ERROR(OperationNotAllowed, "No copy constructor for UndiGraphListener");
40  }
41 
43  GUM_OP_CPY(UndiGraphListener);
44  GUM_ERROR(OperationNotAllowed, "No copy operator for UndiGraphListener");
45  }
46 
48  if (!g) {
49  GUM_ERROR(OperationNotAllowed, "A graph listener need a graph to listen to");
50  }
51 
52  GUM_CONSTRUCTOR(UndiGraphListener);
53  _graph = g;
54 
55  GUM_CONNECT((*_graph), onNodeAdded, (*this), UndiGraphListener::whenNodeAdded);
57  (*_graph), onNodeDeleted, (*this), UndiGraphListener::whenNodeDeleted);
58  GUM_CONNECT((*_graph), onEdgeAdded, (*this), UndiGraphListener::whenEdgeAdded);
60  (*_graph), onEdgeDeleted, (*this), UndiGraphListener::whenEdgeDeleted);
61  }
62 
64 
65 } // namespace gum
UndiGraph * _graph
the graph to listen to
UndiGraphListener(UndiGraph *g)
default constructor
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
UndiGraphListener & operator=(const UndiGraphListener &d)
copy operator (for the moment, this operation is forbidden)
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Definition: agrum.h:25
virtual void whenEdgeAdded(const void *src, NodeId id1, NodeId id2)=0
the action to take when a new edge is inserted into the graph
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Abstract Base class for all undiGraph Listener.
virtual void whenNodeDeleted(const void *src, NodeId id)=0
the action to take when a node has just been removed from the graph
#define GUM_CONNECT(sender, signal, receiver, target)
Definition: listener.h:98
Base class for undirected graphs.
Definition: undiGraph.h:109
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
virtual void whenNodeAdded(const void *src, NodeId id)=0
the action to take when a new node is inserted into the graph
#define GUM_ERROR(type, msg)
Definition: exceptions.h:55