casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
DisplayEvent.h
Go to the documentation of this file.
00001 //# DisplayEvent.h: class for basic event information in the display classes
00002 //# Copyright (C) 1999,2000
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 DISPLAY_DISPLAYEVENT_H
00029 #define DISPLAY_DISPLAYEVENT_H
00030 
00031 #include <casa/aips.h>
00032 
00033 namespace casa { //# NAMESPACE CASA - BEGIN
00034 
00035 // <summary>
00036 // Class describing the most basic event information in the display classes.
00037 // </summary>
00038 
00039 // <use visibility=local>
00040 
00041 // <reviewed reviewer="Ralph Marson" date="2000/04/07" tests="tDisplayEvent">
00042 // </reviewed>
00043 
00044 // <etymology>
00045 // "DisplayEvent" describes "Events" (ie. things which happen at a
00046 // measurable time) which various "Display" class objects would like 
00047 // to know about.
00048 // </etymology>
00049 
00050 // <synopsis>
00051 // This class is a simple class which provides the base for all event
00052 // information in the display classes.  It simply records the one
00053 // thing common to all events: the time the event occured.  The time
00054 // recorded is the Julian date at the time of construction of a 
00055 // DisplayEvent object, stored and returned in seconds.
00056 // <synopsis>
00057 
00058 // <example>
00059 // The following example constructs two DisplayEvent instances, and
00060 // checks that they have stored event times that are ordered correctly
00061 // by the order in which they were constructed:
00062 // <srcblock>
00063 // DisplayEvent *de1, *de2;
00064 // de1 = new DisplayEvent();
00065 // de2 = new DisplayEvent();
00066 // if (de1.timeOfEvent() >= de2.timeOfEvent()) {
00067 //     throw(AipsError("I have invented a time machine!"));
00068 // }
00069 // </srcblock>
00070 // </example>
00071 
00072 // <motivation>
00073 // It is desirable to locate in a single place the information common
00074 // to all events of interest to the display classes.  At the very
00075 // lowest level, the only such common information is time data.
00076 // </motivation>
00077 
00078 // <todo asof="1999/10/15">
00079 // Nothing known.
00080 // </todo>
00081 
00082 class DisplayEvent {
00083 
00084  public:
00085 
00086   // Constructor.  The Julian date at construction is recorded as the
00087   // event time of this DisplayEvent.
00088   DisplayEvent();
00089 
00090   // Copy constructor - construct a new DisplayEvent from
00091   // <src>other</src>.
00092   DisplayEvent(const DisplayEvent &other);
00093 
00094   // Destructor.
00095   virtual ~DisplayEvent();
00096 
00097   // Copy assignment using copy semantics.
00098   DisplayEvent &operator=(const DisplayEvent &other);
00099 
00100   // Return the Julian date (in fractional seconds) that this event
00101   // occured.
00102   virtual Double timeOfEvent() const;
00103 
00104  private:
00105 
00106   // Store the time of the event here at construction.
00107   Double itsTimeOfEvent;
00108 
00109 };
00110 
00111 
00112 } //# NAMESPACE CASA - END
00113 
00114 #endif