casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
CalDescBuffer.h
Go to the documentation of this file.
00001 //# CalDescBuffer.h: Calibration table cal_desc buffer
00002 //# Copyright (C) 1996,1997,1998,2001,2002,2003
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 adressed 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 CALIBRATION_CALDESCBUFFER_H
00030 #define CALIBRATION_CALDESCBUFFER_H
00031 
00032 #include <casa/Arrays/Matrix.h>
00033 #include <synthesis/CalTables/CalIterBase.h>
00034 #include <synthesis/CalTables/CalTable.h>
00035 #include <synthesis/CalTables/CalDescColumns.h>
00036 
00037 namespace casa { //# NAMESPACE CASA - BEGIN
00038 
00039 // <summary> 
00040 // CalDescBuffer: Calibration table cal_desc buffer
00041 // </summary>
00042 
00043 // <use visibility=export>
00044 
00045 // <reviewed reviewer="" date="" tests="" demos="">
00046 
00047 // <prerequisite>
00048 //   <li> <linkto class="CalTable">CalTable</linkto> module
00049 //   <li> <linkto class="CalIterBase">CalIterBase</linkto> module
00050 // </prerequisite>
00051 //
00052 // <etymology>
00053 // From "calibration description table" and "buffer"
00054 // </etymology>
00055 //
00056 // <synopsis>
00057 // The CalDescBuffer class holds a buffer, optionally connected to a 
00058 // calibration table cal_desc iterator (of base type CalIterBase). 
00059 // </synopsis>
00060 //
00061 // <example>
00062 // <srcblock>
00063 // </srcblock>
00064 // </example>
00065 //
00066 // <motivation>
00067 // Encapsulate calibration table cal_desc data buffers.
00068 // </motivation>
00069 //
00070 // <todo asof="01/08/01">
00071 // (i) Deal with non-standard columns.
00072 // </todo>
00073 
00074 class CalDescBuffer 
00075 {
00076  public:
00077   // Default constructor. No connection to an underlying
00078   // calibration table iterator in this case.
00079   CalDescBuffer();
00080 
00081   // Construct from a calibration table iterator. The calibration
00082   // buffer will remain synchronized with the iterator.
00083   CalDescBuffer (CalIterBase& calIter);
00084 
00085   // Default destructor
00086   virtual ~CalDescBuffer();
00087 
00088   // Invalidate the current calibration table cal_desc buffer. 
00089   // This signals that a re-read is required as the iterator has advanced.
00090   virtual void invalidate();
00091 
00092   // Write the current buffer at the end of a specified calibration
00093   // table cal_desc subtable(NYI)
00094   virtual void append (CalTable& /*calTable*/) {};
00095 
00096   // Data field accessors
00097   Vector<Int>& numSpw();
00098   Vector<Int>& numChan();
00099   Vector<Int>& numReceptors();
00100   Vector<Int>& nJones();
00101   Matrix<Int>& spwId();
00102   Array<MFrequency>& chanFreqMeas();
00103   Vector<Int>& measFreqRef();
00104   Array<Quantity>& chanWidthQuant();
00105   Array<Int>& chanRange();
00106   Matrix<String>& polznType();
00107   Vector<String>& jonesType();
00108   Vector<String>& msName();
00109 
00110  protected:
00111   // Factory method to create a columns accessor object of the appropriate type
00112   virtual CalDescColumns* newCalDescCol (CalTable& calTable)
00113     {return new CalDescColumns (calTable);};
00114 
00115   // Access to the columns accessor object
00116   virtual CalDescColumns* calDescCol() {return calDescCol_p;};
00117 
00118   // Is the buffer connected to an underlying iterator ?
00119   Bool connectedToIter() {return connectedToIter_p;};
00120 
00121  private:
00122   // True if connected to underlying iterator
00123   Bool connectedToIter_p;
00124 
00125   // Ptr to cal main columns accessor
00126   CalDescColumns* calDescCol_p;
00127 
00128   // Buffer fields
00129   Vector<Int> numSpw_p;
00130   Vector<Int> numChan_p;
00131   Vector<Int> numReceptors_p;
00132   Vector<Int> nJones_p;
00133   Matrix<Int> spwId_p;
00134   Array<MFrequency> chanFreqMeas_p;
00135   Vector<Int> measFreqRef_p;
00136   Array<Quantity> chanWidthQuant_p;
00137   Array<Int> chanRange_p;
00138   Matrix<String> polznType_p;
00139   Vector<String> jonesType_p;
00140   Vector<String> msName_p;
00141 
00142   // Buffer field status flags
00143   Bool numSpwOK_p;
00144   Bool numChanOK_p;
00145   Bool numReceptorsOK_p;
00146   Bool nJonesOK_p;
00147   Bool spwIdOK_p;
00148   Bool chanFreqMeasOK_p;
00149   Bool measFreqRefOK_p;
00150   Bool chanWidthQuantOK_p;
00151   Bool chanRangeOK_p;
00152   Bool polznTypeOK_p;
00153   Bool jonesTypeOK_p;
00154   Bool msNameOK_p;
00155 };
00156 
00157 
00158 } //# NAMESPACE CASA - END
00159 
00160 #endif