casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DDModEvent.h
Go to the documentation of this file.
1 //# DDModEvent.h: DisplayData Modified Event used to signal change in data
2 //# Copyright (C) 1999,2000,2003
3 //# Associated Universities, Inc. Washington DC, USA.
4 //#
5 //# This library is free software; you can redistribute it and/or modify it
6 //# under the terms of the GNU Library General Public License as published by
7 //# the Free Software Foundation; either version 2 of the License, or (at your
8 //# option) any later version.
9 //#
10 //# This library is distributed in the hope that it will be useful, but WITHOUT
11 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 //# License for more details.
14 //#
15 //# You should have received a copy of the GNU Library General Public License
16 //# along with this library; if not, write to the Free Software Foundation,
17 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18 //#
19 //# Correspondence concerning AIPS++ should be addressed as follows:
20 //# Internet email: aips2-request@nrao.edu.
21 //# Postal address: AIPS++ Project Office
22 //# National Radio Astronomy Observatory
23 //# 520 Edgemont Road
24 //# Charlottesville, VA 22903-2475 USA
25 //#
26 //# $Id$
27 
28 #ifndef TRIALDISPLAY_DDMODEVENT_H
29 #define TRIALDISPLAY_DDMODEVENT_H
30 
31 #include <casa/aips.h>
33 
34 namespace casa { //# NAMESPACE CASA - BEGIN
35 
36 // <summary>
37 // Class used by DisplayDatas to signal change in data
38 // </summary>
39 
40 // <use visibility=local>
41 
42 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
43 // </reviewed>
44 
45 // <etymology>
46 // "DisplayData Modified Event" describes "Events" (ie. things which
47 // happen at a measurable time) which signal to event handlers that
48 // the data of the transmitting displaydata has been modified.
49 // </etymology>
50 
51 // <prerequisite>
52 // <li> <linkto class=DisplayDataEvent>DisplayDataEvent</linkto>
53 // </prerequisite>
54 
55 // <synopsis>
56 // This class adds to the information stored in the <linkto
57 // class=DisplayDataEvent>DisplayDataEvent</linkto> class. It adds a
58 // pointer to a record that holds the modified data. The structure of
59 // the record is specific to each type of Display casacore::Data so the event
60 // handlers will need to know the structure they are listening for
61 // </synopsis>
62 
63 // <example>
64 // <srcBlock>
65 // // Sending a DDModEvent from a Profile2dDD (inherits from ActiveCaching2dDD)
66 // casacore::Record rec;
67 // fillRecordWithData(rec); // DD specific function
68 // DDModEvent ev(this, &rec);
69 // ActiveCaching2dDD::handleEvent(ev); // let super classes send events
70 //
71 // // Receiving a DDModEvent from a Profile2dDD
72 // ...
73 // profile2dDD->addDisplayEventHandler(this);
74 // ...
75 // void MyClass::handleEvent(DisplayEvent &ev) {
76 // DDModEvent *dev = dynamic_cast<DDModEvent*>(&ev);
77 // if (dev) {
78 // Profile2dDD *pdd = dynamic_cast<Profile2dDD*>(dev->displayData());
79 // if (pdd) {
80 // // event from Profile2dDD received!
81 // }
82 // }
83 // }
84 // </srcBlock>
85 // </example>
86 
87 // <motivation>
88 // It's desirable to send some data with DisplayDataEvents that has
89 // information about the DisplayData and the data that is modified
90 // within it.
91 // </motivation>
92 
93 // <thrown>
94 // None.
95 // </thrown>
96 
97 // <todo asof="1999/10/15">
98 // None.
99 // </todo>
100 
101  class DDModEvent : public DisplayDataEvent {
102 
103  public:
104 
105  // Constructor, taking a pointer to a DisplayData and
106  // a pointer to a data record.
107  DDModEvent(DisplayData* dd, const casacore::Record *rec);
108 
109  // Destructor.
110  virtual ~DDModEvent();
111 
112  // Return a pointer to the data record.
113  virtual const casacore::Record *dataRecord() const {
114  return itsRec;
115  }
116 
117  protected:
118 
119  // (Required) default constructor.
120  DDModEvent();
121 
122  // (Required) copy constructor.
123  DDModEvent(const DDModEvent &other);
124 
125  // (Required) copy assignment.
126  DDModEvent &operator=(const DDModEvent &other);
127 
128  private:
129 
130  // the data record
132 
133  };
134 
135 
136 } //# NAMESPACE CASA - END
137 
138 #endif
Class for events sent by DisplayDatas.
const casacore::Record * itsRec
the data record
Definition: DDModEvent.h:131
DDModEvent & operator=(const DDModEvent &other)
(Required) copy assignment.
virtual ~DDModEvent()
Destructor.
A hierarchical collection of named fields of various types.
Definition: Record.h:180
DDModEvent()
(Required) default constructor.
Class used by DisplayDatas to signal change in data.
Definition: DDModEvent.h:101
virtual const casacore::Record * dataRecord() const
Return a pointer to the data record.
Definition: DDModEvent.h:113
Base class for display objects.
Definition: DisplayData.h:317