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