openMSX
Observer.hh
Go to the documentation of this file.
1 #ifndef OBSERVER_HH
2 #define OBSERVER_HH
3 
4 namespace openmsx {
5 
9 template<typename T> class Observer
10 {
11 public:
12  Observer(const Observer&) = delete;
13  Observer& operator=(const Observer&) = delete;
14 
15  virtual void update(const T& subject) noexcept = 0;
16  virtual void subjectDeleted(const T& /*subject*/) { /*nothing*/ }
17 
18 protected:
19  Observer() = default;
20  ~Observer() = default;
21 };
22 
23 } // namespace openmsx
24 
25 #endif
Generic Gang-of-Four Observer class, templatized edition.
Definition: Observer.hh:10
Observer(const Observer &)=delete
~Observer()=default
virtual void subjectDeleted(const T &)
Definition: Observer.hh:16
Observer & operator=(const Observer &)=delete
Observer()=default
virtual void update(const T &subject) noexcept=0
This file implemented 3 utility functions:
Definition: Autofire.cc:9