Column in the Memory table storage manager class. More...
#include <MSMColumn.h>
Public Member Functions | |
MSMColumn (MSMBase *smptr, int dataType, Bool byPtr) | |
Create a column of the given type. | |
virtual | ~MSMColumn () |
Frees up the storage. | |
void | getBoolV (uInt rownr, Bool *dataPtr) |
Get a scalar value in the given row. | |
void | getuCharV (uInt rownr, uChar *dataPtr) |
void | getShortV (uInt rownr, Short *dataPtr) |
void | getuShortV (uInt rownr, uShort *dataPtr) |
void | getIntV (uInt rownr, Int *dataPtr) |
void | getuIntV (uInt rownr, uInt *dataPtr) |
void | getfloatV (uInt rownr, float *dataPtr) |
void | getdoubleV (uInt rownr, double *dataPtr) |
void | getComplexV (uInt rownr, Complex *dataPtr) |
void | getDComplexV (uInt rownr, DComplex *dataPtr) |
void | getStringV (uInt rownr, String *dataPtr) |
void | putBoolV (uInt rownr, const Bool *dataPtr) |
Put a scalar value into the given row. | |
void | putuCharV (uInt rownr, const uChar *dataPtr) |
void | putShortV (uInt rownr, const Short *dataPtr) |
void | putuShortV (uInt rownr, const uShort *dataPtr) |
void | putIntV (uInt rownr, const Int *dataPtr) |
void | putuIntV (uInt rownr, const uInt *dataPtr) |
void | putfloatV (uInt rownr, const float *dataPtr) |
void | putdoubleV (uInt rownr, const double *dataPtr) |
void | putComplexV (uInt rownr, const Complex *dataPtr) |
void | putDComplexV (uInt rownr, const DComplex *dataPtr) |
void | putStringV (uInt rownr, const String *dataPtr) |
uInt | getBlockBoolV (uInt rownr, uInt nrmax, Bool *dataPtr) |
Get scalars from the given row on with a maximum of nrmax values. | |
uInt | getBlockuCharV (uInt rownr, uInt nrmax, uChar *dataPtr) |
uInt | getBlockShortV (uInt rownr, uInt nrmax, Short *dataPtr) |
uInt | getBlockuShortV (uInt rownr, uInt nrmax, uShort *dataPtr) |
uInt | getBlockIntV (uInt rownr, uInt nrmax, Int *dataPtr) |
uInt | getBlockuIntV (uInt rownr, uInt nrmax, uInt *dataPtr) |
uInt | getBlockfloatV (uInt rownr, uInt nrmax, float *dataPtr) |
uInt | getBlockdoubleV (uInt rownr, uInt nrmax, double *dataPtr) |
uInt | getBlockComplexV (uInt rownr, uInt nrmax, Complex *dataPtr) |
uInt | getBlockDComplexV (uInt rownr, uInt nrmax, DComplex *dataPtr) |
uInt | getBlockStringV (uInt rownr, uInt nrmax, String *dataPtr) |
void | putBlockBoolV (uInt rownr, uInt nrmax, const Bool *dataPtr) |
Put nrmax scalars from the given row on. | |
void | putBlockuCharV (uInt rownr, uInt nrmax, const uChar *dataPtr) |
void | putBlockShortV (uInt rownr, uInt nrmax, const Short *dataPtr) |
void | putBlockuShortV (uInt rownr, uInt nrmax, const uShort *dataPtr) |
void | putBlockIntV (uInt rownr, uInt nrmax, const Int *dataPtr) |
void | putBlockuIntV (uInt rownr, uInt nrmax, const uInt *dataPtr) |
void | putBlockfloatV (uInt rownr, uInt nrmax, const float *dataPtr) |
void | putBlockdoubleV (uInt rownr, uInt nrmax, const double *dataPtr) |
void | putBlockComplexV (uInt rownr, uInt nrmax, const Complex *dataPtr) |
void | putBlockDComplexV (uInt rownr, uInt nrmax, const DComplex *dataPtr) |
void | putBlockStringV (uInt rownr, uInt nrmax, const String *dataPtr) |
virtual void | getScalarColumnCellsBoolV (const RefRows &rownrs, Vector< Bool > *dataPtr) |
Get the scalar values in some cells of the column. | |
virtual void | getScalarColumnCellsuCharV (const RefRows &rownrs, Vector< uChar > *dataPtr) |
virtual void | getScalarColumnCellsShortV (const RefRows &rownrs, Vector< Short > *dataPtr) |
virtual void | getScalarColumnCellsuShortV (const RefRows &rownrs, Vector< uShort > *dataPtr) |
virtual void | getScalarColumnCellsIntV (const RefRows &rownrs, Vector< Int > *dataPtr) |
virtual void | getScalarColumnCellsuIntV (const RefRows &rownrs, Vector< uInt > *dataPtr) |
virtual void | getScalarColumnCellsfloatV (const RefRows &rownrs, Vector< float > *dataPtr) |
virtual void | getScalarColumnCellsdoubleV (const RefRows &rownrs, Vector< double > *dataPtr) |
virtual void | getScalarColumnCellsComplexV (const RefRows &rownrs, Vector< Complex > *dataPtr) |
virtual void | getScalarColumnCellsDComplexV (const RefRows &rownrs, Vector< DComplex > *dataPtr) |
virtual void | getScalarColumnCellsStringV (const RefRows &rownrs, Vector< String > *dataPtr) |
virtual void | addRow (uInt newNrrow, uInt oldNrrow) |
Add (newNrrow-oldNrrow) rows to the column. | |
void | resize (uInt nrval) |
Resize the data blocks. | |
virtual void | remove (uInt rownr) |
Remove the given row. | |
virtual void | doCreate (uInt nrrow) |
Create the number of rows in a new table. | |
virtual Bool | ok () const |
Check if the class invariants still hold. | |
Protected Member Functions | |
uInt | findExt (uInt rownr, Bool setCache) |
Find the extension in which the row number is. | |
uInt | nextExt (void *&ext, uInt &extnr, uInt nrmax) const |
Get the next extension. | |
void * | allocData (uInt nrval, Bool byPtr) |
Allocate an extension with the data type of the column. | |
void | deleteAll () |
Delete all extensions. | |
void | deleteData (void *datap, Bool byPtr) |
Delete an extension. | |
void | removeData (void *datap, uInt inx, uInt nrvalAfter) |
Remove an entry (i.e. | |
void | initData (void *datap, uInt nrval) |
Initialize the data (after an open). | |
void * | getArrayPtr (uInt rownr) |
Get the pointer for the given row. | |
void | putArrayPtr (uInt rownr, void *dataPtr) |
Put the pointer for the given row. | |
Protected Attributes | |
MSMBase * | stmanPtr_p |
int | dtype_p |
The data type (for caching purposes). | |
Bool | byPtr_p |
The data is indirectly accessed via a pointer (for the derived classes). | |
uInt | nralloc_p |
The number of allocated rows in the column. | |
uInt | nrext_p |
The nr of extensions in use. | |
Block< void * > | data_p |
The assembly of all extensions (actually Block<T*>). | |
Block< uInt > | ncum_p |
The cumulative nr of rows in all extensions. | |
Private Member Functions | |
MSMColumn (const MSMColumn &) | |
Forbid copy constructor. | |
MSMColumn & | operator= (const MSMColumn &) |
Forbid assignment. |
Column in the Memory table storage manager class.
Internal
MSMColumn handles a column for the memory-based storage manager.
MSMColumn is used by MemoryStMan to handle the access to the data in a table column. It is an storage manager based in memory. Thus the data is lost when the table is closed. On reopen it will be initialized to the default column value. It fully supports addition and removal of rows.
MSMColumn serves 2 purposes:
MSMColumn does not hold a column as a consecutive array, because extending the column (i.e. adding rows) proved be too expensive due to the repeated copying involved when creating a table (this method was used by the first version of the table system). Instead it has a number of data blocks (extensions) indexed to by a super block. Accessing a row means finding the appropriate extension via a binary search. Because there is only 1 extension when a table is read back, the overhead in finding a row is small.
MSMColumn handles the standard data types. The class is not templated, but a switch statement is used instead. Templates would cause too many instantiations.
Definition at line 104 of file MSMColumn.h.
Create a column of the given type.
It will maintain a pointer to its parent storage manager.
virtual casacore::MSMColumn::~MSMColumn | ( | ) | [virtual] |
Frees up the storage.
casacore::MSMColumn::MSMColumn | ( | const MSMColumn & | ) | [private] |
Forbid copy constructor.
Add (newNrrow-oldNrrow) rows to the column.
Reimplemented in casacore::MSMDirColumn.
Allocate an extension with the data type of the column.
void casacore::MSMColumn::deleteAll | ( | ) | [protected] |
Delete all extensions.
Possible underlying data (as used by StManArrayColumnMemory) will not be deleted and should have been deleted beforehand.
void casacore::MSMColumn::deleteData | ( | void * | datap, | |
Bool | byPtr | |||
) | [protected] |
Delete an extension.
virtual void casacore::MSMColumn::doCreate | ( | uInt | nrrow | ) | [virtual] |
Create the number of rows in a new table.
This is used when a table gets created or opened.
Reimplemented in casacore::MSMDirColumn.
Find the extension in which the row number is.
If the flag is true, it also sets the columnCache object.
void* casacore::MSMColumn::getArrayPtr | ( | uInt | rownr | ) | [protected] |
Get the pointer for the given row.
This is for the derived classes like StManArrayColumnMemory.
Get scalars from the given row on with a maximum of nrmax values.
This can be used to get an entire column of scalars or to get a part of a column (for a cache for example). The buffer pointed to by dataPtr has to have the correct length (which is guaranteed by the ScalarColumn get function).
Reimplemented from casacore::StManColumn.
Reimplemented from casacore::StManColumn.
uInt casacore::MSMColumn::getBlockDComplexV | ( | uInt | rownr, | |
uInt | nrmax, | |||
DComplex * | dataPtr | |||
) | [virtual] |
Reimplemented from casacore::StManColumn.
Reimplemented from casacore::StManColumn.
Reimplemented from casacore::StManColumn.
Reimplemented from casacore::StManColumn.
Reimplemented from casacore::StManColumn.
Reimplemented from casacore::StManColumn.
Reimplemented from casacore::StManColumn.
Reimplemented from casacore::StManColumn.
Reimplemented from casacore::StManColumn.
Get a scalar value in the given row.
The buffer pointed to by dataPtr has to have the correct length (which is guaranteed by the Scalar/ArrayColumn get function).
Reimplemented from casacore::DataManagerColumn.
void casacore::MSMColumn::getComplexV | ( | uInt | rownr, | |
Complex * | dataPtr | |||
) | [virtual] |
Reimplemented from casacore::DataManagerColumn.
void casacore::MSMColumn::getDComplexV | ( | uInt | rownr, | |
DComplex * | dataPtr | |||
) | [virtual] |
Reimplemented from casacore::DataManagerColumn.
void casacore::MSMColumn::getdoubleV | ( | uInt | rownr, | |
double * | dataPtr | |||
) | [virtual] |
Reimplemented from casacore::DataManagerColumn.
void casacore::MSMColumn::getfloatV | ( | uInt | rownr, | |
float * | dataPtr | |||
) | [virtual] |
Reimplemented from casacore::DataManagerColumn.
Reimplemented from casacore::DataManagerColumn.
virtual void casacore::MSMColumn::getScalarColumnCellsBoolV | ( | const RefRows & | rownrs, | |
Vector< Bool > * | dataPtr | |||
) | [virtual] |
Get the scalar values in some cells of the column.
The buffer pointed to by dataPtr has to have the correct length. (which is guaranteed by the ScalarColumn getColumnCells function). The default implementation loops through all rows.
Reimplemented from casacore::StManColumn.
virtual void casacore::MSMColumn::getScalarColumnCellsComplexV | ( | const RefRows & | rownrs, | |
Vector< Complex > * | dataPtr | |||
) | [virtual] |
Reimplemented from casacore::StManColumn.
virtual void casacore::MSMColumn::getScalarColumnCellsDComplexV | ( | const RefRows & | rownrs, | |
Vector< DComplex > * | dataPtr | |||
) | [virtual] |
Reimplemented from casacore::StManColumn.
virtual void casacore::MSMColumn::getScalarColumnCellsdoubleV | ( | const RefRows & | rownrs, | |
Vector< double > * | dataPtr | |||
) | [virtual] |
Reimplemented from casacore::StManColumn.
virtual void casacore::MSMColumn::getScalarColumnCellsfloatV | ( | const RefRows & | rownrs, | |
Vector< float > * | dataPtr | |||
) | [virtual] |
Reimplemented from casacore::StManColumn.
virtual void casacore::MSMColumn::getScalarColumnCellsIntV | ( | const RefRows & | rownrs, | |
Vector< Int > * | dataPtr | |||
) | [virtual] |
Reimplemented from casacore::StManColumn.
virtual void casacore::MSMColumn::getScalarColumnCellsShortV | ( | const RefRows & | rownrs, | |
Vector< Short > * | dataPtr | |||
) | [virtual] |
Reimplemented from casacore::StManColumn.
virtual void casacore::MSMColumn::getScalarColumnCellsStringV | ( | const RefRows & | rownrs, | |
Vector< String > * | dataPtr | |||
) | [virtual] |
Reimplemented from casacore::StManColumn.
virtual void casacore::MSMColumn::getScalarColumnCellsuCharV | ( | const RefRows & | rownrs, | |
Vector< uChar > * | dataPtr | |||
) | [virtual] |
Reimplemented from casacore::StManColumn.
virtual void casacore::MSMColumn::getScalarColumnCellsuIntV | ( | const RefRows & | rownrs, | |
Vector< uInt > * | dataPtr | |||
) | [virtual] |
Reimplemented from casacore::StManColumn.
virtual void casacore::MSMColumn::getScalarColumnCellsuShortV | ( | const RefRows & | rownrs, | |
Vector< uShort > * | dataPtr | |||
) | [virtual] |
Reimplemented from casacore::StManColumn.
Reimplemented from casacore::DataManagerColumn.
Reimplemented from casacore::DataManagerColumn.
Reimplemented from casacore::DataManagerColumn.
Reimplemented from casacore::DataManagerColumn.
Reimplemented from casacore::DataManagerColumn.
void casacore::MSMColumn::initData | ( | void * | datap, | |
uInt | nrval | |||
) | [protected] |
Initialize the data (after an open).
Get the next extension.
For the first iteration extnr should be zero. It returns the number of values in it until the maximum is reached. Zero means no more extensions.
virtual Bool casacore::MSMColumn::ok | ( | ) | const [virtual] |
Check if the class invariants still hold.
Reimplemented in casacore::MSMDirColumn.
Forbid assignment.
Reimplemented from casacore::StManColumn.
Reimplemented in casacore::MSMDirColumn, and casacore::MSMIndColumn.
void casacore::MSMColumn::putArrayPtr | ( | uInt | rownr, | |
void * | dataPtr | |||
) | [protected] |
Put the pointer for the given row.
This is for the derived classes like StManArrayColumnMemory.
Put nrmax scalars from the given row on.
This can be used to put an entire column of scalars or to put a part of a column (for a cache for example). The buffer pointed to by dataPtr has to have the correct length (which is guaranteed by the ScalarColumn put function).
Reimplemented from casacore::StManColumn.
void casacore::MSMColumn::putBlockComplexV | ( | uInt | rownr, | |
uInt | nrmax, | |||
const Complex * | dataPtr | |||
) | [virtual] |
Reimplemented from casacore::StManColumn.
void casacore::MSMColumn::putBlockDComplexV | ( | uInt | rownr, | |
uInt | nrmax, | |||
const DComplex * | dataPtr | |||
) | [virtual] |
Reimplemented from casacore::StManColumn.
void casacore::MSMColumn::putBlockdoubleV | ( | uInt | rownr, | |
uInt | nrmax, | |||
const double * | dataPtr | |||
) | [virtual] |
Reimplemented from casacore::StManColumn.
void casacore::MSMColumn::putBlockfloatV | ( | uInt | rownr, | |
uInt | nrmax, | |||
const float * | dataPtr | |||
) | [virtual] |
Reimplemented from casacore::StManColumn.
Reimplemented from casacore::StManColumn.
void casacore::MSMColumn::putBlockShortV | ( | uInt | rownr, | |
uInt | nrmax, | |||
const Short * | dataPtr | |||
) | [virtual] |
Reimplemented from casacore::StManColumn.
void casacore::MSMColumn::putBlockStringV | ( | uInt | rownr, | |
uInt | nrmax, | |||
const String * | dataPtr | |||
) | [virtual] |
Reimplemented from casacore::StManColumn.
void casacore::MSMColumn::putBlockuCharV | ( | uInt | rownr, | |
uInt | nrmax, | |||
const uChar * | dataPtr | |||
) | [virtual] |
Reimplemented from casacore::StManColumn.
Reimplemented from casacore::StManColumn.
void casacore::MSMColumn::putBlockuShortV | ( | uInt | rownr, | |
uInt | nrmax, | |||
const uShort * | dataPtr | |||
) | [virtual] |
Reimplemented from casacore::StManColumn.
Put a scalar value into the given row.
The buffer pointed to by dataPtr has to have the correct length (which is guaranteed by the Scalar/ArrayColumn put function).
Reimplemented from casacore::DataManagerColumn.
void casacore::MSMColumn::putComplexV | ( | uInt | rownr, | |
const Complex * | dataPtr | |||
) | [virtual] |
Reimplemented from casacore::DataManagerColumn.
void casacore::MSMColumn::putDComplexV | ( | uInt | rownr, | |
const DComplex * | dataPtr | |||
) | [virtual] |
Reimplemented from casacore::DataManagerColumn.
void casacore::MSMColumn::putdoubleV | ( | uInt | rownr, | |
const double * | dataPtr | |||
) | [virtual] |
Reimplemented from casacore::DataManagerColumn.
void casacore::MSMColumn::putfloatV | ( | uInt | rownr, | |
const float * | dataPtr | |||
) | [virtual] |
Reimplemented from casacore::DataManagerColumn.
Reimplemented from casacore::DataManagerColumn.
Reimplemented from casacore::DataManagerColumn.
Reimplemented from casacore::DataManagerColumn.
Reimplemented from casacore::DataManagerColumn.
Reimplemented from casacore::DataManagerColumn.
Reimplemented from casacore::DataManagerColumn.
virtual void casacore::MSMColumn::remove | ( | uInt | rownr | ) | [virtual] |
Remove the given row.
If no rows remain in the extension, the extension is also removed.
Reimplemented in casacore::MSMDirColumn, and casacore::MSMIndColumn.
Remove an entry (i.e.
a row) from an extension at the given index. It will do this by shifting the rest (nrvalAfter elements) one position to the left.
void casacore::MSMColumn::resize | ( | uInt | nrval | ) |
Resize the data blocks.
This adds an extension when needed.
Bool casacore::MSMColumn::byPtr_p [protected] |
The data is indirectly accessed via a pointer (for the derived classes).
Definition at line 238 of file MSMColumn.h.
Block<void*> casacore::MSMColumn::data_p [protected] |
The assembly of all extensions (actually Block<T*>).
Definition at line 244 of file MSMColumn.h.
int casacore::MSMColumn::dtype_p [protected] |
The data type (for caching purposes).
Reimplemented from casacore::StManColumn.
Definition at line 236 of file MSMColumn.h.
Block<uInt> casacore::MSMColumn::ncum_p [protected] |
The cumulative nr of rows in all extensions.
Definition at line 246 of file MSMColumn.h.
uInt casacore::MSMColumn::nralloc_p [protected] |
The number of allocated rows in the column.
Definition at line 240 of file MSMColumn.h.
uInt casacore::MSMColumn::nrext_p [protected] |
The nr of extensions in use.
Definition at line 242 of file MSMColumn.h.
MSMBase* casacore::MSMColumn::stmanPtr_p [protected] |
Definition at line 234 of file MSMColumn.h.