ScaRecordColData.h
Classes
- ScalarRecordColumnData -- Access to a table column containing scalar records. (full description)
Interface
- Public Members
- ScalarRecordColumnData (const ScalarRecordColumnDesc*, ColumnSet*)
- ~ScalarRecordColumnData()
- virtual Bool canAccessScalarColumn (Bool& reask) const
- virtual Bool canAccessScalarColumnCells (Bool& reask) const
- virtual void initialize (uInt startRownr, uInt endRownr)
- virtual Bool isDefined (uInt rownr) const
- virtual void get (uInt rownr, void*) const
- virtual void getScalarColumn (void* dataPtr) const
- virtual void getScalarColumnCells (const RefRows& rownrs, void* dataPtr) const
- virtual void put (uInt rownr, const void* dataPtr)
- virtual void putScalarColumn (const void* dataPtr)
- virtual void putScalarColumnCells (const RefRows& rownrs, const void* dataPtr)
- virtual void makeSortKey (Sort&, ObjCompareFunc* cmpFunc, Int order, const void*& dataSave)
- virtual void makeRefSortKey (Sort&, ObjCompareFunc* cmpFunc, Int order, const Vector<uInt>& rownrs, 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)
- virtual void createDataManagerColumn()
- Private Members
- ScalarRecordColumnData (const ScalarRecordColumnData&)
- ScalarRecordColumnData& operator= (const ScalarRecordColumnData&)
- virtual void putFileDerived (AipsIO&)
- virtual void getFileDerived (AipsIO&, const ColumnSet&)
- void getRecord (uInt rownr, TableRecord& rec) const
- void putRecord (uInt rownr, const TableRecord& rec)
Review Status
- Reviewed By:
- Wim Brouw
- Date Reviewed:
- 1998/12/09
- Programs:
- Tests:
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:
- Binding itself to a data manager.
- Letting the data manager create its column object.
- Closing the data manager column object (in putFileDerived).
- Reconstructing the data manager object for an existing table
(in getFileDerived).
- Transferring get/put calls to the data manager column object.
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
A List of bugs, limitations, extensions or planned refinements.
- Introduce a class ArrayRecordColumnData to support arrays of records.
Member Description
Construct a scalar column object from the given description
in the given column set.
This constructor is used by ScalarRecordColumnDesc::makeColumn.
Ask if the data manager can handle a column.
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.
The length of the buffer pointed to by dataPtr must match
the actual length. This is checked by ScalarColumn.
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.
virtual void put (uInt rownr, const void* dataPtr)
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.
virtual void putScalarColumn (const void* dataPtr)
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.
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.
virtual void makeRefSortKey (Sort&, ObjCompareFunc* cmpFunc, Int order, const Vector<uInt>& rownrs, const void*& dataSave)
Add this column and its data to the Sort object.
Sorting on records is not supported, so an exception is thrown.
Do it only for the given row numbers.
virtual void makeSortKey (Sort&, ObjCompareFunc* cmpFunc, Int order, const void*& dataSave)
Add this column and its data to the Sort object.
Sorting on records is not supported, so an exception is thrown.
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.
Iteration based on records is not supported, so an exception is thrown.
virtual void freeIterBuf (void*& lastVal, void*& curVal)
Free the value buffers allocated by allocIterBuf.
Create a data manager column object for this column.
Copy constructor cannot be used.
ScalarRecordColumnData& operator= (const ScalarRecordColumnData&)
Assignment cannot be used.
Write the column data.
The control information is written into the given AipsIO object,
while the data is written/flushed by the data manager.
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.
Handle getting and putting a record.
It is stored as a Vector of uChar.