casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Private Member Functions | Private Attributes
casa::ArrayColumnData< T > Class Template Reference

Access to a table column containing arrays. More...

#include <ArrColData.h>

Inheritance diagram for casa::ArrayColumnData< T >:
casa::PlainColumn casa::BaseColumn

List of all members.

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.
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.

Detailed Description

template<class T>
class casa::ArrayColumnData< T >

Access to a table column containing arrays.

Intended use:

Internal

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

Definition at line 105 of file ArrColData.h.


Constructor & Destructor Documentation

template<class T>
casa::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.

template<class T>
casa::ArrayColumnData< T >::~ArrayColumnData ( )
template<class T>
casa::ArrayColumnData< T >::ArrayColumnData ( const ArrayColumnData< T > &  ) [private]

Copy constructor cannot be used.


Member Function Documentation

template<class T>
virtual Bool casa::ArrayColumnData< T >::canAccessArrayColumn ( Bool reask) const [virtual]

Ask if the data manager can handle a column.

Reimplemented from casa::BaseColumn.

template<class T>
virtual Bool casa::ArrayColumnData< T >::canAccessArrayColumnCells ( Bool reask) const [virtual]

Ask if the data manager can handle some cells in a column.

Reimplemented from casa::BaseColumn.

template<class T>
virtual Bool casa::ArrayColumnData< T >::canAccessColumnSlice ( Bool reask) const [virtual]

Ask if the data manager can handle a column slice.

Reimplemented from casa::BaseColumn.

template<class T>
virtual Bool casa::ArrayColumnData< T >::canAccessSlice ( Bool reask) const [virtual]

Ask if the data manager can handle a cell slice.

Reimplemented from casa::BaseColumn.

template<class T>
virtual Bool casa::ArrayColumnData< T >::canChangeShape ( ) const [virtual]

Ask the data manager if the shape of an existing array can be changed.

Reimplemented from casa::BaseColumn.

template<class T>
void casa::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).

template<class T>
void casa::ArrayColumnData< T >::createDataManagerColumn ( ) [virtual]

Create a data manager column object for this column.

Implements casa::PlainColumn.

template<class T>
void casa::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 casa::BaseColumn.

template<class T>
void casa::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 casa::BaseColumn.

template<class T>
void casa::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 casa::BaseColumn.

template<class T>
void casa::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 casa::BaseColumn.

template<class T>
void casa::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 casa::BaseColumn.

template<class T>
void casa::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 casa::PlainColumn.

template<class T>
void casa::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 casa::BaseColumn.

template<class T>
void casa::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 casa::BaseColumn.

template<class T>
Bool casa::ArrayColumnData< T >::isDefined ( uInt  rownr) const [virtual]

Test if the given cell contains an array.

Implements casa::BaseColumn.

template<class T>
uInt casa::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 casa::BaseColumn.

template<class T>
uInt casa::ArrayColumnData< T >::ndimColumn ( ) const [virtual]

Get the global #dimensions of an array (ie.

for all rows).

Reimplemented from casa::BaseColumn.

template<class T>
ArrayColumnData<T>& casa::ArrayColumnData< T >::operator= ( const ArrayColumnData< T > &  ) [private]

Assignment cannot be used.

template<class T>
void casa::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 casa::BaseColumn.

template<class T>
void casa::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 casa::BaseColumn.

template<class T>
void casa::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 casa::BaseColumn.

template<class T>
void casa::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 casa::BaseColumn.

template<class T>
void casa::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 casa::BaseColumn.

template<class T>
void casa::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 casa::PlainColumn.

template<class T>
void casa::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 casa::BaseColumn.

template<class T>
void casa::ArrayColumnData< T >::setShape ( uInt  rownr,
const IPosition shape 
) [virtual]

Set dimensions of array in a particular cell.

Reimplemented from casa::BaseColumn.

template<class T>
void casa::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 casa::BaseColumn.

template<class T>
void casa::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 casa::PlainColumn.

template<class T>
IPosition casa::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 casa::BaseColumn.

template<class T>
IPosition casa::ArrayColumnData< T >::shapeColumn ( ) const [virtual]

Get the global shape of an array (ie.

for all rows).

Reimplemented from casa::BaseColumn.


Member Data Documentation

template<class T>
const ArrayColumnDesc<T>* casa::ArrayColumnData< T >::arrDescPtr_p [private]

Pointer to column description.

Definition at line 248 of file ArrColData.h.

template<class T>
IPosition casa::ArrayColumnData< T >::shapeCol_p [private]

Shape for all arrays in the column.

Definition at line 252 of file ArrColData.h.

template<class T>
Bool casa::ArrayColumnData< T >::shapeColDef_p [private]

Is the shape for all arrays in the columns defined.

Definition at line 250 of file ArrColData.h.


The documentation for this class was generated from the following file: