casa
$Rev:20696$
|
00001 //# TSMCoordColumn.h: A coordinate column in Tiled Storage Manager 00002 //# Copyright (C) 1995,1996,1999 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 //# $Id: TSMCoordColumn.h 20551 2009-03-25 00:11:33Z Malte.Marquarding $ 00027 00028 #ifndef TABLES_TSMCOORDCOLUMN_H 00029 #define TABLES_TSMCOORDCOLUMN_H 00030 00031 //# Includes 00032 #include <casa/aips.h> 00033 #include <tables/Tables/TSMColumn.h> 00034 00035 namespace casa { //# NAMESPACE CASA - BEGIN 00036 00037 //# Forward declarations 00038 00039 00040 // <summary> 00041 // A coordinate column in Tiled Storage Manager 00042 // </summary> 00043 00044 // <use visibility=local> 00045 00046 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests=""> 00047 // </reviewed> 00048 00049 // <prerequisite> 00050 //# Classes you should understand before using this one. 00051 // <li> <linkto class=TSMColumn>TSMColumn</linkto> 00052 // <li> <linkto class=TSMCube>TSMCube</linkto> 00053 // <li> <linkto class=Record>Record</linkto> 00054 // </prerequisite> 00055 00056 // <etymology> 00057 // TSMCoordColumn handles a coordinate column for a Tiled 00058 // Storage Manager. 00059 // </etymology> 00060 00061 // <synopsis> 00062 // TSMCoordColumn is used by 00063 // <linkto class=TiledStMan>TiledStMan</linkto> 00064 // to handle the access to 00065 // a table column containing coordinates of a tiled hypercube axis. 00066 // There are 2 types of coordinates (as described at 00067 // <linkto class=TableDesc:defineHypercolumn> 00068 // TableDesc::defineHypercolumn</linkto>): 00069 // <ol> 00070 // <li> As a vector. These are the coordinates of the arrays held 00071 // in the data cells. They are accessed via the get/putArray 00072 // functions. Their shapes are dependent on the hypercube shape, 00073 // so it is checked if they match. 00074 // <li> As a scalar. These are the coordinates of the extra axes 00075 // defined in the hypercube. They are accessed via the get/put 00076 // functions. 00077 // </ol> 00078 // The coordinates are held in a TSMCube object. The row number 00079 // determines which TSMCube object has to be accessed. 00080 // <p> 00081 // The creation of a TSMCoordColumn object is done by a TSMColumn object. 00082 // This process is described in more detail in the class 00083 // <linkto class=TSMColumn>TSMColumn</linkto>. 00084 // </synopsis> 00085 00086 // <motivation> 00087 // Handling coordinate columns in the Tiled Storage Manager is 00088 // different from other columns. 00089 // </motivation> 00090 00091 //# <todo asof="$DATE:$"> 00092 //# A List of bugs, limitations, extensions or planned refinements. 00093 //# </todo> 00094 00095 00096 class TSMCoordColumn : public TSMColumn 00097 { 00098 public: 00099 00100 // Create a coordinate column from the given column. 00101 TSMCoordColumn (const TSMColumn& column, uInt axisNr); 00102 00103 // Frees up the storage. 00104 virtual ~TSMCoordColumn(); 00105 00106 // Set the shape of the coordinate vector in the given row. 00107 void setShape (uInt rownr, const IPosition& shape); 00108 00109 // Is the value shape defined in the given row? 00110 Bool isShapeDefined (uInt rownr); 00111 00112 // Get the shape of the item in the given row. 00113 IPosition shape (uInt rownr); 00114 00115 // Get a scalar value in the given row. 00116 // The buffer pointed to by dataPtr has to have the correct length 00117 // (which is guaranteed by the Scalar/ArrayColumn get function). 00118 // <group> 00119 void getIntV (uInt rownr, Int* dataPtr); 00120 void getuIntV (uInt rownr, uInt* dataPtr); 00121 void getfloatV (uInt rownr, float* dataPtr); 00122 void getdoubleV (uInt rownr, double* dataPtr); 00123 void getComplexV (uInt rownr, Complex* dataPtr); 00124 void getDComplexV (uInt rownr, DComplex* dataPtr); 00125 // </group> 00126 00127 // Put a scalar value into the given row. 00128 // The buffer pointed to by dataPtr has to have the correct length 00129 // (which is guaranteed by the Scalar/ArrayColumn put function). 00130 // <group> 00131 void putIntV (uInt rownr, const Int* dataPtr); 00132 void putuIntV (uInt rownr, const uInt* dataPtr); 00133 void putfloatV (uInt rownr, const float* dataPtr); 00134 void putdoubleV (uInt rownr, const double* dataPtr); 00135 void putComplexV (uInt rownr, const Complex* dataPtr); 00136 void putDComplexV (uInt rownr, const DComplex* dataPtr); 00137 // </group> 00138 00139 // Get the array value in the given row. 00140 // The array pointed to by dataPtr has to have the correct length 00141 // (which is guaranteed by the ArrayColumn get function). 00142 // The default implementation thrown an "invalid operation exception". 00143 // <group> 00144 void getArrayIntV (uInt rownr, Array<Int>* dataPtr); 00145 void getArrayuIntV (uInt rownr, Array<uInt>* dataPtr); 00146 void getArrayfloatV (uInt rownr, Array<float>* dataPtr); 00147 void getArraydoubleV (uInt rownr, Array<double>* dataPtr); 00148 void getArrayComplexV (uInt rownr, Array<Complex>* dataPtr); 00149 void getArrayDComplexV (uInt rownr, Array<DComplex>* dataPtr); 00150 // </group> 00151 00152 // Put the array value into the given row. 00153 // The buffer pointed to by dataPtr has to have the correct length 00154 // (which is guaranteed by the ArrayColumn put function). 00155 // The default implementation thrown an "invalid operation exception". 00156 // <group> 00157 void putArrayIntV (uInt rownr, const Array<Int>* dataPtr); 00158 void putArrayuIntV (uInt rownr, const Array<uInt>* dataPtr); 00159 void putArrayfloatV (uInt rownr, const Array<float>* dataPtr); 00160 void putArraydoubleV (uInt rownr, const Array<double>* dataPtr); 00161 void putArrayComplexV (uInt rownr, const Array<Complex>* dataPtr); 00162 void putArrayDComplexV (uInt rownr, const Array<DComplex>* dataPtr); 00163 // </group> 00164 00165 private: 00166 // The axis number of the coordinate. 00167 uInt axisNr_p; 00168 00169 // Forbid copy constructor. 00170 TSMCoordColumn (const TSMCoordColumn&); 00171 00172 // Forbid assignment. 00173 TSMCoordColumn& operator= (const TSMCoordColumn&); 00174 }; 00175 00176 00177 00178 00179 } //# NAMESPACE CASA - END 00180 00181 #endif