casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
DDModEvent.h
Go to the documentation of this file.
00001 //# DDModEvent.h: DisplayData Modified Event used to signal change in data
00002 //# Copyright (C) 1999,2000,2003
00003 //# Associated Universities, Inc. Washington DC, USA.
00004 //# 
00005 //# This library is free software; you can redistribute it and/or modify it
00006 //# under the terms of the GNU Library General Public License as published by
00007 //# the Free Software Foundation; either version 2 of the License, or (at your
00008 //# option) any later version.
00009 //# 
00010 //# This library is distributed in the hope that it will be useful, but WITHOUT
00011 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00012 //# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00013 //# License for more details.
00014 //# 
00015 //# You should have received a copy of the GNU Library General Public License
00016 //# along with this library; if not, write to the Free Software Foundation,
00017 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
00018 //# 
00019 //# Correspondence concerning AIPS++ should be addressed as follows:
00020 //#        Internet email: aips2-request@nrao.edu.
00021 //#        Postal address: AIPS++ Project Office
00022 //#                        National Radio Astronomy Observatory
00023 //#                        520 Edgemont Road
00024 //#                        Charlottesville, VA 22903-2475 USA
00025 //# 
00026 //# $Id$
00027 
00028 #ifndef TRIALDISPLAY_DDMODEVENT_H
00029 #define TRIALDISPLAY_DDMODEVENT_H
00030 
00031 #include <casa/aips.h>
00032 #include <display/DisplayEvents/DisplayDataEvent.h>
00033 
00034 namespace casa { //# NAMESPACE CASA - BEGIN
00035 
00036 // <summary>
00037 // Class used by  DisplayDatas to signal change in data
00038 // </summary>
00039 
00040 // <use visibility=local>
00041 
00042 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
00043 // </reviewed>
00044 
00045 // <etymology>
00046 // "DisplayData Modified Event" describes "Events" (ie. things which
00047 // happen at a measurable time) which signal to event handlers that
00048 // the data of the transmitting displaydata has been modified.
00049 // </etymology>
00050 
00051 // <prerequisite>
00052 // <li> <linkto class=DisplayDataEvent>DisplayDataEvent</linkto>
00053 // </prerequisite>
00054 
00055 // <synopsis>
00056 // This class adds to the information stored in the <linkto
00057 // class=DisplayDataEvent>DisplayDataEvent</linkto> class. It adds a
00058 // pointer to a record that holds the modified data. The structure of
00059 // the record is specific to each type of Display Data so the event
00060 // handlers will need to know the structure they are listening for
00061 // </synopsis>
00062 
00063 // <example>
00064 // <srcBlock>
00065 // // Sending a DDModEvent from a Profile2dDD (inherits from ActiveCaching2dDD)
00066 // Record rec;
00067 // fillRecordWithData(rec); // DD specific function
00068 // DDModEvent ev(this, &rec);
00069 // ActiveCaching2dDD::handleEvent(ev); // let super classes send events
00070 //
00071 // // Receiving a DDModEvent from a Profile2dDD
00072 // ...
00073 // profile2dDD->addDisplayEventHandler(this);
00074 // ...
00075 // void MyClass::handleEvent(DisplayEvent &ev) {
00076 //   DDModEvent *dev = dynamic_cast<DDModEvent*>(&ev);
00077 //   if (dev) {
00078 //     Profile2dDD *pdd = dynamic_cast<Profile2dDD*>(dev->displayData());
00079 //     if (pdd) {
00080 //     // event from Profile2dDD received!
00081 //     }
00082 //   }
00083 // }
00084 // </srcBlock>
00085 // </example>
00086 
00087 // <motivation>
00088 // It's desirable to send some data with DisplayDataEvents that has
00089 // information about the DisplayData and the data that is modified
00090 // within it.
00091 // </motivation>
00092 
00093 // <thrown>
00094 // None.
00095 // </thrown>
00096 
00097 // <todo asof="1999/10/15">
00098 // None.
00099 // </todo>
00100 
00101 class DDModEvent : public DisplayDataEvent {
00102 
00103  public:
00104 
00105   // Constructor, taking a pointer to a DisplayData and
00106   // a pointer to a data record.
00107   DDModEvent(DisplayData* dd, const Record *rec);
00108 
00109   // Destructor.
00110   virtual ~DDModEvent();
00111 
00112   // Return a pointer to the data record.
00113   virtual const Record *dataRecord() const
00114     { return itsRec; }
00115 
00116  protected:
00117 
00118   // (Required) default constructor.
00119   DDModEvent();
00120 
00121   // (Required) copy constructor.
00122   DDModEvent(const DDModEvent &other);
00123   
00124   // (Required) copy assignment.
00125   DDModEvent &operator=(const DDModEvent &other);
00126 
00127  private:
00128 
00129   // the data record
00130   const Record *itsRec;
00131 
00132 };
00133 
00134 
00135 } //# NAMESPACE CASA - END
00136 
00137 #endif