ROOT_Application  2.0
C++ Core modules and GUIStock
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ObsPattern_Obs.h
Go to the documentation of this file.
1 
12 #ifndef OBSPATTERN_OBS_H_
13 #define OBSPATTERN_OBS_H_
14 
15 #include <iostream>
16 #include <vector>
17 #include <string>
18 
19 class Subject;
20 
27 class Observer
28 {
29  public:
30  // constructor in protected
31  virtual ~Observer() {} // {std::cout << "Destructor base Observer " << std::endl;}
32 
34  virtual void update(Subject *) {
35  #ifdef DEBUG_UTIL
36  std::cout << "Observer::update " << std::endl;
37  #endif
38  }
39 
41  virtual void update(Subject *, std::vector<std::string> & ) {
42  #ifdef DEBUG_UTIL
43  std::cout << "Observer::update with message" << std::endl;
44  #endif
45  }
46  protected:
47  Observer() {}//{std::cout << "protected constructor of base Observer" << std::endl;}
48  //private:
49  // comment but need to overwrite later
50  //observer(const observer &);
51  //observer &operator=(const observer &);
52 
53 };
54 
55 #endif /* OBSPATTERN_OBS_H */
56 
57 
58 
virtual void update(Subject *)
simplest update version
Receive notification from the python update.
virtual void update(Subject *, std::vector< std::string > &)
update version with some data
virtual ~Observer()