casa
$Rev:20696$
|
Access to a table column containing scalars. More...
#include <ScaColData.h>
Public Member Functions | |
ScalarColumnData (const ScalarColumnDesc< T > *, ColumnSet *) | |
Construct a scalar column object from the given description in the given column set. | |
~ScalarColumnData () | |
Bool | canAccessScalarColumn (Bool &reask) const |
Ask if the data manager can handle a column. | |
Bool | canAccessScalarColumnCells (Bool &reask) const |
Ask if the data manager can handle some cells in a column. | |
void | initialize (uInt startRownr, uInt endRownr) |
Initialize the rows from startRownr till endRownr (inclusive) with the default value defined in the column description. | |
Bool | isDefined (uInt rownr) const |
Test if the given cell contains a defined value. | |
void | get (uInt rownr, void *) const |
Get the value from a particular cell. | |
void | getScalarColumn (void *dataPtr) const |
Get the array of all values in the column. | |
void | getScalarColumnCells (const RefRows &rownrs, void *dataPtr) const |
Get the array of some values in the column (on behalf of RefColumn). | |
void | put (uInt rownr, const void *dataPtr) |
Put the value in a particular cell. | |
void | putScalarColumn (const void *dataPtr) |
Put the array of all values in the column. | |
void | putScalarColumnCells (const RefRows &rownrs, const void *dataPtr) |
Put the array of some values in the column (on behalf on RefColumn). | |
void | makeSortKey (Sort &, CountedPtr< BaseCompare > &cmpFunc, Int order, const void *&dataSave) |
Add this column and its data to the Sort object. | |
void | makeRefSortKey (Sort &, CountedPtr< BaseCompare > &cmpFunc, Int order, const Vector< uInt > &rownrs, const void *&dataSave) |
Do it only for the given row numbers. | |
void | freeSortKey (const void *&dataSave) |
Free storage on the heap allocated by makeSortkey(). | |
void | allocIterBuf (void *&lastVal, void *&curVal, CountedPtr< BaseCompare > &cmpObj) |
Allocate value buffers for the table iterator. | |
void | freeIterBuf (void *&lastVal, void *&curVal) |
Free the value buffers allocated by allocIterBuf. | |
void | createDataManagerColumn () |
Create a data manager column object for this column. | |
Private Member Functions | |
ScalarColumnData (const ScalarColumnData< T > &) | |
Copy constructor cannot be used. | |
ScalarColumnData< T > & | operator= (const ScalarColumnData< T > &) |
Assignment cannot be used. | |
void | putFileDerived (AipsIO &) |
Write the column data. | |
void | getFileDerived (AipsIO &, const ColumnSet &) |
Read the column data back. | |
void | fillSortKey (const Vector< T > *dataPtr, Sort &, CountedPtr< BaseCompare > &cmpObj, Int order) |
Fill in the sort key on behalf of the Table sort function. | |
Private Attributes | |
const ScalarColumnDesc< T > * | scaDescPtr_p |
Pointer to column description. | |
Bool | undefFlag_p |
Undefined value can exist? | |
T | undefVal_p |
Undefined value. |
Access to a table column containing scalars.
Internal
ScalarColumnData represents a table column containing scalars.
The class ScalarColumnData is derived from PlainColumn. It implements the virtual functions accessing a table column containing scalars with an arbitrary data type.
It is possible to access an scalar 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. It used directly, 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.
Definition at line 95 of file ScaColData.h.
casa::ScalarColumnData< T >::ScalarColumnData | ( | const ScalarColumnDesc< T > * | , |
ColumnSet * | |||
) |
Construct a scalar column object from the given description in the given column set.
This constructor is used by ScalarColumnDesc::makeColumn.
casa::ScalarColumnData< T >::~ScalarColumnData | ( | ) |
casa::ScalarColumnData< T >::ScalarColumnData | ( | const ScalarColumnData< T > & | ) | [private] |
Copy constructor cannot be used.
void casa::ScalarColumnData< T >::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 from casa::BaseColumn.
Bool casa::ScalarColumnData< T >::canAccessScalarColumn | ( | Bool & | reask | ) | const [virtual] |
Ask if the data manager can handle a column.
Reimplemented from casa::BaseColumn.
Bool casa::ScalarColumnData< T >::canAccessScalarColumnCells | ( | Bool & | reask | ) | const [virtual] |
Ask if the data manager can handle some cells in a column.
Reimplemented from casa::BaseColumn.
void casa::ScalarColumnData< T >::createDataManagerColumn | ( | ) | [virtual] |
Create a data manager column object for this column.
Implements casa::PlainColumn.
void casa::ScalarColumnData< T >::fillSortKey | ( | const Vector< T > * | dataPtr, |
Sort & | , | ||
CountedPtr< BaseCompare > & | cmpObj, | ||
Int | order | ||
) | [private] |
Fill in the sort key on behalf of the Table sort function.
The pointer to the data (which can be allocated on the heap) is stored in dataPtr. This is used by freeSortKey to release it. It checks if a compare function is given when needed.
void casa::ScalarColumnData< T >::freeIterBuf | ( | void *& | lastVal, |
void *& | curVal | ||
) | [virtual] |
Free the value buffers allocated by allocIterBuf.
Reimplemented from casa::BaseColumn.
void casa::ScalarColumnData< T >::freeSortKey | ( | const void *& | dataSave | ) | [virtual] |
Free storage on the heap allocated by makeSortkey().
The pointer will be set to zero.
Reimplemented from casa::BaseColumn.
void casa::ScalarColumnData< T >::get | ( | uInt | rownr, |
void * | |||
) | const [virtual] |
Get the value from a particular cell.
Implements casa::BaseColumn.
void casa::ScalarColumnData< T >::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::ScalarColumnData< T >::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.
void casa::ScalarColumnData< T >::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.
void casa::ScalarColumnData< T >::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.
Bool casa::ScalarColumnData< T >::isDefined | ( | uInt | rownr | ) | const [virtual] |
Test if the given cell contains a defined value.
Implements casa::BaseColumn.
void casa::ScalarColumnData< T >::makeRefSortKey | ( | Sort & | , |
CountedPtr< BaseCompare > & | cmpFunc, | ||
Int | order, | ||
const Vector< uInt > & | rownrs, | ||
const void *& | dataSave | ||
) | [virtual] |
Do it only for the given row numbers.
Reimplemented from casa::BaseColumn.
void casa::ScalarColumnData< T >::makeSortKey | ( | Sort & | , |
CountedPtr< BaseCompare > & | cmpFunc, | ||
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 from casa::BaseColumn.
ScalarColumnData<T>& casa::ScalarColumnData< T >::operator= | ( | const ScalarColumnData< T > & | ) | [private] |
Assignment cannot be used.
void casa::ScalarColumnData< T >::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.
void casa::ScalarColumnData< T >::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::ScalarColumnData< T >::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.
void casa::ScalarColumnData< T >::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.
const ScalarColumnDesc<T>* casa::ScalarColumnData< T >::scaDescPtr_p [private] |
Pointer to column description.
Definition at line 181 of file ScaColData.h.
Bool casa::ScalarColumnData< T >::undefFlag_p [private] |
Undefined value can exist?
Definition at line 183 of file ScaColData.h.
T casa::ScalarColumnData< T >::undefVal_p [private] |
Undefined value.
Definition at line 185 of file ScaColData.h.