Loading...
Searching...
No Matches
casacore::ISMIndColumn Class Reference
tables package (libcasa_tables) » DataMan_module » DataMan_module_internal_classes

More...

`#include <ISMIndColumn.h>`

## Public Member Functions

| ISMIndColumn (ISMBase *parent, int dataType, uInt colnr)
| Create a column of the given data type.
virtual | ~ISMIndColumn ()
| Frees up the storage.
| ISMIndColumn (const ISMIndColumn &)=delete
| Forbid copy constructor.
ISMIndColumn & | operator= (const ISMIndColumn &)=delete
| Forbid assignment.
virtual void | addRow (rownr_t newNrrow, rownr_t oldNrrow)
| Add (newNrrow-oldNrrow) rows to the column.
virtual void | setShapeColumn (const IPosition &shape)
| Set the (fixed) shape of the arrays in the entire column.
virtual uInt | ndim (rownr_t rownr)
| Get the dimensionality of the item in the given row.
virtual void | setShape (rownr_t rownr, const IPosition &shape)
| Set the shape of the array in the given row and allocate the array in the file.
virtual Bool | isShapeDefined (rownr_t rownr)
| Is the shape defined (i.e.
virtual IPosition | shape (rownr_t rownr)
| Get the shape of the array in the given row.
virtual Bool | canChangeShape () const
| This storage manager can handle changing array shapes.
virtual void | getArrayV (rownr_t rownr, ArrayBase &)
| Get an array value in the given row.
virtual void | putArrayV (rownr_t rownr, const ArrayBase &)
| Put an array value into the given row.
virtual void | getSliceV (rownr_t rownr, const Slicer &, ArrayBase &)
| Get a section of the array in the given row.
virtual void | putSliceV (rownr_t rownr, const Slicer &, const ArrayBase &)
| Put into a section of the array in the given row.
virtual void | doCreate (ISMBucket *bucket)
| Let the column object create its array file.
virtual void | getFile (rownr_t nrrow)
| Let the column object open an existing file.
virtual Bool | flush (rownr_t nrrow, Bool fsync)
| Flush and optionally fsync the data.
virtual void | resync (rownr_t nrrow)
| Resync the storage manager with the new file contents.
virtual void | reopenRW ()
| Let the column reopen its data files for read/write access.
virtual void | handleCopy (rownr_t rownr, const char *value)
| Handle the duplication of a value; i.e.
virtual void | handleRemove (rownr_t rownr, const char *value)
| Handle the removal of a value; i.e.
Public Member Functions inherited from casacore::ISMColumn
| ISMColumn (ISMBase *parent, int dataType, uInt colnr)
| Create a ISMColumn object with the given parent.
| ~ISMColumn ()
| ISMColumn (const ISMColumn &)=delete
| Forbid copy constructor.
ISMColumn & | operator= (const ISMColumn &)=delete
| Forbid assignment.
void | resync (rownr_t nrrow)
| Resync the storage manager with the new file contents.
virtual void | getBool (rownr_t rownr, Bool *dataPtr)
| Get a scalar value in the given row.
virtual void | getuChar (rownr_t rownr, uChar *dataPtr)
virtual void | getShort (rownr_t rownr, Short *dataPtr)
virtual void | getuShort (rownr_t rownr, uShort *dataPtr)
virtual void | getInt (rownr_t rownr, Int *dataPtr)
virtual void | getuInt (rownr_t rownr, uInt *dataPtr)
virtual void | getInt64 (rownr_t rownr, Int64 *dataPtr)
virtual void | getfloat (rownr_t rownr, float *dataPtr)
virtual void | getdouble (rownr_t rownr, double *dataPtr)
virtual void | getComplex (rownr_t rownr, Complex *dataPtr)
virtual void | getDComplex (rownr_t rownr, DComplex *dataPtr)
virtual void | getString (rownr_t rownr, String *dataPtr)
virtual void | putBool (rownr_t rownr, const Bool *dataPtr)
| Put a scalar value in the given row.
virtual void | putuChar (rownr_t rownr, const uChar *dataPtr)
virtual void | putShort (rownr_t rownr, const Short *dataPtr)
virtual void | putuShort (rownr_t rownr, const uShort *dataPtr)
virtual void | putInt (rownr_t rownr, const Int *dataPtr)
virtual void | putuInt (rownr_t rownr, const uInt *dataPtr)
virtual void | putInt64 (rownr_t rownr, const Int64 *dataPtr)
virtual void | putfloat (rownr_t rownr, const float *dataPtr)
virtual void | putdouble (rownr_t rownr, const double *dataPtr)
virtual void | putComplex (rownr_t rownr, const Complex *dataPtr)
virtual void | putDComplex (rownr_t rownr, const DComplex *dataPtr)
virtual void | putString (rownr_t rownr, const String *dataPtr)
virtual void | getScalarColumnV (ArrayBase &dataPtr)
| Get the scalar values in the entire column.
virtual void | putScalarColumnV (const ArrayBase &dataPtr)
| Put the scalar values into the entire column.
virtual void | getScalarColumnCellsV (const RefRows &rownrs, ArrayBase &dataPtr)
| Get the scalar values in some cells of the column.
void | remove (rownr_t bucketRownr, ISMBucket *bucket, rownr_t bucketNrrow, rownr_t newNrrow)
| Remove the given row in the bucket from the column.
uInt | getFixedLength () const
| Get the fixed length of the data value in a cell of this column (0 = variable length).
uInt | nelements () const
| Get the nr of elements in this data value.
Public Member Functions inherited from casacore::StManColumnBase
| StManColumnBase (int dataType)
| Default constructor.
| ~StManColumnBase ()
| StManColumnBase (const StManColumnBase &)=delete
| The object cannot be copied.
StManColumnBase & | operator= (const StManColumnBase &)=delete
| The object cannot be assigned to.
virtual int | dataType () const
| Return the data type of the column.
DataType | dtype () const
Int | elemSize () const
| Return the size of an element of the column's data type.
Public Member Functions inherited from casacore::DataManagerColumn
| DataManagerColumn ()
| Create a column.
virtual | ~DataManagerColumn ()
| Frees up the storage.
| DataManagerColumn (const DataManagerColumn &)=delete
| The copy constructor cannot be used for this base class.
DataManagerColumn & | operator= (const DataManagerColumn &)=delete
| Assignment cannot be used for this base class.
void | setIsFixedShape (Bool isFixedShape)
| Set the isFixedShape flag.
Bool | isFixedShape () const
| Is this a fixed shape column?
virtual String | dataTypeId () const
| Get the data type id of the column for dataType==TpOther.
virtual Bool | isWritable () const
| Test if data can be put into this column.
virtual void | setMaxLength (uInt maxLength)
| Set the maximum length of the value (can be used for strings).
void | setFixedShapeColumn (const IPosition &shape)
| Set the shape of all (fixed-shaped) arrays in the column.
virtual void | setShapeTiled (rownr_t rownr, const IPosition &shape, const IPosition &tileShape)
| Set the shape and tile shape of an (variable-shaped) array in the given row.
virtual IPosition | tileShape (rownr_t rownr)
| Get the tile shape of the item in the given row.
ColumnCache & | columnCache ()
| Get access to the ColumnCache object.
const ColumnCache * | columnCachePtr () const
void | get (rownr_t rownr, Bool *dataPtr)
| Get the scalar value in the given row.
void | get (rownr_t rownr, uChar *dataPtr)
void | get (rownr_t rownr, Short *dataPtr)
void | get (rownr_t rownr, uShort *dataPtr)
void | get (rownr_t rownr, Int *dataPtr)
void | get (rownr_t rownr, uInt *dataPtr)
void | get (rownr_t rownr, Int64 *dataPtr)
void | get (rownr_t rownr, float *dataPtr)
void | get (rownr_t rownr, double *dataPtr)
void | get (rownr_t rownr, Complex *dataPtr)
void | get (rownr_t rownr, DComplex *dataPtr)
void | get (rownr_t rownr, String *dataPtr)
void | get (rownr_t rownr, void *dataPtr)
| This function is the get for all non-standard data types.
void | put (rownr_t rownr, const Bool *dataPtr)
| Put the scalar value into the given row.
void | put (rownr_t rownr, const uChar *dataPtr)
void | put (rownr_t rownr, const Short *dataPtr)
void | put (rownr_t rownr, const uShort *dataPtr)
void | put (rownr_t rownr, const Int *dataPtr)
void | put (rownr_t rownr, const uInt *dataPtr)
void | put (rownr_t rownr, const Int64 *dataPtr)
void | put (rownr_t rownr, const float *dataPtr)
void | put (rownr_t rownr, const double *dataPtr)
void | put (rownr_t rownr, const Complex *dataPtr)
void | put (rownr_t rownr, const DComplex *dataPtr)
void | put (rownr_t rownr, const String *dataPtr)
void | put (rownr_t rownr, const void *dataPtr)
| This function is the put for all non-standard data types.
virtual void | putScalarColumnCellsV (const RefRows &rownrs, const ArrayBase &dataPtr)
| Put some scalar values in the column.
virtual void | getArrayColumnV (ArrayBase &data)
| Get all array values in the column.
virtual void | putArrayColumnV (const ArrayBase &data)
| Put all array values in the column.
virtual void | getArrayColumnCellsV (const RefRows &rownrs, ArrayBase &data)
| Get some array values in the column.
virtual void | putArrayColumnCellsV (const RefRows &rownrs, const ArrayBase &data)
| Put some array values in the column.
virtual void | getColumnSliceV (const Slicer &slicer, ArrayBase &data)
| Get a section of all arrays in the column.
virtual void | putColumnSliceV (const Slicer &slicer, const ArrayBase &data)
| Put into a section of all arrays in the column.
virtual void | getColumnSliceCellsV (const RefRows &rownrs, const Slicer &slicer, ArrayBase &data)
| Get a section of some arrays in the column.
virtual void | putColumnSliceCellsV (const RefRows &rownrs, const Slicer &slicer, const ArrayBase &data)
| Put into a section of some arrays in the column.
void | throwGet () const
| Throw an "invalid operation" exception for the default implementation of get.
void | throwPut () const
| Throw an "invalid operation" exception for the default implementation of put.
void | setColumnName (const String &colName)
| Set the column name.
const String & | columnName () const
| Get rhe column name.

## Private Member Functions

void | init (ByteIO::OpenOption fileOption)
| Initialize part of the object and open/create the file.
void | clear ()
| Clear the object (used by destructor and init).
virtual Bool | compareValue (const void *val1, const void *val2) const
| Compare the values to check if a value to be put matches the value in the previous or next row.
StIndArray * | getShape (rownr_t rownr)
| Read the shape at the given row.
StIndArray * | putShape (rownr_t rownr, const IPosition &shape)
| Put the shape for an array being put.
StIndArray * | putShapeSliced (rownr_t rownr)
| Put the shape for an array of which a slice is being put.
StIndArray * | getArrayPtr (rownr_t rownr)
| Return a pointer to the array in the given row (for a get).
StIndArray * | putArrayPtr (rownr_t rownr, const IPosition &shape, Bool copyData)
| When needed, create an array in the given row with the given shape.

## Private Attributes

uInt | seqnr_p
| The (unique) sequence number of the column.
IPosition | fixedShape_p
| The shape of all arrays in case it is fixed.
Bool | shapeIsFixed_p
| Switch indicating if the shape is fixed.
StManArrayFile * | iosfile_p
| The file containing the arrays.
StIndArray | indArray_p
| The indirect array object.
Bool | foundArray_p
| The indirect array exists for the row interval last accessed.

## Additional Inherited Members

Static Public Member Functions inherited from casacore::ISMColumn
static Conversion::ValueFunction * | getReaduInt (Bool asCanonical)
| Get the function needed to read/write a uInt and rownr from/to external format.
static Conversion::ValueFunction * | getReadRownr (Bool asCanonical)
static Conversion::ValueFunction * | getWriteuInt (Bool asCanonical)
static Conversion::ValueFunction * | getWriteRownr (Bool asCanonical)
Static Public Member Functions inherited from casacore::StManColumnBase
static Bool | isNativeDataType (int dtype)
| Test if the given data type is supported by storage managers.
Protected Member Functions inherited from casacore::ISMColumn
Bool | isLastValueInvalid (rownr_t rownr)
| Test if the last value is invalid for this row.
void | getValue (rownr_t rownr, void *value, Bool setCache)
| Get the value for this row.
void | putValue (rownr_t rownr, const void *value)
| Put the value for this row.
Protected Member Functions inherited from casacore::DataManagerColumn
virtual void | getOther (rownr_t rownr, void *dataPtr)
| This function is the get for all non-standard data types.
virtual void | putOther (rownr_t rownr, const void *dataPtr)
| This function is the put for all non-standard data types.
void | getScalarColumnBase (ArrayBase &dataPtr)
| The default implementations of get and put functions.
void | putScalarColumnBase (const ArrayBase &dataPtr)
void | getScalarColumnCellsBase (const RefRows &rownrs, ArrayBase &dataPtr)
void | putScalarColumnCellsBase (const RefRows &rownrs, const ArrayBase &dataPtr)
void | getArrayColumnBase (ArrayBase &data)
void | putArrayColumnBase (const ArrayBase &data)
void | getArrayColumnCellsBase (const RefRows &rownrs, ArrayBase &data)
void | putArrayColumnCellsBase (const RefRows &rownrs, const ArrayBase &data)
void | getSliceBase (rownr_t rownr, const Slicer &slicer, ArrayBase &data)
void | putSliceBase (rownr_t rownr, const Slicer &slicer, const ArrayBase &data)
void | getColumnSliceBase (const Slicer &slicer, ArrayBase &data)
void | putColumnSliceBase (const Slicer &slicer, const ArrayBase &data)
void | getColumnSliceCellsBase (const RefRows &rownrs, const Slicer &slicer, ArrayBase &data)
void | putColumnSliceCellsBase (const RefRows &rownrs, const Slicer &slicer, const ArrayBase &data)
Protected Attributes inherited from casacore::ISMColumn
ISMBase * | stmanPtr_p
| Pointer to the parent storage manager.
uInt | fixedLength_p
| Length of column cell value in storage format (0 = variable length).
uInt | colnr_p
| Column sequence number of this column.
IPosition | shape_p
| The shape of the column.
uInt | nrelem_p
| Number of elements in a value for this column.
uInt | nrcopy_p
| Number of values to be copied.
rownr_t | startRow_p
| Cache for interval for which last value read is valid.
rownr_t | endRow_p
void * | lastValue_p
rownr_t | lastRowPut_p
| The last row for which a value has been put.
uInt | typeSize_p
| The size of the data type in local format.
Conversion::ValueFunction * | writeFunc_p
| Pointer to a convert function for writing.
Conversion::ValueFunction * | readFunc_p
| Pointer to a convert function for reading.
ObjCompareFunc * | compareFunc_p
| Pointer to a compare function.

## Detailed Description

A column of Incremental storage manager for indirect arrays.

### Intended use:

Internal

### Review Status

Reviewed By:
  UNKNOWN
Date Reviewed:
  before2004/08/25

### Prerequisite

- ISMColumn
- StIndArray

### Etymology

ISMIndColumn represents a Column in the Incremental Storage Manager containing INDirect arrays.

### Synopsis

ISMIndColumn is the implementation of an ISMColumn class to handle indirect arrays. The arrays (shape and data) are stored in a separate file using class StIndArray. The file offset of the beginning of the array in stored in the ISM using the standard ISMColumn functions.

ISMIndColumn contains functions which are called when ISMColumn duplicates or removes a value. In that way the array can also be duplicated or removed in the StIndArray file by incrementing or decrementing the reference count manitained in the file.

Unlike ISMColumn it is not tested if a value put is equal to the value in the previous or next row, because it is too time-consuming to do so (although this behaviour could be changed in the future). Instead the user should not put equal values to prevent storing equal values.

Note that an indirect array can have a fixed shape. In that case adding a row results in reserving space for the array in the StIndArray file, so for each row an array is present. On the other hand adding a row does nothing for variable shaped arrays. So when no data is put or shape is set, a row may contain no array at all. In that case the function isShapeDefined returns False for that row.

### To Do

- Maybe TpArrayInt, etc. should be used instead of TpInt.

Definition at line 97 of file ISMIndColumn.h.

## Constructor & Destructor Documentation

## ISMIndColumn() [1/2]

casacore::ISMIndColumn::ISMIndColumn | ( | ISMBase * | parent,
|  | int | dataType,
|  | uInt | colnr )

Create a column of the given data type.

It keeps the pointer to its parent (but does not own it).

References casacore::dataType().

Referenced by ISMIndColumn(), and operator=().

## ~ISMIndColumn()

virtual casacore::ISMIndColumn::~ISMIndColumn | ( |  | ) |

virtual

Frees up the storage.

## ISMIndColumn() [2/2]

casacore::ISMIndColumn::ISMIndColumn | ( | const ISMIndColumn & |  | ) |

delete

Forbid copy constructor.

References ISMIndColumn().

## Member Function Documentation

## addRow()

virtual void casacore::ISMIndColumn::addRow | ( | rownr_t | newNrrow,
|  | rownr_t | oldNrrow )

virtual

Add (newNrrow-oldNrrow) rows to the column.

Reimplemented from casacore::ISMColumn.

## canChangeShape()

virtual Bool casacore::ISMIndColumn::canChangeShape | ( |  | ) | const

virtual

This storage manager can handle changing array shapes.

Reimplemented from casacore::DataManagerColumn.

## clear()

void casacore::ISMIndColumn::clear | ( |  | ) |

private

Clear the object (used by destructor and init).

## compareValue()

virtual Bool casacore::ISMIndColumn::compareValue | ( | const void * | val1,
|  | const void * | val2 ) const

private virtual

Compare the values to check if a value to be put matches the value in the previous or next row.

It always return False, because comparing large arrays is too expensive (it could be changed in the future).

Reimplemented from casacore::ISMColumn.

## doCreate()

virtual void casacore::ISMIndColumn::doCreate | ( | ISMBucket * | bucket | ) |

virtual

Let the column object create its array file.

Reimplemented from casacore::ISMColumn.

## flush()

virtual Bool casacore::ISMIndColumn::flush | ( | rownr_t | nrrow,
|  | Bool | fsync )

virtual

Flush and optionally fsync the data.

Reimplemented from casacore::ISMColumn.

## getArrayPtr()

StIndArray * casacore::ISMIndColumn::getArrayPtr | ( | rownr_t | rownr | ) |

private

Return a pointer to the array in the given row (for a get).

## getArrayV()

virtual void casacore::ISMIndColumn::getArrayV | ( | rownr_t | rownr,
|  | ArrayBase & | )

virtual

Get an array value in the given row.

The buffer pointed to by dataPtr has to have the correct length (which is guaranteed by the ArrayColumn get function).

Reimplemented from casacore::ISMColumn.

## getFile()

virtual void casacore::ISMIndColumn::getFile | ( | rownr_t | nrrow | ) |

virtual

Let the column object open an existing file.

Reimplemented from casacore::ISMColumn.

## getShape()

StIndArray * casacore::ISMIndColumn::getShape | ( | rownr_t | rownr | ) |

private

Read the shape at the given row.

This will cache the information in the StIndArray object for that row.

## getSliceV()

virtual void casacore::ISMIndColumn::getSliceV | ( | rownr_t | rownr,
|  | const Slicer & | ,
|  | ArrayBase & | )

virtual

Get a section of the array in the given row.

The array has to have the correct length (which is guaranteed by the ArrayColumn getSlice function).

Reimplemented from casacore::DataManagerColumn.

## handleCopy()

virtual void casacore::ISMIndColumn::handleCopy | ( | rownr_t | rownr,
|  | const char * | value )

virtual

Handle the duplication of a value; i.e.

increment its reference count.

Reimplemented from casacore::ISMColumn.

References casacore::NewDelAllocator< T >::value.

## handleRemove()

virtual void casacore::ISMIndColumn::handleRemove | ( | rownr_t | rownr,
|  | const char * | value )

virtual

Handle the removal of a value; i.e.

decrement its reference count.

Reimplemented from casacore::ISMColumn.

References casacore::NewDelAllocator< T >::value.

## init()

void casacore::ISMIndColumn::init | ( | ByteIO::OpenOption | fileOption | ) |

private

Initialize part of the object and open/create the file.

It is used by doCreate and getFile.

## isShapeDefined()

virtual Bool casacore::ISMIndColumn::isShapeDefined | ( | rownr_t | rownr | ) |

virtual

Is the shape defined (i.e.

is there an array) in this row?

Reimplemented from casacore::DataManagerColumn.

## ndim()

virtual uInt casacore::ISMIndColumn::ndim | ( | rownr_t | rownr | ) |

virtual

Get the dimensionality of the item in the given row.

Reimplemented from casacore::ISMColumn.

## operator=()

ISMIndColumn & casacore::ISMIndColumn::operator= | ( | const ISMIndColumn & |  | ) |

delete

Forbid assignment.

References ISMIndColumn().

## putArrayPtr()

StIndArray * casacore::ISMIndColumn::putArrayPtr | ( | rownr_t | rownr,
|  | const IPosition & | shape,
|  | Bool | copyData )

private

When needed, create an array in the given row with the given shape.

When the array is created, its data are copied when the flag is set.

References shape().

## putArrayV()

virtual void casacore::ISMIndColumn::putArrayV | ( | rownr_t | rownr,
|  | const ArrayBase & | )

virtual

Put an array value into the given row.

The buffer pointed to by dataPtr has to have the correct length (which is guaranteed by the ArrayColumn put function).

Reimplemented from casacore::ISMColumn.

## putShape()

StIndArray * casacore::ISMIndColumn::putShape | ( | rownr_t | rownr,
|  | const IPosition & | shape )

private

Put the shape for an array being put.

When there are multiple rows in the interval, it will split the interval.

References shape().

## putShapeSliced()

StIndArray * casacore::ISMIndColumn::putShapeSliced | ( | rownr_t | rownr | ) |

private

Put the shape for an array of which a slice is being put.

It gets the shape for the given row. When there are multiple rows in the interval, it will split the interval and copy the data.

## putSliceV()

virtual void casacore::ISMIndColumn::putSliceV | ( | rownr_t | rownr,
|  | const Slicer & | ,
|  | const ArrayBase & | )

virtual

Put into a section of the array in the given row.

The array has to have the correct length (which is guaranteed by the ArrayColumn putSlice function).

Reimplemented from casacore::DataManagerColumn.

## reopenRW()

virtual void casacore::ISMIndColumn::reopenRW | ( |  | ) |

virtual

Let the column reopen its data files for read/write access.

Reimplemented from casacore::ISMColumn.

## resync()

virtual void casacore::ISMIndColumn::resync | ( | rownr_t | nrrow | ) |

virtual

Resync the storage manager with the new file contents.

## setShape()

virtual void casacore::ISMIndColumn::setShape | ( | rownr_t | rownr,
|  | const IPosition & | shape )

virtual

Set the shape of the array in the given row and allocate the array in the file.

Reimplemented from casacore::DataManagerColumn.

References shape().

## setShapeColumn()

virtual void casacore::ISMIndColumn::setShapeColumn | ( | const IPosition & | shape | ) |

virtual

Set the (fixed) shape of the arrays in the entire column.

Reimplemented from casacore::ISMColumn.

References shape().

## shape()

virtual IPosition casacore::ISMIndColumn::shape | ( | rownr_t | rownr | ) |

virtual

Get the shape of the array in the given row.

Reimplemented from casacore::ISMColumn.

Referenced by putArrayPtr(), putShape(), setShape(), and setShapeColumn().

## Member Data Documentation

## fixedShape_p

IPosition casacore::ISMIndColumn::fixedShape_p

private

The shape of all arrays in case it is fixed.

Definition at line 219 of file ISMIndColumn.h.

## foundArray_p

Bool casacore::ISMIndColumn::foundArray_p

private

The indirect array exists for the row interval last accessed.

Definition at line 227 of file ISMIndColumn.h.

## indArray_p

StIndArray casacore::ISMIndColumn::indArray_p

private

The indirect array object.

Definition at line 225 of file ISMIndColumn.h.

## iosfile_p

StManArrayFile* casacore::ISMIndColumn::iosfile_p

private

The file containing the arrays.

Definition at line 223 of file ISMIndColumn.h.

## seqnr_p

uInt casacore::ISMIndColumn::seqnr_p

private

The (unique) sequence number of the column.

Definition at line 217 of file ISMIndColumn.h.

## shapeIsFixed_p

Bool casacore::ISMIndColumn::shapeIsFixed_p

private

Switch indicating if the shape is fixed.

Definition at line 221 of file ISMIndColumn.h.

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

- tables/DataMan/ISMIndColumn.h