casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
GBTDAPFiller.h
Go to the documentation of this file.
00001 //# GBTDAPFiller: A generic filler for GBT Data Associated Parameter FITS files.
00002 //# Copyright (C) 1999,2000,2001
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$
00028 
00029 #ifndef NRAO_GBTDAPFILLER_H
00030 #define NRAO_GBTDAPFILLER_H
00031 
00032 #include <nrao/GBTFillers/GBTDAPFillerBase.h>
00033 
00034 #include <casa/Containers/Block.h>
00035 #include <tables/Tables/Table.h>
00036 #include <tables/Tables/TableColumn.h>
00037 #include <casa/BasicSL/String.h>
00038 
00039 
00040 //# Forward Declarations
00041 namespace casa { //# NAMESPACE CASA - BEGIN
00042 class TableRow;
00043 } //# NAMESPACE CASA - END
00044 
00045 #include <casa/namespace.h>
00046 
00047 // <summary>
00048 // A generic filler for GBT Data Associated Parameter FITS files.
00049 // </summary>
00050 
00051 // <use visibility=local>
00052 
00053 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
00054 // </reviewed>
00055 
00056 // <prerequisite>
00057 //   <li> GBT DAP FITS files
00058 //   <li> GBTDAPFillerBase.h
00059 // </prerequisite>
00060 //
00061 // <etymology>
00062 // This fills GBT DAP FITS file contents into a table which is part of
00063 // an AIPS++ MeasurementSet.
00064 // </etymology>
00065 //
00066 // <synopsis>
00067 // </synopsis>
00068 //
00069 // <example>
00070 // </example>
00071 //
00072 // <motivation>
00073 // It is necessary to fill GBT DAP files to a MS.
00074 // </motivation>
00075 //
00076 // <thrown>
00077 //    <li>
00078 //    <li>
00079 // </thrown>
00080 //
00081 
00082 class GBTDAPFiller : public GBTDAPFillerBase
00083 {
00084 public:
00085     // makes new one if not already present in parent, otherwise
00086     // it opens that one up as is
00087     GBTDAPFiller(const String &device, Table &parent);
00088 
00089     virtual ~GBTDAPFiller();
00090 
00091     // the device name used at construction
00092     const String &device() const {return device_p;}
00093 
00094     virtual Int prepare(const String &fileName, const String &manager,
00095                         const String &sampler, const MVTime &startTime);
00096 
00097 
00098     // fill to the standard table attached to the parent used at construction
00099     virtual void fill();
00100 
00101     // flush this to disk
00102     void flush() {tab_p->flush();}
00103 
00104 protected:
00105     // derived classes need read-only access to the underlying table
00106     Table &tab() { return *tab_p;}
00107 
00108 private:
00109     String device_p;
00110 
00111     Table *tab_p;
00112 
00113     // samper, manager and time columns
00114     TableColumn samplerCol_p, managerCol_p, timeCol_p, intervalCol_p;
00115 
00116     // The is where the TableRow appropriate for each DAP is stored
00117     PtrBlock<TableRow *> daprow_p;
00118     // and how many of them are really in use at any given point
00119     Int ndap_p;
00120 
00121     // attach the table columns
00122     void attachColumns();
00123 
00124     // unavailable, undefined
00125     GBTDAPFiller();
00126     GBTDAPFiller(const GBTDAPFiller &);
00127     GBTDAPFiller &operator=(const GBTDAPFiller &);
00128 };
00129 
00130 
00131 #endif
00132 
00133