Main Page | Class List | Directories | File List | Class Members | File Members

ObitTable.h

Go to the documentation of this file.
00001 /* $Id: ObitTable.h,v 1.11 2007/08/31 17:24:48 bcotton Exp $  */
00002 /*--------------------------------------------------------------------*/
00003 /*;  Copyright (C) 2003-2007                                          */
00004 /*;  Associated Universities, Inc. Washington DC, USA.                */
00005 /*;                                                                   */
00006 /*;  This program is free software; you can redistribute it and/or    */
00007 /*;  modify it under the terms of the GNU General Public License as   */
00008 /*;  published by the Free Software Foundation; either version 2 of   */
00009 /*;  the License, or (at your option) any later version.              */
00010 /*;                                                                   */
00011 /*;  This program is distributed in the hope that it will be useful,  */
00012 /*;  but WITHOUT ANY WARRANTY; without even the implied warranty of   */
00013 /*;  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    */
00014 /*;  GNU General Public License for more details.                     */
00015 /*;                                                                   */
00016 /*;  You should have received a copy of the GNU General Public        */
00017 /*;  License along with this program; if not, write to the Free       */
00018 /*;  Software Foundation, Inc., 675 Massachusetts Ave, Cambridge,     */
00019 /*;  MA 02139, USA.                                                   */
00020 /*;                                                                   */
00021 /*; Correspondence about this software should be addressed as follows:*/
00022 /*;         Internet email: bcotton@nrao.edu.                         */
00023 /*;         Postal address: William Cotton                            */
00024 /*;                         National Radio Astronomy Observatory      */
00025 /*;                         520 Edgemont Road                         */
00026 /*;                         Charlottesville, VA 22903-2475 USA        */
00027 /*--------------------------------------------------------------------*/
00028 #ifndef OBITTABLE_H 
00029 #define OBITTABLE_H 
00030 
00031 #include "Obit.h"
00032 #include "ObitErr.h"
00033 #include "ObitThread.h"
00034 #include "ObitInfoList.h"
00035 #include "ObitIO.h"
00036 #include "ObitTableDesc.h"
00037 #include "ObitTableSel.h"
00038 
00039 /*-------- Obit: Software for the recently deceased ------------------*/
00149 /*--------------Class definitions-------------------------------------*/
00151 typedef struct {
00152 #include "ObitTableDef.h"   /* this class definition */
00153 } ObitTable;
00154 
00156 typedef struct {
00157 #include "ObitTableRowDef.h"   /* this class row definition */
00158 } ObitTableRow;
00159 
00160 /*----------------- Macroes ---------------------------*/
00166 #define ObitTableUnref(in) ObitUnref (in)
00167 
00173 #define ObitTableRef(in) ObitRef (in)
00174 
00181 #define ObitTableIsA(in) ObitIsA (in, ObitTableGetClass())
00182 
00188 #define ObitTableRowUnref(in) ObitUnref (in)
00189 
00195 #define ObitTableRowRef(in) ObitRef (in)
00196 
00203 #define ObitTableRowIsA(in) ObitIsA (in, ObitTableRowGetClass())
00204 
00216 #define ObitTableSetFITS(in,disk,file,tab,ver,nrow,err) G_STMT_START{ \
00217        in->info->dim[0]=1; in->info->dim[1]=1; in->info->dim[2]=1;  \
00218        in->info->dim[3]=1; in->info->dim[4]=1;                      \
00219        in->info->work[0] = OBIT_IO_FITS;                            \
00220        in->info->work[1] = ver; in->info->work[2]= nrow;            \
00221        in->info->work[2] = disk;                                    \
00222        in->info->dim[0] = 1;                                        \
00223        ObitInfoListPut (in->info, "Disk", OBIT_int,                 \
00224                  in->info->dim, (gpointer)&in->info->work[2], err); \
00225        ObitInfoListPut (in->info, "FileType", OBIT_int,             \
00226                   in->info->dim, (gpointer)&in->info->work[0], err);\
00227        ObitInfoListPut (in->info, "Ver", OBIT_int,                  \
00228                  in->info->dim, (gpointer)&in->info->work[1], err); \
00229        ObitInfoListPut (in->info, "nRowPIO", OBIT_int,              \
00230                  in->info->dim, (gpointer)&in->info->work[2], err); \
00231        in->info->dim[0] = strlen(tab);                              \
00232        ObitInfoListPut (in->info, "TabName", OBIT_string,           \
00233                  in->info->dim, (gpointer)tab, err);                \
00234        in->info->dim[0] = strlen(file);                             \
00235        ObitInfoListPut (in->info, "FileName", OBIT_string,          \
00236                  in->info->dim, (gpointer)file, err);               \
00237      }G_STMT_END  
00238 
00251 #define ObitTableSetAIPS(in,disk,cno,tab,ver,user,nrow,err)  G_STMT_START{  \
00252        in->info->dim[0]=1; in->info->dim[1]=1; in->info->dim[2]=1;  \
00253        in->info->dim[3]=1; in->info->dim[4]=1;                      \
00254        in->info->work[0] = OBIT_IO_AIPS;                            \
00255        in->info->work[1]= ver;  in->info->work[2]= nrow;            \
00256        ObitInfoListPut (in->info, "FileType", OBIT_int,             \
00257                   in->info->dim, (gpointer)&in->info->work[0], err);\
00258        in->info->dim[0] = 1;                                        \
00259        ObitInfoListPut (in->info, "Disk", OBIT_int,                 \
00260                  in->info->dim, (gpointer)&disk, err);              \
00261        ObitInfoListPut (in->info, "Ver", OBIT_int,                  \
00262                  in->info->dim, (gpointer)&in->info->work[1], err); \
00263        ObitInfoListPut (in->info, "CNO", OBIT_int,                  \
00264                  in->info->dim, (gpointer)&cno, err);               \
00265        ObitInfoListPut (in->info, "User", OBIT_int,                 \
00266                  in->info->dim, (gpointer)&user, err);              \
00267        ObitInfoListPut (in->info, "nRowPIO", OBIT_int,              \
00268                  in->info->dim, (gpointer)&in->info->work[2], err); \
00269        in->info->dim[0] = 2;                                        \
00270        ObitInfoListPut (in->info, "TableType", OBIT_string,         \
00271                  in->info->dim, (gpointer)&tab, err);               \
00272      }G_STMT_END   
00273 
00274 
00275 /*---------------Public functions---------------------------*/
00276 /*----------------Table Row Functions ----------------------*/
00278 void ObitTableRowClassInit (void);
00279 
00281 ObitTableRow* newObitTableRow (ObitTable *table);
00283 typedef ObitTableRow* (*newObitTableRowFP) (ObitTable *in);
00284 
00286 gconstpointer ObitTableRowGetClass (void);
00287 
00288 /*------------------Table Functions ------------------------*/
00290 void ObitTableClassInit (void);
00291 
00293 ObitTable* newObitTable (gchar* name);
00294 
00296 void ObitTableFullInstantiate (ObitTable *in, gboolean exist, ObitErr *err);
00297 typedef void (*ObitTableFullInstantiateFP) (ObitTable *in, gboolean exist, 
00298                                             ObitErr *err);
00300 void ObitTableClearRows (ObitTable *in, ObitErr *err);
00301 typedef void (*ObitTableClearRowsFP) (ObitTable *in, ObitErr *err);
00303 gconstpointer ObitTableGetClass (void);
00304 
00306 ObitTable* ObitTableZap  (ObitTable *in, ObitErr *err);
00308 typedef ObitTable* (*ObitTableZapFP) (ObitTable *in, ObitErr *err);
00309 
00311 ObitTable* ObitTableCopy  (ObitTable *in, ObitTable *out, 
00312                            ObitErr *err);
00313 
00315 ObitTable* ObitTableClone (ObitTable *in, ObitTable *out);
00316 
00318 void ObitTableConcat (ObitTable *in, ObitTable *out, ObitErr *err);
00319 
00321 ObitTable* ObitTableConvert  (ObitTable *in);
00322 typedef ObitTable* (*ObitTableConvertFP) (ObitTable *in);
00323 
00325 ObitIOCode ObitTableOpen (ObitTable *in, ObitIOAccess access, 
00326                           ObitErr *err);
00327 typedef ObitIOCode (*ObitTableOpenFP) (ObitTable *in, ObitIOAccess access, 
00328                           ObitErr *err);
00329 
00331 ObitIOCode ObitTableClose (ObitTable *in, ObitErr *err);
00332 typedef ObitIOCode (*ObitTableCloseFP) (ObitTable *in, ObitErr *err);
00333 
00335 ObitIOCode ObitTableRead (ObitTable *in, glong row, gfloat *data, 
00336                           ObitErr *err);
00337 typedef ObitIOCode (*ObitTableReadFP) (ObitTable *in, glong row, 
00338                                        gfloat *data, ObitErr *err);
00339 
00341 ObitIOCode ObitTableReadSelect (ObitTable *in, glong row, gfloat *data, 
00342                                 ObitErr *err);
00343 typedef ObitIOCode (*ObitTableReadSelectFP) (ObitTable *in, glong row, 
00344                                              gfloat *data, ObitErr *err);
00345 
00347 void ObitTableSetRow  (ObitTable *in, ObitTableRow *row, ObitErr *err);
00348 typedef void (*ObitTableSetRowFP) (ObitTable *in, ObitTableRow *row, 
00349                                    ObitErr *err);
00350 
00352 ObitIOCode ObitTableWrite (ObitTable *in, glong row, gfloat *data, 
00353                            ObitErr *err);
00354 typedef ObitIOCode (*ObitTableWriteFP) (ObitTable *in, glong row, 
00355                                         gfloat *data, ObitErr *err);
00356 
00358 ObitIOCode ObitTableReadRow (ObitTable *in, glong rowno, ObitTableRow *row, 
00359                              ObitErr *err);
00360 typedef ObitIOCode (*ObitTableReadRowFP) (ObitTable *in, glong rowno, 
00361                                           ObitTableRow *row, ObitErr *err);
00362 
00364 ObitIOCode ObitTableWriteRow (ObitTable *in, glong rowno, ObitTableRow *row, 
00365                               ObitErr *err);
00366 typedef ObitIOCode (*ObitTableWriteRowFP) (ObitTable *in, glong rowno, 
00367                                            ObitTableRow *row, ObitErr *err);
00368 
00370 gchar* ObitTableGetType (ObitTable *in, ObitErr *err);
00371 typedef gchar* (*ObitTableGetTypeFP) (ObitTable *in, ObitErr *err);
00372 
00374 glong ObitTableGetVersion (ObitTable *in, ObitErr *err);
00375 typedef glong (*ObitTableGetVersionFP) (ObitTable *in, ObitErr *err);
00376 
00377 /*----------- ClassInfo Structure -----------------------------------*/
00383 typedef struct  {
00384 #include "ObitTableClassDef.h"
00385 } ObitTableClassInfo; 
00386 
00392 typedef struct  {
00393 #include "ObitTableRowClassDef.h"
00394 } ObitTableRowClassInfo; 
00395 
00396 #endif /* OBITTABLE_H */ 

Generated on Fri Aug 31 22:13:04 2007 for Obit by  doxygen 1.3.9.1