Loading...
Searching...
No Matches
casacore::ScaledComplexData< VirtualType, StoredType > Class Template Reference
tables package (libcasa_tables) » DataMan_module

More...

`#include <ScaledComplexData.h>`

## Public Member Functions

| ScaledComplexData (const String &virtualColumnName, const String &storedColumnName, VirtualType scale, VirtualType offset=0)
| Construct an engine to scale all arrays in a column with the given offset and scale factor.
| ScaledComplexData (const String &virtualColumnName, const String &storedColumnName, const String &scaleColumnName, VirtualType offset=0)
| Construct an engine to scale the arrays in a column.
| ScaledComplexData (const String &virtualColumnName, const String &storedColumnName, const String &scaleColumnName, const String &offsetColumnName)
| ScaledComplexData (const Record &spec)
| Construct from a record specification as created by getmanagerSpec().
| ~ScaledComplexData ()
| Destructor is mandatory.
ScaledComplexData< VirtualType, StoredType > & | operator= (const ScaledComplexData< VirtualType, StoredType > &)=delete
| Assignment is not needed and therefore forbidden.
String | dataManagerType () const
| Return the type name of the engine (i.e.
virtual Record | dataManagerSpec () const
| Record a record containing data manager specifications.
Public Member Functions inherited from casacore::BaseMappedArrayEngine< VirtualType, StoredType >
const String & | virtualName () const
| Get the virtual column name.
const String & | storedName () const
| Get the stored column name.
virtual Bool | isWritable () const
| The column is writable if the underlying stored column is writable.
Public Member Functions inherited from casacore::VirtualColumnEngine
| VirtualColumnEngine ()
| Create the object.
virtual | ~VirtualColumnEngine ()
| VirtualColumnEngine (const VirtualColumnEngine &)=delete
| The copy constructor cannot be used for this base class.
VirtualColumnEngine & | operator= (const VirtualColumnEngine &)=delete
| Assignment cannot be used for this base class.
Public Member Functions inherited from casacore::DataManager
| DataManager ()
| Default constructor.
virtual | ~DataManager ()
| DataManager (const DataManager &)=delete
| The copy constructor cannot be used for this base class.
DataManager & | operator= (const DataManager &)=delete
| Assignment cannot be used for this base class.
virtual String | dataManagerName () const
| Return the name of the data manager.
void | dataManagerInfo (Record &info) const
| Add SEQNR and SPEC (the DataManagerSpec subrecord) to the info.
virtual Record | getProperties () const
| Get data manager properties that can be modified.
virtual void | setProperties (const Record &spec)
| Modify data manager properties given in record fields.
virtual Bool | canReallocateColumns () const
| Tell if the data manager wants to reallocate the data manager column objects.
virtual DataManagerColumn * | reallocateColumn (DataManagerColumn *column)
| Reallocate the column object if it is part of this data manager.
uInt | sequenceNr () const
| Get the (unique) sequence nr of this data manager.
uInt | ncolumn () const
| Get the nr of columns in this data manager (can be zero).
Bool | asBigEndian () const
| Have the data to be stored in big or little endian canonical format?
const TSMOption & | tsmOption () const
| Get the TSM option.
std::shared_ptr< MultiFileBase > | multiFile ()
| Get the MultiFile pointer (can be 0).
String | keywordName (const String &keyword) const
| Compose a keyword name from the given keyword appended with the sequence number (e.g.
String | fileName () const
| Compose a unique filename from the table name and sequence number.
ByteIO::OpenOption | fileOption () const
| Get the AipsIO option of the underlying file.
virtual Bool | isRegular () const
| Is this a regular storage manager?
Table & | table () const
| Get the table this object is associated with.
virtual void | reopenRW ()
| Reopen the data manager for read/write access.
virtual Bool | canAddColumn () const
| Does the data manager allow to add columns?
virtual Bool | canRemoveColumn () const
| Does the data manager allow to delete columns?
virtual Bool | canRenameColumn () const
| Does the data manager allow to rename columns?
virtual void | setMaximumCacheSize (uInt nMiB)
| Set the maximum cache size (in bytes) to be used by a storage manager.
virtual void | showCacheStatistics (std::ostream &) const
| Show the data manager's IO statistics.
DataManagerColumn * | createScalarColumn (const String &columnName, int dataType, const String &dataTypeId)
| Create a column in the data manager on behalf of a table column.
DataManagerColumn * | createDirArrColumn (const String &columnName, int dataType, const String &dataTypeId)
| Create a direct array column.
DataManagerColumn * | createIndArrColumn (const String &columnName, int dataType, const String &dataTypeId)
| Create an indirect array column.
DataManager * | getClone () const
| Has the object already been cloned?
void | setClone (DataManager *clone) const
| Set the pointer to the clone.
Public Member Functions inherited from casacore::VirtualArrayColumn< VirtualType >
| VirtualArrayColumn ()
| Create a column.
virtual | ~VirtualArrayColumn ()
VirtualArrayColumn< VirtualType > & | operator= (const VirtualArrayColumn< VirtualType > &)=delete
| The object cannot be assigned to.
virtual int | dataType () const
| Return the data type of the column.
virtual String | dataTypeId () const
| Return the data type Id of the column.
Public Member Functions inherited from casacore::VirtualArrayColumnBase
| VirtualArrayColumnBase ()
| Create a column.
virtual | ~VirtualArrayColumnBase ()
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 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.
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.

## Static Public Member Functions

static String | className ()
| Return the name of the class.
static void | registerClass ()
| Register the class name and the static makeObject "constructor".
static DataManager * | makeObject (const String &dataManagerType, const Record &spec)
| Define the "constructor" to construct this engine when a table is read back.
Static Public Member Functions inherited from casacore::DataManager
static void | registerCtor (const String &type, DataManagerCtor func)
| Register a mapping of a data manager type to its static construction function.
static DataManagerCtor | getCtor (const String &dataManagerType)
| Get the "constructor" of a data manager (thread-safe).
static Bool | isRegistered (const String &dataManagerType)
| Test if a data manager is registered (thread-safe).
static DataManager * | unknownDataManager (const String &dataManagerType, const Record &spec)
| Serve as default function for theirRegisterMap, which catches all unknown data manager types.

## Private Member Functions

| ScaledComplexData ()
| The default constructor is required for reconstruction of the engine when a table is read back.
| ScaledComplexData (const ScaledComplexData< VirtualType, StoredType > &)
| Copy constructor is only used by clone().
virtual DataManager * | clone () const
| Clone the engine object.
virtual void | create64 (rownr_t initialNrrow)
| Initialize the object for a new table.
virtual void | prepare ()
| Preparing consists of setting the writable switch and adding the initial number of rows in case of create.
virtual void | setShapeColumn (const IPosition &shape)
| Set the shape of the FixedShape arrays in the column.
virtual void | setShape (rownr_t rownr, const IPosition &shape)
| Define the shape of the array in the given row.
virtual uInt | ndim (rownr_t rownr)
| Get the dimensionality of the array in the given row.
virtual IPosition | shape (rownr_t rownr)
| Get the shape of the array in the given row.
virtual void | getArray (rownr_t rownr, Array< VirtualType > &array)
| Get an array in the given row.
virtual void | putArray (rownr_t rownr, const Array< VirtualType > &array)
| Put an array in the given row.
virtual void | getSlice (rownr_t rownr, const Slicer &slicer, Array< VirtualType > &array)
| Get a section of the array in the given row.
virtual void | putSlice (rownr_t rownr, const Slicer &slicer, const Array< VirtualType > &array)
| Put into a section of the array in the given row.
virtual void | getArrayColumn (Array< VirtualType > &array)
| Get an entire column.
virtual void | putArrayColumn (const Array< VirtualType > &array)
| Put an entire column.
virtual void | getArrayColumnCells (const RefRows &rownrs, Array< VirtualType > &data)
| Get some array values in the column.
virtual void | putArrayColumnCells (const RefRows &rownrs, const Array< VirtualType > &data)
| Put some array values in the column.
virtual void | getColumnSlice (const Slicer &slicer, Array< VirtualType > &array)
| Get a section of all arrays in the column.
virtual void | putColumnSlice (const Slicer &slicer, const Array< VirtualType > &array)
| Put a section of all arrays in the column.
virtual void | getColumnSliceCells (const RefRows &rownrs, const Slicer &slicer, Array< VirtualType > &data)
| Get a section of some arrays in the column.
virtual void | putColumnSliceCells (const RefRows &rownrs, const Slicer &slicer, const Array< VirtualType > &data)
| Put into a section of some arrays in the column.
void | scaleOnGet (VirtualType scale, VirtualType offset, Array< VirtualType > &array, const Array< StoredType > &stored)
| Scale and/or offset stored to array.
void | scaleOnPut (VirtualType scale, VirtualType offset, const Array< VirtualType > &array, Array< StoredType > &stored)
| Scale and/or offset array to stored.
void | scaleColumnOnGet (Array< VirtualType > &array, const Array< StoredType > &stored)
| Scale and/or offset stored to array for the entire column.
void | scaleColumnOnPut (const Array< VirtualType > &array, Array< StoredType > &stored)
| Scale and/or offset array to stored for the entire column.
void | scaleCellsOnGet (Array< VirtualType > &array, const Array< StoredType > &stored, const RefRows &rownrs)
| Scale and/or offset stored to array for some cells in the column.
void | scaleCellsOnPut (const Array< VirtualType > &array, Array< StoredType > &stored, const RefRows &rownrs)
| Scale and/or offset array to stored for some cells in the column.
IPosition | storedShape (const IPosition &virtualShape) const
| Determine the shape of an array in the stored column.
Slicer | storedSlicer (const Slicer &virtualSlicer) const
| Convert the Slicer for a virtual to a Slicer for the stored.
VirtualType | getScale (rownr_t rownr)
| Get the scale value for this row.
VirtualType | getOffset (rownr_t rownr)
| Get the offset value for this row.

## Private Attributes

String | scaleName_p
String | offsetName_p
VirtualType | scale_p
VirtualType | offset_p
Bool | fixedScale_p
Bool | fixedOffset_p
ScalarColumn< VirtualType > * | scaleColumn_p
ScalarColumn< VirtualType > * | offsetColumn_p

## Additional Inherited Members

Static Public Attributes inherited from casacore::DataManager
static rownr_t | MAXROWNR32
| Define the highest row number that can be represented as signed 32-bit.
Protected Member Functions inherited from casacore::BaseMappedArrayEngine< VirtualType, StoredType >
| BaseMappedArrayEngine (const String &virtualColumnName, const String &storedColumnName)
| Construct an engine to convert the virtual column to the stored column.
| ~BaseMappedArrayEngine ()
| Destructor is mandatory.
| BaseMappedArrayEngine ()
| The default constructor is required for reconstruction of the engine when a table is read back.
| BaseMappedArrayEngine (const BaseMappedArrayEngine &)
| Copy constructor is used by copy constructor of derived classes.
BaseMappedArrayEngine & | operator= (const BaseMappedArrayEngine &)=delete
| Assignment is not needed and therefore forbidden.
void | setWritable (Bool isWritable)
| Set if the column is writable or not.
void | setNames (const String &virtualName, const String &storedName)
| Set the virtual and stored column name.
ArrayColumn< StoredType > & | column ()
| Give access to the stored column.
virtual DataManagerColumn * | makeIndArrColumn (const String &columnName, int dataType, const String &dataTypeId)
| Create the column object for the array column in this engine.
void | prepare1 ()
| Do the 2 stages of the prepare (define columns and adding rows).
void | prepare2 ()
virtual void | addRow64 (rownr_t nrrow)
| Rows are added to the end of the table.
virtual void | addRowInit (rownr_t startRow, rownr_t nrrow)
virtual Bool | isShapeDefined (rownr_t rownr)
| Test if the (underlying) array is defined in the given row.
virtual Bool | canChangeShape () const
| The data manager can handle changing the shape of an existing array when the underlying stored column can do it.
TableColumn | makeTableColumn (const String &columnName)
| Make a table column object for the given column.
virtual IPosition | getStoredShape (rownr_t rownr, const IPosition &virtualShape)
| Map the virtual shape to the stored shape.
virtual Slicer | getStoredSlicer (const Slicer &virtualSlicer) const
| Map the slicer for a virtual shape to a stored shape.
virtual void | mapOnGet (Array< VirtualType > &array, const Array< StoredType > &stored)
| Map StoredType array to VirtualType array.
virtual void | mapOnPut (const Array< VirtualType > &array, Array< StoredType > &stored)
| Map Bool array to bit flags array.
Protected Member Functions inherited from casacore::DataManager
void | decrementNcolumn ()
| Decrement number of columns (in case a column is deleted).
void | setEndian (Bool bigEndian)
| Tell the data manager if big or little endian format is needed.
void | setTsmOption (const TSMOption &tsmOption)
| Tell the data manager which TSM option to use.
void | setMultiFile (const std::shared_ptr< MultiFileBase > &mfile)
| Tell the data manager that MultiFile can be used.
virtual Bool | hasMultiFileSupport () const
| Does the data manager support use of MultiFile?
void | throwDataTypeOther (const String &columnName, int dataType) const
| Throw an exception in case data type is TpOther, because the storage managers (and maybe other data managers) do not support such columns.
Protected Member Functions inherited from casacore::VirtualArrayColumnBase
virtual void | getScalarColumnV (ArrayBase &dataPtr)
| The scalar access functions throw an exception.
virtual void | putScalarColumnV (const ArrayBase &dataPtr)
| Put all scalar values in the column.
virtual void | getScalarColumnCellsV (const RefRows &rownrs, ArrayBase &dataPtr)
| Get some scalar values in the column.
virtual void | putScalarColumnCellsV (const RefRows &rownrs, const ArrayBase &dataPtr)
| Put some scalar values in the column.
Protected Member Functions inherited from casacore::DataManagerColumn
virtual void | getBool (rownr_t rownr, Bool *dataPtr)
| Get the 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 | getOther (rownr_t rownr, void *dataPtr)
| This function is the get for all non-standard data types.
virtual void | putBool (rownr_t rownr, const Bool *dataPtr)
| Put the scalar value into 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 | 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)

## Detailed Description

template<class VirtualType, class StoredType>
class casacore::ScaledComplexData< VirtualType, StoredType >

Templated virtual column engine to scale a complex table array

### Intended use:

Public interface

### Review Status

Reviewed By:
  Gareth Hunt
Date Reviewed:
  94Nov17

### Prerequisite

- VirtualColumnEngine
- VirtualArrayColumn

### Synopsis

ScaledComplexData is a virtual column engine which scales an array of a complex type to 2 values of another type (to save disk storage). For example, ScaledComplexData<Complex,Short> resembles the classic AIPS compress method which scales the data from float to short. The (complex) scale factor and offset value can be given in two ways:

- As a fixed value which is used for all arrays in the column.
- As the name of a column. In this way each array in a column can have its own scale and offset value. The scale and offset value in a row must be put before the array is put and should not be changed anymore.

It is also possible to have a variable scale factor with a fixed offset value. As in FITS the scale and offset values are used as:
True_value = Stored_value * scale + offset;

An engine object should be used for one column only, because the stored column name is part of the engine. If it would be used for more than one column, they would all share the same stored column. When the engine is bound to a column, it is checked if the name of that column matches the given virtual column name.

The engine can be used for a column containing any kind of array (thus direct or indirect, fixed or variable shaped)) as long as the virtual array can be stored in the stored array. Thus a fixed shaped virtual can use a variable shaped stored, but not vice versa. A fixed shape indirect virtual can use a stored with direct arrays.

This class can also serve as an example of how to implement a virtual column engine.

### Motivation

This class allows to store data in a smaller representation. It is needed to resemble the classic AIPS compress option. It adds the scale and offset value on a per row basis.

Because the engine can serve only one column, it was possible to combine the engine and the column functionality in one class. This has been achieved using multiple inheritance. The advantage of this is that only one templated class is used, so less template instantiations are needed.

Class ScaledArrayEngine could not be used, because complex integer types are not supported in the tabe system.

### Example

// Create the table description and 2 columns with indirect arrays in it.
// The Int column will be stored, while the double will be
// used as virtual.
TableDesc tableDesc ("", TableDesc::Scratch);
tableDesc.addColumn (ArrayColumnDesc<Short> ("storedArray"));
tableDesc.addColumn (ArrayColumnDesc<Complex> ("virtualArray"));
// Create a new table using the table description.
SetupNewTable newtab (tableDesc, "tab.data", Table::New);
// Create the array scaling engine to scale from double to Int
// and bind it to the double column.
// Create the table.
ScaledComplexData<Complex,Short> scalingEngine("virtualArray",
"storedArray", 10);
newtab.bindColumn ("virtualArray", scalingEngine);
Table table (newtab);
// Store a 2-D array (with dim. 3,4) into each row of the column.
// The shape of each array in the column is implicitly set by the put
// function. This will also set the shape of the underlying Int array
// (as a 3-D array with shape 2,3,4).
ArrayColumn data (table, "virtualArray");
Array<DComplex> someArray(IPosition(2,3,4));
someArray = 0;
for (rownr_t i=0, i<10; i++) { // table will have 10 rows
table.addRow();
data.put (i, someArray)
}
casacore::ArrayColumnDesc
Templated class for description of table array columns.
Definition ArrColDesc.h:235
casacore::ArrayColumn
Definition ArrayColumn.h:98
casacore::Array
Definition Array.h:155
casacore::DataManager::table
Table & table() const
Get the table this object is associated with.
Definition DataManager.h:323
casacore::IPosition
Definition IPosition.h:117
casacore::ScaledComplexData::ScaledComplexData
ScaledComplexData(const String &virtualColumnName, const String &storedColumnName, VirtualType scale, VirtualType offset=0)
Construct an engine to scale all arrays in a column with the given offset and scale factor.
casacore::SetupNewTable
Create a new table - define shapes, data managers, etc.
Definition SetupNewTab.h:337
casacore::TableDesc
Definition TableDesc.h:189
casacore::TableDesc::Scratch
@ Scratch
Definition TableDesc.h:193
casacore::Table
Definition Table.h:157
casacore::Table::New
@ New
create table
Definition Table.h:175
casacore::rownr_t
uInt64 rownr_t
Define the type of a row number in a table.
Definition aipsxtype.h:44

### Template Type Argument Requirements (VirtualType)

- only complex data types

### Template Type Argument Requirements (StoredType)

- only built-in numerics data types

Definition at line 146 of file ScaledComplexData.h.

## Constructor & Destructor Documentation

## ScaledComplexData() [1/6]

template<class VirtualType, class StoredType>

casacore::ScaledComplexData< VirtualType, StoredType >::ScaledComplexData | ( | const String & | virtualColumnName,
|  | const String & | storedColumnName,
|  | VirtualType | scale,
|  | VirtualType | offset = 0 )

Construct an engine to scale all arrays in a column with the given offset and scale factor.

StoredColumnName is the name of the column where the scaled data will be put and must have data type StoredType. The virtual column using this engine must have data type VirtualType.

References casacore::offset().

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

## ScaledComplexData() [2/6]

template<class VirtualType, class StoredType>

casacore::ScaledComplexData< VirtualType, StoredType >::ScaledComplexData | ( | const String & | virtualColumnName,
|  | const String & | storedColumnName,
|  | const String & | scaleColumnName,
|  | VirtualType | offset = 0 )

Construct an engine to scale the arrays in a column.

The scale and offset values are taken from a column with the given names. In that way each array has its own scale factor and offset value. An exception is thrown if these columns do not exist. VirtualColumnName is the name of the virtual column and is used to check if the engine gets bound to the correct column. StoredColumnName is the name of the column where the scaled data will be put and must have data type StoredType. The virtual column using this engine must have data type VirtualType.

References casacore::offset().

## ScaledComplexData() [3/6]

template<class VirtualType, class StoredType>

casacore::ScaledComplexData< VirtualType, StoredType >::ScaledComplexData | ( | const String & | virtualColumnName,
|  | const String & | storedColumnName,
|  | const String & | scaleColumnName,
|  | const String & | offsetColumnName )

## ScaledComplexData() [4/6]

template<class VirtualType, class StoredType>

casacore::ScaledComplexData< VirtualType, StoredType >::ScaledComplexData | ( | const Record & | spec | ) |

Construct from a record specification as created by getmanagerSpec().

References casacore::Record().

## ~ScaledComplexData()

template<class VirtualType, class StoredType>

casacore::ScaledComplexData< VirtualType, StoredType >::~ScaledComplexData | ( |  | ) |

Destructor is mandatory.

## ScaledComplexData() [5/6]

template<class VirtualType, class StoredType>

casacore::ScaledComplexData< VirtualType, StoredType >::ScaledComplexData | ( |  | ) |

private

The default constructor is required for reconstruction of the engine when a table is read back.

## ScaledComplexData() [6/6]

template<class VirtualType, class StoredType>

casacore::ScaledComplexData< VirtualType, StoredType >::ScaledComplexData | ( | const ScaledComplexData< VirtualType, StoredType > & |  | ) |

private

Copy constructor is only used by clone().

(so it is made private).

References ScaledComplexData().

## Member Function Documentation

## className()

template<class VirtualType, class StoredType>

String casacore::ScaledComplexData< VirtualType, StoredType >::className | ( |  | ) |

static

Return the name of the class.

This includes the names of the template arguments.

## clone()

template<class VirtualType, class StoredType>

virtual DataManager * casacore::ScaledComplexData< VirtualType, StoredType >::clone | ( |  | ) | const

private virtual

Clone the engine object.

Implements casacore::DataManager.

## create64()

template<class VirtualType, class StoredType>

virtual void casacore::ScaledComplexData< VirtualType, StoredType >::create64 | ( | rownr_t | initialNrrow | ) |

private virtual

Initialize the object for a new table.

It defines the keywords containing the engine parameters.

Reimplemented from casacore::BaseMappedArrayEngine< VirtualType, StoredType >.

## dataManagerSpec()

template<class VirtualType, class StoredType>

virtual Record casacore::ScaledComplexData< VirtualType, StoredType >::dataManagerSpec | ( |  | ) | const

virtual

Record a record containing data manager specifications.

Reimplemented from casacore::DataManager.

References casacore::Record().

## dataManagerType()

template<class VirtualType, class StoredType>

String casacore::ScaledComplexData< VirtualType, StoredType >::dataManagerType | ( |  | ) | const

virtual

Return the type name of the engine (i.e.

its class name).

Implements casacore::DataManager.

Referenced by makeObject().

## getArray()

template<class VirtualType, class StoredType>

virtual void casacore::ScaledComplexData< VirtualType, StoredType >::getArray | ( | rownr_t | rownr,
|  | Array< VirtualType > & | array )

private virtual

Get an array in the given row.

This will scale and offset from the underlying array.

Reimplemented from casacore::BaseMappedArrayEngine< VirtualType, StoredType >.

References casacore::array.

## getArrayColumn()

template<class VirtualType, class StoredType>

virtual void casacore::ScaledComplexData< VirtualType, StoredType >::getArrayColumn | ( | Array< VirtualType > & | array | ) |

private virtual

Get an entire column.

This will scale and offset from the underlying array.

Reimplemented from casacore::BaseMappedArrayEngine< VirtualType, StoredType >.

References casacore::array.

## getArrayColumnCells()

template<class VirtualType, class StoredType>

virtual void casacore::ScaledComplexData< VirtualType, StoredType >::getArrayColumnCells | ( | const RefRows & | rownrs,
|  | Array< VirtualType > & | data )

private virtual

Get some array values in the column.

This will scale and offset from the underlying array.

Reimplemented from casacore::BaseMappedArrayEngine< VirtualType, StoredType >.

## getColumnSlice()

template<class VirtualType, class StoredType>

virtual void casacore::ScaledComplexData< VirtualType, StoredType >::getColumnSlice | ( | const Slicer & | slicer,
|  | Array< VirtualType > & | array )

private virtual

Get a section of all arrays in the column.

This will scale and offset from the underlying array.

Reimplemented from casacore::BaseMappedArrayEngine< VirtualType, StoredType >.

References casacore::array.

## getColumnSliceCells()

template<class VirtualType, class StoredType>

virtual void casacore::ScaledComplexData< VirtualType, StoredType >::getColumnSliceCells | ( | const RefRows & | rownrs,
|  | const Slicer & | slicer,
|  | Array< VirtualType > & | data )

private virtual

Get a section of some arrays in the column.

This will scale and offset from the underlying array.

Reimplemented from casacore::BaseMappedArrayEngine< VirtualType, StoredType >.

## getOffset()

template<class VirtualType, class StoredType>

VirtualType casacore::ScaledComplexData< VirtualType, StoredType >::getOffset | ( | rownr_t | rownr | ) |

private

Get the offset value for this row.

## getScale()

template<class VirtualType, class StoredType>

VirtualType casacore::ScaledComplexData< VirtualType, StoredType >::getScale | ( | rownr_t | rownr | ) |

private

Get the scale value for this row.

## getSlice()

template<class VirtualType, class StoredType>

virtual void casacore::ScaledComplexData< VirtualType, StoredType >::getSlice | ( | rownr_t | rownr,
|  | const Slicer & | slicer,
|  | Array< VirtualType > & | array )

private virtual

Get a section of the array in the given row.

This will scale and offset from the underlying array.

Reimplemented from casacore::BaseMappedArrayEngine< VirtualType, StoredType >.

References casacore::array.

## makeObject()

template<class VirtualType, class StoredType>

DataManager * casacore::ScaledComplexData< VirtualType, StoredType >::makeObject | ( | const String & | dataManagerType,
|  | const Record & | spec )

static

Define the "constructor" to construct this engine when a table is read back.

This "constructor" has to be registered by the user of the engine. If the engine is commonly used, its registration can be added to the registerAllCtor function in DataManReg.cc. That function gets automatically invoked by the table system.

References dataManagerType(), and casacore::Record().

## ndim()

template<class VirtualType, class StoredType>

virtual uInt casacore::ScaledComplexData< VirtualType, StoredType >::ndim | ( | rownr_t | rownr | ) |

private virtual

Get the dimensionality of the array in the given row.

Reimplemented from casacore::BaseMappedArrayEngine< VirtualType, StoredType >.

## operator=()

template<class VirtualType, class StoredType>

ScaledComplexData< VirtualType, StoredType > & casacore::ScaledComplexData< VirtualType, StoredType >::operator= | ( | const ScaledComplexData< VirtualType, StoredType > & |  | ) |

delete

Assignment is not needed and therefore forbidden.

References ScaledComplexData().

## prepare()

template<class VirtualType, class StoredType>

virtual void casacore::ScaledComplexData< VirtualType, StoredType >::prepare | ( |  | ) |

private virtual

Preparing consists of setting the writable switch and adding the initial number of rows in case of create.

Furthermore it reads the keywords containing the engine parameters.

Reimplemented from casacore::BaseMappedArrayEngine< VirtualType, StoredType >.

## putArray()

template<class VirtualType, class StoredType>

virtual void casacore::ScaledComplexData< VirtualType, StoredType >::putArray | ( | rownr_t | rownr,
|  | const Array< VirtualType > & | array )

private virtual

Put an array in the given row.

This will scale and offset to the underlying array.

Reimplemented from casacore::BaseMappedArrayEngine< VirtualType, StoredType >.

References casacore::array.

## putArrayColumn()

template<class VirtualType, class StoredType>

virtual void casacore::ScaledComplexData< VirtualType, StoredType >::putArrayColumn | ( | const Array< VirtualType > & | array | ) |

private virtual

Put an entire column.

This will scale and offset to the underlying array.

Reimplemented from casacore::BaseMappedArrayEngine< VirtualType, StoredType >.

References casacore::array.

## putArrayColumnCells()

template<class VirtualType, class StoredType>

virtual void casacore::ScaledComplexData< VirtualType, StoredType >::putArrayColumnCells | ( | const RefRows & | rownrs,
|  | const Array< VirtualType > & | data )

private virtual

Put some array values in the column.

This will scale and offset to the underlying array.

Reimplemented from casacore::BaseMappedArrayEngine< VirtualType, StoredType >.

## putColumnSlice()

template<class VirtualType, class StoredType>

virtual void casacore::ScaledComplexData< VirtualType, StoredType >::putColumnSlice | ( | const Slicer & | slicer,
|  | const Array< VirtualType > & | array )

private virtual

Put a section of all arrays in the column.

This will scale and offset to the underlying array.

Reimplemented from casacore::BaseMappedArrayEngine< VirtualType, StoredType >.

References casacore::array.

## putColumnSliceCells()

template<class VirtualType, class StoredType>

virtual void casacore::ScaledComplexData< VirtualType, StoredType >::putColumnSliceCells | ( | const RefRows & | rownrs,
|  | const Slicer & | slicer,
|  | const Array< VirtualType > & | data )

private virtual

Put into a section of some arrays in the column.

This will scale and offset to the underlying array.

Reimplemented from casacore::BaseMappedArrayEngine< VirtualType, StoredType >.

## putSlice()

template<class VirtualType, class StoredType>

virtual void casacore::ScaledComplexData< VirtualType, StoredType >::putSlice | ( | rownr_t | rownr,
|  | const Slicer & | slicer,
|  | const Array< VirtualType > & | array )

private virtual

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

This will scale and offset to the underlying array.

Reimplemented from casacore::BaseMappedArrayEngine< VirtualType, StoredType >.

References casacore::array.

## registerClass()

template<class VirtualType, class StoredType>

void casacore::ScaledComplexData< VirtualType, StoredType >::registerClass | ( |  | ) |

static

Register the class name and the static makeObject "constructor".

This will make the engine known to the table system. The automatically invoked registration function in DataManReg.cc contains ScaledComplexData<double,Int>. Any other instantiation of this class must be registered "manually" (or added to DataManReg.cc).

## scaleCellsOnGet()

template<class VirtualType, class StoredType>

void casacore::ScaledComplexData< VirtualType, StoredType >::scaleCellsOnGet | ( | Array< VirtualType > & | array,
|  | const Array< StoredType > & | stored,
|  | const RefRows & | rownrs )

private

Scale and/or offset stored to array for some cells in the column.

When the scale and offset are fixed, it will do the entire array. Otherwise it iterates through the array and applies the scale and offset per row.

References casacore::array.

## scaleCellsOnPut()

template<class VirtualType, class StoredType>

void casacore::ScaledComplexData< VirtualType, StoredType >::scaleCellsOnPut | ( | const Array< VirtualType > & | array,
|  | Array< StoredType > & | stored,
|  | const RefRows & | rownrs )

private

Scale and/or offset array to stored for some cells in the column.

When the scale and offset are fixed, it will do the entire array. Otherwise it iterates through the array and applies the scale and offset per row.

References casacore::array.

## scaleColumnOnGet()

template<class VirtualType, class StoredType>

void casacore::ScaledComplexData< VirtualType, StoredType >::scaleColumnOnGet | ( | Array< VirtualType > & | array,
|  | const Array< StoredType > & | stored )

private

Scale and/or offset stored to array for the entire column.

When the scale and offset are fixed, it will do the entire array. Otherwise it iterates through the array and applies the scale and offset per row.

References casacore::array.

## scaleColumnOnPut()

template<class VirtualType, class StoredType>

void casacore::ScaledComplexData< VirtualType, StoredType >::scaleColumnOnPut | ( | const Array< VirtualType > & | array,
|  | Array< StoredType > & | stored )

private

Scale and/or offset array to stored for the entire column.

When the scale and offset are fixed, it will do the entire array. Otherwise it iterates through the array and applies the scale and offset per row.

References casacore::array.

## scaleOnGet()

template<class VirtualType, class StoredType>

void casacore::ScaledComplexData< VirtualType, StoredType >::scaleOnGet | ( | VirtualType | scale,
|  | VirtualType | offset,
|  | Array< VirtualType > & | array,
|  | const Array< StoredType > & | stored )

private

Scale and/or offset stored to array.

This is meant when reading an array from the stored column. It optimizes for scale=1 and/or offset=0.

References casacore::array, and casacore::offset().

## scaleOnPut()

template<class VirtualType, class StoredType>

void casacore::ScaledComplexData< VirtualType, StoredType >::scaleOnPut | ( | VirtualType | scale,
|  | VirtualType | offset,
|  | const Array< VirtualType > & | array,
|  | Array< StoredType > & | stored )

private

Scale and/or offset array to stored.

This is meant when writing an array into the stored column. It optimizes for scale=1 and/or offset=0.

References casacore::array, and casacore::offset().

## setShape()

template<class VirtualType, class StoredType>

virtual void casacore::ScaledComplexData< VirtualType, StoredType >::setShape | ( | rownr_t | rownr,
|  | const IPosition & | shape )

private virtual

Define the shape of the array in the given row.

When the shape of the (underlying) stored array has already been defined, it checks whether its latter dimensions match the given virtual shape. When matching, nothing will be done. When mismatching or when the stored shape has not been defined yet, the stored shape will be defined from the virtual shape and the virtual element shape. E.g. in case of a StokesVector a virtual shape of (512,512) results in a stored shape of (4,512,512).

Reimplemented from casacore::BaseMappedArrayEngine< VirtualType, StoredType >.

References shape().

## setShapeColumn()

template<class VirtualType, class StoredType>

virtual void casacore::ScaledComplexData< VirtualType, StoredType >::setShapeColumn | ( | const IPosition & | shape | ) |

private virtual

Set the shape of the FixedShape arrays in the column.

This function only gets called if the column has FixedShape arrays. The shape gets saved and used to set the shape of the arrays in the stored in case the stored has non-FixedShape arrays.

Reimplemented from casacore::BaseMappedArrayEngine< VirtualType, StoredType >.

References shape().

## shape()

template<class VirtualType, class StoredType>

virtual IPosition casacore::ScaledComplexData< VirtualType, StoredType >::shape | ( | rownr_t | rownr | ) |

private virtual

Get the shape of the array in the given row.

This is done by stripping the first dimension from the shape of the underlying stored array.

Reimplemented from casacore::BaseMappedArrayEngine< VirtualType, StoredType >.

Referenced by setShape(), and setShapeColumn().

## storedShape()

template<class VirtualType, class StoredType>

IPosition casacore::ScaledComplexData< VirtualType, StoredType >::storedShape | ( | const IPosition & | virtualShape | ) | const

inline private

Determine the shape of an array in the stored column.

Definition at line 366 of file ScaledComplexData.h.

References casacore::IPosition::concatenate().

## storedSlicer()

template<class VirtualType, class StoredType>

Slicer casacore::ScaledComplexData< VirtualType, StoredType >::storedSlicer | ( | const Slicer & | virtualSlicer | ) | const

private

Convert the Slicer for a virtual to a Slicer for the stored.

## Member Data Documentation

## fixedOffset_p

template<class VirtualType, class StoredType>

Bool casacore::ScaledComplexData< VirtualType, StoredType >::fixedOffset_p

private

Definition at line 378 of file ScaledComplexData.h.

## fixedScale_p

template<class VirtualType, class StoredType>

Bool casacore::ScaledComplexData< VirtualType, StoredType >::fixedScale_p

private

Definition at line 377 of file ScaledComplexData.h.

## offset_p

template<class VirtualType, class StoredType>

VirtualType casacore::ScaledComplexData< VirtualType, StoredType >::offset_p

private

Definition at line 376 of file ScaledComplexData.h.

## offsetColumn_p

template<class VirtualType, class StoredType>

ScalarColumn<VirtualType>* casacore::ScaledComplexData< VirtualType, StoredType >::offsetColumn_p

private

Definition at line 380 of file ScaledComplexData.h.

## offsetName_p

template<class VirtualType, class StoredType>

String casacore::ScaledComplexData< VirtualType, StoredType >::offsetName_p

private

Definition at line 374 of file ScaledComplexData.h.

## scale_p

template<class VirtualType, class StoredType>

VirtualType casacore::ScaledComplexData< VirtualType, StoredType >::scale_p

private

Definition at line 375 of file ScaledComplexData.h.

## scaleColumn_p

template<class VirtualType, class StoredType>

ScalarColumn<VirtualType>* casacore::ScaledComplexData< VirtualType, StoredType >::scaleColumn_p

private

Definition at line 379 of file ScaledComplexData.h.

## scaleName_p

template<class VirtualType, class StoredType>

String casacore::ScaledComplexData< VirtualType, StoredType >::scaleName_p

private

Definition at line 373 of file ScaledComplexData.h.

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

- tables/DataMan/ScaledComplexData.h