An observer interface of the observers/observable design pattern. More...
#include <observer.hpp>
Public Member Functions | |
| virtual | ~Observer ()=default |
| virtual void | handle (const anch::events::Event< T > &event) noexcept=0 |
An observer interface of the observers/observable design pattern.
It has to be implemented to handle events correctly.
An observer has to be removed from its Observable or EventBus before its destruction. When it can be notified from another thread, it has to be removed in the destructor of the most derived class (base class destructors run after the derived class has been destroyed).
|
virtualdefault |
Observer destructor
|
pure virtualnoexcept |
Receive event notification.
It must not throw (an exception calls std::terminate).
| event | The event to receive |
Implemented in anch::events::EventHandler< T, Derived >, and ErrorObserver.