ISMIndColumn.h

Classes

ISMIndColumn -- A column of Incremental storage manager for indirect arrays. (full description)

class ISMIndColumn : public ISMColumn

Interface

Public Members
ISMIndColumn (ISMBase* parent, int dataType, uInt colnr)
~ISMIndColumn()
virtual Bool canAccessSlice (Bool& reask) const
virtual void addRow (uInt newNrrow, uInt oldNrrow)
virtual void setShapeColumn (const IPosition& shape)
virtual uInt ndim (uInt rownr)
void setShape (uInt rownr, const IPosition& shape)
virtual Bool isShapeDefined (uInt rownr)
virtual IPosition shape (uInt rownr)
Bool canChangeShape() const
virtual void getArrayBoolV (uInt rownr, Array<Bool>* dataPtr)
virtual void getArrayuCharV (uInt rownr, Array<uChar>* dataPtr)
virtual void getArrayShortV (uInt rownr, Array<Short>* dataPtr)
virtual void getArrayuShortV (uInt rownr, Array<uShort>* dataPtr)
virtual void getArrayIntV (uInt rownr, Array<Int>* dataPtr)
virtual void getArrayuIntV (uInt rownr, Array<uInt>* dataPtr)
virtual void getArrayfloatV (uInt rownr, Array<float>* dataPtr)
virtual void getArraydoubleV (uInt rownr, Array<double>* dataPtr)
virtual void getArrayComplexV (uInt rownr, Array<Complex>* dataPtr)
virtual void getArrayDComplexV (uInt rownr, Array<DComplex>* dataPtr)
virtual void getArrayStringV (uInt rownr, Array<String>* dataPtr)
virtual void putArrayBoolV (uInt rownr, const Array<Bool>* dataPtr)
virtual void putArrayuCharV (uInt rownr, const Array<uChar>* dataPtr)
virtual void putArrayShortV (uInt rownr, const Array<Short>* dataPtr)
virtual void putArrayuShortV (uInt rownr, const Array<uShort>* dataPtr)
virtual void putArrayIntV (uInt rownr, const Array<Int>* dataPtr)
virtual void putArrayuIntV (uInt rownr, const Array<uInt>* dataPtr)
virtual void putArrayfloatV (uInt rownr, const Array<float>* dataPtr)
virtual void putArraydoubleV (uInt rownr, const Array<double>* dataPtr)
virtual void putArrayComplexV (uInt rownr, const Array<Complex>* dataPtr)
virtual void putArrayDComplexV (uInt rownr, const Array<DComplex>* dataPtr)
virtual void putArrayStringV (uInt rownr, const Array<String>* dataPtr)
virtual void getSliceBoolV (uInt rownr, const Slicer&, Array<Bool>* dataPtr)
virtual void getSliceuCharV (uInt rownr, const Slicer&, Array<uChar>* dataPtr)
virtual void getSliceShortV (uInt rownr, const Slicer&, Array<Short>* dataPtr)
virtual void getSliceuShortV (uInt rownr, const Slicer&, Array<uShort>* dataPtr)
virtual void getSliceIntV (uInt rownr, const Slicer&, Array<Int>* dataPtr)
virtual void getSliceuIntV (uInt rownr, const Slicer&, Array<uInt>* dataPtr)
virtual void getSlicefloatV (uInt rownr, const Slicer&, Array<float>* dataPtr)
virtual void getSlicedoubleV (uInt rownr, const Slicer&, Array<double>* dataPtr)
virtual void getSliceComplexV (uInt rownr, const Slicer&, Array<Complex>* dataPtr)
virtual void getSliceDComplexV (uInt rownr, const Slicer&, Array<DComplex>* dataPtr)
virtual void getSliceStringV (uInt rownr, const Slicer&, Array<String>* dataPtr)
virtual void putSliceBoolV (uInt rownr, const Slicer&, const Array<Bool>* dataPtr)
virtual void putSliceuCharV (uInt rownr, const Slicer&, const Array<uChar>* dataPtr)
virtual void putSliceShortV (uInt rownr, const Slicer&, const Array<Short>* dataPtr)
virtual void putSliceuShortV (uInt rownr, const Slicer&, const Array<uShort>* dataPtr)
virtual void putSliceIntV (uInt rownr, const Slicer&, const Array<Int>* dataPtr)
virtual void putSliceuIntV (uInt rownr, const Slicer&, const Array<uInt>* dataPtr)
virtual void putSlicefloatV (uInt rownr, const Slicer&, const Array<float>* dataPtr)
virtual void putSlicedoubleV (uInt rownr, const Slicer&, const Array<double>* dataPtr)
virtual void putSliceComplexV (uInt rownr, const Slicer&, const Array<Complex>* dataPtr)
virtual void putSliceDComplexV (uInt rownr, const Slicer&, const Array<DComplex>* dataPtr)
virtual void putSliceStringV (uInt rownr, const Slicer&, const Array<String>* dataPtr)
virtual void doCreate (ISMBucket* bucket)
virtual void getFile (uInt nrrow)
virtual Bool flush (uInt nrrow, Bool fsync)
virtual void resync (uInt nrrow)
virtual void reopenRW()
virtual void handleCopy (uInt rownr, const char* value)
virtual void handleRemove (uInt rownr, const char* value)
Private Members
ISMIndColumn (const ISMIndColumn&)
ISMIndColumn& operator= (const ISMIndColumn&)
void init (ByteIO::OpenOption fileOption)
void clear()
virtual Bool compareValue (const void* val1, const void* val2) const
StIndArray* getShape (uInt rownr)
StIndArray* putShape (uInt rownr, const IPosition& shape)
StIndArray* putShapeSliced (uInt rownr)
StIndArray* getArrayPtr (uInt rownr)
StIndArray* putArrayPtr (uInt rownr, const IPosition& shape, Bool copyData)

Description

Review Status

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

Prerequisite

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

Member Description

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).

~ISMIndColumn()

Frees up the storage.

virtual Bool canAccessSlice (Bool& reask) const

It can handle access to a slice in a cell.

virtual void addRow (uInt newNrrow, uInt 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 (uInt rownr)

Get the dimensionality of the item in the given row.

void setShape (uInt rownr, const IPosition& shape)

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

virtual Bool isShapeDefined (uInt rownr)

Is the shape defined (i.e. is there an array) in this row?

virtual IPosition shape (uInt rownr)

Get the shape of the array in the given row.

Bool canChangeShape() const

This storage manager can handle changing array shapes.

virtual void getArrayBoolV (uInt rownr, Array<Bool>* dataPtr)
virtual void getArrayuCharV (uInt rownr, Array<uChar>* dataPtr)
virtual void getArrayShortV (uInt rownr, Array<Short>* dataPtr)
virtual void getArrayuShortV (uInt rownr, Array<uShort>* dataPtr)
virtual void getArrayIntV (uInt rownr, Array<Int>* dataPtr)
virtual void getArrayuIntV (uInt rownr, Array<uInt>* dataPtr)
virtual void getArrayfloatV (uInt rownr, Array<float>* dataPtr)
virtual void getArraydoubleV (uInt rownr, Array<double>* dataPtr)
virtual void getArrayComplexV (uInt rownr, Array<Complex>* dataPtr)
virtual void getArrayDComplexV (uInt rownr, Array<DComplex>* dataPtr)
virtual void getArrayStringV (uInt rownr, Array<String>* dataPtr)

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).

virtual void putArrayBoolV (uInt rownr, const Array<Bool>* dataPtr)
virtual void putArrayuCharV (uInt rownr, const Array<uChar>* dataPtr)
virtual void putArrayShortV (uInt rownr, const Array<Short>* dataPtr)
virtual void putArrayuShortV (uInt rownr, const Array<uShort>* dataPtr)
virtual void putArrayIntV (uInt rownr, const Array<Int>* dataPtr)
virtual void putArrayuIntV (uInt rownr, const Array<uInt>* dataPtr)
virtual void putArrayfloatV (uInt rownr, const Array<float>* dataPtr)
virtual void putArraydoubleV (uInt rownr, const Array<double>* dataPtr)
virtual void putArrayComplexV (uInt rownr, const Array<Complex>* dataPtr)
virtual void putArrayDComplexV (uInt rownr, const Array<DComplex>* dataPtr)
virtual void putArrayStringV (uInt rownr, const Array<String>* dataPtr)

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).

virtual void getSliceBoolV (uInt rownr, const Slicer&, Array<Bool>* dataPtr)
virtual void getSliceuCharV (uInt rownr, const Slicer&, Array<uChar>* dataPtr)
virtual void getSliceShortV (uInt rownr, const Slicer&, Array<Short>* dataPtr)
virtual void getSliceuShortV (uInt rownr, const Slicer&, Array<uShort>* dataPtr)
virtual void getSliceIntV (uInt rownr, const Slicer&, Array<Int>* dataPtr)
virtual void getSliceuIntV (uInt rownr, const Slicer&, Array<uInt>* dataPtr)
virtual void getSlicefloatV (uInt rownr, const Slicer&, Array<float>* dataPtr)
virtual void getSlicedoubleV (uInt rownr, const Slicer&, Array<double>* dataPtr)
virtual void getSliceComplexV (uInt rownr, const Slicer&, Array<Complex>* dataPtr)
virtual void getSliceDComplexV (uInt rownr, const Slicer&, Array<DComplex>* dataPtr)
virtual void getSliceStringV (uInt rownr, const Slicer&, Array<String>* dataPtr)

Get a section of the array in the given row. The buffer pointed to by dataPtr has to have the correct length (which is guaranteed by the ArrayColumn getSlice function).

virtual void putSliceBoolV (uInt rownr, const Slicer&, const Array<Bool>* dataPtr)
virtual void putSliceuCharV (uInt rownr, const Slicer&, const Array<uChar>* dataPtr)
virtual void putSliceShortV (uInt rownr, const Slicer&, const Array<Short>* dataPtr)
virtual void putSliceuShortV (uInt rownr, const Slicer&, const Array<uShort>* dataPtr)
virtual void putSliceIntV (uInt rownr, const Slicer&, const Array<Int>* dataPtr)
virtual void putSliceuIntV (uInt rownr, const Slicer&, const Array<uInt>* dataPtr)
virtual void putSlicefloatV (uInt rownr, const Slicer&, const Array<float>* dataPtr)
virtual void putSlicedoubleV (uInt rownr, const Slicer&, const Array<double>* dataPtr)
virtual void putSliceComplexV (uInt rownr, const Slicer&, const Array<Complex>* dataPtr)
virtual void putSliceDComplexV (uInt rownr, const Slicer&, const Array<DComplex>* dataPtr)
virtual void putSliceStringV (uInt rownr, const Slicer&, const Array<String>* dataPtr)

Put into a section of the array in the given row. The buffer pointed to by dataPtr has to have the correct length (which is guaranteed by the ArrayColumn putSlice function).

virtual void doCreate (ISMBucket* bucket)

Let the column object create its array file.

virtual void getFile (uInt nrrow)

Let the column object open an existing file.

virtual Bool flush (uInt nrrow, Bool fsync)

Flush and optionally fsync the data.

virtual void resync (uInt 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 (uInt rownr, const char* value)

Handle the duplication of a value; i.e. increment its reference count.

virtual void handleRemove (uInt rownr, const char* value)

Handle the removal of a value; i.e. decrement its reference count.

ISMIndColumn (const ISMIndColumn&)

Forbid copy constructor.

ISMIndColumn& operator= (const ISMIndColumn&)

Forbid assignment.

void init (ByteIO::OpenOption fileOption)

Initialize part of the object and open/create the file. It is used by doCreate and getFile.

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. It always return False, because comparing large arrays is too expensive (it could be changed in the future).

StIndArray* getShape (uInt rownr)

Read the shape at the given row. This will cache the information in the StIndArray object for that row.

StIndArray* putShape (uInt rownr, const IPosition& shape)

Put the shape for an array being put. When there are multiple rows in the interval, it will split the interval.

StIndArray* putShapeSliced (uInt rownr)

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.

StIndArray* getArrayPtr (uInt rownr)

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

StIndArray* putArrayPtr (uInt rownr, const IPosition& shape, Bool copyData)

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.