casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
CalHistoryColumns.h
Go to the documentation of this file.
00001 //# CalHistoryColumns.h: Calibration table cal_history column access
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_CALHISTORYCOLUMNS_H
00030 #define CALIBRATION_CALHISTORYCOLUMNS_H
00031 
00032 #include <casa/aips.h>
00033 #include <measures/Measures/MFrequency.h>
00034 #include <tables/Tables/TableColumn.h>
00035 #include <tables/Tables/ScalarColumn.h>
00036 #include <synthesis/CalTables/CalTable.h>
00037 #include <synthesis/MSVis/MSCalEnums.h>
00038 
00039 namespace casa { //# NAMESPACE CASA - BEGIN
00040 
00041 // <summary> 
00042 // ROCalHistoryColumns: Read-only cal_history calibration table column access
00043 // </summary>
00044 
00045 // <use visibility=export>
00046 
00047 // <reviewed reviewer="" date="" tests="" demos="">
00048 
00049 // <prerequisite>
00050 //   <li> <linkto class="CalTable">CalTable</linkto> module
00051 // </prerequisite>
00052 //
00053 // <etymology>
00054 // From "read-only", "calibration history table" and "columns".
00055 // </etymology>
00056 //
00057 // <synopsis>
00058 // The ROCalHistoryColumns class allows read-only access to columns
00059 // in the cal_history calibration sub-table. 
00060 // </etymology>
00061 //
00062 // <example>
00063 // <srcblock>
00064 // </srcblock>
00065 // </example>
00066 //
00067 // <motivation>
00068 // Encapsulate read-only access to cal_history calibration sub-table columns.
00069 // </motivation>
00070 //
00071 // <todo asof="11/01/01">
00072 // (i) Deal with non-standard columns.
00073 // </todo>
00074 
00075 class ROCalHistoryColumns 
00076 {
00077  public:
00078   // Construct from a cal_history calibration sub-table
00079   ROCalHistoryColumns (const CalTable& calTable);
00080 
00081   // Default destructor
00082   virtual ~ROCalHistoryColumns() {};
00083 
00084   // Read-only column accessors
00085   const ROScalarColumn<String>& calParms() const {return calParms_p;};
00086   const ROScalarColumn<String>& calTables() const {return calTables_p;};
00087   const ROScalarColumn<String>& calSelect() const {return calSelect_p;};
00088   const ROScalarColumn<String>& calNotes() const {return calNotes_p;};
00089 
00090  protected:
00091   // Prohibit public use of the null constructor, which
00092   // does not produce a usable object.
00093   ROCalHistoryColumns() {};
00094 
00095   // Return a CalTable cal_history subtable as a Table reference. 
00096   // Utilizes friendship relationship with class CalTable.
00097   const Table& calHistoryAsTable(const CalTable& calTable) 
00098     {return calTable.calHistoryAsTable();}
00099 
00100   // Attach a table column accessor
00101   void attach (const CalTable& calTable, ROTableColumn& tabCol, 
00102                MSCalEnums::colDef colEnum, const Bool& optional = False);
00103 
00104  private:
00105   // Prohibit copy constructor and assignment operator 
00106   ROCalHistoryColumns (const ROCalHistoryColumns&);
00107   ROCalHistoryColumns& operator= (const ROCalHistoryColumns&);
00108 
00109   // Private column accessors
00110   ROScalarColumn<String> calParms_p;
00111   ROScalarColumn<String> calTables_p;
00112   ROScalarColumn<String> calSelect_p;
00113   ROScalarColumn<String> calNotes_p;
00114 };
00115 
00116 // <summary> 
00117 // CalHistoryColumns: Read-write cal_history calibration table column access
00118 // </summary>
00119 
00120 // <use visibility=export>
00121 
00122 // <reviewed reviewer="" date="" tests="" demos="">
00123 
00124 // <prerequisite>
00125 //   <li> <linkto class="CalTable">CalTable</linkto> module
00126 // </prerequisite>
00127 //
00128 // <etymology>
00129 // From "calibration history table" and "columns".
00130 // </etymology>
00131 //
00132 // <synopsis>
00133 // The CalHistoryColumns class allows read-write access to columns
00134 // in the cal_history calibration sub-table. 
00135 // </etymology>
00136 //
00137 // <example>
00138 // <srcblock>
00139 // </srcblock>
00140 // </example>
00141 //
00142 // <motivation>
00143 // Encapsulate access to cal_history calibration sub-table columns.
00144 // </motivation>
00145 //
00146 // <todo asof="01/07/01">
00147 // (i) Deal with non-standard columns.
00148 // </todo>
00149 
00150 class CalHistoryColumns 
00151 {
00152  public:
00153   // Construct from a calibration table
00154   CalHistoryColumns (CalTable& calTable);
00155 
00156   // Default destructor
00157   virtual ~CalHistoryColumns() {};
00158 
00159   // Read-write column accessors
00160   ScalarColumn<String>& calParms() {return calParms_p;};
00161   ScalarColumn<String>& calTables() {return calTables_p;};
00162   ScalarColumn<String>& calSelect() {return calSelect_p;};
00163   ScalarColumn<String>& calNotes() {return calNotes_p;};
00164 
00165  protected:
00166   // Prohibit public use of the null constructor, which
00167   // does not produce a usable object.
00168   CalHistoryColumns() {};
00169 
00170   // Return a CalTable cal_history subtable as a Table reference. 
00171   // Utilizes friendship relationship with class CalTable.
00172   Table& calHistoryAsTable(CalTable& calTable) 
00173     {return calTable.calHistoryAsTable();}
00174 
00175   // Attach a table column accessor
00176   void attach (CalTable& calTable, ROTableColumn& tabCol, 
00177                MSCalEnums::colDef colEnum, const Bool& optional = False);
00178 
00179  private:
00180   // Prohibit copy constructor and assignment operator 
00181   CalHistoryColumns (const CalHistoryColumns&);
00182   CalHistoryColumns& operator= (const CalHistoryColumns&);
00183 
00184   // Private column accessors
00185   ScalarColumn<String> calParms_p;
00186   ScalarColumn<String> calTables_p;
00187   ScalarColumn<String> calSelect_p;
00188   ScalarColumn<String> calNotes_p;
00189 
00190 };
00191 
00192 
00193 } //# NAMESPACE CASA - END
00194 
00195 #endif
00196    
00197   
00198 
00199 
00200