Main Page | Class Hierarchy | Data Structures | File List | Data Fields | Globals

Subject.hpp

Go to the documentation of this file.
00001 // vim:sw=2:ts=8
00017 #ifndef SUBJECT__HPP
00018 #define SUBJECT__HPP
00019 
00020 #include <list>
00021 
00022 #include "def_graph.hpp"
00023 
00024 #include "Observer.hpp"
00025 
00026 
00027 namespace gns {
00028 
00029 
00056   class Subject
00057   {
00058     protected:
00060       std::list<Observer*> observers;
00061 
00062     public:
00064       Subject();
00065 
00067       virtual ~Subject();
00068 
00070       virtual void attach(Observer *obs);
00071 
00073       virtual void detach(Observer *obs);
00074 
00076       virtual void notify(long msg, Item item = Item());
00077 
00079       virtual std::list<Observer*> get_observers();
00080   };
00081 
00082 }
00083 
00084 #endif

Generated on Sun Nov 5 12:05:19 2006 for Graph by  doxygen 1.4.1