/* * ObserverStub.hpp * * Created on: Jan 16, 2011 * Author: heber */ #ifndef OBSERVERSTUB_HPP_ #define OBSERVERSTUB_HPP_ #include "Observer.hpp" #include "ObservedIterator.hpp" class UpdateCountObserver : public Observer { public: UpdateCountObserver(); void update(Observable *publisher); void subjectKilled(Observable *publisher); int updates; }; class SimpleObservable : public Observable { public: SimpleObservable(); void changeMethod(); }; class CallObservable : public Observable { public: CallObservable(); void changeMethod1(); void changeMethod2(); }; class BlockObservable : public Observable { public: BlockObservable(); void changeMethod1(); void changeMethod2(); void internalMethod1(); void internalMethod2(); void noChangeMethod(); }; class SuperObservable : public Observable { public: SuperObservable(); ~SuperObservable(); void changeMethod(); SimpleObservable *subObservable; }; class NotificationObservable : public Observable { public: NotificationObservable(); ~NotificationObservable(); void operation1(); void operation2(); Notification_ptr notification1; Notification_ptr notification2; }; class NotificationObserver : public Observer { public: NotificationObserver(Notification_ptr notification); void update(Observable*); void subjectKilled(Observable*); void recieveNotification(Observable *publisher, Notification_ptr notification); Notification_ptr requestedNotification; bool wasNotified; }; class ObservableSet : public Observable { public: typedef std::set set; typedef ObservedIterator iterator; typedef set::const_iterator const_iterator; ObservableSet(int _num); ~ObservableSet(); iterator begin(); iterator end(); const int num; private: set theSet; }; class ObservableMap : public Observable { public: typedef std::map set; typedef ObservedIterator iterator; typedef set::const_iterator const_iterator; ObservableMap(int _num); ~ObservableMap(); iterator begin(); iterator end(); const int num; private: set theSet; }; #endif /* OBSERVERSTUB_HPP_ */