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