ArrColData.h

Classes

ArrayColumnData -- Access to a table column containing arrays (full description)

template<class T> class ArrayColumnData : public PlainColumn

Interface

Public Members
ArrayColumnData (const ArrayColumnDesc<T>*, ColumnSet*)
~ArrayColumnData()
virtual Bool canChangeShape() const
virtual Bool canAccessSlice (Bool& reask) const
virtual Bool canAccessArrayColumn (Bool& reask) const
virtual Bool canAccessArrayColumnCells (Bool& reask) const
virtual Bool canAccessColumnSlice (Bool& reask) const
void initialize (uInt startRownr, uInt endRownr)
uInt ndimColumn() const
IPosition shapeColumn() const
void setShapeColumn (const IPosition& shape)
uInt ndim (uInt rownr) const
IPosition shape(uInt rownr) const
void setShape (uInt rownr, const IPosition& shape)
void setShape (uInt rownr, const IPosition& shape, const IPosition& tileShape)
Bool isDefined (uInt rownr) const
void get (uInt rownr, void* arrayPtr) const
void getSlice (uInt rownr, const Slicer&, void* arrayPtr) const
void getArrayColumn (void* arrayPtr) const
void getArrayColumnCells (const RefRows& rownrs, void* arrayPtr) const
void getColumnSlice (const Slicer&, void* arrayPtr) const
void getColumnSliceCells (const RefRows& rownrs, const Slicer&, void* arrayPtr) const
void put (uInt rownr, const void* arrayPtr)
void putSlice (uInt rownr, const Slicer&, const void* arrayPtr)
void putArrayColumn (const void* arrayPtr)
void putArrayColumnCells (const RefRows& rownrs, const void* arrayPtr)
void putColumnSlice (const Slicer&, const void* arrayPtr)
void putColumnSliceCells (const RefRows& rownrs, const Slicer&, const void* arrayPtr)
void createDataManagerColumn()
Private Members
ArrayColumnData (const ArrayColumnData<T>&)
ArrayColumnData<T>& operator= (const ArrayColumnData<T>&)
void checkShape (const IPosition& shape) const
void putFileDerived (AipsIO&)
void getFileDerived (AipsIO&, const ColumnSet&)

Description

Review Status

Reviewed By:
Gareth Hunt
Date Reviewed:
94Nov17

Prerequisite

Etymology

ArrayColumnData represents a table column containing array data.

Synopsis

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.

Template Type Argument Requirements (T)

To Do

Member Description

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.

~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. for all rows).

IPosition shapeColumn() const

Get the global shape of an array (ie. for all rows).

void setShapeColumn (const IPosition& shape)

Set shape of all arrays in the column. It can only be used for direct arrays.

uInt ndim (uInt rownr) const

Get the #dimensions of an array in a particular cell. If the cell does not contain an array, 0 is returned.

IPosition shape(uInt rownr) const

Get the shape of an array in a particular cell. If the cell does not contain an array, an empty IPosition is returned.

void setShape (uInt rownr, const IPosition& shape, const IPosition& tileShape)

Set dimensions of array in a particular cell.

The shape of tiles in the array can also be defined.

void setShape (uInt rownr, const IPosition& shape)

Set dimensions of array in a particular cell.

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. The length of the buffer pointed to by arrayPtr must match the actual length. This is checked by ArrayColumn.

void getSlice (uInt rownr, const Slicer&, void* arrayPtr) const

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.

void getArrayColumn (void* arrayPtr) const

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.

void getArrayColumnCells (const RefRows& rownrs, void* arrayPtr) const

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.

void getColumnSlice (const Slicer&, void* arrayPtr) const

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.

void getColumnSliceCells (const RefRows& rownrs, const Slicer&, void* arrayPtr) const

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.

void put (uInt rownr, const void* arrayPtr)

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.

void putSlice (uInt rownr, const Slicer&, const void* arrayPtr)

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.

void putArrayColumn (const void* arrayPtr)

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.

void putArrayColumnCells (const RefRows& rownrs, const void* arrayPtr)

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.

void putColumnSlice (const Slicer&, const void* arrayPtr)

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.

void putColumnSliceCells (const RefRows& rownrs, const Slicer&, const void* arrayPtr)

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.

void createDataManagerColumn()

Create a data manager column object for this column.

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. if matching possible #dim in column description).

void putFileDerived (AipsIO&)

Write the column data. The control information is written into the given AipsIO object, while the data is written/flushed by the data manager.

void getFileDerived (AipsIO&, const ColumnSet&)

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.