Tulip  4.2.0
Better Visualization Through Research
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Groups Pages
ObservableProperty.h
1 /*
2  *
3  * This file is part of Tulip (www.tulip-software.org)
4  *
5  * Authors: David Auber and the Tulip development Team
6  * from LaBRI, University of Bordeaux 1 and Inria Bordeaux - Sud Ouest
7  *
8  * Tulip is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU Lesser General Public License
10  * as published by the Free Software Foundation, either version 3
11  * of the License, or (at your option) any later version.
12  *
13  * Tulip is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16  * See the GNU General Public License for more details.
17  *
18  */
19 ///@cond DOXYGEN_HIDDEN
20 
21 #ifndef PROPERTYOBSERVABLE_H
22 #define PROPERTYOBSERVABLE_H
23 
24 #include <tulip/tulipconf.h>
25 #include <tulip/Node.h>
26 #include <tulip/Edge.h>
27 #include <tulip/Observable.h>
28 
29 namespace tlp {
30 
31 class PropertyInterface;
32 //=========================================================
33 
34 /**
35  * @ingroup Observation
36  * The Observer pattern is described in the lecture notes and pp293-304
37  * of Design Patterns by Gamma, Helm, Johnson, and Vlissides. It is a
38  * framework for handling state dependency between observer and observed
39  * object.
40  */
41 class _DEPRECATED TLP_SCOPE PropertyObserver {
42 
43 public:
44  virtual ~PropertyObserver() {}
45  virtual void beforeSetNodeValue(PropertyInterface*, const node) {}
46  virtual void afterSetNodeValue(PropertyInterface*, const node) {}
47  virtual void beforeSetEdgeValue(PropertyInterface*, const edge) {}
48  virtual void afterSetEdgeValue(PropertyInterface*, const edge) {}
49  virtual void beforeSetAllNodeValue(PropertyInterface*) {}
50  virtual void afterSetAllNodeValue(PropertyInterface*) {}
51  virtual void beforeSetAllEdgeValue(PropertyInterface*) {}
52  virtual void afterSetAllEdgeValue(PropertyInterface*) {}
53  virtual void destroy(PropertyInterface*) {}
54 protected:
55  void treatEvent(const Event& ev);
56 };
57 
58 }
59 
60 #endif
61 
62 ///@endcond