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  virtual void update(const T& subject) = 0;
13  virtual void subjectDeleted(const T& /*subject*/) { /*nothing*/ }
14 
15 protected:
16  ~Observer() = default;
17 };
18 
19 } // namespace openmsx
20 
21 #endif
openmsx::Observer::subjectDeleted
virtual void subjectDeleted(const T &)
Definition: Observer.hh:13
openmsx::Observer::~Observer
~Observer()=default
openmsx::Observer::update
virtual void update(const T &subject)=0
openmsx
This file implemented 3 utility functions:
Definition: Autofire.cc:5
openmsx::Observer
Generic Gang-of-Four Observer class, templatized edition.
Definition: Observer.hh:10