casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
GBTMSProcessorFiller.h
Go to the documentation of this file.
00001 //# GBTMSProcessorFiller.h: GBTMSProcessorFiller fills the MSProcessor 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_GBTMSPROCESSORFILLER_H
00030 #define NRAO_GBTMSPROCESSORFILLER_H
00031 
00032 #include <casa/aips.h>
00033 #include <casa/Containers/RecordField.h>
00034 #include <ms/MeasurementSets/MSProcessor.h>
00035 
00036 //# Forward Declarations
00037 namespace casa { //# NAMESPACE CASA - BEGIN
00038 class ColumnsIndex;
00039 class MSProcessorColumns;
00040 } //# NAMESPACE CASA - END
00041 
00042 #include <casa/namespace.h>
00043 
00044 // <summary>
00045 // GBTMSProcessorFiller fills the MSProcessor 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 MSProcessor table.
00060 // </etymology>
00061 //
00062 // <synopsis>
00063 // This class puts the appropriate values for the GBT in an MSProcessor
00064 // table (which has been previously created as part of a MeasurementSet).
00065 // On each fill() any necessary additions to the MSProcessor are made.  
00066 //
00067 // The processorId is available to be used by 
00068 // other GBTMS*Fillers as other subtables are filled in turn.
00069 //
00070 // </synopsis>
00071 //
00072 // <example>
00073 // </example>
00074 //
00075 // <motivation>
00076 // Writing a filler is a daunting task.  There are various dependencies
00077 // between the subtables.  It helps to encapsulate the knowlege and
00078 // task of filling a specific subtable to separate classes.
00079 // </motivation>
00080 //
00081 //#! <thrown>
00082 //#! A list of exceptions thrown if errors are discovered in the function.
00083 //#! This tag will appear in the body of the header file, preceding the
00084 //#! declaration of each function which throws an exception.
00085 //#! </thrown>
00086 
00087 class GBTMSProcessorFiller
00088 {
00089 public:
00090 
00091     // The default ctor.  No MSProcessor table has been attached yet.
00092     // Calling fill on such a filler will throw an exception.
00093     // It is present so that this object can be instantiated before
00094     // an MSProcessor has been created.
00095     GBTMSProcessorFiller();
00096 
00097     // A filler attached to an MSProcessor table
00098     GBTMSProcessorFiller(MSProcessor &msProcessor);
00099 
00100     ~GBTMSProcessorFiller();
00101 
00102     // attach it to an MSProcessor
00103     void attach(MSProcessor &msProcessor);
00104 
00105     // fill - sub_type is always GBT, mode_id is not yet used
00106     void fill(const String &type, Int typeId);
00107 
00108     // this is the row number of the most recently "filled" MSProcessor row
00109     Int processorId() {return procId_p;}
00110 
00111     // flush the underlying MS subtable
00112     void flush() {msProcessor_p->flush();}
00113 private:
00114     MSProcessor *msProcessor_p;
00115     MSProcessorColumns *msProcCols_p;
00116 
00117     ColumnsIndex *index_p;
00118 
00119     RecordFieldPtr<String> typeKey_p;
00120     RecordFieldPtr<Int> typeIdKey_p;
00121 
00122     Int procId_p;
00123 
00124     // initialize the above for the first time
00125     void init(MSProcessor &msProcessor);
00126 
00127     // undefined and unavailable
00128     GBTMSProcessorFiller(const GBTMSProcessorFiller &other);
00129     void operator=(const GBTMSProcessorFiller &other);
00130 };
00131 
00132 #endif
00133 
00134