Subject.h

Go to the documentation of this file.
00001 /* $Id: Subject.h,v 1.6 2005/06/10 07:49:02 pfb Exp $ */
00002 
00003 #ifndef _Subject_h
00004 #define _Subject_h
00005 
00010 #include <list>
00011 
00017 class Observer;
00018 
00019 class Subject
00020   {
00021   //****************************************************************************
00022                              public:
00023 
00024 
00028   Subject();
00029 
00033   virtual ~Subject();
00034 
00039   void addObserver(Observer *observer);
00040 
00045   void removeObserver(Observer *observer);
00046 
00051   int numberOfObservers() const;
00052 
00053   //****************************************************************************
00054                              protected:
00055 
00059   void initiateNotify();
00060   
00061   //****************************************************************************
00062                              private:
00063 
00064   typedef std::list<Observer *>::iterator ListIterator;
00065   std::list<Observer *>obvlist;
00066   };
00067 
00068 /*
00069  * $Log: Subject.h,v $
00070  * Revision 1.6  2005/06/10 07:49:02  pfb
00071  * Changes made as a result of dev. machine update from woody to sarge.
00072  * Most of the changes are because of the upgrade from gcc-2.95 to gcc-3.3.
00073  *
00074  * Revision 1.5  2005/05/10 17:08:02  pfb
00075  * Added module info.
00076  *
00077  * Revision 1.4  2003/02/26 05:32:52  pfb
00078  * Added comments.
00079  *
00080  * Revision 1.3  2003/02/25 13:56:35  pfb
00081  * Added numberOfObservers().
00082  *
00083  * Revision 1.2  2003/02/24 02:28:35  pfb
00084  * Added expansion keywords etc.
00085  *
00086  * Revision 1.1  2003/02/23 15:56:09  pfb
00087  * Initial rev.
00088  *
00089  *
00090  */
00091 
00095 #endif  // _Subject_h
00096