casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MSMDirColumn.h
Go to the documentation of this file.
1 //# MSMDirColumn.h: Memory storage manager for fixed shape table arrays
2 //# Copyright (C) 2003
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_MSMDIRCOLUMN_H
29 #define TABLES_MSMDIRCOLUMN_H
30 
31 
32 //# Includes
33 #include <casacore/casa/aips.h>
36 
37 
38 namespace casacore { //# NAMESPACE CASACORE - BEGIN
39 
40 // <summary>
41 // Memory storage manager for table arrays
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> MSMBase
52 // <li> MSMColumn
53 // </prerequisite>
54 
55 // <synopsis>
56 // MSMDirColumn handles arrays in a table column.
57 // It only keeps them in memory, so they are not persistent.
58 // </synopsis>
59 
60 //# <todo asof="$DATE:$">
61 //# A List of bugs, limitations, extensions or planned refinements.
62 //# </todo>
63 
64 
65 class MSMDirColumn: public MSMColumn
66 {
67 public:
68  // Create a column of the given type.
69  MSMDirColumn (MSMBase* smptr, int dataType);
70 
71  // Frees up the storage.
72  ~MSMDirColumn();
73 
74  // It can handle access to a slice in a cell.
75  Bool canAccessSlice (Bool& reask) const;
76 
77  // It can handle access to an entire column.
78  Bool canAccessArrayColumn (Bool& reask) const;
79 
80  // Set the (fixed) shape of the arrays in the entire column.
81  void setShapeColumn (const IPosition& shape);
82 
83  // Add (newNrrow-oldNrrow) rows to the column.
84  // Allocate the data arrays in these rows if the shape is fixed.
85  void addRow (uInt newNrrow, uInt oldNrrow);
86 
87  // Get the dimensionality of the item in the given row.
88  // 0 is returned if there is no array.
89  uInt ndim (uInt rownr);
90 
91  // Get the shape of the array in the given row.
92  // An zero-length IPosition is returned if there is no array.
93  IPosition shape (uInt rownr);
94 
95  // Get an array value in the given row.
96  // The buffer pointed to by dataPtr has to have the correct length
97  // (which is guaranteed by the ArrayColumn get function).
98  // <group>
99  void getArrayBoolV (uInt rownr, Array<Bool>* dataPtr);
100  void getArrayuCharV (uInt rownr, Array<uChar>* dataPtr);
101  void getArrayShortV (uInt rownr, Array<Short>* dataPtr);
102  void getArrayuShortV (uInt rownr, Array<uShort>* dataPtr);
103  void getArrayIntV (uInt rownr, Array<Int>* dataPtr);
104  void getArrayuIntV (uInt rownr, Array<uInt>* dataPtr);
105  void getArrayInt64V (uInt rownr, Array<Int64>* dataPtr);
106  void getArrayfloatV (uInt rownr, Array<float>* dataPtr);
107  void getArraydoubleV (uInt rownr, Array<double>* dataPtr);
108  void getArrayComplexV (uInt rownr, Array<Complex>* dataPtr);
109  void getArrayDComplexV (uInt rownr, Array<DComplex>* dataPtr);
110  void getArrayStringV (uInt rownr, Array<String>* dataPtr);
111  // </group>
112 
113  // Put an array value into the given row.
114  // The buffer pointed to by dataPtr has to have the correct length
115  // (which is guaranteed by the ArrayColumn put function).
116  // <group>
117  void putArrayBoolV (uInt rownr, const Array<Bool>* dataPtr);
118  void putArrayuCharV (uInt rownr, const Array<uChar>* dataPtr);
119  void putArrayShortV (uInt rownr, const Array<Short>* dataPtr);
120  void putArrayuShortV (uInt rownr, const Array<uShort>* dataPtr);
121  void putArrayIntV (uInt rownr, const Array<Int>* dataPtr);
122  void putArrayuIntV (uInt rownr, const Array<uInt>* dataPtr);
123  void putArrayInt64V (uInt rownr, const Array<Int64>* dataPtr);
124  void putArrayfloatV (uInt rownr, const Array<float>* dataPtr);
125  void putArraydoubleV (uInt rownr, const Array<double>* dataPtr);
126  void putArrayComplexV (uInt rownr, const Array<Complex>* dataPtr);
127  void putArrayDComplexV (uInt rownr, const Array<DComplex>* dataPtr);
128  void putArrayStringV (uInt rownr, const Array<String>* dataPtr);
129  // </group>
130 
131  // Get a section of the array in the given row.
132  // The buffer pointed to by dataPtr has to have the correct length
133  // (which is guaranteed by the ArrayColumn getSlice function).
134  // <group>
135  void getSliceBoolV (uInt rownr, const Slicer&, Array<Bool>* dataPtr);
136  void getSliceuCharV (uInt rownr, const Slicer&, Array<uChar>* dataPtr);
137  void getSliceShortV (uInt rownr, const Slicer&, Array<Short>* dataPtr);
138  void getSliceuShortV (uInt rownr, const Slicer&, Array<uShort>* dataPtr);
139  void getSliceIntV (uInt rownr, const Slicer&, Array<Int>* dataPtr);
140  void getSliceuIntV (uInt rownr, const Slicer&, Array<uInt>* dataPtr);
141  void getSliceInt64V (uInt rownr, const Slicer&, Array<Int64>* dataPtr);
142  void getSlicefloatV (uInt rownr, const Slicer&, Array<float>* dataPtr);
143  void getSlicedoubleV (uInt rownr, const Slicer&, Array<double>* dataPtr);
144  void getSliceComplexV (uInt rownr, const Slicer&, Array<Complex>* dataPtr);
145  void getSliceDComplexV (uInt rownr, const Slicer&, Array<DComplex>* dataPtr);
146  void getSliceStringV (uInt rownr, const Slicer&, Array<String>* dataPtr);
147  // </group>
148 
149  // Put into a section of the array in the given row.
150  // The buffer pointed to by dataPtr has to have the correct length
151  // (which is guaranteed by the ArrayColumn putSlice function).
152  // <group>
153  void putSliceBoolV (uInt rownr, const Slicer&,
154  const Array<Bool>* dataPtr);
155  void putSliceuCharV (uInt rownr, const Slicer&,
156  const Array<uChar>* dataPtr);
157  void putSliceShortV (uInt rownr, const Slicer&,
158  const Array<Short>* dataPtr);
159  void putSliceuShortV (uInt rownr, const Slicer&,
160  const Array<uShort>* dataPtr);
161  void putSliceIntV (uInt rownr, const Slicer&,
162  const Array<Int>* dataPtr);
163  void putSliceuIntV (uInt rownr, const Slicer&,
164  const Array<uInt>* dataPtr);
165  void putSliceInt64V (uInt rownr, const Slicer&,
166  const Array<Int64>* dataPtr);
167  void putSlicefloatV (uInt rownr, const Slicer&,
168  const Array<float>* dataPtr);
169  void putSlicedoubleV (uInt rownr, const Slicer&,
170  const Array<double>* dataPtr);
171  void putSliceComplexV (uInt rownr, const Slicer&,
172  const Array<Complex>* dataPtr);
173  void putSliceDComplexV (uInt rownr, const Slicer&,
174  const Array<DComplex>* dataPtr);
175  void putSliceStringV (uInt rownr, const Slicer&,
176  const Array<String>* dataPtr);
177  // </group>
178 
179  // Get all array values in the column.
180  // The buffer pointed to by dataPtr has to have the correct length
181  // (which is guaranteed by the ArrayColumn getColumn function).
182  // <group>
183  void getArrayColumnBoolV (Array<Bool>* dataPtr);
184  void getArrayColumnuCharV (Array<uChar>* dataPtr);
185  void getArrayColumnShortV (Array<Short>* dataPtr);
186  void getArrayColumnuShortV (Array<uShort>* dataPtr);
187  void getArrayColumnIntV (Array<Int>* dataPtr);
188  void getArrayColumnuIntV (Array<uInt>* dataPtr);
189  void getArrayColumnInt64V (Array<Int64>* dataPtr);
190  void getArrayColumnfloatV (Array<float>* dataPtr);
191  void getArrayColumndoubleV (Array<double>* dataPtr);
192  void getArrayColumnComplexV (Array<Complex>* dataPtr);
194  void getArrayColumnStringV (Array<String>* dataPtr);
195  // </group>
196 
197  // Put all arrays in the column.
198  // The buffer pointed to by dataPtr has to have the correct length
199  // (which is guaranteed by the ArrayColumn putColumn function).
200  // <group>
201  void putArrayColumnBoolV (const Array<Bool>* dataPtr);
202  void putArrayColumnuCharV (const Array<uChar>* dataPtr);
203  void putArrayColumnShortV (const Array<Short>* dataPtr);
204  void putArrayColumnuShortV (const Array<uShort>* dataPtr);
205  void putArrayColumnIntV (const Array<Int>* dataPtr);
206  void putArrayColumnuIntV (const Array<uInt>* dataPtr);
207  void putArrayColumnInt64V (const Array<Int64>* dataPtr);
208  void putArrayColumnfloatV (const Array<float>* dataPtr);
209  void putArrayColumndoubleV (const Array<double>* dataPtr);
210  void putArrayColumnComplexV (const Array<Complex>* dataPtr);
211  void putArrayColumnDComplexV (const Array<DComplex>* dataPtr);
212  void putArrayColumnStringV (const Array<String>* dataPtr);
213  // </group>
214 
215  // Remove the value in the given row.
216  void remove (uInt rownr);
217 
218  // Let the column create its arrays.
219  void doCreate (uInt nrrow);
220 
221  // Check if the class invariants still hold.
222  Bool ok() const;
223 
224 private:
225  // The (unique) sequence number of the column.
227  // The shape of the array.
229  // The nr of elements in the array.
231 
232 
233  // Delete the array in the given row.
234  void deleteArray (uInt rownr);
235 
236  // Forbid copy constructor.
237  MSMDirColumn (const MSMDirColumn&);
238 
239  // Forbid assignment.
241 };
242 
243 
244 
245 
246 } //# NAMESPACE CASACORE - END
247 
248 #endif
void putSliceShortV(uInt rownr, const Slicer &, const Array< Short > *dataPtr)
void putSlicefloatV(uInt rownr, const Slicer &, const Array< float > *dataPtr)
A Vector of integers, for indexing into Array&lt;T&gt; objects.
Definition: IPosition.h:119
void putArrayColumnInt64V(const Array< Int64 > *dataPtr)
uInt seqnr_p
The (unique) sequence number of the column.
Definition: MSMDirColumn.h:226
void putArrayColumnShortV(const Array< Short > *dataPtr)
void putSliceuCharV(uInt rownr, const Slicer &, const Array< uChar > *dataPtr)
void putArrayfloatV(uInt rownr, const Array< float > *dataPtr)
void putArrayColumnfloatV(const Array< float > *dataPtr)
void putArrayColumndoubleV(const Array< double > *dataPtr)
void putArrayColumnComplexV(const Array< Complex > *dataPtr)
void putArraydoubleV(uInt rownr, const Array< double > *dataPtr)
Memory storage manager for table arrays.
Definition: MSMDirColumn.h:65
void getArrayStringV(uInt rownr, Array< String > *dataPtr)
void getArrayColumnfloatV(Array< float > *dataPtr)
void putSliceDComplexV(uInt rownr, const Slicer &, const Array< DComplex > *dataPtr)
void getArrayShortV(uInt rownr, Array< Short > *dataPtr)
void getSliceShortV(uInt rownr, const Slicer &, Array< Short > *dataPtr)
void getSliceuShortV(uInt rownr, const Slicer &, Array< uShort > *dataPtr)
void getArrayComplexV(uInt rownr, Array< Complex > *dataPtr)
void getArrayColumnuIntV(Array< uInt > *dataPtr)
Base class for memory-based table storage manager class.
Definition: MSMBase.h:67
void putSliceInt64V(uInt rownr, const Slicer &, const Array< Int64 > *dataPtr)
MSMDirColumn & operator=(const MSMDirColumn &)
Forbid assignment.
void putSliceStringV(uInt rownr, const Slicer &, const Array< String > *dataPtr)
void putArrayColumnuCharV(const Array< uChar > *dataPtr)
MSMDirColumn(MSMBase *smptr, int dataType)
Create a column of the given type.
void putArrayColumnBoolV(const Array< Bool > *dataPtr)
Put all arrays in the column.
void putSliceIntV(uInt rownr, const Slicer &, const Array< Int > *dataPtr)
void putArrayColumnIntV(const Array< Int > *dataPtr)
void putArrayDComplexV(uInt rownr, const Array< DComplex > *dataPtr)
int dataType() const
Return the data type of the column.
Bool canAccessSlice(Bool &reask) const
It can handle access to a slice in a cell.
void putArrayStringV(uInt rownr, const Array< String > *dataPtr)
void getArrayColumnBoolV(Array< Bool > *dataPtr)
Get all array values in the column.
void getArrayfloatV(uInt rownr, Array< float > *dataPtr)
void getSliceIntV(uInt rownr, const Slicer &, Array< Int > *dataPtr)
void getSlicefloatV(uInt rownr, const Slicer &, Array< float > *dataPtr)
IPosition shape(uInt rownr)
Get the shape of the array in the given row.
void putArrayColumnuShortV(const Array< uShort > *dataPtr)
void putArrayuCharV(uInt rownr, const Array< uChar > *dataPtr)
void deleteArray(uInt rownr)
Delete the array in the given row.
void putSliceuShortV(uInt rownr, const Slicer &, const Array< uShort > *dataPtr)
void getArrayInt64V(uInt rownr, Array< Int64 > *dataPtr)
void getArrayColumnuCharV(Array< uChar > *dataPtr)
void putArrayuShortV(uInt rownr, const Array< uShort > *dataPtr)
void putSliceuIntV(uInt rownr, const Slicer &, const Array< uInt > *dataPtr)
void getArrayBoolV(uInt rownr, Array< Bool > *dataPtr)
Get an array value in the given row.
void addRow(uInt newNrrow, uInt oldNrrow)
Add (newNrrow-oldNrrow) rows to the column.
~MSMDirColumn()
Frees up the storage.
void getArrayDComplexV(uInt rownr, Array< DComplex > *dataPtr)
void getArrayColumnStringV(Array< String > *dataPtr)
void getArrayIntV(uInt rownr, Array< Int > *dataPtr)
void getArrayColumnuShortV(Array< uShort > *dataPtr)
void getSliceuCharV(uInt rownr, const Slicer &, Array< uChar > *dataPtr)
void putArrayColumnStringV(const Array< String > *dataPtr)
Bool canAccessArrayColumn(Bool &reask) const
It can handle access to an entire column.
void putSliceBoolV(uInt rownr, const Slicer &, const Array< Bool > *dataPtr)
Put into a section of the array in the given row.
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
void getSliceComplexV(uInt rownr, const Slicer &, Array< Complex > *dataPtr)
void putSlicedoubleV(uInt rownr, const Slicer &, const Array< double > *dataPtr)
void putArrayColumnDComplexV(const Array< DComplex > *dataPtr)
void getArrayColumndoubleV(Array< double > *dataPtr)
void doCreate(uInt nrrow)
Let the column create its arrays.
void putSliceComplexV(uInt rownr, const Slicer &, const Array< Complex > *dataPtr)
void putArrayuIntV(uInt rownr, const Array< uInt > *dataPtr)
void getArrayColumnIntV(Array< Int > *dataPtr)
Column in the Memory table storage manager class.
Definition: MSMColumn.h:104
void getArrayuShortV(uInt rownr, Array< uShort > *dataPtr)
void setShapeColumn(const IPosition &shape)
Set the (fixed) shape of the arrays in the entire column.
Specify which elements to extract from an n-dimensional array.
Definition: Slicer.h:289
void getArraydoubleV(uInt rownr, Array< double > *dataPtr)
void getSliceStringV(uInt rownr, const Slicer &, Array< String > *dataPtr)
uInt nrelem_p
The nr of elements in the array.
Definition: MSMDirColumn.h:230
void getArrayColumnShortV(Array< Short > *dataPtr)
Bool ok() const
Check if the class invariants still hold.
void getSliceDComplexV(uInt rownr, const Slicer &, Array< DComplex > *dataPtr)
void getSliceInt64V(uInt rownr, const Slicer &, Array< Int64 > *dataPtr)
void putArrayIntV(uInt rownr, const Array< Int > *dataPtr)
IPosition shape_p
The shape of the array.
Definition: MSMDirColumn.h:228
void putArrayComplexV(uInt rownr, const Array< Complex > *dataPtr)
void getArrayColumnComplexV(Array< Complex > *dataPtr)
void putArrayColumnuIntV(const Array< uInt > *dataPtr)
void getSlicedoubleV(uInt rownr, const Slicer &, Array< double > *dataPtr)
void getArrayColumnInt64V(Array< Int64 > *dataPtr)
void putArrayShortV(uInt rownr, const Array< Short > *dataPtr)
uInt ndim(uInt rownr)
Get the dimensionality of the item in the given row.
void getSliceBoolV(uInt rownr, const Slicer &, Array< Bool > *dataPtr)
Get a section of the array in the given row.
void putArrayBoolV(uInt rownr, const Array< Bool > *dataPtr)
Put an array value into the given row.
void getArrayuIntV(uInt rownr, Array< uInt > *dataPtr)
void getArrayColumnDComplexV(Array< DComplex > *dataPtr)
unsigned int uInt
Definition: aipstype.h:51
void getArrayuCharV(uInt rownr, Array< uChar > *dataPtr)
void getSliceuIntV(uInt rownr, const Slicer &, Array< uInt > *dataPtr)
void putArrayInt64V(uInt rownr, const Array< Int64 > *dataPtr)
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42