casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Protected Member Functions | Protected Attributes
casa::BaseColumn Class Reference

Abstract base class for a table column. More...

#include <BaseColumn.h>

Inheritance diagram for casa::BaseColumn:
casa::ConcatColumn casa::PlainColumn casa::RefColumn casa::ConcatScalarColumn< T > casa::ArrayColumnData< T > casa::ScalarColumnData< T > casa::ScalarRecordColumnData

List of all members.

Public Member Functions

 BaseColumn (const BaseColumnDesc *)
 Construct it using the given column description.
virtual ~BaseColumn ()
virtual Bool isWritable () const =0
 Test if the column is writable.
virtual Bool isStored () const =0
 Test if the column is stored (otherwise it is virtual).
virtual TableRecordrwKeywordSet ()=0
 Get access to the column keyword set.
virtual TableRecordkeywordSet ()=0
const ColumnDesccolumnDesc () const
 Get const access to the column description.
virtual uInt nrow () const =0
 Get nr of rows in the column.
virtual Bool isDefined (uInt rownr) const =0
 Test if the given cell contains a defined value.
virtual void setShape (uInt rownr, const IPosition &shape)
 Set the shape of the array in the given row.
virtual void setShape (uInt rownr, const IPosition &shape, const IPosition &tileShape)
 Set the shape and tile shape of the array in the given row.
virtual uInt ndimColumn () const
 Get the global #dimensions of an array (ie.
virtual IPosition shapeColumn () const
 Get the global shape of an array (ie.
virtual uInt ndim (uInt rownr) const
 Get the #dimensions of an array in a particular cell.
virtual IPosition shape (uInt rownr) const
 Get the shape of an array in a particular cell.
virtual Bool canChangeShape () const
 Ask the data manager if the shape of an existing array can be changed.
virtual Bool canAccessScalarColumn (Bool &reask) const
 Ask if the data manager can handle a scalar column.
virtual Bool canAccessArrayColumn (Bool &reask) const
 Ask if the data manager can handle an array column.
virtual Bool canAccessScalarColumnCells (Bool &reask) const
 Ask if the data manager can handle a collection of cells in a scalar column.
virtual Bool canAccessArrayColumnCells (Bool &reask) const
 Ask if the data manager can handle a collection of cells in an array column.
virtual Bool canAccessSlice (Bool &reask) const
 Ask if the data manager can handle a cell slice.
virtual Bool canAccessColumnSlice (Bool &reask) const
 Ask if the data manager can handle a column slice.
virtual void initialize (uInt startRownr, uInt endRownr)=0
 Initialize the rows from startRow till endRow (inclusive) with the default value defined in the column description.
virtual void get (uInt rownr, void *dataPtr) const =0
 Get the value from a particular cell.
virtual void getSlice (uInt rownr, const Slicer &, void *dataPtr) const
 Get a slice of an N-dimensional array in a particular cell.
virtual void getScalarColumn (void *dataPtr) const
 Get the vector of all scalar values in a column.
virtual void getArrayColumn (void *dataPtr) const
 Get the array of all array values in a column.
virtual void getColumnSlice (const Slicer &, void *dataPtr) const
 Get subsections from all arrays in the column.
virtual void getScalarColumnCells (const RefRows &rownrs, void *dataPtr) const
 Get the vector of some scalar values in a column.
virtual void getArrayColumnCells (const RefRows &rownrs, void *dataPtr) const
 Get the array of some array values in a column.
virtual void getColumnSliceCells (const RefRows &rownrs, const Slicer &, void *dataPtr) const
 Get subsections from some arrays in the column.
virtual void put (uInt rownr, const void *dataPtr)=0
 Put the value in a particular cell.
virtual void putSlice (uInt rownr, const Slicer &, const void *dataPtr)
 Put a slice of an N-dimensional array in a particular cell.
virtual void putScalarColumn (const void *dataPtr)
 Put the vector of all scalar values in the column.
virtual void putArrayColumn (const void *dataPtr)
 Put the array of all array values in the column.
virtual void putColumnSlice (const Slicer &, const void *dataPtr)
 Put into subsections of all table arrays in the column.
virtual void putScalarColumnCells (const RefRows &rownrs, const void *dataPtr)
 Get the vector of some scalar values in a column.
virtual void putArrayColumnCells (const RefRows &rownrs, const void *dataPtr)
 Get the array of some array values in a column.
virtual void putColumnSliceCells (const RefRows &rownrs, const Slicer &, const void *dataPtr)
 Put subsections of some arrays in the column.
void getScalar (uInt rownr, Bool &value) const
 Get the value from the row and convert it to the required type.
void getScalar (uInt rownr, uChar &value) const
void getScalar (uInt rownr, Short &value) const
void getScalar (uInt rownr, uShort &value) const
void getScalar (uInt rownr, Int &value) const
void getScalar (uInt rownr, uInt &value) const
void getScalar (uInt rownr, Int64 &value) const
void getScalar (uInt rownr, float &value) const
void getScalar (uInt rownr, double &value) const
void getScalar (uInt rownr, Complex &value) const
void getScalar (uInt rownr, DComplex &value) const
void getScalar (uInt rownr, String &value) const
void getScalar (uInt rownr, TableRecord &value) const
void getScalar (uInt rownr, void *value, const String &dataTypeId) const
 Get a scalar for the other data types.
void putScalar (uInt rownr, const Bool &value)
 Put the value into the row and convert it from the given type.
void putScalar (uInt rownr, const uChar &value)
void putScalar (uInt rownr, const Short &value)
void putScalar (uInt rownr, const uShort &value)
void putScalar (uInt rownr, const Int &value)
void putScalar (uInt rownr, const uInt &value)
void putScalar (uInt rownr, const float &value)
void putScalar (uInt rownr, const double &value)
void putScalar (uInt rownr, const Complex &value)
void putScalar (uInt rownr, const DComplex &value)
void putScalar (uInt rownr, const String &value)
void putScalar (uInt rownr, const Char *value)
void putScalar (uInt rownr, const TableRecord &value)
virtual ColumnCachecolumnCache ()=0
 Get a pointer to the underlying column cache.
virtual void setMaximumCacheSize (uInt nbytes)=0
 Set the maximum cache size (in bytes) to be used by a storage manager.
virtual void makeSortKey (Sort &, CountedPtr< BaseCompare > &cmpObj, Int order, const void *&dataSave)
 Add this column and its data to the Sort object.
virtual void makeRefSortKey (Sort &, CountedPtr< BaseCompare > &cmpObj, Int order, const Vector< uInt > &rownrs, const void *&dataSave)
 Do it only for the given row numbers.
virtual void freeSortKey (const void *&dataSave)
 Free storage on the heap allocated by makeSortkey().
virtual void allocIterBuf (void *&lastVal, void *&curVal, CountedPtr< BaseCompare > &cmpObj)
 Allocate value buffers for the table iterator.
virtual void freeIterBuf (void *&lastVal, void *&curVal)
 Free the value buffers allocated by allocIterBuf.

Protected Member Functions

void throwGetScalar () const
 Throw exceptions for invalid scalar get or put.
void throwPutScalar () const
void throwGetType (const String &type) const
void throwPutType (const String &type) const

Protected Attributes

const BaseColumnDesccolDescPtr_p
 
      

ColumnDesc colDesc_p

Detailed Description

Abstract base class for a table column.

Intended use:

Internal

Review Status

Reviewed By:
UNKNOWN
Date Reviewed:
before2004/08/25

Prerequisite

Etymology

This is the (abstract) base class to access a column in a table.

Synopsis

This class is the base class for the derived column classes. It is a private class in the sense that the user cannot get access to it. All user access to a column is done via the classes TableColumn, ScalarColumn and ArrayColumn. They call the corresponding functions in this class and its derived classes.

Motivation

This class serves a the base for the more specialized column classes like FilledScalarColumn and RefColumn. It defines many virtual functions, which are implemented in the derived classes. Some of these functions are purely virtual, some have a default implementation throwing an "invalid operation" exception. In that way those latter functions only have to be implemented in the classes which handle those cases.
Tip: The class RefColumn is in fact implemented in terms of this class; Almost every function in RefColumn calls the corresponding function in BaseColumn with the correct row number;

Definition at line 98 of file BaseColumn.h.


Constructor & Destructor Documentation

Construct it using the given column description.

virtual casa::BaseColumn::~BaseColumn ( ) [virtual]

Member Function Documentation

virtual void casa::BaseColumn::allocIterBuf ( void *&  lastVal,
void *&  curVal,
CountedPtr< BaseCompare > &  cmpObj 
) [virtual]

Allocate value buffers for the table iterator.

Also get a comparison object if undefined. The function freeIterBuf must be called to free the buffers.

Reimplemented in casa::RefColumn, casa::ConcatColumn, casa::ScalarColumnData< T >, and casa::ScalarRecordColumnData.

virtual Bool casa::BaseColumn::canAccessArrayColumn ( Bool reask) const [virtual]

Ask if the data manager can handle an array column.

Default is never.

Reimplemented in casa::ConcatColumn, casa::RefColumn, and casa::ArrayColumnData< T >.

virtual Bool casa::BaseColumn::canAccessArrayColumnCells ( Bool reask) const [virtual]

Ask if the data manager can handle a collection of cells in an array column.

Default is never.

Reimplemented in casa::ConcatColumn, casa::RefColumn, and casa::ArrayColumnData< T >.

virtual Bool casa::BaseColumn::canAccessColumnSlice ( Bool reask) const [virtual]

Ask if the data manager can handle a column slice.

Default is never.

Reimplemented in casa::ConcatColumn, casa::RefColumn, and casa::ArrayColumnData< T >.

virtual Bool casa::BaseColumn::canAccessScalarColumn ( Bool reask) const [virtual]

Ask if the data manager can handle a scalar column.

Default is never.

Reimplemented in casa::ConcatColumn, casa::RefColumn, casa::ScalarRecordColumnData, and casa::ScalarColumnData< T >.

virtual Bool casa::BaseColumn::canAccessScalarColumnCells ( Bool reask) const [virtual]

Ask if the data manager can handle a collection of cells in a scalar column.

Default is never.

Reimplemented in casa::ConcatColumn, casa::RefColumn, casa::ScalarRecordColumnData, and casa::ScalarColumnData< T >.

virtual Bool casa::BaseColumn::canAccessSlice ( Bool reask) const [virtual]

Ask if the data manager can handle a cell slice.

Default is never.

Reimplemented in casa::ConcatColumn, casa::RefColumn, and casa::ArrayColumnData< T >.

virtual Bool casa::BaseColumn::canChangeShape ( ) const [virtual]

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

Default is no.

Reimplemented in casa::ConcatColumn, casa::RefColumn, and casa::ArrayColumnData< T >.

virtual ColumnCache& casa::BaseColumn::columnCache ( ) [pure virtual]

Get a pointer to the underlying column cache.

Implemented in casa::RefColumn, casa::ConcatColumn, and casa::PlainColumn.

const ColumnDesc& casa::BaseColumn::columnDesc ( ) const [inline]

Get const access to the column description.

Definition at line 120 of file BaseColumn.h.

References colDesc_p.

virtual void casa::BaseColumn::freeIterBuf ( void *&  lastVal,
void *&  curVal 
) [virtual]

Free the value buffers allocated by allocIterBuf.

Reimplemented in casa::RefColumn, casa::ConcatColumn, casa::ScalarColumnData< T >, and casa::ScalarRecordColumnData.

virtual void casa::BaseColumn::freeSortKey ( const void *&  dataSave) [virtual]

Free storage on the heap allocated by makeSortkey().

The pointer will be set to zero.

Reimplemented in casa::RefColumn, casa::ScalarRecordColumnData, casa::ScalarColumnData< T >, and casa::ConcatScalarColumn< T >.

virtual void casa::BaseColumn::get ( uInt  rownr,
void *  dataPtr 
) const [pure virtual]
virtual void casa::BaseColumn::getArrayColumn ( void *  dataPtr) const [virtual]

Get the array of all array 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.

Reimplemented in casa::ConcatColumn, casa::RefColumn, and casa::ArrayColumnData< T >.

virtual void casa::BaseColumn::getArrayColumnCells ( const RefRows rownrs,
void *  dataPtr 
) const [virtual]

Get the array of some array 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.

Reimplemented in casa::ConcatColumn, casa::RefColumn, and casa::ArrayColumnData< T >.

virtual void casa::BaseColumn::getColumnSlice ( const Slicer ,
void *  dataPtr 
) 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.

Reimplemented in casa::ArrayColumnData< T >, casa::ConcatColumn, and casa::RefColumn.

virtual void casa::BaseColumn::getColumnSliceCells ( const RefRows rownrs,
const Slicer ,
void *  dataPtr 
) 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.

Reimplemented in casa::ConcatColumn, casa::RefColumn, and casa::ArrayColumnData< T >.

void casa::BaseColumn::getScalar ( uInt  rownr,
Bool value 
) const

Get the value from the row and convert it to the required type.

This can only be used for scalar columns with a standard data type. Note that an unsigned integer caanot be converted to a signed integer with the same length. So only Int64 can handle all integer values.

Referenced by casa::TableColumn::getScalar(), and casa::TableColumn::getScalarValue().

void casa::BaseColumn::getScalar ( uInt  rownr,
uChar value 
) const
void casa::BaseColumn::getScalar ( uInt  rownr,
Short value 
) const
void casa::BaseColumn::getScalar ( uInt  rownr,
uShort value 
) const
void casa::BaseColumn::getScalar ( uInt  rownr,
Int value 
) const
void casa::BaseColumn::getScalar ( uInt  rownr,
uInt value 
) const
void casa::BaseColumn::getScalar ( uInt  rownr,
Int64 value 
) const
void casa::BaseColumn::getScalar ( uInt  rownr,
float &  value 
) const
void casa::BaseColumn::getScalar ( uInt  rownr,
double &  value 
) const
void casa::BaseColumn::getScalar ( uInt  rownr,
Complex &  value 
) const
void casa::BaseColumn::getScalar ( uInt  rownr,
DComplex &  value 
) const
void casa::BaseColumn::getScalar ( uInt  rownr,
String value 
) const
void casa::BaseColumn::getScalar ( uInt  rownr,
TableRecord value 
) const
void casa::BaseColumn::getScalar ( uInt  rownr,
void *  value,
const String dataTypeId 
) const

Get a scalar for the other data types.

The given data type id must match the data type id of this column.

virtual void casa::BaseColumn::getScalarColumn ( void *  dataPtr) const [virtual]

Get the vector of all scalar values in a column.

Reimplemented in casa::RefColumn, casa::ScalarRecordColumnData, casa::ScalarColumnData< T >, and casa::ConcatScalarColumn< T >.

virtual void casa::BaseColumn::getScalarColumnCells ( const RefRows rownrs,
void *  dataPtr 
) const [virtual]

Get the vector of some scalar values in a column.

Reimplemented in casa::RefColumn, casa::ScalarRecordColumnData, casa::ScalarColumnData< T >, and casa::ConcatScalarColumn< T >.

virtual void casa::BaseColumn::getSlice ( uInt  rownr,
const Slicer ,
void *  dataPtr 
) const [virtual]

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

Reimplemented in casa::ConcatColumn, casa::RefColumn, and casa::ArrayColumnData< T >.

virtual void casa::BaseColumn::initialize ( uInt  startRownr,
uInt  endRownr 
) [pure virtual]

Initialize the rows from startRow till endRow (inclusive) with the default value defined in the column description.

Implemented in casa::ConcatColumn, casa::RefColumn, casa::ArrayColumnData< T >, casa::ScalarRecordColumnData, and casa::ScalarColumnData< T >.

virtual Bool casa::BaseColumn::isDefined ( uInt  rownr) const [pure virtual]
virtual Bool casa::BaseColumn::isStored ( ) const [pure virtual]

Test if the column is stored (otherwise it is virtual).

Implemented in casa::ConcatColumn, casa::RefColumn, and casa::PlainColumn.

virtual Bool casa::BaseColumn::isWritable ( ) const [pure virtual]

Test if the column is writable.

Implemented in casa::ConcatColumn, casa::RefColumn, and casa::PlainColumn.

virtual TableRecord& casa::BaseColumn::keywordSet ( ) [pure virtual]
virtual void casa::BaseColumn::makeRefSortKey ( Sort ,
CountedPtr< BaseCompare > &  cmpObj,
Int  order,
const Vector< uInt > &  rownrs,
const void *&  dataSave 
) [virtual]

Do it only for the given row numbers.

Reimplemented in casa::ScalarRecordColumnData, casa::ScalarColumnData< T >, and casa::ConcatScalarColumn< T >.

virtual void casa::BaseColumn::makeSortKey ( Sort ,
CountedPtr< BaseCompare > &  cmpObj,
Int  order,
const void *&  dataSave 
) [virtual]

Add this column and its data to the Sort object.

It may allocate some storage on the heap, which will be saved in the argument dataSave. The function freeSortKey must be called to free this storage.

Reimplemented in casa::RefColumn, casa::ScalarColumnData< T >, casa::ScalarRecordColumnData, and casa::ConcatScalarColumn< T >.

virtual uInt casa::BaseColumn::ndim ( uInt  rownr) const [virtual]

Get the #dimensions of an array in a particular cell.

Reimplemented in casa::ArrayColumnData< T >, casa::ConcatColumn, and casa::RefColumn.

Referenced by casa::ArrayColumn< Complex >::ndim(), and casa::TableColumn::ndim().

virtual uInt casa::BaseColumn::ndimColumn ( ) const [virtual]

Get the global #dimensions of an array (ie.

for all rows).

Reimplemented in casa::ArrayColumnData< T >, casa::ConcatColumn, and casa::RefColumn.

Referenced by casa::TableColumn::ndimColumn().

virtual uInt casa::BaseColumn::nrow ( ) const [pure virtual]

Get nr of rows in the column.

Implemented in casa::ConcatColumn, casa::RefColumn, and casa::PlainColumn.

Referenced by casa::TableColumn::nrow().

virtual void casa::BaseColumn::put ( uInt  rownr,
const void *  dataPtr 
) [pure virtual]
virtual void casa::BaseColumn::putArrayColumn ( const void *  dataPtr) [virtual]

Put the array of all array 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.

Reimplemented in casa::RefColumn, casa::ArrayColumnData< T >, and casa::ConcatColumn.

virtual void casa::BaseColumn::putArrayColumnCells ( const RefRows rownrs,
const void *  dataPtr 
) [virtual]

Get the array of some array 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.

Reimplemented in casa::RefColumn, casa::ArrayColumnData< T >, and casa::ConcatColumn.

virtual void casa::BaseColumn::putColumnSlice ( const Slicer ,
const void *  dataPtr 
) [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.

Reimplemented in casa::ArrayColumnData< T >, casa::RefColumn, and casa::ConcatColumn.

virtual void casa::BaseColumn::putColumnSliceCells ( const RefRows rownrs,
const Slicer ,
const void *  dataPtr 
) [virtual]

Put subsections of some 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.

Reimplemented in casa::ArrayColumnData< T >, casa::RefColumn, and casa::ConcatColumn.

void casa::BaseColumn::putScalar ( uInt  rownr,
const Bool value 
)

Put the value into the row and convert it from the given type.

This can only be used for scalar columns with a standard data type.

Referenced by casa::TableColumn::putScalar().

void casa::BaseColumn::putScalar ( uInt  rownr,
const uChar value 
)
void casa::BaseColumn::putScalar ( uInt  rownr,
const Short value 
)
void casa::BaseColumn::putScalar ( uInt  rownr,
const uShort value 
)
void casa::BaseColumn::putScalar ( uInt  rownr,
const Int value 
)
void casa::BaseColumn::putScalar ( uInt  rownr,
const uInt value 
)
void casa::BaseColumn::putScalar ( uInt  rownr,
const float &  value 
)
void casa::BaseColumn::putScalar ( uInt  rownr,
const double &  value 
)
void casa::BaseColumn::putScalar ( uInt  rownr,
const Complex &  value 
)
void casa::BaseColumn::putScalar ( uInt  rownr,
const DComplex &  value 
)
void casa::BaseColumn::putScalar ( uInt  rownr,
const String value 
)
void casa::BaseColumn::putScalar ( uInt  rownr,
const Char value 
) [inline]

Definition at line 290 of file BaseColumn.h.

References putScalar(), and String.

Referenced by putScalar().

void casa::BaseColumn::putScalar ( uInt  rownr,
const TableRecord value 
)
virtual void casa::BaseColumn::putScalarColumn ( const void *  dataPtr) [virtual]

Put the vector of all scalar values in the column.

Reimplemented in casa::RefColumn, casa::ScalarRecordColumnData, casa::ScalarColumnData< T >, and casa::ConcatScalarColumn< T >.

virtual void casa::BaseColumn::putScalarColumnCells ( const RefRows rownrs,
const void *  dataPtr 
) [virtual]

Get the vector of some scalar values in a column.

Reimplemented in casa::RefColumn, casa::ScalarRecordColumnData, casa::ScalarColumnData< T >, and casa::ConcatScalarColumn< T >.

virtual void casa::BaseColumn::putSlice ( uInt  rownr,
const Slicer ,
const void *  dataPtr 
) [virtual]

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

Reimplemented in casa::ArrayColumnData< T >, casa::RefColumn, and casa::ConcatColumn.

virtual TableRecord& casa::BaseColumn::rwKeywordSet ( ) [pure virtual]

Get access to the column keyword set.

Implemented in casa::ConcatColumn, casa::RefColumn, and casa::PlainColumn.

virtual void casa::BaseColumn::setMaximumCacheSize ( uInt  nbytes) [pure virtual]

Set the maximum cache size (in bytes) to be used by a storage manager.

Implemented in casa::RefColumn, casa::ConcatColumn, and casa::PlainColumn.

Referenced by casa::TableColumn::setMaximumCacheSize().

virtual void casa::BaseColumn::setShape ( uInt  rownr,
const IPosition shape 
) [virtual]

Set the shape of the array in the given row.

Reimplemented in casa::ArrayColumnData< T >, casa::ConcatColumn, and casa::RefColumn.

virtual void casa::BaseColumn::setShape ( uInt  rownr,
const IPosition shape,
const IPosition tileShape 
) [virtual]

Set the shape and tile shape of the array in the given row.

Reimplemented in casa::ArrayColumnData< T >, casa::ConcatColumn, and casa::RefColumn.

virtual IPosition casa::BaseColumn::shape ( uInt  rownr) const [virtual]

Get the shape of an array in a particular cell.

Reimplemented in casa::ArrayColumnData< T >, casa::ConcatColumn, and casa::RefColumn.

Referenced by casa::ArrayColumn< Complex >::shape(), and casa::TableColumn::shape().

virtual IPosition casa::BaseColumn::shapeColumn ( ) const [virtual]

Get the global shape of an array (ie.

for all rows).

Reimplemented in casa::ArrayColumnData< T >, casa::ConcatColumn, and casa::RefColumn.

Referenced by casa::TableColumn::shapeColumn().

void casa::BaseColumn::throwGetScalar ( ) const [protected]

Throw exceptions for invalid scalar get or put.

void casa::BaseColumn::throwGetType ( const String type) const [protected]
void casa::BaseColumn::throwPutScalar ( ) const [protected]
void casa::BaseColumn::throwPutType ( const String type) const [protected]

Member Data Documentation

Definition at line 340 of file BaseColumn.h.

Referenced by columnDesc().

      

Definition at line 337 of file BaseColumn.h.


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