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