aGrUM  0.14.2
diGraphListener.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2005 by Christophe GONZALES and Pierre-Henri WUILLEMIN *
3  * {prenom.nom}_at_lip6.fr *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19  ***************************************************************************/
25 #ifndef GUM_DIGRAPH_LISTENER_H
26 #define GUM_DIGRAPH_LISTENER_H
27 
29 #include <agrum/graphs/diGraph.h>
30 
31 namespace gum {
46  class DiGraphListener : public Listener {
47  public:
48  // ############################################################################
50  // ############################################################################
52 
54 
58  DiGraphListener(const DiGraph* g);
59 
62 
64 
65  // ############################################################################
67  // ############################################################################
69 
71 
73  virtual void whenNodeAdded(const void* src, NodeId id) = 0;
74 
76 
78  virtual void whenNodeDeleted(const void* src, NodeId id) = 0;
79 
81 
84  virtual void whenArcAdded(const void* src, NodeId from, NodeId to) = 0;
85 
87 
90  virtual void whenArcDeleted(const void* src, NodeId from, NodeId to) = 0;
91 
93 
94  protected:
97 
98  private:
100 
102 
104 
106  };
107 
108 } // namespace gum
109 
110 #ifndef GUM_NO_INLINE
112 #endif // GUM_NOINLINE
113 
114 #endif // GUM_DIGRAPH_LISTENER_H
Abstract Base class for all diGraph Listener.
DiGraphListener(const DiGraph *g)
default constructor
Base classes for oriented graphs.
Class of listener.
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
gum is the global namespace for all aGrUM entities
Definition: agrum.h:25
Base class for all oriented graphs.
Definition: diGraph.h:108
DiGraphListener & operator=(const DiGraphListener &d)
copy operator (for the moment, this operation is forbidden)
Inline implementation fo base classes for oriented graphs listener.
~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
Size NodeId
Type for node ids.
Definition: graphElements.h:97
Every class who would catch signal from signaler should derive from Listener.
Definition: listener.h:72