15 std::list<std::shared_ptr<Observer>> observers;
24 virtual void notify(std::shared_ptr<Event> event);
30 virtual void notifyNow(std::shared_ptr<Event> event);
36 virtual void addObserver(std::shared_ptr<Observer> observer);
virtual void notify(std::shared_ptr< Event > event)
notify is used to tell observers of an event.
Definition: subject.cpp:13
virtual void addObserver(std::shared_ptr< Observer > observer)
Adds an observer.
Definition: subject.cpp:5
Class for a subject that an observer would observe for changes.
Definition: subject.h:13
virtual ~Subject()=default
virtual void notifyNow(std::shared_ptr< Event > event)
notifyNow is used to tell observers of an event as an interrupt.
Definition: subject.cpp:19
virtual void removeObserver(std::shared_ptr< Observer > observer)
Removes an observer.
Definition: subject.cpp:9