casacore
TSMCoordColumn.h
Go to the documentation of this file.
1 //# TSMCoordColumn.h: A coordinate column in Tiled Storage Manager
2 //# Copyright (C) 1995,1996,1999
3 //# Associated Universities, Inc. Washington DC, USA.
4 //#
5 //# This library is free software; you can redistribute it and/or modify it
6 //# under the terms of the GNU Library General Public License as published by
7 //# the Free Software Foundation; either version 2 of the License, or (at your
8 //# option) any later version.
9 //#
10 //# This library is distributed in the hope that it will be useful, but WITHOUT
11 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 //# License for more details.
14 //#
15 //# You should have received a copy of the GNU Library General Public License
16 //# along with this library; if not, write to the Free Software Foundation,
17 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18 //#
19 //# Correspondence concerning AIPS++ should be addressed as follows:
20 //# Internet email: aips2-request@nrao.edu.
21 //# Postal address: AIPS++ Project Office
22 //# National Radio Astronomy Observatory
23 //# 520 Edgemont Road
24 //# Charlottesville, VA 22903-2475 USA
25 //#
26 //# $Id$
27 
28 #ifndef TABLES_TSMCOORDCOLUMN_H
29 #define TABLES_TSMCOORDCOLUMN_H
30 
31 //# Includes
32 #include <casacore/casa/aips.h>
33 #include <casacore/tables/DataMan/TSMColumn.h>
34 
35 namespace casacore { //# NAMESPACE CASACORE - BEGIN
36 
37 //# Forward declarations
38 
39 
40 // <summary>
41 // A coordinate column in Tiled Storage Manager
42 // </summary>
43 
44 // <use visibility=local>
45 
46 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
47 // </reviewed>
48 
49 // <prerequisite>
50 //# Classes you should understand before using this one.
51 // <li> <linkto class=TSMColumn>TSMColumn</linkto>
52 // <li> <linkto class=TSMCube>TSMCube</linkto>
53 // <li> <linkto class=Record>Record</linkto>
54 // </prerequisite>
55 
56 // <etymology>
57 // TSMCoordColumn handles a coordinate column for a Tiled
58 // Storage Manager.
59 // </etymology>
60 
61 // <synopsis>
62 // TSMCoordColumn is used by
63 // <linkto class=TiledStMan>TiledStMan</linkto>
64 // to handle the access to
65 // a table column containing coordinates of a tiled hypercube axis.
66 // There are 2 types of coordinates (as described at
67 // <linkto class=TableDesc:defineHypercolumn>
68 // TableDesc::defineHypercolumn</linkto>):
69 // <ol>
70 // <li> As a vector. These are the coordinates of the arrays held
71 // in the data cells. They are accessed via the get/putArray
72 // functions. Their shapes are dependent on the hypercube shape,
73 // so it is checked if they match.
74 // <li> As a scalar. These are the coordinates of the extra axes
75 // defined in the hypercube. They are accessed via the get/put
76 // functions.
77 // </ol>
78 // The coordinates are held in a TSMCube object. The row number
79 // determines which TSMCube object has to be accessed.
80 // <p>
81 // The creation of a TSMCoordColumn object is done by a TSMColumn object.
82 // This process is described in more detail in the class
83 // <linkto class=TSMColumn>TSMColumn</linkto>.
84 // </synopsis>
85 
86 // <motivation>
87 // Handling coordinate columns in the Tiled Storage Manager is
88 // different from other columns.
89 // </motivation>
90 
91 //# <todo asof="$DATE:$">
92 //# A List of bugs, limitations, extensions or planned refinements.
93 //# </todo>
94 
95 
96 class TSMCoordColumn : public TSMColumn
97 {
98 public:
99 
100  // Create a coordinate column from the given column.
101  TSMCoordColumn (const TSMColumn& column, uInt axisNr);
102 
103  // Frees up the storage.
104  virtual ~TSMCoordColumn();
105 
106  // Set the shape of the coordinate vector in the given row.
107  void setShape (uInt rownr, const IPosition& shape);
108 
109  // Is the value shape defined in the given row?
110  Bool isShapeDefined (uInt rownr);
111 
112  // Get the shape of the item in the given row.
113  IPosition shape (uInt rownr);
114 
115  // Get a scalar value in the given row.
116  // The buffer pointed to by dataPtr has to have the correct length
117  // (which is guaranteed by the Scalar/ArrayColumn get function).
118  // <group>
119  void getIntV (uInt rownr, Int* dataPtr);
120  void getuIntV (uInt rownr, uInt* dataPtr);
121  void getfloatV (uInt rownr, float* dataPtr);
122  void getdoubleV (uInt rownr, double* dataPtr);
123  void getComplexV (uInt rownr, Complex* dataPtr);
124  void getDComplexV (uInt rownr, DComplex* dataPtr);
125  // </group>
126 
127  // Put a scalar value into the given row.
128  // The buffer pointed to by dataPtr has to have the correct length
129  // (which is guaranteed by the Scalar/ArrayColumn put function).
130  // <group>
131  void putIntV (uInt rownr, const Int* dataPtr);
132  void putuIntV (uInt rownr, const uInt* dataPtr);
133  void putfloatV (uInt rownr, const float* dataPtr);
134  void putdoubleV (uInt rownr, const double* dataPtr);
135  void putComplexV (uInt rownr, const Complex* dataPtr);
136  void putDComplexV (uInt rownr, const DComplex* dataPtr);
137  // </group>
138 
139  // Get the array value in the given row.
140  // The array pointed to by dataPtr has to have the correct length
141  // (which is guaranteed by the ArrayColumn get function).
142  // The default implementation thrown an "invalid operation exception".
143  // <group>
144  void getArrayIntV (uInt rownr, Array<Int>* dataPtr);
145  void getArrayuIntV (uInt rownr, Array<uInt>* dataPtr);
146  void getArrayfloatV (uInt rownr, Array<float>* dataPtr);
147  void getArraydoubleV (uInt rownr, Array<double>* dataPtr);
148  void getArrayComplexV (uInt rownr, Array<Complex>* dataPtr);
149  void getArrayDComplexV (uInt rownr, Array<DComplex>* dataPtr);
150  // </group>
151 
152  // Put the array value into the given row.
153  // The buffer pointed to by dataPtr has to have the correct length
154  // (which is guaranteed by the ArrayColumn put function).
155  // The default implementation thrown an "invalid operation exception".
156  // <group>
157  void putArrayIntV (uInt rownr, const Array<Int>* dataPtr);
158  void putArrayuIntV (uInt rownr, const Array<uInt>* dataPtr);
159  void putArrayfloatV (uInt rownr, const Array<float>* dataPtr);
160  void putArraydoubleV (uInt rownr, const Array<double>* dataPtr);
161  void putArrayComplexV (uInt rownr, const Array<Complex>* dataPtr);
162  void putArrayDComplexV (uInt rownr, const Array<DComplex>* dataPtr);
163  // </group>
164 
165 private:
166  // The axis number of the coordinate.
168 
169  // Forbid copy constructor.
171 
172  // Forbid assignment.
174 };
175 
176 
177 
178 
179 } //# NAMESPACE CASACORE - END
180 
181 #endif
void getfloatV(uInt rownr, float *dataPtr)
A Vector of integers, for indexing into Array<T> objects.
Definition: IPosition.h:119
TSMCoordColumn & operator=(const TSMCoordColumn &)
Forbid assignment.
void getArrayComplexV(uInt rownr, Array< Complex > *dataPtr)
void putArrayuIntV(uInt rownr, const Array< uInt > *dataPtr)
int Int
Definition: aipstype.h:50
void putdoubleV(uInt rownr, const double *dataPtr)
void getIntV(uInt rownr, Int *dataPtr)
Get a scalar value in the given row.
virtual ~TSMCoordColumn()
Frees up the storage.
TSMCoordColumn(const TSMColumn &column, uInt axisNr)
Create a coordinate column from the given column.
void putDComplexV(uInt rownr, const DComplex *dataPtr)
void getArrayIntV(uInt rownr, Array< Int > *dataPtr)
Get the array value in the given row.
void getDComplexV(uInt rownr, DComplex *dataPtr)
void putfloatV(uInt rownr, const float *dataPtr)
void setShape(uInt rownr, const IPosition &shape)
Set the shape of the coordinate vector in the given row.
void putuIntV(uInt rownr, const uInt *dataPtr)
void getArraydoubleV(uInt rownr, Array< double > *dataPtr)
void getArrayfloatV(uInt rownr, Array< float > *dataPtr)
void putArrayIntV(uInt rownr, const Array< Int > *dataPtr)
Put the array value into the given row.
void putArraydoubleV(uInt rownr, const Array< double > *dataPtr)
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
A column in the Tiled Storage Manager.
Definition: TSMColumn.h:97
void getArrayuIntV(uInt rownr, Array< uInt > *dataPtr)
void putArrayDComplexV(uInt rownr, const Array< DComplex > *dataPtr)
void putArrayfloatV(uInt rownr, const Array< float > *dataPtr)
A coordinate column in Tiled Storage Manager.
void getdoubleV(uInt rownr, double *dataPtr)
void getuIntV(uInt rownr, uInt *dataPtr)
void putArrayComplexV(uInt rownr, const Array< Complex > *dataPtr)
uInt axisNr_p
The axis number of the coordinate.
IPosition shape(uInt rownr)
Get the shape of the item in the given row.
void getComplexV(uInt rownr, Complex *dataPtr)
Bool isShapeDefined(uInt rownr)
Is the value shape defined in the given row?
void getArrayDComplexV(uInt rownr, Array< DComplex > *dataPtr)
void putIntV(uInt rownr, const Int *dataPtr)
Put a scalar value into the given row.
this file contains all the compiler specific defines
Definition: mainpage.dox:28
unsigned int uInt
Definition: aipstype.h:51
void putComplexV(uInt rownr, const Complex *dataPtr)