Simpatico  v1.10
Observer.h
1 #ifndef UTIL_OBSERVER_H
2 #define UTIL_OBSERVER_H
3 
4 /*
5 * Util Package - C++ Utilities for Scientific Computation
6 *
7 * Copyright 2010 - 2017, The Regents of the University of Minnesota
8 * Distributed under the terms of the GNU General Public License.
9 */
10 
11 namespace Util
12 {
13 
23  template <typename Event>
24  class Observer
25  {
26 
27  public:
28 
29  // Default constructor.
30 
34  virtual ~Observer();
35 
41  virtual void update(const Event& event) = 0;
42 
43  };
44 
45  // Destructor
46  template <typename Event>
48  {}
49 
50 }
51 
52 #endif
Utility classes for scientific computation.
Definition: accumulators.mod:1
virtual ~Observer()
Destructor.
Definition: Observer.h:47
virtual void update(const Event &event)=0
Respond to news of an event.