casa
$Rev:20696$
|
00001 //# GBTMSHistoryFiller.h: GBTMSHistoryFiller fills the MSHistory table for GBT fillers 00002 //# Copyright (C) 2000,2001 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 //# 00027 //# $Id$ 00028 00029 #ifndef NRAO_GBTMSHISTORYFILLER_H 00030 #define NRAO_GBTMSHISTORYFILLER_H 00031 00032 #include <casa/aips.h> 00033 #include <casa/BasicSL/String.h> 00034 #include <ms/MeasurementSets/MSHistory.h> 00035 00036 //# Forward Declarations 00037 namespace casa { //# NAMESPACE CASA - BEGIN 00038 class MSHistoryColumns; 00039 class MVTime; 00040 } //# NAMESPACE CASA - END 00041 00042 #include <casa/namespace.h> 00043 00044 // <summary> 00045 // GBTMSHistoryFiller fills the MSHistory table for GBT fillers 00046 // </summary> 00047 00048 // <use visibility=local> 00049 00050 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos=""> 00051 // </reviewed> 00052 00053 // <prerequisite> 00054 // <li> MeasurementSets 00055 // <li> GBT FITS files 00056 // </prerequisite> 00057 // 00058 // <etymology> 00059 // This class puts GBT data (fills) into the MSHistory table. 00060 // </etymology> 00061 // 00062 // <synopsis> 00063 // This class puts the appropriate values for the GBT in an MSHistory 00064 // table (which has been previously created as part of a MeasurementSet). 00065 // On each fill() any necessary additions to the MSHistory are made. 00066 // Each fill() always adds a new row to the MSHistory table. 00067 // </synopsis> 00068 // 00069 // <example> 00070 // </example> 00071 // 00072 // <motivation> 00073 // Writing a filler is a daunting task. There are various dependencies 00074 // between the subtables. It helps to encapsulate the knowlege and 00075 // task of filling a specific subtable to separate classes. 00076 // </motivation> 00077 // 00078 //#! <thrown> 00079 //#! A list of exceptions thrown if errors are discovered in the function. 00080 //#! This tag will appear in the body of the header file, preceding the 00081 //#! declaration of each function which throws an exception. 00082 //#! </thrown> 00083 00084 class GBTMSHistoryFiller 00085 { 00086 public: 00087 00088 // The default ctor. No MSHistory table has been attached yet. 00089 // Calling fill on such a filler will throw an exception. 00090 // It is present so that this object can be instantiated before 00091 // an MSHistory has been created. 00092 GBTMSHistoryFiller(); 00093 00094 // A filler attached to an MSHistory table 00095 GBTMSHistoryFiller(MSHistory &msHistory); 00096 00097 ~GBTMSHistoryFiller(); 00098 00099 // attach it to an MSHistory 00100 void attach(MSHistory &msHistory); 00101 00102 // fill - always adds a new row to the obsLog table 00103 void fill(Int observationId, const String &message, 00104 const String &priority, const String &origin, 00105 const MVTime ×tamp); 00106 00107 // flush the underlying MS subtable 00108 void flush() {msHistory_p->flush();} 00109 00110 private: 00111 MSHistory *msHistory_p; 00112 MSHistoryColumns *msHistoryCols_p; 00113 00114 // initialize the above for the first time 00115 void init(MSHistory &msHistory); 00116 00117 // undefined and unavailable 00118 GBTMSHistoryFiller(const GBTMSHistoryFiller &other); 00119 void operator=(const GBTMSHistoryFiller &other); 00120 }; 00121 00122 #endif 00123 00124