RefColumn.h

Classes

RefColumn -- A column in a reference table (full description)

class RefColumn : public BaseColumn

Interface

Public Members
RefColumn (const BaseColumnDesc*, RefTable*, BaseColumn* referencedColumn)
~RefColumn()
virtual Bool isWritable() const
virtual Bool isStored() const
virtual TableRecord& rwKeywordSet()
virtual TableRecord& keywordSet()
virtual uInt nrow() const
virtual Bool isDefined (uInt rownr) const
virtual void setShape (uInt rownr, const IPosition& shape)
virtual void setShape (uInt rownr, const IPosition& shape, const IPosition& tileShape)
virtual uInt ndimColumn() const
virtual IPosition shapeColumn() const
virtual uInt ndim (uInt rownr) const
virtual IPosition shape (uInt rownr) const
virtual Bool canChangeShape() const
virtual Bool canAccessScalarColumn (Bool& reask) const
virtual Bool canAccessArrayColumn (Bool& reask) const
virtual Bool canAccessSlice (Bool& reask) const
virtual Bool canAccessColumnSlice (Bool& reask) const
virtual Bool canAccessScalarColumnCells (Bool& reask) const
virtual Bool canAccessArrayColumnCells (Bool& reask) const
void initialize (uInt startRownr, uInt endRownr)
virtual void get (uInt rownr, void* dataPtr) const
virtual void getSlice (uInt rownr, const Slicer&, void* dataPtr) const
virtual void getScalarColumn (void* dataPtr) const
virtual void getArrayColumn (void* dataPtr) const
virtual void getColumnSlice (const Slicer&, void* dataPtr) const
virtual void getScalarColumnCells (const RefRows& rownrs, void* dataPtr) const
virtual void getArrayColumnCells (const RefRows& rownrs, void* dataPtr) const
virtual void getColumnSliceCells (const RefRows& rownrs, const Slicer&, void* dataPtr) const
virtual void put (uInt rownr, const void* dataPtr)
virtual void putSlice (uInt rownr, const Slicer&, const void* dataPtr)
virtual void putScalarColumn (const void* dataPtr)
virtual void putArrayColumn (const void* dataPtr)
virtual void putColumnSlice (const Slicer&, const void* dataPtr)
virtual void putScalarColumnCells (const RefRows& rownrs, const void* dataPtr)
virtual void putArrayColumnCells (const RefRows& rownrs, const void* dataPtr)
virtual void putColumnSliceCells (const RefRows& rownrs, const Slicer&, const void* dataPtr)
virtual ColumnCache& columnCache()
virtual void setMaximumCacheSize (uInt nbytes)
virtual void makeSortKey (Sort&, ObjCompareFunc* cmpFunc, Int order, const void*& dataSave)
virtual void freeSortKey (const void*& dataSave)
virtual void allocIterBuf (void*& lastVal, void*& curVal, ObjCompareFunc*& cmpFunc)
virtual void freeIterBuf (void*& lastVal, void*& curVal)

Description

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

Member Description

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.

~RefColumn()

virtual Bool isWritable() const

Test if the column is writable in the parent table.

virtual Bool isStored() const

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

virtual TableRecord& rwKeywordSet()
virtual TableRecord& keywordSet()

Get access to the column keyword set. This is the keyword set in the referenced column.

virtual uInt nrow() const

Get nr of rows in the column.

virtual Bool isDefined (uInt rownr) const

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

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 (i.e. for all rows).

virtual IPosition shapeColumn() const

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

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

It can change shape if the underlying column can.

virtual Bool canAccessScalarColumn (Bool& reask) const

It can handle a scalar column if the underlying column can handle cells in a scalar column.

virtual Bool canAccessArrayColumn (Bool& reask) const

It can handle an array column if the underlying column can handle cells in an array column.

virtual Bool canAccessSlice (Bool& reask) const

It can handle a cell slice if the underlying column can do it.

virtual Bool canAccessColumnSlice (Bool& reask) const

It can handle a column slice if the underlying column can handle a collection of cells in a column and a column slice.

virtual Bool canAccessScalarColumnCells (Bool& reask) const

It can handle cells in a scalar column if the underlying column can do it.

virtual Bool canAccessArrayColumnCells (Bool& reask) const

It can handle cells in an array column if the underlying column can do it.

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

virtual void get (uInt rownr, void* dataPtr) const

Get the value from a particular cell. This can be a scalar or an array.

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

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

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

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

virtual void put (uInt rownr, const void* dataPtr)

Put the value in a particular cell. This can be a scalar or an array.

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

virtual void putColumnSlice (const Slicer&, const void* dataPtr)

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.

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

virtual void putColumnSliceCells (const RefRows& rownrs, const Slicer&, const void* dataPtr)

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.

virtual ColumnCache& columnCache()

Get the underlying column cache.

virtual void setMaximumCacheSize (uInt nbytes)

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

virtual void makeSortKey (Sort&, ObjCompareFunc* cmpFunc, Int order, const void*& dataSave)

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.

virtual void freeSortKey (const void*& dataSave)

Free storage on the heap allocated by makeSortkey(). The pointer will be set to zero.

virtual void allocIterBuf (void*& lastVal, void*& curVal, ObjCompareFunc*& cmpFunc)

Allocate value buffers for the table iterator. Also get a comparison functiuon if undefined. The function freeIterBuf must be called to free the buffers.

virtual void freeIterBuf (void*& lastVal, void*& curVal)

Free the value buffers allocated by allocIterBuf.