casacore
Loading...
Searching...
No Matches
DataManagerColumn.h
Go to the documentation of this file.
1// # DataManagerColumn.h: Abstract base class for a data manager column
2// # Copyright (C) 1994,1995,1996,1997,1998,1999,2001,2002
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: casa-feedback@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#ifndef TABLES_DATAMANAGERCOLUMN_H
27#define TABLES_DATAMANAGERCOLUMN_H
28
29// # Includes
30#include <casacore/casa/aips.h>
31#include <casacore/tables/Tables/ColumnCache.h>
32#include <casacore/casa/BasicSL/String.h>
33#include <casacore/casa/BasicSL/Complex.h>
34#include <memory>
35#include <type_traits>
36
37namespace casacore { // # NAMESPACE CASACORE - BEGIN
38
39// # Forward Declarations
40class IPosition;
41class Slicer;
42class RefRows;
43class ArrayBase;
44
45// <summary>
46// Abstract base class for a column in a data manager
47// </summary>
48
49// <use visibility=local>
50
51// <reviewed reviewer="Gareth Hunt" date="94Nov17" tests="">
52// </reviewed>
53
54// <prerequisite>
55// # Classes you should understand before using this one.
56// <li> DataManager
57// </prerequisite>
58
59// <etymology>
60// DataManagerColumn handles a column for a data manager.
61// </etymology>
62
63// <synopsis>
64// DataManagerColumn is the abstract base class to handle a column in
65// a data manager. Each data manager class must have one or more associated
66// classes derived from DataManagerColumn to handle the columns.
67// For example, storage manager StManAipsIO has columns classes
68// StManColumnAipsIO, StManColumnArrayAipsIO and StManColumnIndArrayAipsIO
69// to handle scalars, direct arrays and indirect arrays, resp..
70// However, using multiple inheritance it is possible that the derived
71// DataManager and DataManagerColumn classes are the same. This is used
72// in class ScaledArrayEngine<S,T> which represents both the data manager
73// and its column class. It can do that, because the virtual column engine
74// <linkto class="ScaledArrayEngine:description">ScaledArrayEngine</linkto>
75// can handle only one column.
76//
77// In the synopsis of class DataManager it is described how the (derived)
78// DataManagerColumn objects gets created and deleted.
79//
80// DataManagerColumn defines various virtual functions to get or put (slices)
81// of data in a column. These functions are called by the table column
82// classes ScalarColumnData and ArrayColumnData.
83// It does not define functions create, open, flush and prepare like
84// those defined in DataManager. It is left to the derived classes to
85// define those as needed and to interact properly with their
86// data manager object.
87//
88// The get/put interface has changed per 1-Sep-2017.
89// The old interface for ArrayColumn::getArray worked as follows:
90// <ol>
91// <li>ArrayColumn calls (virtual) BaseColumn::get passing the array as a void*.
92// void* is used to support the derived RefColumn class which is not templated.
93// <li>BaseColumn::get calls (virtual) DataManagerColumn::getArrayV.
94// This function can be implemented by a derived storage manager or
95// virtual column engine class.
96// <li>Storage managers derive from StManColumn. Its getArrayV function calls
97// the appropriate getArrayXXV function where XX is the data type (e.g. Int).
98// These getArrayXXV functions are implemented in the storage managers.
99// <li>Virtual column engines derive from the templated VirtArrCol class which
100// implements getArrayV by calling a templated virtual getArray function.
101// </ol>
102// The old interface for a function such as getArrayColumn works more or less
103// the same. However, this function does not need to be implemented by a data manager.
104// ArrayColumn will first ask the data manager if it supports getting an entire
105// array column. If not, ArrayColumn will call getArray for each row.
106// Functions such as getSlice, etc. work similarly.
107//
108// A new interface has been developed which should result in a smaller code base
109// and simpler classes. The new interface could be developed thanks to same
110// Array enhancements making it possible to use quite some Array functionality
111// in non-templated classes.
112// The new interface works differently in a number of points:
113// <ul>
114// <li> Arrays are passed as ArrayBase* instead of void* making it possible to
115// get shapes, etc. in a non-templated way.
116// <li> ArrayColumn does not ask anymore if a data manager supports getArrayColumn.
117// Instead, the default implementation in DataManagerColumn::getArrayColumnV
118// will call getArrayV repetitively.
119// <li> The StManColumn interface is not really necessary anymore.
120// </ul>
121//
122// However, some plug-in data managers exist outside the Casacore repository
123// (e.g., LofarStMan and AdiosStMan). It should be possible to build and use them
124// for some time with the old and new interface. To make this possible the new
125// interface has to be backward compatible for some time. This is achieved by:
126// <ul>
127// <li> StManColumn is maintained (but getArrayV takes ArrayBase&, not void*).
128// It calls getArrayXXV(void*) depending on the data type.
129// A storage manager can implemented getArrayV itself bypassing StManColumn.
130// <li> Functions such as getArrayColumn are a bit more complicated.
131// StManColumn::getArrayColumnV calls getArrayColumnXXV, which calls
132// DataManager::getArrayColumnAB doing the getArrayV per row.
133// A derived class can have getArrayColumnXXV implemented.
134// </ul>
135// </synopsis>
136
137// <motivation>
138// An abstract base class is needed to support multiple data
139// managers in the table system
140// </motivation>
141
142// <todo asof="$DATE:$">
143// # A List of bugs, limitations, extensions or planned refinements.
144// </todo>
145
147 public:
148 // Create a column.
150
151 // Frees up the storage.
153
154 // The copy constructor cannot be used for this base class.
156
157 // Assignment cannot be used for this base class.
159
160 // Set the isFixedShape flag.
162
163 // Is this a fixed shape column?
164 Bool isFixedShape() const { return isFixedShape_p; }
165
166 // Get the data type of the column as defined in DataType.h.
167 virtual int dataType() const = 0;
168
169 // Get the data type id of the column for dataType==TpOther.
170 // The default implementation returns an emptry string.
171 // This function is required for virtual column engines handling
172 // non-standard data types. It is used to check the data type.
173 virtual String dataTypeId() const;
174
175 // Test if data can be put into this column.
176 // This does not test if the data file is writable, only if
177 // it is in principle allowed to store data into the column.
178 // (It may not be allowed for virtual columns).
179 // The default is True.
180 virtual Bool isWritable() const;
181
182 // Set the maximum length of the value (can be used for strings).
183 // By default the maximum length is ignored.
184 virtual void setMaxLength(uInt maxLength);
185
186 // Set the shape of all (fixed-shaped) arrays in the column.
187 // Effectively it is the same as setShapeColumn, but it also sets
188 // the isFixedShape_p flag.
193
194 // Set the shape of an (variable-shaped) array in the given row.
195 // By default it throws a "not possible" exception.
196 virtual void setShape(rownr_t rownr, const IPosition& shape);
197
198 // Set the shape and tile shape of an (variable-shaped) array
199 // in the given row.
200 // By default it ignores the tile shape (thus only sets the shape).
201 virtual void setShapeTiled(rownr_t rownr, const IPosition& shape, const IPosition& tileShape);
202
203 // Is the value shape defined in the given row?
204 // By default it returns True.
206
207 // Get the dimensionality of the item in the given row.
208 // By default it returns shape(rownr).nelements().
209 virtual uInt ndim(rownr_t rownr);
210
211 // Get the shape of the item in the given row.
212 // By default it returns a zero-length IPosition (for a scalar value).
213 virtual IPosition shape(rownr_t rownr);
214
215 // Get the tile shape of the item in the given row.
216 // By default it returns a zero-length IPosition.
218
219 // Can the data manager handle chaging the shape of an existing array?
220 // Default is no.
221 virtual Bool canChangeShape() const;
222
223 // Get access to the ColumnCache object.
224 // <group>
226 const ColumnCache* columnCachePtr() const { return &colCache_p; }
227 // </group>
228
229 // Get the scalar value in the given row.
230 // These functions are non-virtual and are converted to their
231 // virtual getXX equivalent to achieve that a derived templated class
232 // (such as VirtualScalarColumn) does not have to declare and implement
233 // all these functions.
234 // The compiler complains about hiding virtual functions if you do not
235 // declare all virtual functions with the same name in a derived class.
236 // <group>
237 void get(rownr_t rownr, Bool* dataPtr) { getBool(rownr, dataPtr); }
238 void get(rownr_t rownr, uChar* dataPtr) { getuChar(rownr, dataPtr); }
239 void get(rownr_t rownr, Short* dataPtr) { getShort(rownr, dataPtr); }
240 void get(rownr_t rownr, uShort* dataPtr) { getuShort(rownr, dataPtr); }
241 void get(rownr_t rownr, Int* dataPtr) { getInt(rownr, dataPtr); }
242 void get(rownr_t rownr, uInt* dataPtr) { getuInt(rownr, dataPtr); }
243 void get(rownr_t rownr, Int64* dataPtr) { getInt64(rownr, dataPtr); }
244 void get(rownr_t rownr, float* dataPtr) { getfloat(rownr, dataPtr); }
245 void get(rownr_t rownr, double* dataPtr) { getdouble(rownr, dataPtr); }
246 void get(rownr_t rownr, Complex* dataPtr) { getComplex(rownr, dataPtr); }
247 void get(rownr_t rownr, DComplex* dataPtr) { getDComplex(rownr, dataPtr); }
248 void get(rownr_t rownr, String* dataPtr) { getString(rownr, dataPtr); }
249 // This function is the get for all non-standard data types.
250 void get(rownr_t rownr, void* dataPtr) { getOther(rownr, dataPtr); }
251 // </group>
252
253 // Put the scalar value into the given row.
254 // These functions are non-virtual and are converted to their
255 // virtual putXX equivalent to achieve that a derived templated class
256 // (such as VirtualScalarColumn) does not have to declare and implement
257 // all these functions.
258 // The compiler complains about hiding virtual functions if you do not
259 // declare all virtual functions with the same name in a derived class.
260 // <group>
261 void put(rownr_t rownr, const Bool* dataPtr) { putBool(rownr, dataPtr); }
262 void put(rownr_t rownr, const uChar* dataPtr) { putuChar(rownr, dataPtr); }
263 void put(rownr_t rownr, const Short* dataPtr) { putShort(rownr, dataPtr); }
264 void put(rownr_t rownr, const uShort* dataPtr) { putuShort(rownr, dataPtr); }
265 void put(rownr_t rownr, const Int* dataPtr) { putInt(rownr, dataPtr); }
266 void put(rownr_t rownr, const uInt* dataPtr) { putuInt(rownr, dataPtr); }
267 void put(rownr_t rownr, const Int64* dataPtr) { putInt64(rownr, dataPtr); }
268 void put(rownr_t rownr, const float* dataPtr) { putfloat(rownr, dataPtr); }
269 void put(rownr_t rownr, const double* dataPtr) { putdouble(rownr, dataPtr); }
270 void put(rownr_t rownr, const Complex* dataPtr) { putComplex(rownr, dataPtr); }
271 void put(rownr_t rownr, const DComplex* dataPtr) { putDComplex(rownr, dataPtr); }
272 void put(rownr_t rownr, const String* dataPtr) { putString(rownr, dataPtr); }
273 // This function is the put for all non-standard data types.
274 void put(rownr_t rownr, const void* dataPtr) { putOther(rownr, dataPtr); }
275 // </group>
276
277 // Get all scalar values in the column.
278 // The vector given in <src>data</src> has to have the correct length
279 // (which is guaranteed by the ScalarColumn getColumn function).
280 // The default implementation does a getXX per row.
281 virtual void getScalarColumnV(ArrayBase& dataPtr);
282
283 // Put all scalar values in the column.
284 // The vector given in <src>data</src> has to have the correct length
285 // (which is guaranteed by the ScalarColumn putColumn function).
286 // The default implementation does a putXX per row.
287 virtual void putScalarColumnV(const ArrayBase& dataPtr);
288
289 // Get some scalar values in the column.
290 // The vector given in <src>data</src> has to have the correct length
291 // (which is guaranteed by the ScalarColumn getColumn function).
292 // The default implementation does a getXX per row.
293 virtual void getScalarColumnCellsV(const RefRows& rownrs, ArrayBase& dataPtr);
294
295 // Put some scalar values in the column.
296 // The vector given in <src>data</src> has to have the correct length
297 // (which is guaranteed by the ScalarColumn getColumn function).
298 // The default implementation does a putXX per row.
299 virtual void putScalarColumnCellsV(const RefRows& rownrs, const ArrayBase& dataPtr);
300
301 // Get the array value in the given row.
302 // The array given in <src>data</src> has to have the correct shape
303 // (which is guaranteed by the ArrayColumn get function).
304 // The default implementation throws an "invalid operation" exception.
305 virtual void getArrayV(rownr_t rownr, ArrayBase& dataPtr);
306
307 // Put the array value into the given row.
308 // The array given in <src>data</src> has to have the correct shape
309 // (which is guaranteed by the ArrayColumn put function).
310 // The default implementation throws an "invalid operation" exception.
311 virtual void putArrayV(rownr_t rownr, const ArrayBase& data);
312
313 // Get all array values in the column.
314 // The array given in <src>data</src> has to have the correct shape
315 // (which is guaranteed by the ArrayColumn getColumn function).
316 // The default implementation does a getArrayV per row.
317 virtual void getArrayColumnV(ArrayBase& data);
318
319 // Put all array values in the column.
320 // The array given in <src>data</src> has to have the correct shape
321 // (which is guaranteed by the ArrayColumn putColumn function).
322 // The default implementation does a putArrayV per row.
323 virtual void putArrayColumnV(const ArrayBase& data);
324
325 // Get some array values in the column.
326 // The array given in <src>data</src> has to have the correct shape
327 // (which is guaranteed by the ArrayColumn getColumn function).
328 // The default implementation does a getArrayV per row.
329 virtual void getArrayColumnCellsV(const RefRows& rownrs, ArrayBase& data);
330
331 // Put some array values in the column.
332 // The array given in <src>data</src> has to have the correct shape
333 // (which is guaranteed by the ArrayColumn getColumn function).
334 // The default implementation does a putArrayV per row.
335 virtual void putArrayColumnCellsV(const RefRows& rownrs, const ArrayBase& data);
336
337 // Get a section of the array in the given row.
338 // The array given in <src>data</src> has to have the correct shape
339 // (which is guaranteed by the ArrayColumn getSlice function).
340 // The default implementation does getArrayV and takes the slice.
341 virtual void getSliceV(rownr_t rownr, const Slicer& slicer, ArrayBase& data);
342
343 // Put into a section of the array in the given row.
344 // The array given in <src>data</src> has to have the correct shape
345 // (which is guaranteed by the ArrayColumn putSlice function).
346 // The default implementation does get/putArrayV and puts the slice.
347 virtual void putSliceV(rownr_t rownr, const Slicer& slicer, const ArrayBase& data);
348
349 // Get a section of all arrays in the column.
350 // The array given in <src>data</src> has to have the correct shape
351 // (which is guaranteed by the ArrayColumn getColumn function).
352 // The default implementation does a getSliceV per row.
353 virtual void getColumnSliceV(const Slicer& slicer, ArrayBase& data);
354
355 // Put into a section of all arrays in the column.
356 // The array given in <src>data</src> has to have the correct shape
357 // (which is guaranteed by the ArrayColumn putColumn function).
358 // The default implementation does a putSliceV per row.
359 virtual void putColumnSliceV(const Slicer& slicer, const ArrayBase& data);
360
361 // Get a section of some arrays in the column.
362 // The array given in <src>data</src> has to have the correct shape
363 // (which is guaranteed by the ArrayColumn getColumn function).
364 // The default implementation does a getSliceV per row.
365 virtual void getColumnSliceCellsV(const RefRows& rownrs, const Slicer& slicer, ArrayBase& data);
366
367 // Put into a section of some arrays in the column.
368 // The array given in <src>data</src> has to have the correct shape
369 // (which is guaranteed by the ArrayColumn putColumn function).
370 // The default implementation does a putSliceV per row.
371 virtual void putColumnSliceCellsV(const RefRows& rownrs, const Slicer& slicer,
372 const ArrayBase& data);
373
374 // Throw an "invalid operation" exception for the default
375 // implementation of get.
376 void throwGet() const;
377
378 // Throw an "invalid operation" exception for the default
379 // implementation of put.
380 void throwPut() const;
381
382 // Set the column name.
383 void setColumnName(const String& colName) { colName_p = colName; }
384
385 // Get rhe column name.
386 const String& columnName() const { return colName_p; }
387
388 protected:
389 // Get the scalar value in the given row.
390 // The default implementation throws an "invalid operation" exception.
391 // <group>
392 virtual void getBool(rownr_t rownr, Bool* dataPtr);
393 virtual void getuChar(rownr_t rownr, uChar* dataPtr);
394 virtual void getShort(rownr_t rownr, Short* dataPtr);
395 virtual void getuShort(rownr_t rownr, uShort* dataPtr);
396 virtual void getInt(rownr_t rownr, Int* dataPtr);
397 virtual void getuInt(rownr_t rownr, uInt* dataPtr);
398 virtual void getInt64(rownr_t rownr, Int64* dataPtr);
399 virtual void getfloat(rownr_t rownr, float* dataPtr);
400 virtual void getdouble(rownr_t rownr, double* dataPtr);
401 virtual void getComplex(rownr_t rownr, Complex* dataPtr);
402 virtual void getDComplex(rownr_t rownr, DComplex* dataPtr);
403 virtual void getString(rownr_t rownr, String* dataPtr);
404 // This function is the get for all non-standard data types.
405 virtual void getOther(rownr_t rownr, void* dataPtr);
406 // </group>
407
408 // Put the scalar value into the given row.
409 // The default implementation throws an "invalid operation" exception.
410 // <group>
411 virtual void putBool(rownr_t rownr, const Bool* dataPtr);
412 virtual void putuChar(rownr_t rownr, const uChar* dataPtr);
413 virtual void putShort(rownr_t rownr, const Short* dataPtr);
414 virtual void putuShort(rownr_t rownr, const uShort* dataPtr);
415 virtual void putInt(rownr_t rownr, const Int* dataPtr);
416 virtual void putuInt(rownr_t rownr, const uInt* dataPtr);
417 virtual void putInt64(rownr_t rownr, const Int64* dataPtr);
418 virtual void putfloat(rownr_t rownr, const float* dataPtr);
419 virtual void putdouble(rownr_t rownr, const double* dataPtr);
420 virtual void putComplex(rownr_t rownr, const Complex* dataPtr);
421 virtual void putDComplex(rownr_t rownr, const DComplex* dataPtr);
422 virtual void putString(rownr_t rownr, const String* dataPtr);
423 // This function is the put for all non-standard data types.
424 virtual void putOther(rownr_t rownr, const void* dataPtr);
425 // </group>
426
427 template <typename T>
428 void getValueGeneric(rownr_t rownr, T* dataPtr) {
429 if constexpr (std::is_same_v<T, Bool>) {
430 getBool(rownr, dataPtr);
431 } else if constexpr (std::is_same_v<T, uChar>) {
432 getuChar(rownr, dataPtr);
433 } else if constexpr (std::is_same_v<T, Short>) {
434 getShort(rownr, dataPtr);
435 } else if constexpr (std::is_same_v<T, uShort>) {
436 getuShort(rownr, dataPtr);
437 } else if constexpr (std::is_same_v<T, Int>) {
438 getInt(rownr, dataPtr);
439 } else if constexpr (std::is_same_v<T, uInt>) {
440 getuInt(rownr, dataPtr);
441 } else if constexpr (std::is_same_v<T, Int64>) {
442 getInt64(rownr, dataPtr);
443 } else if constexpr (std::is_same_v<T, float>) {
444 getfloat(rownr, dataPtr);
445 } else if constexpr (std::is_same_v<T, double>) {
446 getdouble(rownr, dataPtr);
447 } else if constexpr (std::is_same_v<T, Complex>) {
448 getComplex(rownr, dataPtr);
449 } else if constexpr (std::is_same_v<T, DComplex>) {
450 getDComplex(rownr, dataPtr);
451 } else if constexpr (std::is_same_v<T, String>) {
452 getString(rownr, dataPtr);
453 } else {
454 getOther(rownr, static_cast<void*>(dataPtr));
455 }
456 }
457
458 template <typename T>
459 void putValueGeneric(rownr_t rownr, const T* dataPtr) {
460 if constexpr (std::is_same_v<T, Bool>) {
461 putBool(rownr, dataPtr);
462 } else if constexpr (std::is_same_v<T, uChar>) {
463 putuChar(rownr, dataPtr);
464 } else if constexpr (std::is_same_v<T, Short>) {
465 putShort(rownr, dataPtr);
466 } else if constexpr (std::is_same_v<T, uShort>) {
467 putuShort(rownr, dataPtr);
468 } else if constexpr (std::is_same_v<T, Int>) {
469 putInt(rownr, dataPtr);
470 } else if constexpr (std::is_same_v<T, uInt>) {
471 putuInt(rownr, dataPtr);
472 } else if constexpr (std::is_same_v<T, Int64>) {
473 putInt64(rownr, dataPtr);
474 } else if constexpr (std::is_same_v<T, float>) {
475 putfloat(rownr, dataPtr);
476 } else if constexpr (std::is_same_v<T, double>) {
477 putdouble(rownr, dataPtr);
478 } else if constexpr (std::is_same_v<T, Complex>) {
479 putComplex(rownr, dataPtr);
480 } else if constexpr (std::is_same_v<T, DComplex>) {
481 putDComplex(rownr, dataPtr);
482 } else if constexpr (std::is_same_v<T, String>) {
483 putString(rownr, dataPtr);
484 } else {
485 putOther(rownr, static_cast<const void*>(dataPtr));
486 }
487 }
488
489 // The default implementations of get and put functions.
490 // <group>
492 void putScalarColumnBase(const ArrayBase& dataPtr);
493 void getScalarColumnCellsBase(const RefRows& rownrs, ArrayBase& dataPtr);
494 void putScalarColumnCellsBase(const RefRows& rownrs, const ArrayBase& dataPtr);
496 void putArrayColumnBase(const ArrayBase& data);
497 void getArrayColumnCellsBase(const RefRows& rownrs, ArrayBase& data);
498 void putArrayColumnCellsBase(const RefRows& rownrs, const ArrayBase& data);
499 void getSliceBase(rownr_t rownr, const Slicer& slicer, ArrayBase& data);
500 void putSliceBase(rownr_t rownr, const Slicer& slicer, const ArrayBase& data);
501 void getColumnSliceBase(const Slicer& slicer, ArrayBase& data);
502 void putColumnSliceBase(const Slicer& slicer, const ArrayBase& data);
503 void getColumnSliceCellsBase(const RefRows& rownrs, const Slicer& slicer, ArrayBase& data);
504 void putColumnSliceCellsBase(const RefRows& rownrs, const Slicer& slicer, const ArrayBase& data);
505 // </group>
506
507 private:
508 template <typename T>
509 void GetCells(const RefRows& rownrs, ArrayBase& arr);
510 template <typename T>
511 void PutCells(const RefRows& rownrs, const ArrayBase& arr);
512 template <typename T>
513 void GetCol(ArrayBase& arr);
514 template <typename T>
515 void PutCol(const ArrayBase& arr);
516
517 // Set the shape of all (fixed-shaped) arrays in the column.
518 // By default it throws a "not possible" exception.
519 virtual void setShapeColumn(const IPosition& shape);
520
521 // Get a slice from the array in the given row.
522 // It reads the full array in the possibly reshaped ArrayBase object.
523 void getSliceArr(rownr_t row, const Slicer& section, std::shared_ptr<ArrayBase>& fullArr,
524 ArrayBase& arr);
525
526 // Put a slice into the array in the given row.
527 // It reads and writes the full array in the possibly reshaped ArrayBase
528 // object.
529 void putSliceArr(rownr_t row, const Slicer& section, std::shared_ptr<ArrayBase>& fullArr,
530 const ArrayBase& arr);
531
532 // # Data members
536};
537
538} // namespace casacore
539
540#endif
Non-templated base class for templated Array class.
Definition ArrayBase.h:69
virtual uInt ndim(rownr_t rownr)
Get the dimensionality of the item in the given row.
virtual void getInt(rownr_t rownr, Int *dataPtr)
void get(rownr_t rownr, uShort *dataPtr)
void throwGet() const
Throw an "invalid operation" exception for the default implementation of get.
void put(rownr_t rownr, const float *dataPtr)
virtual void getSliceV(rownr_t rownr, const Slicer &slicer, ArrayBase &data)
Get a section of the array in the given row.
virtual void putdouble(rownr_t rownr, const double *dataPtr)
virtual void getuInt(rownr_t rownr, uInt *dataPtr)
virtual void getScalarColumnCellsV(const RefRows &rownrs, ArrayBase &dataPtr)
Get some scalar values in the column.
void putColumnSliceCellsBase(const RefRows &rownrs, const Slicer &slicer, const ArrayBase &data)
virtual void getuChar(rownr_t rownr, uChar *dataPtr)
virtual void putBool(rownr_t rownr, const Bool *dataPtr)
Put the scalar value into the given row.
virtual void getArrayColumnV(ArrayBase &data)
Get all array values in the column.
virtual void putuInt(rownr_t rownr, const uInt *dataPtr)
virtual void getArrayColumnCellsV(const RefRows &rownrs, ArrayBase &data)
Get some array values in the column.
void put(rownr_t rownr, const String *dataPtr)
void put(rownr_t rownr, const Int *dataPtr)
virtual void putShort(rownr_t rownr, const Short *dataPtr)
virtual void getfloat(rownr_t rownr, float *dataPtr)
void get(rownr_t rownr, Bool *dataPtr)
Get the scalar value in the given row.
void get(rownr_t rownr, Int64 *dataPtr)
virtual void setShape(rownr_t rownr, const IPosition &shape)
Set the shape of an (variable-shaped) array in the given row.
virtual void putInt64(rownr_t rownr, const Int64 *dataPtr)
virtual void getString(rownr_t rownr, String *dataPtr)
virtual void putOther(rownr_t rownr, const void *dataPtr)
This function is the put for all non-standard data types.
void put(rownr_t rownr, const void *dataPtr)
This function is the put for all non-standard data types.
virtual void getBool(rownr_t rownr, Bool *dataPtr)
Get the scalar value in the given row.
void get(rownr_t rownr, DComplex *dataPtr)
void putArrayColumnBase(const ArrayBase &data)
virtual void setMaxLength(uInt maxLength)
Set the maximum length of the value (can be used for strings).
virtual void getuShort(rownr_t rownr, uShort *dataPtr)
void get(rownr_t rownr, void *dataPtr)
This function is the get for all non-standard data types.
void putArrayColumnCellsBase(const RefRows &rownrs, const ArrayBase &data)
void get(rownr_t rownr, Short *dataPtr)
void put(rownr_t rownr, const Int64 *dataPtr)
void putSliceBase(rownr_t rownr, const Slicer &slicer, const ArrayBase &data)
void getSliceArr(rownr_t row, const Slicer &section, std::shared_ptr< ArrayBase > &fullArr, ArrayBase &arr)
Get a slice from the array in the given row.
void setFixedShapeColumn(const IPosition &shape)
Set the shape of all (fixed-shaped) arrays in the column.
void get(rownr_t rownr, uInt *dataPtr)
void putScalarColumnBase(const ArrayBase &dataPtr)
DataManagerColumn(const DataManagerColumn &)=delete
The copy constructor cannot be used for this base class.
virtual Bool isWritable() const
Test if data can be put into this column.
void PutCol(const ArrayBase &arr)
void getArrayColumnCellsBase(const RefRows &rownrs, ArrayBase &data)
virtual void getInt64(rownr_t rownr, Int64 *dataPtr)
virtual Bool isShapeDefined(rownr_t rownr)
Is the value shape defined in the given row?
void getValueGeneric(rownr_t rownr, T *dataPtr)
void getSliceBase(rownr_t rownr, const Slicer &slicer, ArrayBase &data)
virtual void getComplex(rownr_t rownr, Complex *dataPtr)
void get(rownr_t rownr, float *dataPtr)
virtual void putDComplex(rownr_t rownr, const DComplex *dataPtr)
virtual int dataType() const =0
Get the data type of the column as defined in DataType.h.
virtual void getScalarColumnV(ArrayBase &dataPtr)
Get all scalar values in the column.
virtual void putColumnSliceCellsV(const RefRows &rownrs, const Slicer &slicer, const ArrayBase &data)
Put into a section of some arrays in the column.
virtual void getdouble(rownr_t rownr, double *dataPtr)
virtual Bool canChangeShape() const
Can the data manager handle chaging the shape of an existing array?
void put(rownr_t rownr, const Bool *dataPtr)
Put the scalar value into the given row.
void put(rownr_t rownr, const uShort *dataPtr)
virtual void getOther(rownr_t rownr, void *dataPtr)
This function is the get for all non-standard data types.
void get(rownr_t rownr, String *dataPtr)
void GetCol(ArrayBase &arr)
void getColumnSliceBase(const Slicer &slicer, ArrayBase &data)
void put(rownr_t rownr, const Complex *dataPtr)
void putColumnSliceBase(const Slicer &slicer, const ArrayBase &data)
void throwPut() const
Throw an "invalid operation" exception for the default implementation of put.
virtual void putScalarColumnCellsV(const RefRows &rownrs, const ArrayBase &dataPtr)
Put some scalar values in the column.
virtual void getShort(rownr_t rownr, Short *dataPtr)
virtual IPosition shape(rownr_t rownr)
Get the shape of the item in the given row.
ColumnCache & columnCache()
Get access to the ColumnCache object.
virtual void getDComplex(rownr_t rownr, DComplex *dataPtr)
void PutCells(const RefRows &rownrs, const ArrayBase &arr)
DataManagerColumn & operator=(const DataManagerColumn &)=delete
Assignment cannot be used for this base class.
void put(rownr_t rownr, const uChar *dataPtr)
virtual void getColumnSliceCellsV(const RefRows &rownrs, const Slicer &slicer, ArrayBase &data)
Get a section of some arrays in the column.
void put(rownr_t rownr, const uInt *dataPtr)
void getArrayColumnBase(ArrayBase &data)
virtual void putArrayColumnCellsV(const RefRows &rownrs, const ArrayBase &data)
Put some array values in the column.
void GetCells(const RefRows &rownrs, ArrayBase &arr)
void getScalarColumnBase(ArrayBase &dataPtr)
The default implementations of get and put functions.
virtual void setShapeTiled(rownr_t rownr, const IPosition &shape, const IPosition &tileShape)
Set the shape and tile shape of an (variable-shaped) array in the given row.
virtual void putColumnSliceV(const Slicer &slicer, const ArrayBase &data)
Put into a section of all arrays in the column.
const ColumnCache * columnCachePtr() const
void get(rownr_t rownr, Int *dataPtr)
virtual void putInt(rownr_t rownr, const Int *dataPtr)
void putScalarColumnCellsBase(const RefRows &rownrs, const ArrayBase &dataPtr)
void putSliceArr(rownr_t row, const Slicer &section, std::shared_ptr< ArrayBase > &fullArr, const ArrayBase &arr)
Put a slice into the array in the given row.
virtual void putuShort(rownr_t rownr, const uShort *dataPtr)
void put(rownr_t rownr, const DComplex *dataPtr)
void setColumnName(const String &colName)
Set the column name.
void put(rownr_t rownr, const double *dataPtr)
void getColumnSliceCellsBase(const RefRows &rownrs, const Slicer &slicer, ArrayBase &data)
Bool isFixedShape() const
Is this a fixed shape column?
virtual void putComplex(rownr_t rownr, const Complex *dataPtr)
virtual void getColumnSliceV(const Slicer &slicer, ArrayBase &data)
Get a section of all arrays in the column.
void get(rownr_t rownr, uChar *dataPtr)
virtual void putArrayV(rownr_t rownr, const ArrayBase &data)
Put the array value into the given row.
virtual void putString(rownr_t rownr, const String *dataPtr)
void setIsFixedShape(Bool isFixedShape)
Set the isFixedShape flag.
void getScalarColumnCellsBase(const RefRows &rownrs, ArrayBase &dataPtr)
DataManagerColumn()
Create a column.
virtual void getArrayV(rownr_t rownr, ArrayBase &dataPtr)
Get the array value in the given row.
void putValueGeneric(rownr_t rownr, const T *dataPtr)
virtual void putSliceV(rownr_t rownr, const Slicer &slicer, const ArrayBase &data)
Put into a section of the array in the given row.
void get(rownr_t rownr, double *dataPtr)
virtual void setShapeColumn(const IPosition &shape)
Set the shape of all (fixed-shaped) arrays in the column.
virtual void putuChar(rownr_t rownr, const uChar *dataPtr)
virtual IPosition tileShape(rownr_t rownr)
Get the tile shape of the item in the given row.
virtual void putArrayColumnV(const ArrayBase &data)
Put all array values in the column.
const String & columnName() const
Get rhe column name.
void get(rownr_t rownr, Complex *dataPtr)
void put(rownr_t rownr, const Short *dataPtr)
virtual void putScalarColumnV(const ArrayBase &dataPtr)
Put all scalar values in the column.
virtual void putfloat(rownr_t rownr, const float *dataPtr)
virtual ~DataManagerColumn()
Frees up the storage.
virtual String dataTypeId() const
Get the data type id of the column for dataType==TpOther.
String: the storage and methods of handling collections of characters.
Definition String.h:355
For temporary backward namespace compatibility, use casa as alias for casacore.
Definition mainpage.dox:28
unsigned char uChar
Definition aipstype.h:45
const Bool False
Definition aipstype.h:42
short Short
Definition aipstype.h:46
unsigned int uInt
Definition aipstype.h:49
unsigned short uShort
Definition aipstype.h:47
long long Int64
Define the extra non-standard types used by Casacore (like proposed uSize, Size).
Definition aipsxtype.h:36
int Int
Definition aipstype.h:48
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40
const Bool True
Definition aipstype.h:41
uInt64 rownr_t
Define the type of a row number in a table.
Definition aipsxtype.h:44