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