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

More...

`#include <BaseMappedArrayEngine.h>`

## Public Member Functions

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 DataManager * | clone () const =0
| Make a clone of the derived object.
virtual String | dataManagerName () const
| Return the name of the data manager.
virtual String | dataManagerType () const =0
| Return the type name of the data manager (in fact its class name).
void | dataManagerInfo (Record &info) const
| Add SEQNR and SPEC (the DataManagerSpec subrecord) to the info.
virtual Record | dataManagerSpec () const
| Return a record containing data manager specifications.
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.

## Protected Member Functions

| 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.
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.
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 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 Bool | isShapeDefined (rownr_t rownr)
| Test if the (underlying) array is defined in the given row.
virtual uInt | ndim (rownr_t rownr)
| Get the dimensionality of the (underlying) array in the given row.
virtual IPosition | shape (rownr_t rownr)
| Get the shape of the (underlying) array 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 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.
void | getColumnSlice (const Slicer &slicer, Array< VirtualType > &array)
| Get a section of all arrays in the column.
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.
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)

## Private Attributes

String | virtualName_p
String | storedName_p
Bool | isWritable_p
Bool | tempWritable_p
rownr_t | initialNrrow_p
Bool | arrayIsFixed_p
IPosition | shapeFixed_p
ArrayColumn< StoredType > * | column_p

## Additional Inherited Members

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.
Static Public Attributes inherited from casacore::DataManager
static rownr_t | MAXROWNR32
| Define the highest row number that can be represented as signed 32-bit.

## Detailed Description

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

Templated virtual column engine for a table array of any type.

### Intended use:

Public interface

### Review Status

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

### Prerequisite

- VirtualColumnEngine
- VirtualArrayColumn

### Etymology

BaseMappedArrayEngine contains for the 1-1 mapping of a virtual column to a stored column (both containing arrays).

### Synopsis

BaseMappedArrayEngine is an abstract base class for virtual column engines which map data from the arrays in the virtual column to the arrays in the stored column. Note the the stored column does not need to be stored; it can be another virtual column, but usually it will be a stored column. Examples of classes using this base class are ScaledArrayEngine and RetypedArrayEngine.

The virtual column has to be bound to the virtual column engine used for it. The stored column will usually be bound to a storage manager, but any other suitable data manager is possible. E.g. it is possible to use MappedArrayEngine<StokesVector,float> to map a StokesVector to a float column, which in its turn uses ScaledArrayEngine<float,Int> to store it as integers. Note that the names of the virtual and stored column have to be different, otherwise the table system cannot distinguish them.

This base class does several tasks for the derived classes. The main one is to keep and handle the information about the virtual and stored column. The name of the stored column is written as a keyword in the virtual column. In this way the stored column is known when a table is read back. It also creates (RO)ArrayColumn<T> objects to access the stored column. The function roColumn gives read access, while rwColumn gives write access.

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.

The DataManager framework contains various virtual functions. This class implements several, but not all of them. Furthermore some implementations may not be optimal or correct for derived classes. Hereafter follows a list of functions which may need implementation in derived classes. The classes mentioned in the examples below show implementations of these functions.

- The following (virtual) functions have to be implemented:
  ~... (the destructor)
  DataManager* clone() const;
  String dataManagerType() const;
  static void registerClass();
  static DataManager* makeObject (const String& dataManagerType);
  void getArray (rownr_t rownr, Array<T>& data);
  void putArray (rownr_t rownr, const Array<T>& data); (only if the virtual column is writable).
- For efficiency reasons it could be better to implement the following functions:
  void getSlice (rownr_t rownr, const Slicer& slicer, Array<T>& data);
  void putSlice (rownr_t rownr, const Slicer& slicer, const Array<T>& data);
  void getArrayColumn (Array<T>& data);
  void putArrayColumn (const Array<T>& data);
  void getColumnSlice (const Slicer& slicer, Array<T>& data);
  void putColumnSlice (const Slicer& slicer, const Array<T>& data);
- The following functions have to be implemented when the shapes of the virtual and stored arrays are not the same.
  void setShapeColumn (const IPosition& shape);
  void setShape (rownr_t rownr, const IPosition& shape);
  uInt ndim (rownr_t rownr);
  IPosition shape (rownr_t rownr);
- The following functions deal with the initialization and persistence of engine specific variables. When the class has variables of its own, these functions may need to be implemented. Implementations of create and prepare have to call the similar functions in this base class.
  void close (AipsIO& ios);
  void create64 (rownr_t nrrow);
  void open64 (rownr_t nrrow, AipsIO& ios);
  void prepare();
- The following functions do not need to be declared and implemented in derived classes unless it is a very special case.
  String dataManagerName() const;
  Bool canAddRow() const;
  Bool canRemoveRow() const;
  void addRow64 (rownr_t nrrow);
  void removeRow64 (rownr_t rownr);
  DataManagerColumn* makeDirArrColumn (const String& columnName, int dataType, const String& dataTypeId);
  DataManagerColumn* makeIndArrColumn (const String& columnName, int dataType, const String& dataTypeId);
  Bool isWritable() const;
  Bool isShapeDefined (rownr_t rownr);

### Example

The derived classes ScaledArrayEngine and RetypedArrayEngine are two examples of how to derive a class from this base class. Note that ScaledArrayEngine does not need to implement functions dealing with shapes, because it can use them from this base class. On the other hand they need to be implemented in RetypedArrayEngine.

### Motivation

This base class implements several functions making the implementation of derived classes simpler. Many details are implemented here, so often only the basic mapping functions (get, put) need to be implemented in a derived class.

### Template Type Argument Requirements (VirtualType)

- default constructor
- copy constructor
- assignment operator
- static String dataTypeId(); // unique name of the class

### Template Type Argument Requirements (StoredType)

- Default constructor
- Copy constructor
- Assignment operator

Definition at line 263 of file BaseMappedArrayEngine.h.

## Constructor & Destructor Documentation

## BaseMappedArrayEngine() [1/3]

template<class VirtualType, class StoredType>

casacore::BaseMappedArrayEngine< VirtualType, StoredType >::BaseMappedArrayEngine | ( | const String & | virtualColumnName,
|  | const String & | storedColumnName )

protected

Construct an engine to convert the virtual column to the stored column.

StoredColumnName is the name of the column where the converted data will be put and must have data type StoredType. The virtual column using this engine must have data type VirtualType. By default the virtual column is assumed to be writable. Use setWritable to unset it.

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

## ~BaseMappedArrayEngine()

template<class VirtualType, class StoredType>

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

protected

Destructor is mandatory.

## BaseMappedArrayEngine() [2/3]

template<class VirtualType, class StoredType>

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

protected

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

## BaseMappedArrayEngine() [3/3]

template<class VirtualType, class StoredType>

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

protected

Copy constructor is used by copy constructor of derived classes.

References BaseMappedArrayEngine().

## Member Function Documentation

## addRow64()

template<class VirtualType, class StoredType>

virtual void casacore::BaseMappedArrayEngine< VirtualType, StoredType >::addRow64 | ( | rownr_t | nrrow | ) |

protected virtual

Rows are added to the end of the table.

If the virtual column has FixedShape arrays and the stored not, the shape in each stored row will be set. This assures that the arrays are properly defined in each row, so putSlice can be used without problems.
The second version is used by prepare2, because in case a column is added to an already existing table, table.nrow() gives the existing number of columns instead of 0.

Reimplemented from casacore::VirtualColumnEngine.

## addRowInit()

template<class VirtualType, class StoredType>

virtual void casacore::BaseMappedArrayEngine< VirtualType, StoredType >::addRowInit | ( | rownr_t | startRow,
|  | rownr_t | nrrow )

protected virtual

Reimplemented in casacore::CompressComplex, and casacore::CompressFloat.

## canChangeShape()

template<class VirtualType, class StoredType>

virtual Bool casacore::BaseMappedArrayEngine< VirtualType, StoredType >::canChangeShape | ( |  | ) | const

protected virtual

The data manager can handle changing the shape of an existing array when the underlying stored column can do it.

Reimplemented from casacore::DataManagerColumn.

## column()

template<class VirtualType, class StoredType>

ArrayColumn< StoredType > & casacore::BaseMappedArrayEngine< VirtualType, StoredType >::column | ( |  | ) |

inline protected

Give access to the stored column.

This can be used by the derived classes to get/put data.

Definition at line 507 of file BaseMappedArrayEngine.h.

References column_p.

## create64()

template<class VirtualType, class StoredType>

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

protected virtual

Initialize the object for a new table.

It defines a virtual column keyword telling the stored column name. Initially the table has the given number of rows. A derived class can have its own create function, but that should always call this create function.

Reimplemented from casacore::VirtualColumnEngine.

Reimplemented in casacore::BitFlagsEngine< StoredType >, casacore::CompressComplex, casacore::CompressComplexSD, casacore::CompressFloat, casacore::RetypedArrayEngine< VirtualType, StoredType >, casacore::ScaledArrayEngine< VirtualType, StoredType >, and casacore::ScaledComplexData< VirtualType, StoredType >.

## getArray()

template<class VirtualType, class StoredType>

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

protected virtual

Get an array in the given row.

This will scale and offset from the underlying array.

Implements casacore::VirtualArrayColumn< VirtualType >.

Reimplemented in casacore::BitFlagsEngine< StoredType >, casacore::CompressComplex, casacore::CompressFloat, casacore::ScaledArrayEngine< VirtualType, StoredType >, and casacore::ScaledComplexData< VirtualType, StoredType >.

References casacore::array.

## getArrayColumn()

template<class VirtualType, class StoredType>

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

protected virtual

Get an entire column.

This will scale and offset from the underlying array.

Reimplemented from casacore::VirtualArrayColumn< VirtualType >.

Reimplemented in casacore::BitFlagsEngine< StoredType >, casacore::CompressComplex, casacore::CompressFloat, casacore::ScaledArrayEngine< VirtualType, StoredType >, and casacore::ScaledComplexData< VirtualType, StoredType >.

References casacore::array.

## getArrayColumnCells()

template<class VirtualType, class StoredType>

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

protected virtual

Get some array values in the column.

This will scale and offset from the underlying array.

Reimplemented from casacore::VirtualArrayColumn< VirtualType >.

Reimplemented in casacore::BitFlagsEngine< StoredType >, casacore::CompressComplex, casacore::CompressFloat, and casacore::ScaledComplexData< VirtualType, StoredType >.

## getColumnSlice()

template<class VirtualType, class StoredType>

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

protected virtual

Get a section of all arrays in the column.

This will scale and offset from the underlying array.

Reimplemented from casacore::VirtualArrayColumn< VirtualType >.

Reimplemented in casacore::BitFlagsEngine< StoredType >, casacore::CompressComplex, casacore::CompressFloat, casacore::ScaledArrayEngine< VirtualType, StoredType >, and casacore::ScaledComplexData< VirtualType, StoredType >.

References casacore::array.

## getColumnSliceCells()

template<class VirtualType, class StoredType>

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

protected virtual

Get a section of some arrays in the column.

This will scale and offset from the underlying array.

Reimplemented from casacore::VirtualArrayColumn< VirtualType >.

Reimplemented in casacore::BitFlagsEngine< StoredType >, casacore::CompressComplex, casacore::CompressFloat, and casacore::ScaledComplexData< VirtualType, StoredType >.

## getSlice()

template<class VirtualType, class StoredType>

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

protected virtual

Get a section of the array in the given row.

This will scale and offset from the underlying array.

Reimplemented from casacore::VirtualArrayColumn< VirtualType >.

Reimplemented in casacore::BitFlagsEngine< StoredType >, casacore::CompressComplex, casacore::CompressFloat, casacore::ScaledArrayEngine< VirtualType, StoredType >, and casacore::ScaledComplexData< VirtualType, StoredType >.

References casacore::array.

## getStoredShape()

template<class VirtualType, class StoredType>

virtual IPosition casacore::BaseMappedArrayEngine< VirtualType, StoredType >::getStoredShape | ( | rownr_t | rownr,
|  | const IPosition & | virtualShape )

protected virtual

Map the virtual shape to the stored shape.

By default is returns the virtual shape.

Reimplemented in casacore::RetypedArrayEngine< VirtualType, StoredType >.

## getStoredSlicer()

template<class VirtualType, class StoredType>

virtual Slicer casacore::BaseMappedArrayEngine< VirtualType, StoredType >::getStoredSlicer | ( | const Slicer & | virtualSlicer | ) | const

protected virtual

Map the slicer for a virtual shape to a stored shape.

By default it returns the virtual input slicer.

Reimplemented in casacore::RetypedArrayEngine< VirtualType, StoredType >.

## isShapeDefined()

template<class VirtualType, class StoredType>

virtual Bool casacore::BaseMappedArrayEngine< VirtualType, StoredType >::isShapeDefined | ( | rownr_t | rownr | ) |

protected virtual

Test if the (underlying) array is defined in the given row.

Reimplemented from casacore::VirtualArrayColumnBase.

## isWritable()

template<class VirtualType, class StoredType>

virtual Bool casacore::BaseMappedArrayEngine< VirtualType, StoredType >::isWritable | ( |  | ) | const

virtual

The column is writable if the underlying stored column is writable.

Reimplemented from casacore::VirtualArrayColumnBase.

Referenced by setWritable().

## makeIndArrColumn()

template<class VirtualType, class StoredType>

virtual DataManagerColumn * casacore::BaseMappedArrayEngine< VirtualType, StoredType >::makeIndArrColumn | ( | const String & | columnName,
|  | int | dataType,
|  | const String & | dataTypeId )

protected virtual

Create the column object for the array column in this engine.

It will check if the given column name matches the virtual column name. This assures that the engine is bound to the correct column.

Reimplemented from casacore::VirtualColumnEngine.

References casacore::DataManagerColumn::columnName(), casacore::VirtualArrayColumn< VirtualType >::dataType(), and casacore::VirtualArrayColumn< VirtualType >::dataTypeId().

## makeTableColumn()

template<class VirtualType, class StoredType>

TableColumn casacore::BaseMappedArrayEngine< VirtualType, StoredType >::makeTableColumn | ( | const String & | columnName | ) |

protected

Make a table column object for the given column.

This has to be used in the create function, otherwise it could not create a TableColumn object to store data in the column keywords.

References casacore::DataManagerColumn::columnName().

## mapOnGet()

template<class VirtualType, class StoredType>

virtual void casacore::BaseMappedArrayEngine< VirtualType, StoredType >::mapOnGet | ( | Array< VirtualType > & | array,
|  | const Array< StoredType > & | stored )

protected virtual

Map StoredType array to VirtualType array.

This is meant when reading an array from the stored column. The default implementation throws an exception.

Reimplemented in casacore::BitFlagsEngine< StoredType >, casacore::MappedArrayEngine< VirtualType, StoredType >, and casacore::RetypedArrayEngine< VirtualType, StoredType >.

References casacore::array.

## mapOnPut()

template<class VirtualType, class StoredType>

virtual void casacore::BaseMappedArrayEngine< VirtualType, StoredType >::mapOnPut | ( | const Array< VirtualType > & | array,
|  | Array< StoredType > & | stored )

protected virtual

Map Bool array to bit flags array.

This is meant when writing an array into the stored column. The default implementation throws an exception.

Reimplemented in casacore::BitFlagsEngine< StoredType >, casacore::MappedArrayEngine< VirtualType, StoredType >, and casacore::RetypedArrayEngine< VirtualType, StoredType >.

References casacore::array.

## ndim()

template<class VirtualType, class StoredType>

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

protected virtual

Get the dimensionality of the (underlying) array in the given row.

This implementation assumes the dimensionality of virtual and stored arrays are the same. If not, it has to be overidden in a derived class.

Reimplemented from casacore::DataManagerColumn.

Reimplemented in casacore::RetypedArrayEngine< VirtualType, StoredType >, and casacore::ScaledComplexData< VirtualType, StoredType >.

## operator=()

template<class VirtualType, class StoredType>

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

protected delete

Assignment is not needed and therefore forbidden.

References BaseMappedArrayEngine().

## prepare()

template<class VirtualType, class StoredType>

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

protected virtual

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

It reads the stored column name from the virtual column keywords. A derived class can have its own prepare function, but that should always call this prepare function.

Reimplemented from casacore::VirtualColumnEngine.

Reimplemented in casacore::BitFlagsEngine< StoredType >, casacore::CompressComplex, casacore::CompressFloat, casacore::RetypedArrayEngine< VirtualType, StoredType >, casacore::ScaledArrayEngine< VirtualType, StoredType >, and casacore::ScaledComplexData< VirtualType, StoredType >.

## prepare1()

template<class VirtualType, class StoredType>

void casacore::BaseMappedArrayEngine< VirtualType, StoredType >::prepare1 | ( |  | ) |

protected

Do the 2 stages of the prepare (define columns and adding rows).

## prepare2()

template<class VirtualType, class StoredType>

void casacore::BaseMappedArrayEngine< VirtualType, StoredType >::prepare2 | ( |  | ) |

protected

## putArray()

template<class VirtualType, class StoredType>

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

protected virtual

Put an array in the given row.

This will scale and offset to the underlying array.

Reimplemented from casacore::VirtualArrayColumn< VirtualType >.

Reimplemented in casacore::BitFlagsEngine< StoredType >, casacore::CompressComplex, casacore::CompressFloat, casacore::ScaledArrayEngine< VirtualType, StoredType >, and casacore::ScaledComplexData< VirtualType, StoredType >.

References casacore::array.

## putArrayColumn()

template<class VirtualType, class StoredType>

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

protected virtual

Put an entire column.

This will scale and offset to the underlying array.

Reimplemented from casacore::VirtualArrayColumn< VirtualType >.

Reimplemented in casacore::BitFlagsEngine< StoredType >, casacore::CompressComplex, casacore::CompressFloat, casacore::ScaledArrayEngine< VirtualType, StoredType >, and casacore::ScaledComplexData< VirtualType, StoredType >.

References casacore::array.

## putArrayColumnCells()

template<class VirtualType, class StoredType>

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

protected virtual

Put some array values in the column.

This will scale and offset to the underlying array.

Reimplemented from casacore::VirtualArrayColumn< VirtualType >.

Reimplemented in casacore::BitFlagsEngine< StoredType >, casacore::CompressComplex, casacore::CompressFloat, and casacore::ScaledComplexData< VirtualType, StoredType >.

## putColumnSlice()

template<class VirtualType, class StoredType>

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

protected virtual

Put a section of all arrays in the column.

This will scale and offset to the underlying array.

Reimplemented from casacore::VirtualArrayColumn< VirtualType >.

Reimplemented in casacore::BitFlagsEngine< StoredType >, casacore::CompressComplex, casacore::CompressFloat, casacore::ScaledArrayEngine< VirtualType, StoredType >, and casacore::ScaledComplexData< VirtualType, StoredType >.

References casacore::array.

## putColumnSliceCells()

template<class VirtualType, class StoredType>

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

protected virtual

Put into a section of some arrays in the column.

This will scale and offset to the underlying array.

Reimplemented from casacore::VirtualArrayColumn< VirtualType >.

Reimplemented in casacore::BitFlagsEngine< StoredType >, casacore::CompressComplex, casacore::CompressFloat, and casacore::ScaledComplexData< VirtualType, StoredType >.

## putSlice()

template<class VirtualType, class StoredType>

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

protected virtual

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

This will scale and offset to the underlying array.

Reimplemented from casacore::VirtualArrayColumn< VirtualType >.

Reimplemented in casacore::BitFlagsEngine< StoredType >, casacore::CompressComplex, casacore::CompressFloat, casacore::ScaledArrayEngine< VirtualType, StoredType >, and casacore::ScaledComplexData< VirtualType, StoredType >.

References casacore::array.

## setNames()

template<class VirtualType, class StoredType>

void casacore::BaseMappedArrayEngine< VirtualType, StoredType >::setNames | ( | const String & | virtualName,
|  | const String & | storedName )

inline protected

Set the virtual and stored column name.

Definition at line 493 of file BaseMappedArrayEngine.h.

References storedName(), storedName_p, virtualName(), and virtualName_p.

## setShape()

template<class VirtualType, class StoredType>

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

protected virtual

Define the shape of the array in the given row.

It will define the shape of the (underlying) array. This implementation assumes the shape of virtual and stored arrays are the same. If not, it has to be overidden in a derived class.

Reimplemented from casacore::VirtualArrayColumnBase.

Reimplemented in casacore::RetypedArrayEngine< VirtualType, StoredType >, and casacore::ScaledComplexData< VirtualType, StoredType >.

References shape().

## setShapeColumn()

template<class VirtualType, class StoredType>

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

protected 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. This implementation assumes the shape of virtual and stored arrays are the same. If not, it has to be overidden in a derived class.

Reimplemented from casacore::VirtualArrayColumnBase.

Reimplemented in casacore::RetypedArrayEngine< VirtualType, StoredType >, and casacore::ScaledComplexData< VirtualType, StoredType >.

References shape().

## setWritable()

template<class VirtualType, class StoredType>

void casacore::BaseMappedArrayEngine< VirtualType, StoredType >::setWritable | ( | Bool | isWritable | ) |

inline protected

Set if the column is writable or not.

Definition at line 502 of file BaseMappedArrayEngine.h.

References isWritable(), and isWritable_p.

## shape()

template<class VirtualType, class StoredType>

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

protected virtual

Get the shape of the (underlying) array in the given row.

This implementation assumes the shape of virtual and stored arrays are the same. If not, it has to be overidden in a derived class.

Reimplemented from casacore::VirtualArrayColumnBase.

Reimplemented in casacore::RetypedArrayEngine< VirtualType, StoredType >, and casacore::ScaledComplexData< VirtualType, StoredType >.

Referenced by setShape(), and setShapeColumn().

## storedName()

template<class VirtualType, class StoredType>

const String & casacore::BaseMappedArrayEngine< VirtualType, StoredType >::storedName | ( |  | ) | const

inline

Get the stored column name.

Definition at line 488 of file BaseMappedArrayEngine.h.

References storedName_p.

Referenced by setNames().

## virtualName()

template<class VirtualType, class StoredType>

const String & casacore::BaseMappedArrayEngine< VirtualType, StoredType >::virtualName | ( |  | ) | const

inline

Get the virtual column name.

Definition at line 483 of file BaseMappedArrayEngine.h.

References virtualName_p.

Referenced by setNames().

## Member Data Documentation

## arrayIsFixed_p

template<class VirtualType, class StoredType>

Bool casacore::BaseMappedArrayEngine< VirtualType, StoredType >::arrayIsFixed_p

private

Definition at line 474 of file BaseMappedArrayEngine.h.

## column_p

template<class VirtualType, class StoredType>

ArrayColumn<StoredType>* casacore::BaseMappedArrayEngine< VirtualType, StoredType >::column_p

private

Definition at line 476 of file BaseMappedArrayEngine.h.

Referenced by column().

## initialNrrow_p

template<class VirtualType, class StoredType>

rownr_t casacore::BaseMappedArrayEngine< VirtualType, StoredType >::initialNrrow_p

private

Definition at line 473 of file BaseMappedArrayEngine.h.

## isWritable_p

template<class VirtualType, class StoredType>

Bool casacore::BaseMappedArrayEngine< VirtualType, StoredType >::isWritable_p

private

Definition at line 469 of file BaseMappedArrayEngine.h.

Referenced by setWritable().

## shapeFixed_p

template<class VirtualType, class StoredType>

IPosition casacore::BaseMappedArrayEngine< VirtualType, StoredType >::shapeFixed_p

private

Definition at line 475 of file BaseMappedArrayEngine.h.

## storedName_p

template<class VirtualType, class StoredType>

String casacore::BaseMappedArrayEngine< VirtualType, StoredType >::storedName_p

private

Definition at line 468 of file BaseMappedArrayEngine.h.

Referenced by setNames(), and storedName().

## tempWritable_p

template<class VirtualType, class StoredType>

Bool casacore::BaseMappedArrayEngine< VirtualType, StoredType >::tempWritable_p

private

Definition at line 470 of file BaseMappedArrayEngine.h.

## virtualName_p

template<class VirtualType, class StoredType>

String casacore::BaseMappedArrayEngine< VirtualType, StoredType >::virtualName_p

private

Definition at line 467 of file BaseMappedArrayEngine.h.

Referenced by setNames(), and virtualName().

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

- tables/DataMan/BaseMappedArrayEngine.h