casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Private Member Functions | Private Attributes
casa::ISMIndColumn Class Reference

A column of Incremental storage manager for indirect arrays. More...

#include <ISMIndColumn.h>

Inheritance diagram for casa::ISMIndColumn:
casa::ISMColumn casa::StManColumn casa::DataManagerColumn

List of all members.

Public Member Functions

 ISMIndColumn (ISMBase *parent, int dataType, uInt colnr)
 Create a column of the given data type.
 ~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.
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)
 Get an array value in the given row.
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)
 Put an array value into the given row.
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)
 Get a section of the array in the given row.
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)
 Put into a section of the array in the given row.
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)
 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.
virtual void handleRemove (uInt rownr, const char *value)
 Handle the removal of a value; i.e.

Private Member Functions

 ISMIndColumn (const ISMIndColumn &)
 Forbid copy constructor.
ISMIndColumnoperator= (const ISMIndColumn &)
 Forbid assignment.
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.
StIndArraygetShape (uInt rownr)
 Read the shape at the given row.
StIndArrayputShape (uInt rownr, const IPosition &shape)
 Put the shape for an array being put.
StIndArrayputShapeSliced (uInt rownr)
 Put the shape for an array of which a slice is being put.
StIndArraygetArrayPtr (uInt rownr)
 Return a pointer to the array in the given row (for a get).
StIndArrayputArrayPtr (uInt 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.
StManArrayFileiosfile_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.

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

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

Definition at line 99 of file ISMIndColumn.h.


Constructor & Destructor Documentation

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

Frees up the storage.

Forbid copy constructor.


Member Function Documentation

virtual void casa::ISMIndColumn::addRow ( uInt  newNrrow,
uInt  oldNrrow 
) [virtual]

Add (newNrrow-oldNrrow) rows to the column.

Reimplemented from casa::ISMColumn.

virtual Bool casa::ISMIndColumn::canAccessSlice ( Bool reask) const [virtual]

It can handle access to a slice in a cell.

Reimplemented from casa::DataManagerColumn.

This storage manager can handle changing array shapes.

Reimplemented from casa::DataManagerColumn.

void casa::ISMIndColumn::clear ( ) [private]

Clear the object (used by destructor and init).

Reimplemented from casa::ISMColumn.

virtual Bool casa::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 casa::ISMColumn.

virtual void casa::ISMIndColumn::doCreate ( ISMBucket bucket) [virtual]

Let the column object create its array file.

Reimplemented from casa::ISMColumn.

virtual Bool casa::ISMIndColumn::flush ( uInt  nrrow,
Bool  fsync 
) [virtual]

Flush and optionally fsync the data.

Reimplemented from casa::ISMColumn.

virtual void casa::ISMIndColumn::getArrayBoolV ( uInt  rownr,
Array< Bool > *  dataPtr 
) [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 casa::ISMColumn.

virtual void casa::ISMIndColumn::getArrayComplexV ( uInt  rownr,
Array< Complex > *  dataPtr 
) [virtual]

Reimplemented from casa::ISMColumn.

virtual void casa::ISMIndColumn::getArrayDComplexV ( uInt  rownr,
Array< DComplex > *  dataPtr 
) [virtual]

Reimplemented from casa::ISMColumn.

virtual void casa::ISMIndColumn::getArraydoubleV ( uInt  rownr,
Array< double > *  dataPtr 
) [virtual]

Reimplemented from casa::ISMColumn.

virtual void casa::ISMIndColumn::getArrayfloatV ( uInt  rownr,
Array< float > *  dataPtr 
) [virtual]

Reimplemented from casa::ISMColumn.

virtual void casa::ISMIndColumn::getArrayIntV ( uInt  rownr,
Array< Int > *  dataPtr 
) [virtual]

Reimplemented from casa::ISMColumn.

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

virtual void casa::ISMIndColumn::getArrayShortV ( uInt  rownr,
Array< Short > *  dataPtr 
) [virtual]

Reimplemented from casa::ISMColumn.

virtual void casa::ISMIndColumn::getArrayStringV ( uInt  rownr,
Array< String > *  dataPtr 
) [virtual]

Reimplemented from casa::ISMColumn.

virtual void casa::ISMIndColumn::getArrayuCharV ( uInt  rownr,
Array< uChar > *  dataPtr 
) [virtual]

Reimplemented from casa::ISMColumn.

virtual void casa::ISMIndColumn::getArrayuIntV ( uInt  rownr,
Array< uInt > *  dataPtr 
) [virtual]

Reimplemented from casa::ISMColumn.

virtual void casa::ISMIndColumn::getArrayuShortV ( uInt  rownr,
Array< uShort > *  dataPtr 
) [virtual]

Reimplemented from casa::ISMColumn.

virtual void casa::ISMIndColumn::getFile ( uInt  nrrow) [virtual]

Let the column object open an existing file.

Reimplemented from casa::ISMColumn.

Read the shape at the given row.

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

virtual void casa::ISMIndColumn::getSliceBoolV ( uInt  rownr,
const Slicer ,
Array< Bool > *  dataPtr 
) [virtual]

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

Reimplemented from casa::StManColumn.

virtual void casa::ISMIndColumn::getSliceComplexV ( uInt  rownr,
const Slicer ,
Array< Complex > *  dataPtr 
) [virtual]

Reimplemented from casa::StManColumn.

virtual void casa::ISMIndColumn::getSliceDComplexV ( uInt  rownr,
const Slicer ,
Array< DComplex > *  dataPtr 
) [virtual]

Reimplemented from casa::StManColumn.

virtual void casa::ISMIndColumn::getSlicedoubleV ( uInt  rownr,
const Slicer ,
Array< double > *  dataPtr 
) [virtual]

Reimplemented from casa::StManColumn.

virtual void casa::ISMIndColumn::getSlicefloatV ( uInt  rownr,
const Slicer ,
Array< float > *  dataPtr 
) [virtual]

Reimplemented from casa::StManColumn.

virtual void casa::ISMIndColumn::getSliceIntV ( uInt  rownr,
const Slicer ,
Array< Int > *  dataPtr 
) [virtual]

Reimplemented from casa::StManColumn.

virtual void casa::ISMIndColumn::getSliceShortV ( uInt  rownr,
const Slicer ,
Array< Short > *  dataPtr 
) [virtual]

Reimplemented from casa::StManColumn.

virtual void casa::ISMIndColumn::getSliceStringV ( uInt  rownr,
const Slicer ,
Array< String > *  dataPtr 
) [virtual]

Reimplemented from casa::StManColumn.

virtual void casa::ISMIndColumn::getSliceuCharV ( uInt  rownr,
const Slicer ,
Array< uChar > *  dataPtr 
) [virtual]

Reimplemented from casa::StManColumn.

virtual void casa::ISMIndColumn::getSliceuIntV ( uInt  rownr,
const Slicer ,
Array< uInt > *  dataPtr 
) [virtual]

Reimplemented from casa::StManColumn.

virtual void casa::ISMIndColumn::getSliceuShortV ( uInt  rownr,
const Slicer ,
Array< uShort > *  dataPtr 
) [virtual]

Reimplemented from casa::StManColumn.

virtual void casa::ISMIndColumn::handleCopy ( uInt  rownr,
const char *  value 
) [virtual]

Handle the duplication of a value; i.e.

increment its reference count.

Reimplemented from casa::ISMColumn.

virtual void casa::ISMIndColumn::handleRemove ( uInt  rownr,
const char *  value 
) [virtual]

Handle the removal of a value; i.e.

decrement its reference count.

Reimplemented from casa::ISMColumn.

void casa::ISMIndColumn::init ( ByteIO::OpenOption  fileOption) [private]

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

It is used by doCreate and getFile.

virtual Bool casa::ISMIndColumn::isShapeDefined ( uInt  rownr) [virtual]

Is the shape defined (i.e.

is there an array) in this row?

Reimplemented from casa::DataManagerColumn.

virtual uInt casa::ISMIndColumn::ndim ( uInt  rownr) [virtual]

Get the dimensionality of the item in the given row.

Reimplemented from casa::ISMColumn.

ISMIndColumn& casa::ISMIndColumn::operator= ( const ISMIndColumn ) [private]

Forbid assignment.

virtual void casa::ISMIndColumn::putArrayBoolV ( uInt  rownr,
const Array< Bool > *  dataPtr 
) [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 casa::ISMColumn.

virtual void casa::ISMIndColumn::putArrayComplexV ( uInt  rownr,
const Array< Complex > *  dataPtr 
) [virtual]

Reimplemented from casa::ISMColumn.

virtual void casa::ISMIndColumn::putArrayDComplexV ( uInt  rownr,
const Array< DComplex > *  dataPtr 
) [virtual]

Reimplemented from casa::ISMColumn.

virtual void casa::ISMIndColumn::putArraydoubleV ( uInt  rownr,
const Array< double > *  dataPtr 
) [virtual]

Reimplemented from casa::ISMColumn.

virtual void casa::ISMIndColumn::putArrayfloatV ( uInt  rownr,
const Array< float > *  dataPtr 
) [virtual]

Reimplemented from casa::ISMColumn.

virtual void casa::ISMIndColumn::putArrayIntV ( uInt  rownr,
const Array< Int > *  dataPtr 
) [virtual]

Reimplemented from casa::ISMColumn.

StIndArray* casa::ISMIndColumn::putArrayPtr ( uInt  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.

virtual void casa::ISMIndColumn::putArrayShortV ( uInt  rownr,
const Array< Short > *  dataPtr 
) [virtual]

Reimplemented from casa::ISMColumn.

virtual void casa::ISMIndColumn::putArrayStringV ( uInt  rownr,
const Array< String > *  dataPtr 
) [virtual]

Reimplemented from casa::ISMColumn.

virtual void casa::ISMIndColumn::putArrayuCharV ( uInt  rownr,
const Array< uChar > *  dataPtr 
) [virtual]

Reimplemented from casa::ISMColumn.

virtual void casa::ISMIndColumn::putArrayuIntV ( uInt  rownr,
const Array< uInt > *  dataPtr 
) [virtual]

Reimplemented from casa::ISMColumn.

virtual void casa::ISMIndColumn::putArrayuShortV ( uInt  rownr,
const Array< uShort > *  dataPtr 
) [virtual]

Reimplemented from casa::ISMColumn.

StIndArray* casa::ISMIndColumn::putShape ( uInt  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.

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.

virtual void casa::ISMIndColumn::putSliceBoolV ( uInt  rownr,
const Slicer ,
const Array< Bool > *  dataPtr 
) [virtual]

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

Reimplemented from casa::StManColumn.

virtual void casa::ISMIndColumn::putSliceComplexV ( uInt  rownr,
const Slicer ,
const Array< Complex > *  dataPtr 
) [virtual]

Reimplemented from casa::StManColumn.

virtual void casa::ISMIndColumn::putSliceDComplexV ( uInt  rownr,
const Slicer ,
const Array< DComplex > *  dataPtr 
) [virtual]

Reimplemented from casa::StManColumn.

virtual void casa::ISMIndColumn::putSlicedoubleV ( uInt  rownr,
const Slicer ,
const Array< double > *  dataPtr 
) [virtual]

Reimplemented from casa::StManColumn.

virtual void casa::ISMIndColumn::putSlicefloatV ( uInt  rownr,
const Slicer ,
const Array< float > *  dataPtr 
) [virtual]

Reimplemented from casa::StManColumn.

virtual void casa::ISMIndColumn::putSliceIntV ( uInt  rownr,
const Slicer ,
const Array< Int > *  dataPtr 
) [virtual]

Reimplemented from casa::StManColumn.

virtual void casa::ISMIndColumn::putSliceShortV ( uInt  rownr,
const Slicer ,
const Array< Short > *  dataPtr 
) [virtual]

Reimplemented from casa::StManColumn.

virtual void casa::ISMIndColumn::putSliceStringV ( uInt  rownr,
const Slicer ,
const Array< String > *  dataPtr 
) [virtual]

Reimplemented from casa::StManColumn.

virtual void casa::ISMIndColumn::putSliceuCharV ( uInt  rownr,
const Slicer ,
const Array< uChar > *  dataPtr 
) [virtual]

Reimplemented from casa::StManColumn.

virtual void casa::ISMIndColumn::putSliceuIntV ( uInt  rownr,
const Slicer ,
const Array< uInt > *  dataPtr 
) [virtual]

Reimplemented from casa::StManColumn.

virtual void casa::ISMIndColumn::putSliceuShortV ( uInt  rownr,
const Slicer ,
const Array< uShort > *  dataPtr 
) [virtual]

Reimplemented from casa::StManColumn.

virtual void casa::ISMIndColumn::reopenRW ( ) [virtual]

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

Reimplemented from casa::ISMColumn.

virtual void casa::ISMIndColumn::resync ( uInt  nrrow) [virtual]

Resync the storage manager with the new file contents.

Reimplemented from casa::ISMColumn.

void casa::ISMIndColumn::setShape ( uInt  rownr,
const IPosition shape 
) [virtual]

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

Reimplemented from casa::DataManagerColumn.

virtual void casa::ISMIndColumn::setShapeColumn ( const IPosition shape) [virtual]

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

Reimplemented from casa::ISMColumn.

virtual IPosition casa::ISMIndColumn::shape ( uInt  rownr) [virtual]

Get the shape of the array in the given row.

Reimplemented from casa::ISMColumn.


Member Data Documentation

The shape of all arrays in case it is fixed.

Definition at line 294 of file ISMIndColumn.h.

The indirect array exists for the row interval last accessed.

Definition at line 302 of file ISMIndColumn.h.

The indirect array object.

Definition at line 300 of file ISMIndColumn.h.

The file containing the arrays.

Definition at line 298 of file ISMIndColumn.h.

The (unique) sequence number of the column.

Definition at line 292 of file ISMIndColumn.h.

Switch indicating if the shape is fixed.

Definition at line 296 of file ISMIndColumn.h.


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