#include <xmol/utils/Observable.h>
template<typename Observer>
Observable class
Implements base primitives for observable entity.
Contents
Constructors, destructors, conversion operators
- Observable() defaulted
- Observable(Observable&& rhs) defaulted noexcept
- Observable(const Observable& rhs) defaulted
Public functions
- auto operator=(Observable&& rhs) -> Observable& defaulted noexcept
- auto operator=(const Observable& rhs) -> Observable& defaulted
- void on_move(Observer& from, Observer& to)
- void on_delete(Observer& o)
- void on_copy(Observer& o)
Protected functions
-
template<ObserverState apply_to = ObserverState::ANY, typename... Args, typename Func = void (Observer::*)(Args...)>void notify(Func func, Args && ... args) const
- void add_observer(Observer& ptr) const
- void remove_observer(Observer& ptr) const
- void clear_observers() const
- void invalidate_observer(Observer& ptr) const
- marks observer as invalid next broadcast notify would fire an exception
- void move_observer(Observer& from, Observer& to) const
Protected variables
- std::map<Observer*, ObserverState> observers