core/vgui/vgui_observer.h
Go to the documentation of this file.
00001 // This is core/vgui/vgui_observer.h
00002 #ifndef vgui_observer_h_
00003 #define vgui_observer_h_
00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00005 #pragma interface
00006 #endif
00007 //:
00008 // \file
00009 // \brief  Base class for classes that receive messages from observables.
00010 // \author Philip C. Pritchett, Robotics Research Group, University of Oxford
00011 // \date   11 Sep 99
00012 //
00013 //  Contains class vgui_observer
00014 //
00015 // \verbatim
00016 //  Modifications
00017 //   11-Sep-1999 P.Pritchett - Initial version.
00018 //   14-Aug-2002 K.Y.McGaul - Converted to Doxygen style comments.
00019 // \endverbatim
00020 
00021 class vgui_message;
00022 class vgui_observable;
00023 
00024 //: Base class for classes that receive messages from observables.
00025 //
00026 //  Observers attach them selves to a vgui_observable object.  The observable
00027 //  can broadcast a vgui_message or an update to all the vgui_observer's
00028 //  attached to themselves.
00029 class vgui_observer
00030 {
00031  public:
00032   //: Constructor - create a default observable.
00033   vgui_observer() {}
00034 
00035   //: Destructor.
00036   virtual ~vgui_observer() {}
00037 
00038   //: Called by the observable when some event occurs.
00039   virtual void update();
00040 
00041   //: Called by the observable with a message.
00042   virtual void update(vgui_message const &);
00043 
00044   //: Called by the observable with a message.
00045   virtual void update(vgui_observable const *);
00046 };
00047 
00048 #endif // vgui_observer_h_