28 #ifndef TABLES_ISMCOLUMN_H
29 #define TABLES_ISMCOLUMN_H
33 #include <casacore/casa/aips.h>
34 #include <casacore/tables/DataMan/StManColumnBase.h>
35 #include <casacore/tables/DataMan/ISMBase.h>
36 #include <casacore/casa/Arrays/IPosition.h>
37 #include <casacore/casa/Containers/Block.h>
38 #include <casacore/casa/Utilities/Compare.h>
39 #include <casacore/casa/OS/Conversion.h>
308 const char* data,
uInt lenData,
321 const char* data,
uInt lenData,
332 static size_t fromString (
void* out,
const void* in,
size_t n,
334 static size_t toString (
void* out,
const void* in,
size_t n,
385 return rownr < startRow_p || rownr >
endRow_p;
Non-templated base class for templated Array class.
size_t ValueFunction(void *to, const void *from, size_t nvalues)
Define the signature of a function converting nvalues values from internal to external format or vice...
virtual void putDComplex(rownr_t rownr, const DComplex *dataPtr)
ObjCompareFunc * compareFunc_p
Pointer to a compare function.
static size_t writeStringLE(void *out, const void *in, size_t n)
void resync(rownr_t nrrow)
Resync the storage manager with the new file contents.
void getScaCol(Vector< uInt > &)
IPosition shape_p
The shape of the column.
virtual void getShort(rownr_t rownr, Short *dataPtr)
uInt getFixedLength() const
Get the fixed length of the data value in a cell of this column (0 = variable length).
void getScaCol(Vector< Short > &)
virtual Bool compareValue(const void *val1, const void *val2) const
Compare the values.
void getScaColCells(const RefRows &, Vector< uInt > &)
static size_t writeStringBE(void *out, const void *in, size_t n)
static Conversion::ValueFunction * getReaduInt(Bool asCanonical)
Get the function needed to read/write a uInt and rownr from/to external format.
void getScaCol(Vector< uChar > &)
void getScaCol(Vector< Int > &)
void getScaCol(Vector< double > &)
void getScaColCells(const RefRows &, Vector< Complex > &)
ISMColumn(const ISMColumn &)
Forbid copy constructor.
virtual void putfloat(rownr_t rownr, const float *dataPtr)
virtual void putScalarColumnV(const ArrayBase &dataPtr)
Put the scalar values into the entire column.
void getScaCol(Vector< float > &)
void getScaCol(Vector< String > &)
void putScaCol(const Vector< Int > &)
void putValue(rownr_t rownr, const void *value)
Put the value for this row.
virtual void getArrayV(rownr_t rownr, ArrayBase &dataPtr)
Get an array value in the given row.
Conversion::ValueFunction * writeFunc_p
Pointer to a convert function for writing.
virtual void handleRemove(rownr_t rownr, const char *value)
Give a derived class the opportunity to react on the removal of a value.
static Conversion::ValueFunction * getWriteuInt(Bool asCanonical)
ISMColumn(ISMBase *parent, int dataType, uInt colnr)
Create a ISMColumn object with the given parent.
virtual void putArrayV(rownr_t rownr, const ArrayBase &dataPtr)
Put an array value in the given row.
rownr_t lastRowPut_p
The last row for which a value has been put.
virtual void getScalarColumnCellsV(const RefRows &rownrs, ArrayBase &dataPtr)
Get the scalar values in some cells of the column.
void getScaColCells(const RefRows &, Vector< Short > &)
void replaceData(ISMBucket *bucket, rownr_t bucketStartRow, rownr_t bucketNrrow, rownr_t bucketRownr, uInt &offset, const char *data, uInt lenData, Bool canSplit=True)
Replace a value at the given offset in the bucket.
virtual void putBool(rownr_t rownr, const Bool *dataPtr)
Put a scalar value in the given row.
void putScaCol(const Vector< Int64 > &)
void getScaCol(Vector< uShort > &)
virtual Bool flush(rownr_t nrrow, Bool fsync)
Flush and optionally fsync the data.
virtual void getScalarColumnV(ArrayBase &dataPtr)
Get the scalar values in the entire column.
void getScaColCells(const RefRows &, Vector< double > &)
virtual void putuShort(rownr_t rownr, const uShort *dataPtr)
virtual void getBool(rownr_t rownr, Bool *dataPtr)
Get a scalar value in the given row.
virtual void putShort(rownr_t rownr, const Short *dataPtr)
void putScaCol(const Vector< uShort > &)
void getScaCol(Vector< Int64 > &)
uInt nrelem_p
Number of elements in a value for this column.
void putScaCol(const Vector< Bool > &)
void getScaColCells(const RefRows &, Vector< Bool > &)
void remove(rownr_t bucketRownr, ISMBucket *bucket, rownr_t bucketNrrow, rownr_t newNrrow)
Remove the given row in the bucket from the column.
void getScaCol(Vector< Complex > &)
void putScaCol(const Vector< DComplex > &)
void getScaColCells(const RefRows &, Vector< uChar > &)
virtual void getString(rownr_t rownr, String *dataPtr)
virtual void doCreate(ISMBucket *)
Let the column object initialize itself for a newly created table.
Bool addData(ISMBucket *bucket, rownr_t bucketStartRow, rownr_t bucketNrrow, rownr_t bucketRownr, uInt inx, const char *data, uInt lenData, Bool afterLastRow=False, Bool canSplit=True)
Add a value at the given index in the bucket.
static size_t fromString(void *out, const void *in, size_t n, Conversion::ValueFunction *writeLeng)
Handle a String in copying to/from external format.
virtual void getuShort(rownr_t rownr, uShort *dataPtr)
static size_t readStringLE(void *out, const void *in, size_t n)
ISMColumn & operator=(const ISMColumn &)
Forbid assignment.
uInt colnr_p
Column sequence number of this column.
virtual void getComplex(rownr_t rownr, Complex *dataPtr)
virtual void getdouble(rownr_t rownr, double *dataPtr)
void getScaColCells(const RefRows &, Vector< float > &)
void putData(ISMBucket *bucket, rownr_t bucketStartRow, rownr_t bucketNrrow, rownr_t bucketRownr, const char *data, uInt lenData, Bool afterLastRow, Bool canSplit)
Put a data value into the bucket.
virtual void getuChar(rownr_t rownr, uChar *dataPtr)
static Conversion::ValueFunction * getWriteRownr(Bool asCanonical)
void handleSplit(ISMBucket &bucket, const Block< Bool > &duplicated)
Handle the duplicated values after a bucket split.
void getScaColCells(const RefRows &, Vector< String > &)
void putScaCol(const Vector< uChar > &)
void init()
Initialize part of the object.
void putScaCol(const Vector< float > &)
void putScaCol(const Vector< Short > &)
static Conversion::ValueFunction * getReadRownr(Bool asCanonical)
virtual void putInt(rownr_t rownr, const Int *dataPtr)
void getScaColCells(const RefRows &, Vector< DComplex > &)
void getScaColCells(const RefRows &, Vector< Int64 > &)
uInt nelements() const
Get the nr of elements in this data value.
void putScaCol(const Vector< String > &)
void clear()
Clear the object (used by destructor and init).
virtual IPosition shape(rownr_t rownr)
Get the shape of the array in the given row.
rownr_t startRow_p
Cache for interval for which last value read is valid.
virtual void getfloat(rownr_t rownr, float *dataPtr)
Conversion::ValueFunction * readFunc_p
Pointer to a convert function for reading.
void putScaCol(const Vector< double > &)
virtual void putString(rownr_t rownr, const String *dataPtr)
virtual void getFile(rownr_t nrrow)
Let the column object initialize itself for an existing table.
static size_t toString(void *out, const void *in, size_t n, Conversion::ValueFunction *readLeng)
Bool isLastValueInvalid(rownr_t rownr)
Test if the last value is invalid for this row.
ISMBase * stmanPtr_p
Pointer to the parent storage manager.
void getValue(rownr_t rownr, void *value, Bool setCache)
Get the value for this row.
virtual void getuInt(rownr_t rownr, uInt *dataPtr)
uInt fixedLength_p
Length of column cell value in storage format (0 = variable length).
virtual void setShapeColumn(const IPosition &shape)
Set the shape of an array in the column.
virtual void getInt(rownr_t rownr, Int *dataPtr)
virtual void putInt64(rownr_t rownr, const Int64 *dataPtr)
void getScaCol(Vector< DComplex > &)
virtual void putuChar(rownr_t rownr, const uChar *dataPtr)
virtual void reopenRW()
Let the column reopen its data files for read/write access.
void getScaColCells(const RefRows &, Vector< Int > &)
void putScaCol(const Vector< uInt > &)
void putFromRow(rownr_t rownr, const char *data, uInt lenData)
Put the value in all buckets from the given row on.
virtual void getInt64(rownr_t rownr, Int64 *dataPtr)
virtual uInt ndim(rownr_t rownr)
Get the dimensionality of the item in the given row.
virtual void getDComplex(rownr_t rownr, DComplex *dataPtr)
virtual void addRow(rownr_t newNrrow, rownr_t oldNrrow)
Add (newNrrow-oldNrrow) rows to the column and initialize the new rows when needed.
static size_t readStringBE(void *out, const void *in, size_t n)
void getScaColCells(const RefRows &, Vector< uShort > &)
void getScaCol(Vector< Bool > &)
uInt typeSize_p
The size of the data type in local format.
uInt nrcopy_p
Number of values to be copied.
virtual void putdouble(rownr_t rownr, const double *dataPtr)
virtual void putuInt(rownr_t rownr, const uInt *dataPtr)
void putScaCol(const Vector< Complex > &)
virtual void handleCopy(rownr_t rownr, const char *value)
Give a derived class the opportunity to react on the duplication of a value.
virtual void putComplex(rownr_t rownr, const Complex *dataPtr)
virtual int dataType() const
Return the data type of the column.
String: the storage and methods of handling collections of characters.
std::complex< Float > Complex
std::complex< Double > DComplex
this file contains all the compiler specific defines
long long Int64
Define the extra non-standard types used by Casacore (like proposed uSize, Size)
bool Bool
Define the standard types used by Casacore.
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
uInt64 rownr_t
Define the type of a row number in a table.