casacore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
casacore::SSMIndColumn Class Reference

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

#include <SSMIndColumn.h>

Inheritance diagram for casacore::SSMIndColumn:
casacore::SSMColumn casacore::StManColumnBase casacore::DataManagerColumn

Public Member Functions

 SSMIndColumn (SSMBase *aParent, int aDataType, uInt aColNr)
 Create a column of the given data type. More...
 
 ~SSMIndColumn ()
 Frees up the storage. More...
 
virtual void setMaxLength (uInt maxLength)
 An array of 'fixed length' strings is not handled specially, thus this function is ignored. More...
 
virtual void addRow (rownr_t aNewNrRows, rownr_t anOldNrRows, Bool doInit)
 Add (newNrrow-oldNrrow) rows to the column. More...
 
virtual void setShapeColumn (const IPosition &aShape)
 Set the (fixed) shape of the arrays in the entire column. More...
 
virtual uInt ndim (rownr_t aRowNr)
 Get the dimensionality of the item in the given row. More...
 
void setShape (rownr_t aRowNr, const IPosition &aShape)
 Set the shape of the array in the given row and allocate the array in the file. More...
 
virtual Bool isShapeDefined (rownr_t aRowNr)
 Is the shape defined (i.e. More...
 
virtual IPosition shape (rownr_t aRowNr)
 Get the shape of the array in the given row. More...
 
Bool canChangeShape () const
 This storage manager can handle changing array shapes. More...
 
virtual void getArrayV (rownr_t aRowNr, ArrayBase &aDataPtr)
 Get an array value in the given row. More...
 
virtual void putArrayV (rownr_t aRowNr, const ArrayBase &aDataPtr)
 Put an array value into the given row. More...
 
virtual void getSliceV (rownr_t aRowNr, const Slicer &, ArrayBase &aDataPtr)
 Get a section of the array in the given row. More...
 
virtual void putSliceV (rownr_t aRowNr, const Slicer &, const ArrayBase &aDataPtr)
 Put into a section of the array in the given row. More...
 
virtual void doCreate (rownr_t aNrRows)
 Let the column object create its array file. More...
 
virtual void getFile (rownr_t aNrRows)
 Open an existing file. More...
 
virtual void deleteRow (rownr_t aRowNr)
 Remove the given row from the data bucket and possibly string bucket. More...
 
- Public Member Functions inherited from casacore::SSMColumn
 SSMColumn (SSMBase *aParent, int aDataType, uInt aColNr)
 Create a SSMColumn object with the given parent. More...
 
virtual ~SSMColumn ()
 
void resync (rownr_t aNrRow)
 Resync the storage manager with the new file contents. More...
 
virtual void getBool (rownr_t aRowNr, Bool *aDataPtr)
 Get the scalar value in the given row. More...
 
virtual void getuChar (rownr_t aRowNr, uChar *aDataPtr)
 
virtual void getShort (rownr_t aRowNr, Short *aDataPtr)
 
virtual void getuShort (rownr_t aRowNr, uShort *aDataPtr)
 
virtual void getInt (rownr_t aRowNr, Int *aDataPtr)
 
virtual void getuInt (rownr_t aRowNr, uInt *aDataPtr)
 
virtual void getInt64 (rownr_t aRowNr, Int64 *aDataPtr)
 
virtual void getfloat (rownr_t aRowNr, float *aDataPtr)
 
virtual void getdouble (rownr_t aRowNr, double *aDataPtr)
 
virtual void getComplex (rownr_t aRowNr, Complex *aDataPtr)
 
virtual void getDComplex (rownr_t aRowNr, DComplex *aDataPtr)
 
virtual void getString (rownr_t aRowNr, String *aDataPtr)
 
virtual void putBool (rownr_t aRowNr, const Bool *aDataPtr)
 Put the scalar value in the given row. More...
 
virtual void putuChar (rownr_t aRowNr, const uChar *aDataPtr)
 
virtual void putShort (rownr_t aRowNr, const Short *aDataPtr)
 
virtual void putuShort (rownr_t aRowNr, const uShort *aDataPtr)
 
virtual void putInt (rownr_t aRowNr, const Int *aDataPtr)
 
virtual void putuInt (rownr_t aRowNr, const uInt *aDataPtr)
 
virtual void putInt64 (rownr_t aRowNr, const Int64 *aDataPtr)
 
virtual void putfloat (rownr_t aRowNr, const float *aDataPtr)
 
virtual void putdouble (rownr_t aRowNr, const double *aDataPtr)
 
virtual void putComplex (rownr_t aRowNr, const Complex *aDataPtr)
 
virtual void putDComplex (rownr_t aRowNr, const DComplex *aDataPtr)
 
virtual void putString (rownr_t aRowNr, const String *aDataPtr)
 
virtual void getScalarColumnV (ArrayBase &aDataPtr)
 Get the scalar values of the entire column. More...
 
virtual void putScalarColumnV (const ArrayBase &aDataPtr)
 Put the scalar values of the entire column. More...
 
uInt getExternalSizeBytes () const
 Get the size of the dataType in bytes!! More...
 
uInt getExternalSizeBits () const
 Get the size of the dataType in bits!! More...
 
uInt getColNr ()
 get the sequence number of this column. More...
 
void setColNr (uInt aColNr)
 set the sequence number of this column. More...
 
void removeColumn ()
 If something special has to be done before removing the Column, as is the case with Strings, it can be done here. More...
 
- Public Member Functions inherited from casacore::StManColumnBase
 StManColumnBase (int dataType)
 Default constructor. More...
 
 ~StManColumnBase ()
 
virtual int dataType () const
 Return the data type of the column. More...
 
DataType dtype () const
 
Int elemSize () const
 Return the size of an element of the column's data type. More...
 
- Public Member Functions inherited from casacore::DataManagerColumn
 DataManagerColumn ()
 Create a column. More...
 
virtual ~DataManagerColumn ()
 Frees up the storage. More...
 
void setIsFixedShape (Bool isFixedShape)
 Set the isFixedShape flag. More...
 
Bool isFixedShape () const
 Is this a fixed shape column? More...
 
virtual String dataTypeId () const
 Get the data type id of the column for dataType==TpOther. More...
 
virtual Bool isWritable () const
 Test if data can be put into this column. More...
 
void setFixedShapeColumn (const IPosition &shape)
 Set the shape of all (fixed-shaped) arrays in the column. More...
 
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. More...
 
virtual IPosition tileShape (rownr_t rownr)
 Get the tile shape of the item in the given row. More...
 
ColumnCachecolumnCache ()
 Get access to the ColumnCache object. More...
 
const ColumnCachecolumnCachePtr () const
 
void get (rownr_t rownr, Bool *dataPtr)
 Get the scalar value in the given row. More...
 
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. More...
 
void put (rownr_t rownr, const Bool *dataPtr)
 Put the scalar value into the given row. More...
 
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. More...
 
virtual void getScalarColumnCellsV (const RefRows &rownrs, ArrayBase &dataPtr)
 Get some scalar values in the column. More...
 
virtual void putScalarColumnCellsV (const RefRows &rownrs, const ArrayBase &dataPtr)
 Put some scalar values in the column. More...
 
virtual void getArrayColumnV (ArrayBase &data)
 Get all array values in the column. More...
 
virtual void putArrayColumnV (const ArrayBase &data)
 Put all array values in the column. More...
 
virtual void getArrayColumnCellsV (const RefRows &rownrs, ArrayBase &data)
 Get some array values in the column. More...
 
virtual void putArrayColumnCellsV (const RefRows &rownrs, const ArrayBase &data)
 Put some array values in the column. More...
 
virtual void getColumnSliceV (const Slicer &slicer, ArrayBase &data)
 Get a section of all arrays in the column. More...
 
virtual void putColumnSliceV (const Slicer &slicer, const ArrayBase &data)
 Put into a section of all arrays in the column. More...
 
virtual void getColumnSliceCellsV (const RefRows &rownrs, const Slicer &slicer, ArrayBase &data)
 Get a section of some arrays in the column. More...
 
virtual void putColumnSliceCellsV (const RefRows &rownrs, const Slicer &slicer, const ArrayBase &data)
 Put into a section of some arrays in the column. More...
 
void throwGet () const
 Throw an "invalid operation" exception for the default implementation of get. More...
 
void throwPut () const
 Throw an "invalid operation" exception for the default implementation of put. More...
 
void setColumnName (const String &colName)
 Set the column name. More...
 
const StringcolumnName () const
 Get rhe column name. More...
 

Private Member Functions

 SSMIndColumn (const SSMIndColumn &)
 Forbid copy constructor. More...
 
SSMIndColumnoperator= (const SSMIndColumn &)
 Forbid assignment. More...
 
void init ()
 Initialize part of the object and open/create the file. More...
 
StIndArraygetShape (rownr_t aRowNr)
 Read the shape at the given row. More...
 
StIndArraygetArrayPtr (rownr_t aRowNr)
 Return a pointer to the array in the given row (for a get). More...
 

Private Attributes

IPosition itsFixedShape
 
Bool isShapeFixed
 
StManArrayFileitsIosFile
 
StIndArray itsIndArray
 

Additional Inherited Members

- Static Public Member Functions inherited from casacore::StManColumnBase
static Bool isNativeDataType (int dtype)
 Test if the given data type is supported by storage managers. More...
 
- Protected Member Functions inherited from casacore::SSMColumn
void shiftRows (char *aValue, rownr_t rowNr, rownr_t startRow, rownr_t endRow)
 Shift the rows in the bucket one to the left when removing the given row. More...
 
void getValue (rownr_t aRowNr)
 Fill the cache with data of the bucket containing the given row. More...
 
ChargetRowValue (Int *data, rownr_t aRowNr)
 Get the bucketnr, offset, and length of a variable length string. More...
 
void putValue (rownr_t aRowNr, const void *aValue)
 Put the given value for the row into the correct data bucket. More...
 
void putValueShortString (rownr_t aRowNr, const void *aValue, const String &string)
 Put the given string for the row into the correct data bucket. More...
 
void getColumnValue (void *anArray, rownr_t aNrRows)
 Get the values for the entire column. More...
 
void putColumnValue (const void *anArray, rownr_t aNrRows)
 Put the values from the array in the entire column. More...
 
- 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. More...
 
virtual void putOther (rownr_t rownr, const void *dataPtr)
 This function is the put for all non-standard data types. More...
 
void getScalarColumnBase (ArrayBase &dataPtr)
 The default implementations of get and put functions. More...
 
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::SSMColumn
SSMBaseitsSSMPtr
 Pointer to the parent storage manager. More...
 
uInt itsExternalSizeBytes
 Length of column cell value in storage format (0 = variable length). More...
 
uInt itsExternalSizeBits
 
uInt itsColNr
 Column sequence number of this column. More...
 
IPosition itsShape
 The shape of the column. More...
 
uInt itsMaxLen
 The maximum length of a 'fixed length' string. More...
 
uInt itsNrElem
 Number of elements in a value for this column. More...
 
uInt itsNrCopy
 Number of values to be copied. More...
 
uInt itsLocalSize
 The sizeof the datatype in local format. More...
 
void * itsData
 The data in local format. More...
 
Conversion::ValueFunctionitsWriteFunc
 Pointer to a convert function for writing. More...
 
Conversion::ValueFunctionitsReadFunc
 Pointer to a convert function for reading. More...
 

Detailed Description

A column of Standard storage manager for indirect arrays.

Intended use:

Internal

Review Status

Reviewed By:
UNKNOWN
Date Reviewed:
before2004/08/25
Test programs:
tStandardStMan

Prerequisite

Etymology

SSMIndColumn represents a Column in the Standard Storage Manager containing Indirect arrays.

Synopsis

SSMIndColumn is the implementation of an SSMColumn 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 appropriate data bucket using the standard SSMColumn functions.

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.

Indirect arrays containing strings are not handled by this class, but by SSMIndStringColumn. That class stores those string arrays in the special string buckets instead of using StIndArray. The reason is that the string buckets are more disk space efficient when string arrays are frequently updated.

Definition at line 93 of file SSMIndColumn.h.

Constructor & Destructor Documentation

casacore::SSMIndColumn::SSMIndColumn ( SSMBase aParent,
int  aDataType,
uInt  aColNr 
)

Create a column of the given data type.

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

casacore::SSMIndColumn::~SSMIndColumn ( )

Frees up the storage.

casacore::SSMIndColumn::SSMIndColumn ( const SSMIndColumn )
private

Forbid copy constructor.

Member Function Documentation

virtual void casacore::SSMIndColumn::addRow ( rownr_t  aNewNrRows,
rownr_t  anOldNrRows,
Bool  doInit 
)
virtual

Add (newNrrow-oldNrrow) rows to the column.

Reimplemented from casacore::SSMColumn.

Bool casacore::SSMIndColumn::canChangeShape ( ) const
virtual

This storage manager can handle changing array shapes.

Reimplemented from casacore::DataManagerColumn.

virtual void casacore::SSMIndColumn::deleteRow ( rownr_t  aRowNr)
virtual

Remove the given row from the data bucket and possibly string bucket.

Reimplemented from casacore::SSMColumn.

virtual void casacore::SSMIndColumn::doCreate ( rownr_t  aNrRows)
virtual

Let the column object create its array file.

Reimplemented from casacore::SSMColumn.

StIndArray* casacore::SSMIndColumn::getArrayPtr ( rownr_t  aRowNr)
private

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

virtual void casacore::SSMIndColumn::getArrayV ( rownr_t  aRowNr,
ArrayBase aDataPtr 
)
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::DataManagerColumn.

virtual void casacore::SSMIndColumn::getFile ( rownr_t  aNrRows)
virtual

Open an existing file.

Reimplemented from casacore::SSMColumn.

StIndArray* casacore::SSMIndColumn::getShape ( rownr_t  aRowNr)
private

Read the shape at the given row.

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

virtual void casacore::SSMIndColumn::getSliceV ( rownr_t  aRowNr,
const Slicer ,
ArrayBase aDataPtr 
)
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 casacore::DataManagerColumn.

void casacore::SSMIndColumn::init ( )
private

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

It is used by doCreate and getFile.

virtual Bool casacore::SSMIndColumn::isShapeDefined ( rownr_t  aRowNr)
virtual

Is the shape defined (i.e.

is there an array) in this row?

Reimplemented from casacore::DataManagerColumn.

virtual uInt casacore::SSMIndColumn::ndim ( rownr_t  aRowNr)
virtual

Get the dimensionality of the item in the given row.

Reimplemented from casacore::SSMColumn.

SSMIndColumn& casacore::SSMIndColumn::operator= ( const SSMIndColumn )
private

Forbid assignment.

virtual void casacore::SSMIndColumn::putArrayV ( rownr_t  aRowNr,
const ArrayBase aDataPtr 
)
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::DataManagerColumn.

virtual void casacore::SSMIndColumn::putSliceV ( rownr_t  aRowNr,
const Slicer ,
const ArrayBase aDataPtr 
)
virtual

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

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

Reimplemented from casacore::DataManagerColumn.

virtual void casacore::SSMIndColumn::setMaxLength ( uInt  maxLength)
virtual

An array of 'fixed length' strings is not handled specially, thus this function is ignored.

It is needed to override the bahviour of the base class.

Reimplemented from casacore::SSMColumn.

void casacore::SSMIndColumn::setShape ( rownr_t  aRowNr,
const IPosition aShape 
)
virtual

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

Reimplemented from casacore::DataManagerColumn.

virtual void casacore::SSMIndColumn::setShapeColumn ( const IPosition aShape)
virtual

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

Reimplemented from casacore::SSMColumn.

virtual IPosition casacore::SSMIndColumn::shape ( rownr_t  aRowNr)
virtual

Get the shape of the array in the given row.

Reimplemented from casacore::SSMColumn.

Member Data Documentation

Bool casacore::SSMIndColumn::isShapeFixed
private

Definition at line 185 of file SSMIndColumn.h.

IPosition casacore::SSMIndColumn::itsFixedShape
private

Definition at line 183 of file SSMIndColumn.h.

StIndArray casacore::SSMIndColumn::itsIndArray
private

Definition at line 189 of file SSMIndColumn.h.

StManArrayFile* casacore::SSMIndColumn::itsIosFile
private

Definition at line 187 of file SSMIndColumn.h.


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