Access to a table column containing arrays. More...
#include <ArrColData.h>
Public Member Functions | |
ArrayColumnData (const ArrayColumnDesc< T > *, ColumnSet *) | |
Construct an array column object from the given description in the given column set. | |
~ArrayColumnData () | |
virtual Bool | canChangeShape () const |
Ask the data manager if the shape of an existing array can be changed. | |
virtual Bool | canAccessSlice (Bool &reask) const |
Ask if the data manager can handle a cell slice. | |
virtual Bool | canAccessArrayColumn (Bool &reask) const |
Ask if the data manager can handle a column. | |
virtual Bool | canAccessArrayColumnCells (Bool &reask) const |
Ask if the data manager can handle some cells in a column. | |
virtual Bool | canAccessColumnSlice (Bool &reask) const |
Ask if the data manager can handle a column slice. | |
void | initialize (uInt startRownr, uInt endRownr) |
Initialize the rows from startRownr till endRownr (inclusive) with the default value defined in the column description (if defined). | |
uInt | ndimColumn () const |
Get the global #dimensions of an array (ie. | |
IPosition | shapeColumn () const |
Get the global shape of an array (ie. | |
void | setShapeColumn (const IPosition &shape) |
Set shape of all arrays in the column. | |
uInt | ndim (uInt rownr) const |
Get the #dimensions of an array in a particular cell. | |
IPosition | shape (uInt rownr) const |
Get the shape of an array in a particular cell. | |
IPosition | tileShape (uInt rownr) const |
Get the tile shape of an array in a particular cell. | |
void | setShape (uInt rownr, const IPosition &shape) |
Set dimensions of array in a particular cell. | |
void | setShape (uInt rownr, const IPosition &shape, const IPosition &tileShape) |
The shape of tiles in the array can also be defined. | |
Bool | isDefined (uInt rownr) const |
Test if the given cell contains an array. | |
void | get (uInt rownr, void *arrayPtr) const |
Get the array from a particular cell. | |
void | getSlice (uInt rownr, const Slicer &, void *arrayPtr) const |
Get a slice of an N-dimensional array in a particular cell. | |
void | getArrayColumn (void *arrayPtr) const |
Get the array of all values in a column. | |
void | getArrayColumnCells (const RefRows &rownrs, void *arrayPtr) const |
Get the array of some values in a column. | |
void | getColumnSlice (const Slicer &, void *arrayPtr) const |
Get subsections from all arrays in the column. | |
void | getColumnSliceCells (const RefRows &rownrs, const Slicer &, void *arrayPtr) const |
Get subsections from some arrays in the column. | |
void | put (uInt rownr, const void *arrayPtr) |
Put the value in a particular cell. | |
void | putSlice (uInt rownr, const Slicer &, const void *arrayPtr) |
Put a slice of an N-dimensional array in a particular cell. | |
void | putArrayColumn (const void *arrayPtr) |
Put the array of all values in the column. | |
void | putArrayColumnCells (const RefRows &rownrs, const void *arrayPtr) |
Put the array of some values in the column. | |
void | putColumnSlice (const Slicer &, const void *arrayPtr) |
Put into subsections of all table arrays in the column. | |
void | putColumnSliceCells (const RefRows &rownrs, const Slicer &, const void *arrayPtr) |
Put into subsections of some table arrays in the column. | |
void | createDataManagerColumn () |
Create a data manager column object for this column. | |
Private Member Functions | |
ArrayColumnData (const ArrayColumnData< T > &) | |
Copy constructor cannot be used. | |
ArrayColumnData< T > & | operator= (const ArrayColumnData< T > &) |
Assignment cannot be used. | |
void | checkShape (const IPosition &shape) const |
Check if the shape of an array can be set and if it is set correctly (i.e. | |
void | putFileDerived (AipsIO &) |
Write the column data. | |
void | getFileDerived (AipsIO &, const ColumnSet &) |
Read the column data back. | |
Private Attributes | |
const ArrayColumnDesc< T > * | arrDescPtr_p |
Pointer to column description. | |
Bool | shapeColDef_p |
Is the shape for all arrays in the columns defined. | |
IPosition | shapeCol_p |
Shape for all arrays in the column. |
Access to a table column containing arrays.
Internal
ArrayColumnData represents a table column containing array data.
The class ArrayColumnData is derived from PlainColumn. It implements the virtual functions accessing a table column containing arrays with an arbitrary data type. Both direct and indirect arrays are supported.
It is possible to access an array or a subsection of it in an individual cell (i.e. table row) or in the entire column. The functions accessing the entire column are implemented by looping over the individual cells.
The main task of this class is to communicate with the data manager column object. This consists of:
The class is hidden from the user by the envelope class ArrayColumn. It used directly, it should be done with care. It assumes that the arrays in the various get and put functions have the correct length. ArrayColumn does that check.
Definition at line 105 of file ArrColData.h.
casacore::ArrayColumnData< T >::ArrayColumnData | ( | const ArrayColumnDesc< T > * | , | |
ColumnSet * | ||||
) |
Construct an array column object from the given description in the given column set.
This constructor is used by ArrayColumnDesc::makeColumn.
casacore::ArrayColumnData< T >::~ArrayColumnData | ( | ) |
casacore::ArrayColumnData< T >::ArrayColumnData | ( | const ArrayColumnData< T > & | ) | [private] |
Copy constructor cannot be used.
virtual Bool casacore::ArrayColumnData< T >::canAccessArrayColumn | ( | Bool & | reask | ) | const [virtual] |
Ask if the data manager can handle a column.
Reimplemented from casacore::BaseColumn.
virtual Bool casacore::ArrayColumnData< T >::canAccessArrayColumnCells | ( | Bool & | reask | ) | const [virtual] |
Ask if the data manager can handle some cells in a column.
Reimplemented from casacore::BaseColumn.
virtual Bool casacore::ArrayColumnData< T >::canAccessColumnSlice | ( | Bool & | reask | ) | const [virtual] |
Ask if the data manager can handle a column slice.
Reimplemented from casacore::BaseColumn.
virtual Bool casacore::ArrayColumnData< T >::canAccessSlice | ( | Bool & | reask | ) | const [virtual] |
Ask if the data manager can handle a cell slice.
Reimplemented from casacore::BaseColumn.
virtual Bool casacore::ArrayColumnData< T >::canChangeShape | ( | ) | const [virtual] |
Ask the data manager if the shape of an existing array can be changed.
Reimplemented from casacore::BaseColumn.
void casacore::ArrayColumnData< T >::checkShape | ( | const IPosition & | shape | ) | const [private] |
Check if the shape of an array can be set and if it is set correctly (i.e.
if matching possible #dim in column description).
void casacore::ArrayColumnData< T >::createDataManagerColumn | ( | ) | [virtual] |
Create a data manager column object for this column.
Implements casacore::PlainColumn.
void casacore::ArrayColumnData< T >::get | ( | uInt | rownr, | |
void * | arrayPtr | |||
) | const [virtual] |
Get the array from a particular cell.
The length of the buffer pointed to by arrayPtr must match the actual length. This is checked by ArrayColumn.
Implements casacore::BaseColumn.
void casacore::ArrayColumnData< T >::getArrayColumn | ( | void * | arrayPtr | ) | const [virtual] |
Get the array of all values in a column.
If the column contains n-dim arrays, the resulting array is (n+1)-dim. The arrays in the column have to have the same shape in all cells. The length of the buffer pointed to by arrayPtr must match the actual length. This is checked by ArrayColumn.
Reimplemented from casacore::BaseColumn.
void casacore::ArrayColumnData< T >::getArrayColumnCells | ( | const RefRows & | rownrs, | |
void * | arrayPtr | |||
) | const [virtual] |
Get the array of some values in a column.
If the column contains n-dim arrays, the resulting array is (n+1)-dim. The arrays in the column have to have the same shape in all cells. The length of the buffer pointed to by arrayPtr must match the actual length. This is checked by ArrayColumn.
Reimplemented from casacore::BaseColumn.
void casacore::ArrayColumnData< T >::getColumnSlice | ( | const Slicer & | , | |
void * | arrayPtr | |||
) | const [virtual] |
Get subsections from all arrays in the column.
If the column contains n-dim arrays, the resulting array is (n+1)-dim. The arrays in the column have to have the same shape in all cells. The length of the buffer pointed to by arrayPtr must match the actual length. This is checked by ArrayColumn.
Reimplemented from casacore::BaseColumn.
void casacore::ArrayColumnData< T >::getColumnSliceCells | ( | const RefRows & | rownrs, | |
const Slicer & | , | |||
void * | arrayPtr | |||
) | const [virtual] |
Get subsections from some arrays in the column.
If the column contains n-dim arrays, the resulting array is (n+1)-dim. The arrays in the column have to have the same shape in all cells. The length of the buffer pointed to by arrayPtr must match the actual length. This is checked by ArrayColumn.
Reimplemented from casacore::BaseColumn.
void casacore::ArrayColumnData< T >::getFileDerived | ( | AipsIO & | , | |
const ColumnSet & | ||||
) | [private, virtual] |
Read the column data back.
The control information is read from the given AipsIO object. This is used to bind the column to the appropriate data manager. Thereafter the data manager gets opened.
Implements casacore::PlainColumn.
void casacore::ArrayColumnData< T >::getSlice | ( | uInt | rownr, | |
const Slicer & | , | |||
void * | arrayPtr | |||
) | const [virtual] |
Get a slice of an N-dimensional array in a particular cell.
The length of the buffer pointed to by arrayPtr must match the actual length. This is checked by ArrayColumn.
Reimplemented from casacore::BaseColumn.
void casacore::ArrayColumnData< T >::initialize | ( | uInt | startRownr, | |
uInt | endRownr | |||
) | [virtual] |
Initialize the rows from startRownr till endRownr (inclusive) with the default value defined in the column description (if defined).
Implements casacore::BaseColumn.
Bool casacore::ArrayColumnData< T >::isDefined | ( | uInt | rownr | ) | const [virtual] |
Test if the given cell contains an array.
Implements casacore::BaseColumn.
uInt casacore::ArrayColumnData< T >::ndim | ( | uInt | rownr | ) | const [virtual] |
Get the #dimensions of an array in a particular cell.
If the cell does not contain an array, 0 is returned.
Reimplemented from casacore::BaseColumn.
uInt casacore::ArrayColumnData< T >::ndimColumn | ( | ) | const [virtual] |
ArrayColumnData<T>& casacore::ArrayColumnData< T >::operator= | ( | const ArrayColumnData< T > & | ) | [private] |
Assignment cannot be used.
void casacore::ArrayColumnData< T >::put | ( | uInt | rownr, | |
const void * | arrayPtr | |||
) | [virtual] |
Put the value in a particular cell.
The length of the buffer pointed to by arrayPtr must match the actual length. This is checked by ArrayColumn.
Implements casacore::BaseColumn.
void casacore::ArrayColumnData< T >::putArrayColumn | ( | const void * | arrayPtr | ) | [virtual] |
Put the array of all values in the column.
If the column contains n-dim arrays, the source array is (n+1)-dim. The arrays in the column have to have the same shape in all cells. The length of the buffer pointed to by arrayPtr must match the actual length. This is checked by ArrayColumn.
Reimplemented from casacore::BaseColumn.
void casacore::ArrayColumnData< T >::putArrayColumnCells | ( | const RefRows & | rownrs, | |
const void * | arrayPtr | |||
) | [virtual] |
Put the array of some values in the column.
If the column contains n-dim arrays, the source array is (n+1)-dim. The arrays in the column have to have the same shape in all cells. The length of the buffer pointed to by arrayPtr must match the actual length. This is checked by ArrayColumn.
Reimplemented from casacore::BaseColumn.
void casacore::ArrayColumnData< T >::putColumnSlice | ( | const Slicer & | , | |
const void * | arrayPtr | |||
) | [virtual] |
Put into subsections of all table arrays in the column.
If the column contains n-dim arrays, the source array is (n+1)-dim. The arrays in the column have to have the same shape in all cells. The length of the buffer pointed to by arrayPtr must match the actual length. This is checked by ArrayColumn.
Reimplemented from casacore::BaseColumn.
void casacore::ArrayColumnData< T >::putColumnSliceCells | ( | const RefRows & | rownrs, | |
const Slicer & | , | |||
const void * | arrayPtr | |||
) | [virtual] |
Put into subsections of some table arrays in the column.
If the column contains n-dim arrays, the source array is (n+1)-dim. The arrays in the column have to have the same shape in all cells. The length of the buffer pointed to by arrayPtr must match the actual length. This is checked by ArrayColumn.
Reimplemented from casacore::BaseColumn.
void casacore::ArrayColumnData< T >::putFileDerived | ( | AipsIO & | ) | [private, virtual] |
Write the column data.
The control information is written into the given AipsIO object, while the data is written/flushed by the data manager.
Implements casacore::PlainColumn.
void casacore::ArrayColumnData< T >::putSlice | ( | uInt | rownr, | |
const Slicer & | , | |||
const void * | arrayPtr | |||
) | [virtual] |
Put a slice of an N-dimensional array in a particular cell.
The length of the buffer pointed to by arrayPtr must match the actual length. This is checked by ArrayColumn.
Reimplemented from casacore::BaseColumn.
void casacore::ArrayColumnData< T >::setShape | ( | uInt | rownr, | |
const IPosition & | shape, | |||
const IPosition & | tileShape | |||
) | [virtual] |
The shape of tiles in the array can also be defined.
Reimplemented from casacore::BaseColumn.
void casacore::ArrayColumnData< T >::setShape | ( | uInt | rownr, | |
const IPosition & | shape | |||
) | [virtual] |
Set dimensions of array in a particular cell.
Reimplemented from casacore::BaseColumn.
void casacore::ArrayColumnData< T >::setShapeColumn | ( | const IPosition & | shape | ) | [virtual] |
Set shape of all arrays in the column.
It can only be used for direct arrays.
Reimplemented from casacore::PlainColumn.
IPosition casacore::ArrayColumnData< T >::shape | ( | uInt | rownr | ) | const [virtual] |
Get the shape of an array in a particular cell.
If the cell does not contain an array, an empty IPosition is returned.
Reimplemented from casacore::BaseColumn.
IPosition casacore::ArrayColumnData< T >::shapeColumn | ( | ) | const [virtual] |
IPosition casacore::ArrayColumnData< T >::tileShape | ( | uInt | rownr | ) | const [virtual] |
Get the tile shape of an array in a particular cell.
If the cell does not contain an array, an empty IPosition is returned.
Reimplemented from casacore::BaseColumn.
const ArrayColumnDesc<T>* casacore::ArrayColumnData< T >::arrDescPtr_p [private] |
Pointer to column description.
Definition at line 252 of file ArrColData.h.
IPosition casacore::ArrayColumnData< T >::shapeCol_p [private] |
Shape for all arrays in the column.
Definition at line 256 of file ArrColData.h.
Bool casacore::ArrayColumnData< T >::shapeColDef_p [private] |
Is the shape for all arrays in the columns defined.
Definition at line 254 of file ArrColData.h.