casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
MSDataDescription.h
Go to the documentation of this file.
00001 //# MSDataDescription.h: The MeasurementSet DATADESCRIPTION Table
00002 //# Copyright (C) 1996,2000
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: MSDataDescription.h 20299 2008-04-03 05:56:44Z gervandiepen $
00028 
00029 #ifndef MS_MSDATADESCRIPTION_H
00030 #define MS_MSDATADESCRIPTION_H
00031 
00032 #include <casa/aips.h>
00033 #include <ms/MeasurementSets/MSTable.h>
00034 #include <ms/MeasurementSets/MSDataDescEnums.h>
00035 
00036 namespace casa { //# NAMESPACE CASA - BEGIN
00037 
00038 // <summary> 
00039 // A Table intended to hold a MeasurementSet DATADESCRIPTION table.
00040 // </summary>
00041 
00042 // <use visibility=export>
00043 
00044 // <reviewed reviewer="Bob Garwood" date="1997/02/01" tests="" demos="">
00045 
00046 // <prerequisite>
00047 //   <li> <linkto class="MeasurementSet:description">MeasurementSet</linkto> 
00048 //   <li> <linkto class="MSTable">MSTable</linkto> 
00049 // </prerequisite>
00050 //
00051 // <etymology>
00052 // MSDataDescription stands for the MeasurementSet Datadescription table.
00053 // </etymology>
00054 //
00055 // <synopsis> 
00056 // An MSDataDescription is a table intended to hold the DATADESCRIPTION table for
00057 // the MeasurementSet. It has an identical set of member functions as
00058 // the main MeasurementSet class, except (currently) for the default
00059 // calibration members. For further info and examples see the 
00060 // MeasurementSet class.
00061 // </synopsis> 
00062 //
00063 // <example>
00064 // See the MeasurementSet for an example of how to access and use this class.
00065 // </example>
00066 //
00067 // <motivation>
00068 // It was found that subtables and the main table of the MeasurementSet have
00069 // a lot in common, therefore they derive their interface from the same
00070 // base class. Each subtable has its own class to keep the enum definitions
00071 // and conversion functions in separate scopes.
00072 // </motivation>
00073 //
00074 // <todo asof="1999/01/13">
00075 // see MeasurementSet.
00076 // </todo>
00077 
00078 
00079 class MSDataDescription:public MSDataDescriptionEnums,
00080                 public MSTable<MSDataDescriptionEnums::PredefinedColumns,
00081                                MSDataDescriptionEnums::PredefinedKeywords>
00082 {
00083 public:
00084     // This constructs an empty MSDataDescription
00085     MSDataDescription ();
00086     //
00087     // These constructors mirror the Table ones with additional checking
00088     // on validity (verifying that the MSDataDescription will have the required columns
00089     // and keywords).
00090     // An exception is thrown if the constructed Table is not a valid MSDataDescription
00091     // <thrown>
00092     //   <li> AipsError
00093     // </thrown>
00094     // <group name=tableLikeConstructors>
00095     MSDataDescription (const String &tableName, TableOption = Table::Old);
00096     MSDataDescription (const String &tableName, const String &tableDescName,
00097                     TableOption = Table::Old);
00098     MSDataDescription (SetupNewTable &newTab, uInt nrrow = 0,
00099                     Bool initialize = False);
00100     MSDataDescription (const Table &table);
00101     MSDataDescription (const MSDataDescription &other);
00102     // </group>
00103 
00104     // As with tables, the destructor writes the table if necessary.
00105     // Additional checking is done here to verify that all required
00106     // columns are still present.
00107     // If it is NOT valid, it will write the table and then throw an exception.
00108     // <thrown>
00109     //   <li> AipsError
00110     // </thrown>
00111     ~MSDataDescription();
00112 
00113     //  Assignment operator, reference semantics
00114     MSDataDescription& operator=(const MSDataDescription&);
00115 
00116     // Make a special copy of this Table which references all columns from
00117     // this Table except those mentioned; those are empty and writable.
00118     // Each forwarded column has the same writable status as the underlying
00119     // column. The mentioned columns all use the AipsIO storage manager.
00120     // This function is inherited from MSTable and unlikely to be of use,
00121     // except in the class MeasurementSet (see comment there)..
00122     MSDataDescription referenceCopy(const String& newTableName,
00123                             const Block<String>& writableColumns) const;
00124 
00125     // Initialize the statics appropriately. This does not need to be
00126     // called by users, it is called by the implementation class
00127     // MSTableImpl.
00128     static void init();
00129 
00130 private:
00131 
00132     // required by the need to throw an exception in the destructor
00133     Bool hasBeenDestroyed_p;
00134 
00135 };
00136 
00137 
00138 } //# NAMESPACE CASA - END
00139 
00140 #endif