casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DisplayEvent.h
Go to the documentation of this file.
1 //# DisplayEvent.h: class for basic event information in the display classes
2 //# Copyright (C) 1999,2000
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 DISPLAY_DISPLAYEVENT_H
29 #define DISPLAY_DISPLAYEVENT_H
30 
31 #include <casa/aips.h>
32 
33 namespace casa { //# NAMESPACE CASA - BEGIN
34 
35 // <summary>
36 // Class describing the most basic event information in the display classes.
37 // </summary>
38 
39 // <use visibility=local>
40 
41 // <reviewed reviewer="Ralph Marson" date="2000/04/07" tests="tDisplayEvent">
42 // </reviewed>
43 
44 // <etymology>
45 // "DisplayEvent" describes "Events" (ie. things which happen at a
46 // measurable time) which various "Display" class objects would like
47 // to know about.
48 // </etymology>
49 
50 // <synopsis>
51 // This class is a simple class which provides the base for all event
52 // information in the display classes. It simply records the one
53 // thing common to all events: the time the event occured. The time
54 // recorded is the Julian date at the time of construction of a
55 // DisplayEvent object, stored and returned in seconds.
56 // <synopsis>
57 
58 // <example>
59 // The following example constructs two DisplayEvent instances, and
60 // checks that they have stored event times that are ordered correctly
61 // by the order in which they were constructed:
62 // <srcblock>
63 // DisplayEvent *de1, *de2;
64 // de1 = new DisplayEvent();
65 // de2 = new DisplayEvent();
66 // if (de1.timeOfEvent() >= de2.timeOfEvent()) {
67 // throw(casacore::AipsError("I have invented a time machine!"));
68 // }
69 // </srcblock>
70 // </example>
71 
72 // <motivation>
73 // It is desirable to locate in a single place the information common
74 // to all events of interest to the display classes. At the very
75 // lowest level, the only such common information is time data.
76 // </motivation>
77 
78 // <todo asof="1999/10/15">
79 // Nothing known.
80 // </todo>
81 
82  class DisplayEvent {
83 
84  public:
85 
86  // Constructor. The Julian date at construction is recorded as the
87  // event time of this DisplayEvent.
88  DisplayEvent();
89 
90  // Copy constructor - construct a new DisplayEvent from
91  // <src>other</src>.
92  DisplayEvent(const DisplayEvent &other);
93 
94  // Destructor.
95  virtual ~DisplayEvent();
96 
97  // Copy assignment using copy semantics.
98  DisplayEvent &operator=(const DisplayEvent &other);
99 
100  // Return the Julian date (in fractional seconds) that this event
101  // occured.
102  virtual casacore::Double timeOfEvent() const;
103 
104  private:
105 
106  // Store the time of the event here at construction.
108 
109  };
110 
111 
112 } //# NAMESPACE CASA - END
113 
114 #endif
virtual casacore::Double timeOfEvent() const
Return the Julian date (in fractional seconds) that this event occured.
double Double
Definition: aipstype.h:55
Class describing the most basic event information in the display classes.
Definition: DisplayEvent.h:82
DisplayEvent & operator=(const DisplayEvent &other)
Copy assignment using copy semantics.
virtual ~DisplayEvent()
Destructor.
DisplayEvent()
Constructor.
casacore::Double itsTimeOfEvent
Store the time of the event here at construction.
Definition: DisplayEvent.h:107