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

A column in a reference table. More...

#include <RefColumn.h>

Inheritance diagram for casacore::RefColumn:
casacore::BaseColumn

Public Member Functions

 RefColumn (const BaseColumnDesc *, RefTable *, BaseColumn *referencedColumn)
 Construct the RefColumn. More...
 
 ~RefColumn ()
 
virtual Bool isWritable () const
 Test if the column is writable in the parent table. More...
 
virtual Bool isStored () const
 Test if the column is stored (otherwise it is virtual). More...
 
virtual TableRecordrwKeywordSet ()
 Get access to the column keyword set. More...
 
virtual TableRecordkeywordSet ()
 
virtual rownr_t nrow () const
 Get nr of rows in the column. More...
 
virtual Bool isDefined (rownr_t rownr) const
 Test if a value in a particular cell has been defined. More...
 
virtual void setShape (rownr_t rownr, const IPosition &shape)
 Set the shape of the array in the given row. More...
 
virtual void setShape (rownr_t rownr, const IPosition &shape, const IPosition &tileShape)
 Set the shape and tile shape of the array in the given row. More...
 
virtual uInt ndimColumn () const
 Get the global #dimensions of an array (i.e. More...
 
virtual IPosition shapeColumn () const
 Get the global shape of an array (i.e. More...
 
virtual uInt ndim (rownr_t rownr) const
 Get the #dimensions of an array in a particular cell. More...
 
virtual IPosition shape (rownr_t rownr) const
 Get the shape of an array in a particular cell. More...
 
virtual Bool canChangeShape () const
 It can change shape if the underlying column can. 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...
 
virtual void get (rownr_t rownr, void *dataPtr) const
 Get the value from a particular cell. More...
 
virtual void getArray (rownr_t rownr, ArrayBase &dataPtr) const
 Get an array from a particular cell. More...
 
virtual void getSlice (rownr_t rownr, const Slicer &, ArrayBase &dataPtr) const
 Get a slice of an N-dimensional array in a particular cell. More...
 
virtual void getScalarColumn (ArrayBase &dataPtr) const
 Get the vector of all scalar values in a column. More...
 
virtual void getArrayColumn (ArrayBase &dataPtr) const
 Get the array of all array values in a column. More...
 
virtual void getColumnSlice (const Slicer &, ArrayBase &dataPtr) const
 Get subsections from all arrays in the column. More...
 
virtual void getScalarColumnCells (const RefRows &rownrs, ArrayBase &dataPtr) const
 Get the vector of some scalar values in a column. More...
 
virtual void getArrayColumnCells (const RefRows &rownrs, ArrayBase &dataPtr) const
 Get the array of some array values in a column. More...
 
virtual void getColumnSliceCells (const RefRows &rownrs, const Slicer &, ArrayBase &dataPtr) const
 Get subsections from some arrays in the column. More...
 
virtual void put (rownr_t rownr, const void *dataPtr)
 Put the value in a particular cell. More...
 
virtual void putArray (rownr_t rownr, const ArrayBase &dataPtr)
 Put the array value in a particular cell. More...
 
virtual void putSlice (rownr_t rownr, const Slicer &, const ArrayBase &dataPtr)
 Put a slice of an N-dimensional array in a particular cell. More...
 
virtual void putScalarColumn (const ArrayBase &dataPtr)
 Put the vector of all scalar values in the column. More...
 
virtual void putArrayColumn (const ArrayBase &dataPtr)
 Put the array of all array values in the column. More...
 
virtual void putColumnSlice (const Slicer &, const ArrayBase &dataPtr)
 Put into subsections of all table arrays in the column. More...
 
virtual void putScalarColumnCells (const RefRows &rownrs, const ArrayBase &dataPtr)
 Get the vector of some scalar values in a column. More...
 
virtual void putArrayColumnCells (const RefRows &rownrs, const ArrayBase &dataPtr)
 Get the array of some array values in a column. More...
 
virtual void putColumnSliceCells (const RefRows &rownrs, const Slicer &, const ArrayBase &dataPtr)
 Put subsections of some arrays in the column. More...
 
virtual ColumnCachecolumnCache ()
 Get 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...
 
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 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...
 
- 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 IPosition tileShape (rownr_t rownr) const
 Get the tile shape of an array in a particular cell. 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 makeRefSortKey (Sort &, CountedPtr< BaseCompare > &cmpObj, Int order, const Vector< rownr_t > &rownrs, CountedPtr< ArrayBase > &dataSave)
 Do it only for the given row numbers. More...
 

Protected Attributes

RefTablerefTabPtr_p
 
BaseColumncolPtr_p
 
ColumnCache colCache_p
 
- Protected Attributes inherited from casacore::BaseColumn
const BaseColumnDesccolDescPtr_p
 

Additional Inherited Members

- 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
 

Detailed Description

A column in a reference table.

Intended use:

Internal

Review Status

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

Prerequisite

Etymology

RefTable represents a column in a RefTable. A RefTable is a table referencing another table, usually as the result of a select, etc..

Synopsis

RefColumn handles the access of a column in a RefTable. It calls the corresponding function in the referenced column while converting the given row number to the row number in the referenced table.

Motivation

This class is untyped, i.e. not templated. Every call is sent to the underlying referenced BaseColumn which is typed by the virtual function mechanism. A RefColumn can never be used directly. A user always has to construct a typed ArrayColumn or ScalarColumn object to access a column. This means everyting is fully type safe.

To Do

Definition at line 90 of file RefColumn.h.

Constructor & Destructor Documentation

casacore::RefColumn::RefColumn ( const BaseColumnDesc ,
RefTable ,
BaseColumn referencedColumn 
)

Construct the RefColumn.

It will point to the given column description, RefTable and referenced column. The RefTable will be used to convert the rownr to the rownr in the referenced column.

casacore::RefColumn::~RefColumn ( )

Member Function Documentation

virtual void casacore::RefColumn::allocIterBuf ( void *&  lastVal,
void *&  curVal,
CountedPtr< BaseCompare > &  cmpObj 
)
virtual

Allocate value buffers for the table iterator.

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

Reimplemented from casacore::BaseColumn.

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

It can change shape if the underlying column can.

Reimplemented from casacore::BaseColumn.

virtual ColumnCache& casacore::RefColumn::columnCache ( )
virtual

Get the underlying column cache.

Implements casacore::BaseColumn.

virtual void casacore::RefColumn::freeIterBuf ( void *&  lastVal,
void *&  curVal 
)
virtual

Free the value buffers allocated by allocIterBuf.

Reimplemented from casacore::BaseColumn.

virtual void casacore::RefColumn::get ( rownr_t  rownr,
void *  dataPtr 
) const
virtual

Get the value from a particular cell.

This can be a scalar or an array.

Reimplemented from casacore::BaseColumn.

virtual void casacore::RefColumn::getArray ( rownr_t  rownr,
ArrayBase dataPtr 
) const
virtual

Get an array from a particular cell.

Reimplemented from casacore::BaseColumn.

virtual void casacore::RefColumn::getArrayColumn ( ArrayBase 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 from casacore::BaseColumn.

virtual void casacore::RefColumn::getArrayColumnCells ( const RefRows rownrs,
ArrayBase 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 from casacore::BaseColumn.

virtual void casacore::RefColumn::getColumnSlice ( const Slicer ,
ArrayBase 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 from casacore::BaseColumn.

virtual void casacore::RefColumn::getColumnSliceCells ( const RefRows rownrs,
const Slicer ,
ArrayBase 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 from casacore::BaseColumn.

virtual void casacore::RefColumn::getScalarColumn ( ArrayBase dataPtr) const
virtual

Get the vector of all scalar values in a column.

Reimplemented from casacore::BaseColumn.

virtual void casacore::RefColumn::getScalarColumnCells ( const RefRows rownrs,
ArrayBase dataPtr 
) const
virtual

Get the vector of some scalar values in a column.

Reimplemented from casacore::BaseColumn.

virtual void casacore::RefColumn::getSlice ( rownr_t  rownr,
const Slicer ,
ArrayBase dataPtr 
) const
virtual

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

Reimplemented from casacore::BaseColumn.

void casacore::RefColumn::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.

virtual Bool casacore::RefColumn::isDefined ( rownr_t  rownr) const
virtual

Test if a value in a particular cell has been defined.

Implements casacore::BaseColumn.

virtual Bool casacore::RefColumn::isStored ( ) const
virtual

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

Implements casacore::BaseColumn.

virtual Bool casacore::RefColumn::isWritable ( ) const
virtual

Test if the column is writable in the parent table.

Implements casacore::BaseColumn.

virtual TableRecord& casacore::RefColumn::keywordSet ( )
virtual

Implements casacore::BaseColumn.

virtual void casacore::RefColumn::makeSortKey ( Sort ,
CountedPtr< BaseCompare > &  cmpObj,
Int  order,
CountedPtr< ArrayBase > &  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 from casacore::BaseColumn.

virtual uInt casacore::RefColumn::ndim ( rownr_t  rownr) const
virtual

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

Reimplemented from casacore::BaseColumn.

virtual uInt casacore::RefColumn::ndimColumn ( ) const
virtual

Get the global #dimensions of an array (i.e.

for all rows).

Reimplemented from casacore::BaseColumn.

virtual rownr_t casacore::RefColumn::nrow ( ) const
virtual

Get nr of rows in the column.

Implements casacore::BaseColumn.

virtual void casacore::RefColumn::put ( rownr_t  rownr,
const void *  dataPtr 
)
virtual

Put the value in a particular cell.

This can be a scalar or an array.

Reimplemented from casacore::BaseColumn.

virtual void casacore::RefColumn::putArray ( rownr_t  rownr,
const ArrayBase dataPtr 
)
virtual

Put the array value in a particular cell.

Reimplemented from casacore::BaseColumn.

virtual void casacore::RefColumn::putArrayColumn ( const ArrayBase 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 from casacore::BaseColumn.

virtual void casacore::RefColumn::putArrayColumnCells ( const RefRows rownrs,
const ArrayBase 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 from casacore::BaseColumn.

virtual void casacore::RefColumn::putColumnSlice ( const Slicer ,
const ArrayBase 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 from casacore::BaseColumn.

virtual void casacore::RefColumn::putColumnSliceCells ( const RefRows rownrs,
const Slicer ,
const ArrayBase 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 from casacore::BaseColumn.

virtual void casacore::RefColumn::putScalarColumn ( const ArrayBase dataPtr)
virtual

Put the vector of all scalar values in the column.

Reimplemented from casacore::BaseColumn.

virtual void casacore::RefColumn::putScalarColumnCells ( const RefRows rownrs,
const ArrayBase dataPtr 
)
virtual

Get the vector of some scalar values in a column.

Reimplemented from casacore::BaseColumn.

virtual void casacore::RefColumn::putSlice ( rownr_t  rownr,
const Slicer ,
const ArrayBase dataPtr 
)
virtual

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

Reimplemented from casacore::BaseColumn.

virtual TableRecord& casacore::RefColumn::rwKeywordSet ( )
virtual

Get access to the column keyword set.

This is the keyword set in the referenced column.

Implements casacore::BaseColumn.

virtual void casacore::RefColumn::setMaximumCacheSize ( uInt  nbytes)
virtual

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

Implements casacore::BaseColumn.

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

Set the shape of the array in the given row.

Reimplemented from casacore::BaseColumn.

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

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

Reimplemented from casacore::BaseColumn.

virtual IPosition casacore::RefColumn::shape ( rownr_t  rownr) const
virtual

Get the shape of an array in a particular cell.

Reimplemented from casacore::BaseColumn.

virtual IPosition casacore::RefColumn::shapeColumn ( ) const
virtual

Get the global shape of an array (i.e.

for all rows).

Reimplemented from casacore::BaseColumn.

Member Data Documentation

ColumnCache casacore::RefColumn::colCache_p
protected

Definition at line 250 of file RefColumn.h.

BaseColumn* casacore::RefColumn::colPtr_p
protected

Definition at line 249 of file RefColumn.h.

RefTable* casacore::RefColumn::refTabPtr_p
protected

Definition at line 248 of file RefColumn.h.


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