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