casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
casacore::ScaledArrayEngine< VirtualType, StoredType > Class Template Reference

Templated virtual column engine to scale a table array. More...

#include <ScaledArrayEngine.h>

Inheritance diagram for casacore::ScaledArrayEngine< VirtualType, StoredType >:
casacore::BaseMappedArrayEngine< VirtualType, StoredType > casacore::VirtualColumnEngine casacore::VirtualArrayColumn< VirtualType > casacore::DataManager casacore::DataManagerColumn

Public Member Functions

 ScaledArrayEngine (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. More...
 
 ScaledArrayEngine (const String &virtualColumnName, const String &storedColumnName, const String &scaleColumnName, VirtualType offset=0)
 Construct an engine to scale the arrays in a column. More...
 
 ScaledArrayEngine (const String &virtualColumnName, const String &storedColumnName, const String &scaleColumnName, const String &offsetColumnName)
 
 ScaledArrayEngine (const Record &spec)
 Construct from a record specification as created by getmanagerSpec(). More...
 
 ~ScaledArrayEngine ()
 Destructor is mandatory. More...
 
virtual String dataManagerType () const
 Return the type name of the engine (i.e. More...
 
virtual String dataManagerName () const
 Get the name given to the engine (is the virtual column name). More...
 
virtual Record dataManagerSpec () const
 Record a record containing data manager specifications. More...
 
- Public Member Functions inherited from casacore::BaseMappedArrayEngine< VirtualType, StoredType >
const StringvirtualName () const
 Get the virtual column name. More...
 
const StringstoredName () const
 Get the stored column name. More...
 
virtual Bool isWritable () const
 The column is writable if the underlying stored column is writable. More...
 
- Public Member Functions inherited from casacore::VirtualColumnEngine
 VirtualColumnEngine ()
 Create the object. More...
 
virtual ~VirtualColumnEngine ()
 
- Public Member Functions inherited from casacore::DataManager
 DataManager ()
 Default constructor. More...
 
virtual ~DataManager ()
 
void dataManagerInfo (Record &info) const
 Add SEQNR and SPEC (the DataManagerSpec subrecord) to the info. More...
 
virtual Record getProperties () const
 Get data manager properties that can be modified. More...
 
virtual void setProperties (const Record &spec)
 Modify data manager properties given in record fields. More...
 
virtual Bool canReallocateColumns () const
 Tell if the data manager wants to reallocate the data manager column objects. More...
 
virtual DataManagerColumnreallocateColumn (DataManagerColumn *column)
 Reallocate the column object if it is part of this data manager. More...
 
uInt sequenceNr () const
 Get the (unique) sequence nr of this data manager. More...
 
uInt ncolumn () const
 Get the nr of columns in this data manager (can be zero). More...
 
Bool asBigEndian () const
 Have the data to be stored in big or little endian canonical format? More...
 
const TSMOptiontsmOption () const
 Get the TSM option. More...
 
MultiFileBasemultiFile ()
 Get the MultiFile pointer (can be 0). More...
 
String keywordName (const String &keyword) const
 Compose a keyword name from the given keyword appended with the sequence number (e.g. More...
 
String fileName () const
 Compose a unique filename from the table name and sequence number. More...
 
ByteIO::OpenOption fileOption () const
 Get the AipsIO option of the underlying file. More...
 
virtual Bool isRegular () const
 Is this a regular storage manager? It is regular if it allows addition of rows and writing data in them. More...
 
Tabletable () const
 Get the table this object is associated with. More...
 
virtual void reopenRW ()
 Reopen the data manager for read/write access. More...
 
virtual Bool canAddColumn () const
 Does the data manager allow to add columns? (default no) More...
 
virtual Bool canRemoveColumn () const
 Does the data manager allow to delete columns? (default no) More...
 
virtual Bool canRenameColumn () const
 Does the data manager allow to rename columns? (default yes) More...
 
virtual void setMaximumCacheSize (uInt nbytes)
 Set the maximum cache size (in bytes) to be used by a storage manager. More...
 
virtual void showCacheStatistics (std::ostream &) const
 Show the data manager's IO statistics. More...
 
DataManagerColumncreateScalarColumn (const String &columnName, int dataType, const String &dataTypeId)
 Create a column in the data manager on behalf of a table column. More...
 
DataManagerColumncreateDirArrColumn (const String &columnName, int dataType, const String &dataTypeId)
 Create a direct array column. More...
 
DataManagerColumncreateIndArrColumn (const String &columnName, int dataType, const String &dataTypeId)
 Create an indirect array column. More...
 
DataManagergetClone () const
 Has the object already been cloned? More...
 
void setClone (DataManager *clone) const
 Set the pointer to the clone. More...
 
- Public Member Functions inherited from casacore::VirtualArrayColumn< VirtualType >
 VirtualArrayColumn ()
 Create a column. More...
 
virtual ~VirtualArrayColumn ()
 Frees up the storage. More...
 
virtual int dataType () const
 Return the data type of the column. More...
 
virtual String dataTypeId () const
 Return the data type Id of the column. More...
 
virtual Bool canAccessSlice (Bool &reask) const
 The class can handle a get/putSlice. More...
 
virtual Bool canAccessArrayColumn (Bool &reask) const
 The class can handle a get/putArrayColumn. More...
 
virtual Bool canAccessColumnSlice (Bool &reask) const
 The class can handle a get/putColumnSlice. 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 void setMaxLength (uInt maxLength)
 Set the maximum length of the value (can be used for strings). More...
 
void setFixedShapeColumn (const IPosition &shape)
 Set the shape of all (fixed-shaped) arrays in the column. More...
 
virtual void setShapeTiled (uInt 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 (uInt rownr)
 Get the tile shape of the item in the given row. More...
 
virtual Bool canAccessScalarColumn (Bool &reask) const
 Can the column data manager handle access to a scalar column? If not, the caller should access the column by looping through all cells in the column. More...
 
virtual Bool canAccessScalarColumnCells (Bool &reask) const
 Can the column data manager handle access to a clooection of cells in a scalar column? If not, the caller should access the column cells by looping through the cells in the column. More...
 
virtual Bool canAccessArrayColumnCells (Bool &reask) const
 Can the column data manager handle access to a collection of cells in an array column? If not, the caller should access the column cells by looping through the cells in the column. More...
 
ColumnCachecolumnCache ()
 Get access to the ColumnCache object. More...
 
const ColumnCachecolumnCachePtr () const
 
void get (uInt rownr, Bool *dataPtr)
 Get the scalar value in the given row. More...
 
void get (uInt rownr, uChar *dataPtr)
 
void get (uInt rownr, Short *dataPtr)
 
void get (uInt rownr, uShort *dataPtr)
 
void get (uInt rownr, Int *dataPtr)
 
void get (uInt rownr, uInt *dataPtr)
 
void get (uInt rownr, Int64 *dataPtr)
 
void get (uInt rownr, float *dataPtr)
 
void get (uInt rownr, double *dataPtr)
 
void get (uInt rownr, Complex *dataPtr)
 
void get (uInt rownr, DComplex *dataPtr)
 
void get (uInt rownr, String *dataPtr)
 
void get (uInt rownr, void *dataPtr)
 This function is the get for all non-standard data types. More...
 
void put (uInt rownr, const Bool *dataPtr)
 Put the scalar value into the given row. More...
 
void put (uInt rownr, const uChar *dataPtr)
 
void put (uInt rownr, const Short *dataPtr)
 
void put (uInt rownr, const uShort *dataPtr)
 
void put (uInt rownr, const Int *dataPtr)
 
void put (uInt rownr, const uInt *dataPtr)
 
void put (uInt rownr, const Int64 *dataPtr)
 
void put (uInt rownr, const float *dataPtr)
 
void put (uInt rownr, const double *dataPtr)
 
void put (uInt rownr, const Complex *dataPtr)
 
void put (uInt rownr, const DComplex *dataPtr)
 
void put (uInt rownr, const String *dataPtr)
 
void put (uInt rownr, const void *dataPtr)
 This function is the put for all non-standard data types. More...
 
virtual void getScalarColumnV (void *dataPtr)
 Get all scalar values in the column. More...
 
virtual void putScalarColumnV (const void *dataPtr)
 Put all scalar values in the column. More...
 
virtual void getScalarColumnCellsV (const RefRows &rownrs, void *dataPtr)
 Get some scalar values in the column. More...
 
virtual void putScalarColumnCellsV (const RefRows &rownrs, const void *dataPtr)
 Put some scalar values in the column. More...
 
virtual uInt getBlockV (uInt rownr, uInt nrmax, void *dataPtr)
 Get scalars from the given row on with a maximum of nrmax values. More...
 
virtual void putBlockV (uInt rownr, uInt nrmax, const void *dataPtr)
 Put nrmax scalars from the given row on. 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...
 

Static Public Member Functions

static String className ()
 Return the name of the class. More...
 
static void registerClass ()
 Register the class name and the static makeObject "constructor". More...
 
static DataManagermakeObject (const String &dataManagerType, const Record &spec)
 
- 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. More...
 
static DataManagerCtor getCtor (const String &dataManagerType)
 Get the "constructor" of a data manager (thread-safe). More...
 
static Bool isRegistered (const String &dataManagerType)
 Test if a data manager is registered (thread-safe). More...
 
static DataManagerunknownDataManager (const String &dataManagerType, const Record &spec)
 Serve as default function for theirRegisterMap, which catches all unknown data manager types. More...
 

Private Member Functions

 ScaledArrayEngine (const ScaledArrayEngine< VirtualType, StoredType > &)
 Copy constructor is only used by clone(). More...
 
ScaledArrayEngine< VirtualType,
StoredType > & 
operator= (const ScaledArrayEngine< VirtualType, StoredType > &)
 Assignment is not needed and therefore forbidden (so it is made private and not implemented). More...
 
DataManagerclone () const
 Clone the engine object. More...
 
void create (uInt initialNrrow)
 Initialize the object for a new table. More...
 
void prepare ()
 Preparing consists of setting the writable switch and adding the initial number of rows in case of create. More...
 
void getArray (uInt rownr, Array< VirtualType > &array)
 Get an array in the given row. More...
 
void putArray (uInt rownr, const Array< VirtualType > &array)
 Put an array in the given row. More...
 
void getSlice (uInt rownr, const Slicer &slicer, Array< VirtualType > &array)
 Get a section of the array in the given row. More...
 
void putSlice (uInt rownr, const Slicer &slicer, const Array< VirtualType > &array)
 Put into a section of the array in the given row. More...
 
void getArrayColumn (Array< VirtualType > &array)
 Get an entire column. More...
 
void putArrayColumn (const Array< VirtualType > &array)
 Put an entire column. More...
 
void getColumnSlice (const Slicer &slicer, Array< VirtualType > &array)
 Get a section of all arrays in the column. More...
 
void putColumnSlice (const Slicer &slicer, const Array< VirtualType > &array)
 Put a section of all arrays in the column. More...
 
void scaleOnGet (VirtualType scale, VirtualType offset, Array< VirtualType > &array, const Array< StoredType > &stored)
 Scale and/or offset stored to array. More...
 
void scaleOnPut (VirtualType scale, VirtualType offset, const Array< VirtualType > &array, Array< StoredType > &stored)
 Scale and/or offset array to stored. More...
 
void scaleColumnOnGet (Array< VirtualType > &array, const Array< StoredType > &stored)
 Scale and/or offset stored to array for the entire column. More...
 
void scaleColumnOnPut (const Array< VirtualType > &array, Array< StoredType > &stored)
 Scale and/or offset array to stored for the entire column. More...
 
VirtualType getScale (uInt rownr)
 Get the scale value for this row. More...
 
VirtualType getOffset (uInt rownr)
 Get the offset value for this row. More...
 

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

- 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. More...
 
 ~BaseMappedArrayEngine ()
 Destructor is mandatory. More...
 
 BaseMappedArrayEngine ()
 The default constructor is required for reconstruction of the engine when a table is read back. More...
 
 BaseMappedArrayEngine (const BaseMappedArrayEngine< VirtualType, StoredType > &)
 Copy constructor is only used by copy constructor of derived classes. More...
 
void setWritable (Bool isWritable)
 Set if the column is writable or not. More...
 
void setNames (const String &virtualName, const String &storedName)
 Set the virtual and stored column name. More...
 
ArrayColumn< StoredType > & column ()
 Give access to the stored column. More...
 
virtual DataManagerColumnmakeIndArrColumn (const String &columnName, int dataType, const String &dataTypeId)
 Create the column object for the array column in this engine. More...
 
void prepare1 ()
 Do the 2 stages of the prepare (define columns and adding rows). More...
 
void prepare2 ()
 
virtual void addRow (uInt nrrow)
 Rows are added to the end of the table. More...
 
virtual void addRowInit (uInt startRow, uInt nrrow)
 
virtual void setShapeColumn (const IPosition &shape)
 Set the shape of the FixedShape arrays in the column. More...
 
virtual void setShape (uInt rownr, const IPosition &shape)
 Define the shape of the array in the given row. More...
 
virtual Bool isShapeDefined (uInt rownr)
 Test if the (underlying) array is defined in the given row. More...
 
virtual uInt ndim (uInt rownr)
 Get the dimensionality of the (underlying) array in the given row. More...
 
virtual IPosition shape (uInt rownr)
 Get the shape of the (underlying) array in the given row. More...
 
virtual Bool canChangeShape () const
 The data manager can handle changing the shape of an existing array when the underlying stored column can do it. More...
 
TableColumn makeTableColumn (const String &columnName)
 Make a table column object for the given column. More...
 
virtual void getArrayColumnCells (const RefRows &rownrs, Array< VirtualType > &data)
 Get some array values in the column. More...
 
virtual void putArrayColumnCells (const RefRows &rownrs, const Array< VirtualType > &data)
 Put some array values in the column. More...
 
void getColumnSlice (const Slicer &slicer, Array< VirtualType > &array)
 Get a section of all arrays in the column. More...
 
void putColumnSlice (const Slicer &slicer, const Array< VirtualType > &array)
 Put a section of all arrays in the column. More...
 
virtual void getColumnSliceCells (const RefRows &rownrs, const Slicer &slicer, Array< VirtualType > &data)
 Get a section of some arrays in the column. More...
 
virtual void putColumnSliceCells (const RefRows &rownrs, const Slicer &slicer, const Array< VirtualType > &data)
 Put into a section of some arrays in the column. More...
 
virtual IPosition getStoredShape (uInt rownr, const IPosition &virtualShape)
 Map the virtual shape to the stored shape. More...
 
virtual Slicer getStoredSlicer (const Slicer &virtualSlicer) const
 Map the slicer for a virtual shape to a stored shape. More...
 
virtual void mapOnGet (Array< VirtualType > &array, const Array< StoredType > &stored)
 Map StoredType array to VirtualType array. More...
 
virtual void mapOnPut (const Array< VirtualType > &array, Array< StoredType > &stored)
 Map Bool array to bit flags array. More...
 
- Protected Member Functions inherited from casacore::DataManager
void decrementNcolumn ()
 Decrement number of columns (in case a column is deleted). More...
 
void setEndian (Bool bigEndian)
 Tell the data manager if big or little endian format is needed. More...
 
void setTsmOption (const TSMOption &tsmOption)
 Tell the data manager which TSM option to use. More...
 
void setMultiFile (MultiFileBase *mfile)
 Tell the data manager that MultiFile can be used. More...
 
virtual Bool hasMultiFileSupport () const
 Does the data manager support use of MultiFile? A derived class has to return True if it can use the MultiFile. More...
 
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. More...
 
- Protected Member Functions inherited from casacore::DataManagerColumn
virtual void getBoolV (uInt rownr, Bool *dataPtr)
 Get the scalar value in the given row. More...
 
virtual void getuCharV (uInt rownr, uChar *dataPtr)
 
virtual void getShortV (uInt rownr, Short *dataPtr)
 
virtual void getuShortV (uInt rownr, uShort *dataPtr)
 
virtual void getIntV (uInt rownr, Int *dataPtr)
 
virtual void getuIntV (uInt rownr, uInt *dataPtr)
 
virtual void getInt64V (uInt rownr, Int64 *dataPtr)
 
virtual void getfloatV (uInt rownr, float *dataPtr)
 
virtual void getdoubleV (uInt rownr, double *dataPtr)
 
virtual void getComplexV (uInt rownr, Complex *dataPtr)
 
virtual void getDComplexV (uInt rownr, DComplex *dataPtr)
 
virtual void getStringV (uInt rownr, String *dataPtr)
 
virtual void getOtherV (uInt rownr, void *dataPtr)
 This function is the get for all non-standard data types. More...
 
virtual void putBoolV (uInt rownr, const Bool *dataPtr)
 Put the scalar value into the given row. More...
 
virtual void putuCharV (uInt rownr, const uChar *dataPtr)
 
virtual void putShortV (uInt rownr, const Short *dataPtr)
 
virtual void putuShortV (uInt rownr, const uShort *dataPtr)
 
virtual void putIntV (uInt rownr, const Int *dataPtr)
 
virtual void putuIntV (uInt rownr, const uInt *dataPtr)
 
virtual void putInt64V (uInt rownr, const Int64 *dataPtr)
 
virtual void putfloatV (uInt rownr, const float *dataPtr)
 
virtual void putdoubleV (uInt rownr, const double *dataPtr)
 
virtual void putComplexV (uInt rownr, const Complex *dataPtr)
 
virtual void putDComplexV (uInt rownr, const DComplex *dataPtr)
 
virtual void putStringV (uInt rownr, const String *dataPtr)
 
virtual void putOtherV (uInt rownr, const void *dataPtr)
 This function is the put for all non-standard data types. More...
 

Detailed Description

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

Templated virtual column engine to scale a table array.

Intended use:

Public interface

Review Status

Reviewed By:
Gareth Hunt
Date Reviewed:
94Nov17

Prerequisite

Synopsis

ScaledArrayEngine is a virtual column engine which scales an array of one type to another type to save disk storage. This resembles the classic AIPS compress method which scales the data from float to short. The scale factor and offset value can be given in two ways:

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.

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<Int> ("storedArray"));
tableDesc.addColumn (ArrayColumnDesc<double> ("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.
ScaledArrayEngine<double,Int> scalingEngine("virtualArray",
"storedArray", 10);
newtab.bindColumn ("virtualArray", scalingEngine);
Table table (newtab);
// Store a 3-D array (with dim. 2,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.
ArrayColumn data (table, "virtualArray");
Array<double> someArray(IPosition(4,2,3,4));
someArray = 0;
for (uInt i=0, i<10; i++) { // table will have 10 rows
data.put (i, someArray)
}

Template Type Argument Requirements (VirtualType)

Template Type Argument Requirements (StoredType)

Definition at line 143 of file ScaledArrayEngine.h.

Constructor & Destructor Documentation

template<class VirtualType , class StoredType >
casacore::ScaledArrayEngine< VirtualType, StoredType >::ScaledArrayEngine ( 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.

template<class VirtualType , class StoredType >
casacore::ScaledArrayEngine< VirtualType, StoredType >::ScaledArrayEngine ( 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.

template<class VirtualType , class StoredType >
casacore::ScaledArrayEngine< VirtualType, StoredType >::ScaledArrayEngine ( const String virtualColumnName,
const String storedColumnName,
const String scaleColumnName,
const String offsetColumnName 
)
template<class VirtualType , class StoredType >
casacore::ScaledArrayEngine< VirtualType, StoredType >::ScaledArrayEngine ( const Record spec)

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

template<class VirtualType , class StoredType >
casacore::ScaledArrayEngine< VirtualType, StoredType >::~ScaledArrayEngine ( )

Destructor is mandatory.

template<class VirtualType , class StoredType >
casacore::ScaledArrayEngine< VirtualType, StoredType >::ScaledArrayEngine ( const ScaledArrayEngine< VirtualType, StoredType > &  )
private

Copy constructor is only used by clone().

(so it is made private).

Member Function Documentation

template<class VirtualType , class StoredType >
static String casacore::ScaledArrayEngine< VirtualType, StoredType >::className ( )
static

Return the name of the class.

This includes the names of the template arguments.

template<class VirtualType , class StoredType >
DataManager* casacore::ScaledArrayEngine< VirtualType, StoredType >::clone ( ) const
privatevirtual

Clone the engine object.

Implements casacore::DataManager.

template<class VirtualType , class StoredType >
void casacore::ScaledArrayEngine< VirtualType, StoredType >::create ( uInt  initialNrrow)
privatevirtual

Initialize the object for a new table.

It defines the keywords containing the engine parameters.

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

template<class VirtualType , class StoredType >
virtual String casacore::ScaledArrayEngine< VirtualType, StoredType >::dataManagerName ( ) const
virtual

Get the name given to the engine (is the virtual column name).

Reimplemented from casacore::DataManager.

template<class VirtualType , class StoredType >
virtual Record casacore::ScaledArrayEngine< VirtualType, StoredType >::dataManagerSpec ( ) const
virtual

Record a record containing data manager specifications.

Reimplemented from casacore::DataManager.

template<class VirtualType , class StoredType >
virtual String casacore::ScaledArrayEngine< VirtualType, StoredType >::dataManagerType ( ) const
virtual

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

its class name).

Implements casacore::DataManager.

template<class VirtualType , class StoredType >
void casacore::ScaledArrayEngine< VirtualType, StoredType >::getArray ( uInt  rownr,
Array< VirtualType > &  array 
)
privatevirtual

Get an array in the given row.

This will scale and offset from the underlying array.

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

template<class VirtualType , class StoredType >
void casacore::ScaledArrayEngine< VirtualType, StoredType >::getArrayColumn ( Array< VirtualType > &  array)
privatevirtual

Get an entire column.

This will scale and offset from the underlying array.

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

template<class VirtualType , class StoredType >
void casacore::ScaledArrayEngine< VirtualType, StoredType >::getColumnSlice ( const Slicer slicer,
Array< VirtualType > &  array 
)
privatevirtual

Get a section of all arrays in the column.

This will scale and offset from the underlying array.

Reimplemented from casacore::VirtualArrayColumn< VirtualType >.

template<class VirtualType , class StoredType >
VirtualType casacore::ScaledArrayEngine< VirtualType, StoredType >::getOffset ( uInt  rownr)
private

Get the offset value for this row.

template<class VirtualType , class StoredType >
VirtualType casacore::ScaledArrayEngine< VirtualType, StoredType >::getScale ( uInt  rownr)
private

Get the scale value for this row.

template<class VirtualType , class StoredType >
void casacore::ScaledArrayEngine< VirtualType, StoredType >::getSlice ( uInt  rownr,
const Slicer slicer,
Array< VirtualType > &  array 
)
privatevirtual

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

template<class VirtualType , class StoredType >
static DataManager* casacore::ScaledArrayEngine< VirtualType, StoredType >::makeObject ( const String dataManagerType,
const Record spec 
)
static
template<class VirtualType , class StoredType >
ScaledArrayEngine<VirtualType,StoredType>& casacore::ScaledArrayEngine< VirtualType, StoredType >::operator= ( const ScaledArrayEngine< VirtualType, StoredType > &  )
private

Assignment is not needed and therefore forbidden (so it is made private and not implemented).

template<class VirtualType , class StoredType >
void casacore::ScaledArrayEngine< VirtualType, StoredType >::prepare ( )
privatevirtual

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

template<class VirtualType , class StoredType >
void casacore::ScaledArrayEngine< VirtualType, StoredType >::putArray ( uInt  rownr,
const Array< VirtualType > &  array 
)
privatevirtual

Put an array in the given row.

This will scale and offset to the underlying array.

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

template<class VirtualType , class StoredType >
void casacore::ScaledArrayEngine< VirtualType, StoredType >::putArrayColumn ( const Array< VirtualType > &  array)
privatevirtual

Put an entire column.

This will scale and offset to the underlying array.

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

template<class VirtualType , class StoredType >
void casacore::ScaledArrayEngine< VirtualType, StoredType >::putColumnSlice ( const Slicer slicer,
const Array< VirtualType > &  array 
)
privatevirtual

Put a section of all arrays in the column.

This will scale and offset to the underlying array.

Reimplemented from casacore::VirtualArrayColumn< VirtualType >.

template<class VirtualType , class StoredType >
void casacore::ScaledArrayEngine< VirtualType, StoredType >::putSlice ( uInt  rownr,
const Slicer slicer,
const Array< VirtualType > &  array 
)
privatevirtual

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

template<class VirtualType , class StoredType >
static void casacore::ScaledArrayEngine< 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 ScaledArrayEngine<double,Int>. Any other instantiation of this class must be registered "manually" (or added to DataManReg.cc).

template<class VirtualType , class StoredType >
void casacore::ScaledArrayEngine< 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.

template<class VirtualType , class StoredType >
void casacore::ScaledArrayEngine< 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.

template<class VirtualType , class StoredType >
void casacore::ScaledArrayEngine< 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.

template<class VirtualType , class StoredType >
void casacore::ScaledArrayEngine< 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.

Member Data Documentation

template<class VirtualType , class StoredType >
Bool casacore::ScaledArrayEngine< VirtualType, StoredType >::fixedOffset_p
private

Definition at line 303 of file ScaledArrayEngine.h.

template<class VirtualType , class StoredType >
Bool casacore::ScaledArrayEngine< VirtualType, StoredType >::fixedScale_p
private

Definition at line 302 of file ScaledArrayEngine.h.

template<class VirtualType , class StoredType >
VirtualType casacore::ScaledArrayEngine< VirtualType, StoredType >::offset_p
private

Definition at line 301 of file ScaledArrayEngine.h.

template<class VirtualType , class StoredType >
ScalarColumn<VirtualType>* casacore::ScaledArrayEngine< VirtualType, StoredType >::offsetColumn_p
private

Definition at line 305 of file ScaledArrayEngine.h.

template<class VirtualType , class StoredType >
String casacore::ScaledArrayEngine< VirtualType, StoredType >::offsetName_p
private

Definition at line 299 of file ScaledArrayEngine.h.

template<class VirtualType , class StoredType >
VirtualType casacore::ScaledArrayEngine< VirtualType, StoredType >::scale_p
private

Definition at line 300 of file ScaledArrayEngine.h.

template<class VirtualType , class StoredType >
ScalarColumn<VirtualType>* casacore::ScaledArrayEngine< VirtualType, StoredType >::scaleColumn_p
private

Definition at line 304 of file ScaledArrayEngine.h.

template<class VirtualType , class StoredType >
String casacore::ScaledArrayEngine< VirtualType, StoredType >::scaleName_p
private

Definition at line 298 of file ScaledArrayEngine.h.


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