casacore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
casacore::ArrayColumnData Class Reference

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

#include <ArrColData.h>

Inheritance diagram for casacore::ArrayColumnData:
casacore::PlainColumn casacore::BaseColumn

Public Member Functions

 ArrayColumnData (const ArrayColumnDescBase *, ColumnSet *)
 Construct an array column object from the given description in the given column set. More...
 
 ~ArrayColumnData ()
 
virtual Bool canChangeShape () const
 Ask the data manager if the shape of an existing array can be changed. More...
 
void initialize (rownr_t startRownr, rownr_t endRownr)
 Initialize the rows from startRownr till endRownr (inclusive) with the default value defined in the column description (if defined). More...
 
uInt ndimColumn () const
 Get the global #dimensions of an array (ie. More...
 
IPosition shapeColumn () const
 Get the global shape of an array (ie. More...
 
void setShapeColumn (const IPosition &shape)
 Set shape of all arrays in the column. More...
 
uInt ndim (rownr_t rownr) const
 Get the #dimensions of an array in a particular cell. More...
 
IPosition shape (rownr_t rownr) const
 Get the shape of an array in a particular cell. More...
 
IPosition tileShape (rownr_t rownr) const
 Get the tile shape of an array in a particular cell. More...
 
void setShape (rownr_t rownr, const IPosition &shape)
 Set dimensions of array in a particular cell. More...
 
void setShape (rownr_t rownr, const IPosition &shape, const IPosition &tileShape)
 The shape of tiles in the array can also be defined. More...
 
Bool isDefined (rownr_t rownr) const
 Test if the given cell contains an array. More...
 
void getArray (rownr_t rownr, ArrayBase &arrayPtr) const
 Get the array from a particular cell. More...
 
void getSlice (rownr_t rownr, const Slicer &, ArrayBase &arrayPtr) const
 Get a slice of an N-dimensional array in a particular cell. More...
 
void getArrayColumn (ArrayBase &arrayPtr) const
 Get the array of all values in a column. More...
 
void getArrayColumnCells (const RefRows &rownrs, ArrayBase &arrayPtr) const
 Get the array of some values in a column. More...
 
void getColumnSlice (const Slicer &, ArrayBase &arrayPtr) const
 Get subsections from all arrays in the column. More...
 
void getColumnSliceCells (const RefRows &rownrs, const Slicer &, ArrayBase &arrayPtr) const
 Get subsections from some arrays in the column. More...
 
void putArray (rownr_t rownr, const ArrayBase &arrayPtr)
 Put the value in a particular cell. More...
 
void putSlice (rownr_t rownr, const Slicer &, const ArrayBase &arrayPtr)
 Put a slice of an N-dimensional array in a particular cell. More...
 
void putArrayColumn (const ArrayBase &arrayPtr)
 Put the array of all values in the column. More...
 
void putArrayColumnCells (const RefRows &rownrs, const ArrayBase &arrayPtr)
 Put the array of some values in the column. More...
 
void putColumnSlice (const Slicer &, const ArrayBase &arrayPtr)
 Put into subsections of all table arrays in the column. More...
 
void putColumnSliceCells (const RefRows &rownrs, const Slicer &, const ArrayBase &arrayPtr)
 Put into subsections of some table arrays in the column. More...
 
void createDataManagerColumn ()
 Create a data manager column object for this column. More...
 
- Public Member Functions inherited from casacore::PlainColumn
 PlainColumn (const BaseColumnDesc *, ColumnSet *)
 
virtual ~PlainColumn ()
 
virtual Bool isWritable () const
 Test if the column is in principle writable. More...
 
virtual Bool isStored () const
 Test if the column is stored (otherwise it is virtual). More...
 
TableRecordrwKeywordSet ()
 Get access to the column keyword set. More...
 
TableRecordkeywordSet ()
 
rownr_t nrow () const
 Get nr of rows in the column. More...
 
virtual Bool isBound () const
 Test if the column is bound to a storage manager or virtual column engine. More...
 
virtual void bind (DataManager *)
 Bind the column to a data manager. More...
 
DataManagerdataManager () const
 Get the pointer to the data manager. More...
 
DataManagerColumn *& dataManagerColumn ()
 Get the pointer to the data manager column. More...
 
virtual ColumnCachecolumnCache ()
 Get a pointer to the underlying column cache. More...
 
virtual void setMaximumCacheSize (uInt nbytes)
 Set the maximum cache size (in bytes) to be used by a storage manager. More...
 
void putFile (AipsIO &, const TableAttr &)
 Write the column. More...
 
void getFile (AipsIO &, const ColumnSet &, const TableAttr &)
 Read the column. More...
 
- Public Member Functions inherited from casacore::BaseColumn
 BaseColumn (const BaseColumnDesc *)
 Construct it using the given column description. More...
 
virtual ~BaseColumn ()
 
const ColumnDesccolumnDesc () const
 Get const access to the column description. More...
 
virtual void get (rownr_t rownr, void *dataPtr) const
 Get a scalar value from a particular cell. More...
 
virtual void getScalarColumn (ArrayBase &dataPtr) const
 Get the vector of all scalar values in a column. More...
 
virtual void getScalarColumnCells (const RefRows &rownrs, ArrayBase &dataPtr) const
 Get the vector of some scalar values in a column. More...
 
virtual void put (rownr_t rownr, const void *dataPtr)
 Put the scalar value in a particular cell. More...
 
virtual void putScalarColumn (const ArrayBase &dataPtr)
 Put the vector of all scalar values in the column. More...
 
virtual void putScalarColumnCells (const RefRows &rownrs, const ArrayBase &dataPtr)
 Get the vector of some scalar values in a column. More...
 
void getScalar (rownr_t rownr, Bool &value) const
 Get the value from the row and convert it to the required type. More...
 
void getScalar (rownr_t rownr, uChar &value) const
 
void getScalar (rownr_t rownr, Short &value) const
 
void getScalar (rownr_t rownr, uShort &value) const
 
void getScalar (rownr_t rownr, Int &value) const
 
void getScalar (rownr_t rownr, uInt &value) const
 
void getScalar (rownr_t rownr, Int64 &value) const
 
void getScalar (rownr_t rownr, float &value) const
 
void getScalar (rownr_t rownr, double &value) const
 
void getScalar (rownr_t rownr, Complex &value) const
 
void getScalar (rownr_t rownr, DComplex &value) const
 
void getScalar (rownr_t rownr, String &value) const
 
void getScalar (rownr_t rownr, TableRecord &value) const
 
void getScalar (rownr_t rownr, void *value, const String &dataTypeId) const
 Get a scalar for the other data types. More...
 
void putScalar (rownr_t rownr, const Bool &value)
 Put the value into the row and convert it from the given type. More...
 
void putScalar (rownr_t rownr, const uChar &value)
 
void putScalar (rownr_t rownr, const Short &value)
 
void putScalar (rownr_t rownr, const uShort &value)
 
void putScalar (rownr_t rownr, const Int &value)
 
void putScalar (rownr_t rownr, const uInt &value)
 
void putScalar (rownr_t rownr, const Int64 &value)
 
void putScalar (rownr_t rownr, const float &value)
 
void putScalar (rownr_t rownr, const double &value)
 
void putScalar (rownr_t rownr, const Complex &value)
 
void putScalar (rownr_t rownr, const DComplex &value)
 
void putScalar (rownr_t rownr, const String &value)
 
void putScalar (rownr_t rownr, const Char *value)
 
void putScalar (rownr_t rownr, const TableRecord &value)
 
virtual void makeSortKey (Sort &, CountedPtr< BaseCompare > &cmpObj, Int order, CountedPtr< ArrayBase > &dataSave)
 Add this column and its data to the Sort object. More...
 
virtual void makeRefSortKey (Sort &, CountedPtr< BaseCompare > &cmpObj, Int order, const Vector< rownr_t > &rownrs, CountedPtr< ArrayBase > &dataSave)
 Do it only for the given row numbers. More...
 
virtual void allocIterBuf (void *&lastVal, void *&curVal, CountedPtr< BaseCompare > &cmpObj)
 Allocate value buffers for the table iterator. More...
 
virtual void freeIterBuf (void *&lastVal, void *&curVal)
 Free the value buffers allocated by allocIterBuf. More...
 

Private Member Functions

 ArrayColumnData (const ArrayColumnData &)
 Copy constructor cannot be used. More...
 
ArrayColumnDataoperator= (const ArrayColumnData &)
 Assignment cannot be used. More...
 
void checkShape (const IPosition &shape) const
 Check if the shape of an array can be set and if it is set correctly (i.e. More...
 
void putFileDerived (AipsIO &)
 Write the column data. More...
 
void getFileDerived (AipsIO &, const ColumnSet &)
 Read the column data back. More...
 

Private Attributes

const ArrayColumnDescBasearrDescPtr_p
 Pointer to column description. More...
 
Bool shapeColDef_p
 Is the shape for all arrays in the columns defined. More...
 
IPosition shapeCol_p
 Shape for all arrays in the column. More...
 
Bool checkValueLength_p
 Does the length of a string has to be checked? More...
 

Additional Inherited Members

- Protected Member Functions inherited from casacore::PlainColumn
int traceId () const
 Get the trace-id of the table. More...
 
void checkValueLength (const void *) const
 Check the length of a value. More...
 
void checkValueLength (const String *value) const
 
void checkValueLength (const Array< String > *value) const
 
void checkReadLock (Bool wait) const
 Lock the table before reading or writing. More...
 
void checkWriteLock (Bool wait) const
 
void autoReleaseLock () const
 Inspect the auto lock when the inspection interval has expired and release it when another process needs the lock. More...
 
- Protected Member Functions inherited from casacore::BaseColumn
void throwGetScalar () const
 Throw exceptions for invalid scalar get or put. More...
 
void throwPutScalar () const
 
void throwGetType (const String &type) const
 
void throwPutType (const String &type) const
 
- Protected Attributes inherited from casacore::PlainColumn
DataManagerdataManPtr_p
 
DataManagerColumndataColPtr_p
 
ColumnSetcolSetPtr_p
 
String originalName_p
 
Bool rtraceColumn_p
 
Bool wtraceColumn_p
 
- Protected Attributes inherited from casacore::BaseColumn
const BaseColumnDesccolDescPtr_p
 

Detailed Description

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.

To Do

Definition at line 99 of file ArrColData.h.

Constructor & Destructor Documentation

casacore::ArrayColumnData::ArrayColumnData ( const ArrayColumnDescBase ,
ColumnSet  
)

Construct an array column object from the given description in the given column set.

This constructor is used by ArrayColumnDescBase::makeColumn.

casacore::ArrayColumnData::~ArrayColumnData ( )
casacore::ArrayColumnData::ArrayColumnData ( const ArrayColumnData )
private

Copy constructor cannot be used.

Member Function Documentation

virtual Bool casacore::ArrayColumnData::canChangeShape ( ) const
virtual

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

Reimplemented from casacore::BaseColumn.

void casacore::ArrayColumnData::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::createDataManagerColumn ( )
virtual

Create a data manager column object for this column.

Implements casacore::PlainColumn.

void casacore::ArrayColumnData::getArray ( rownr_t  rownr,
ArrayBase arrayPtr 
) const
virtual

Get the array from a particular cell.

The length of the array given by ArrayBase must match the actual length. This is checked by ArrayColumn.

Reimplemented from casacore::BaseColumn.

void casacore::ArrayColumnData::getArrayColumn ( ArrayBase 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 array given by ArrayBase must match the actual length. This is checked by ArrayColumn.

Reimplemented from casacore::BaseColumn.

void casacore::ArrayColumnData::getArrayColumnCells ( const RefRows rownrs,
ArrayBase 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 array given by ArrayBase must match the actual length. This is checked by ArrayColumn.

Reimplemented from casacore::BaseColumn.

void casacore::ArrayColumnData::getColumnSlice ( const Slicer ,
ArrayBase 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 array given by ArrayBase must match the actual length. This is checked by ArrayColumn.

Reimplemented from casacore::BaseColumn.

void casacore::ArrayColumnData::getColumnSliceCells ( const RefRows rownrs,
const Slicer ,
ArrayBase 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 array given by ArrayBase must match the actual length. This is checked by ArrayColumn.

Reimplemented from casacore::BaseColumn.

void casacore::ArrayColumnData::getFileDerived ( AipsIO ,
const ColumnSet  
)
privatevirtual

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::getSlice ( rownr_t  rownr,
const Slicer ,
ArrayBase arrayPtr 
) const
virtual

Get a slice of an N-dimensional array in a particular cell.

The length of the array given by ArrayBase must match the actual length. This is checked by ArrayColumn.

Reimplemented from casacore::BaseColumn.

void casacore::ArrayColumnData::initialize ( rownr_t  startRownr,
rownr_t  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::isDefined ( rownr_t  rownr) const
virtual

Test if the given cell contains an array.

Implements casacore::BaseColumn.

uInt casacore::ArrayColumnData::ndim ( rownr_t  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::ndimColumn ( ) const
virtual

Get the global #dimensions of an array (ie.

for all rows).

Reimplemented from casacore::BaseColumn.

ArrayColumnData& casacore::ArrayColumnData::operator= ( const ArrayColumnData )
private

Assignment cannot be used.

void casacore::ArrayColumnData::putArray ( rownr_t  rownr,
const ArrayBase arrayPtr 
)
virtual

Put the value in a particular cell.

The length of the array given by ArrayBase must match the actual length. This is checked by ArrayColumn.

Reimplemented from casacore::BaseColumn.

void casacore::ArrayColumnData::putArrayColumn ( const ArrayBase 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 array given by ArrayBase must match the actual length. This is checked by ArrayColumn.

Reimplemented from casacore::BaseColumn.

void casacore::ArrayColumnData::putArrayColumnCells ( const RefRows rownrs,
const ArrayBase 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 array given by ArrayBase must match the actual length. This is checked by ArrayColumn.

Reimplemented from casacore::BaseColumn.

void casacore::ArrayColumnData::putColumnSlice ( const Slicer ,
const ArrayBase 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 array given by ArrayBase must match the actual length. This is checked by ArrayColumn.

Reimplemented from casacore::BaseColumn.

void casacore::ArrayColumnData::putColumnSliceCells ( const RefRows rownrs,
const Slicer ,
const ArrayBase 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 array given by ArrayBase must match the actual length. This is checked by ArrayColumn.

Reimplemented from casacore::BaseColumn.

void casacore::ArrayColumnData::putFileDerived ( AipsIO )
privatevirtual

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::putSlice ( rownr_t  rownr,
const Slicer ,
const ArrayBase arrayPtr 
)
virtual

Put a slice of an N-dimensional array in a particular cell.

The length of the array given by ArrayBase must match the actual length. This is checked by ArrayColumn.

Reimplemented from casacore::BaseColumn.

void casacore::ArrayColumnData::setShape ( rownr_t  rownr,
const IPosition shape 
)
virtual

Set dimensions of array in a particular cell.

Reimplemented from casacore::BaseColumn.

void casacore::ArrayColumnData::setShape ( rownr_t  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::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::shape ( rownr_t  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::shapeColumn ( ) const
virtual

Get the global shape of an array (ie.

for all rows).

Reimplemented from casacore::BaseColumn.

IPosition casacore::ArrayColumnData::tileShape ( rownr_t  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.

Member Data Documentation

const ArrayColumnDescBase* casacore::ArrayColumnData::arrDescPtr_p
private

Pointer to column description.

Definition at line 234 of file ArrColData.h.

Bool casacore::ArrayColumnData::checkValueLength_p
private

Does the length of a string has to be checked?

Definition at line 240 of file ArrColData.h.

IPosition casacore::ArrayColumnData::shapeCol_p
private

Shape for all arrays in the column.

Definition at line 238 of file ArrColData.h.

Bool casacore::ArrayColumnData::shapeColDef_p
private

Is the shape for all arrays in the columns defined.

Definition at line 236 of file ArrColData.h.


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