13 #ifndef __NOTIFIER_H__ 14 #define __NOTIFIER_H__ 24 template<
typename Data>
45 virtual void receive(Data d) = 0;
55 template<
typename Data>
58 bool _atChange =
false;
69 l->detachNotifier(
this);
77 _listeners.push_back(l);
87 _listeners.erase(std::remove(_listeners.begin(), _listeners.end(), l), _listeners.end());
99 template<
typename Data>
103 n->removeListener(other);
108 template<
typename Data>
112 n->removeListener(other);
119 template<
typename Data>
126 template<
typename Data>
139 template<
typename Data>
Notifier(const Notifier< Data > &)
Definition: notifier.hpp:63
void setNotifier(Notifier< Data > *n)
Definition: notifier.hpp:127
~Notifier()
Definition: notifier.hpp:65
void removeListener(Listener< Data > *l)
Definition: notifier.hpp:82
Notifier & operator=(const Notifier< Data > &)
Definition: notifier.hpp:64
Definition: notifier.hpp:25
void addListener(Listener< Data > *l)
Definition: notifier.hpp:72
friend void swap(Listener< T > &l1, Listener< T > &l2)
const Notifier< Data > * notifier() const
Definition: notifier.hpp:43
void notify(Data d) const
Definition: notifier.hpp:92
Listener(const Listener< Data > &)
Definition: notifier.hpp:32
~Listener()
Definition: notifier.hpp:120
Notifier< Data > * notifier()
Definition: notifier.hpp:42
virtual void receive(Data d)=0
Definition: aeolus.cpp:26
Listener & operator=(const Listener< Data > &)
Definition: notifier.hpp:34
void detachNotifier(Notifier< Data > *n)
Definition: notifier.hpp:40
Definition: notifier.hpp:18
std::vector< Listener< Data > * > _listeners
Definition: notifier.hpp:57
Listener(Notifier< Data > *n)
Definition: notifier.hpp:30
Notifier< Data > * _notifier
Definition: notifier.hpp:26