casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
CalHistoryBuffer.h
Go to the documentation of this file.
00001 //# CalHistoryBuffer.h: Calibration table cal_history buffer
00002 //# Copyright (C) 1996,1997,1998,2001,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_CALHISTORYBUFFER_H
00030 #define CALIBRATION_CALHISTORYBUFFER_H
00031 
00032 #include <synthesis/CalTables/CalIterBase.h>
00033 #include <synthesis/CalTables/CalTable.h>
00034 #include <synthesis/CalTables/CalHistoryColumns.h>
00035 
00036 namespace casa { //# NAMESPACE CASA - BEGIN
00037 
00038 // <summary> 
00039 // CalHistoryBuffer: Calibration table cal_history buffer
00040 // </summary>
00041 
00042 // <use visibility=export>
00043 
00044 // <reviewed reviewer="" date="" tests="" demos="">
00045 
00046 // <prerequisite>
00047 //   <li> <linkto class="CalTable">CalTable</linkto> module
00048 //   <li> <linkto class="CalIterBase">CalIterBase</linkto> module
00049 // </prerequisite>
00050 //
00051 // <etymology>
00052 // From "calibration history sub-table" and "buffer"
00053 // </etymology>
00054 //
00055 // <synopsis>
00056 // The CalHistoryBuffer class holds a buffer for the cal_history
00057 // sub-table, optionally connected to a calibration table 
00058 // iterator (of base type CalIterBase). 
00059 // </synopsis>
00060 //
00061 // <example>
00062 // <srcblock>
00063 // </srcblock>
00064 // </example>
00065 //
00066 // <motivation>
00067 // Encapsulate calibration table cal_history data buffer.
00068 // </motivation>
00069 //
00070 // <todo asof="01/12/26">
00071 // (i) Deal with non-standard columns.
00072 // </todo>
00073 
00074 class CalHistoryBuffer 
00075 {
00076  public:
00077   // Default constructor. No connection to an underlying
00078   // calibration table iterator in this case.
00079   CalHistoryBuffer();
00080 
00081   // Construct from a calibration table iterator. The calibration
00082   // buffer will remain synchronized with the iterator.
00083   CalHistoryBuffer (CalIterBase& calIter);
00084 
00085   // Default destructor
00086   virtual ~CalHistoryBuffer();
00087 
00088   // Invalidate the current calibration buffer. This signals
00089   // 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 
00093   // cal_history table (NYI)
00094   virtual void append (CalTable& /*calTable*/) {};
00095 
00096   // Data field accessors
00097   Vector<String>& calParms();
00098   Vector<String>& calTables();
00099   Vector<String>& calSelect();
00100   Vector<String>& calNotes();
00101 
00102  protected:
00103   // Factory method to create a columns accessor object of the appropriate type
00104   virtual CalHistoryColumns* newCalHistoryCol (CalTable& calTable)
00105     {return new CalHistoryColumns (calTable);};
00106 
00107   // Access to the columns accessor object
00108   virtual CalHistoryColumns* calHistCol() {return calHistCol_p;};
00109 
00110   // Is the buffer connected to an underlying iterator ?
00111   Bool connectedToIter() {return connectedToIter_p;};
00112 
00113  private:
00114   // True if connected to underlying iterator
00115   Bool connectedToIter_p;
00116 
00117   // Ptr to cal_history columns accessor
00118   CalHistoryColumns* calHistCol_p;
00119 
00120   // Buffer fields
00121   Vector<String> calParms_p;
00122   Vector<String> calTables_p;
00123   Vector<String> calSelect_p;
00124   Vector<String> calNotes_p;
00125 
00126   // Buffer field status flags
00127   Bool calParmsOK_p;
00128   Bool calTablesOK_p;
00129   Bool calSelectOK_p;
00130   Bool calNotesOK_p;
00131 };
00132 
00133 
00134 } //# NAMESPACE CASA - END
00135 
00136 #endif
00137    
00138   
00139 
00140 
00141