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

Access to a table column containing scalar records. More...

#include <ScaRecordColData.h>

Inheritance diagram for casa::ScalarRecordColumnData:
casa::PlainColumn casa::BaseColumn

List of all members.

Public Member Functions

 ScalarRecordColumnData (const ScalarRecordColumnDesc *, ColumnSet *)
 Construct a scalar column object from the given description in the given column set.
 ~ScalarRecordColumnData ()
virtual Bool canAccessScalarColumn (Bool &reask) const
 Ask if the data manager can handle a column.
virtual Bool canAccessScalarColumnCells (Bool &reask) const
 Ask if the data manager can handle some cells in a column.
virtual void initialize (uInt startRownr, uInt endRownr)
 Initialize the rows from startRownr till endRownr (inclusive) with the default value defined in the column description.
virtual Bool isDefined (uInt rownr) const
 Test if the given cell contains a defined value.
virtual void get (uInt rownr, void *) const
 Get the value from a particular cell.
virtual void getScalarColumn (void *dataPtr) const
 Get the array of all values in the column.
virtual void getScalarColumnCells (const RefRows &rownrs, void *dataPtr) const
 Get the array of some values in the column (on behalf of RefColumn).
virtual void put (uInt rownr, const void *dataPtr)
 Put the value in a particular cell.
virtual void putScalarColumn (const void *dataPtr)
 Put the array of all values in the column.
virtual void putScalarColumnCells (const RefRows &rownrs, const void *dataPtr)
 Put the array of some values in the column (on behalf on RefColumn).
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.
virtual void createDataManagerColumn ()
 Create a data manager column object for this column.

Private Member Functions

 ScalarRecordColumnData (const ScalarRecordColumnData &)
 Copy constructor cannot be used.
ScalarRecordColumnDataoperator= (const ScalarRecordColumnData &)
 Assignment cannot be used.
virtual void putFileDerived (AipsIO &)
 Write the column data.
virtual void getFileDerived (AipsIO &, const ColumnSet &)
 Read the column data back.
void getRecord (uInt rownr, TableRecord &rec) const
 Handle getting and putting a record.
void putRecord (uInt rownr, const TableRecord &rec)

Private Attributes

const ScalarRecordColumnDescscaDescPtr_p
 Pointer to column description.

Detailed Description

Access to a table column containing scalar records.

Intended use:

Internal

Review Status

Reviewed By:
Wim Brouw
Date Reviewed:
1998/12/09
Test programs:
tRecordColumn

Prerequisite

Etymology

ScalarRecordColumnData represents a table column containing scalars.

Synopsis

The class ScalarRecordColumnData is derived from PlainColumn. It implements the virtual functions accessing a table column containing scalars holding records.
It is possible to access an scalar in an individual cell (i.e. table row) or in the entire column.

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 ScalarColumn. If used directly by other Table classes, it should be done with care. It assumes that the arrays in the various get and put functions have the correct length. ScalarColumn does that check.

To Do

Definition at line 96 of file ScaRecordColData.h.


Constructor & Destructor Documentation

Construct a scalar column object from the given description in the given column set.

This constructor is used by ScalarRecordColumnDesc::makeColumn.

Copy constructor cannot be used.


Member Function Documentation

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

Allocate value buffers for the table iterator.

Iteration based on records is not supported, so an exception is thrown.

Reimplemented from casa::BaseColumn.

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

Ask if the data manager can handle a column.

Reimplemented from casa::BaseColumn.

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

Reimplemented from casa::BaseColumn.

Create a data manager column object for this column.

Implements casa::PlainColumn.

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

Free the value buffers allocated by allocIterBuf.

Reimplemented from casa::BaseColumn.

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

Free storage on the heap allocated by makeSortkey().

The pointer will be set to zero.

Reimplemented from casa::BaseColumn.

virtual void casa::ScalarRecordColumnData::get ( uInt  rownr,
void *   
) const [virtual]

Get the value from a particular cell.

Implements casa::BaseColumn.

virtual void casa::ScalarRecordColumnData::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.

void casa::ScalarRecordColumnData::getRecord ( uInt  rownr,
TableRecord rec 
) const [private]

Handle getting and putting a record.

It is stored as a Vector of uChar.

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

Get the array of all values in the column.

The length of the buffer pointed to by dataPtr must match the actual length. This is checked by ScalarColumn.

Reimplemented from casa::BaseColumn.

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

Get the array of some values in the column (on behalf of RefColumn).

The length of the buffer pointed to by dataPtr must match the actual length. This is checked by ScalarColumn.

Reimplemented from casa::BaseColumn.

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

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

Implements casa::BaseColumn.

virtual Bool casa::ScalarRecordColumnData::isDefined ( uInt  rownr) const [virtual]

Test if the given cell contains a defined value.

Implements casa::BaseColumn.

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

Do it only for the given row numbers.

Reimplemented from casa::BaseColumn.

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

Add this column and its data to the Sort object.

Sorting on records is not supported, so an exception is thrown.

Reimplemented from casa::BaseColumn.

ScalarRecordColumnData& casa::ScalarRecordColumnData::operator= ( const ScalarRecordColumnData ) [private]

Assignment cannot be used.

virtual void casa::ScalarRecordColumnData::put ( uInt  rownr,
const void *  dataPtr 
) [virtual]

Put the value in a particular cell.

The length of the buffer pointed to by dataPtr must match the actual length. This is checked by ScalarColumn.

Implements casa::BaseColumn.

virtual void casa::ScalarRecordColumnData::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.

void casa::ScalarRecordColumnData::putRecord ( uInt  rownr,
const TableRecord rec 
) [private]
virtual void casa::ScalarRecordColumnData::putScalarColumn ( const void *  dataPtr) [virtual]

Put the array of all values in the column.

The length of the buffer pointed to by dataPtr must match the actual length. This is checked by ScalarColumn.

Reimplemented from casa::BaseColumn.

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

Put the array of some values in the column (on behalf on RefColumn).

The length of the buffer pointed to by dataPtr must match the actual length. This is checked by ScalarColumn.

Reimplemented from casa::BaseColumn.


Member Data Documentation

Pointer to column description.

Definition at line 181 of file ScaRecordColData.h.


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