Loading...
Searching...
No Matches
casacore::ScalarRecordColumnData Class Reference
tables package (libcasa_tables) » Tables_module » Tables_module_internal_classes

More...

`#include <ScaRecordColData.h>`

## Public Member Functions

| ScalarRecordColumnData (const ScalarRecordColumnDesc *, ColumnSet *)
| Construct a scalar column object from the given description in the given column set.
| ~ScalarRecordColumnData ()
| ScalarRecordColumnData (const ScalarRecordColumnData &)=delete
| Copy constructor cannot be used.
ScalarRecordColumnData & | operator= (const ScalarRecordColumnData &)=delete
| Assignment cannot be used.
virtual void | initialize (rownr_t startRownr, rownr_t endRownr)
| Initialize the rows from startRownr till endRownr (inclusive) with the default value defined in the column description.
virtual Bool | isDefined (rownr_t rownr) const
| Test if the given cell contains a defined value.
virtual void | get (rownr_t rownr, void *) const
| Get the value from a particular cell.
virtual void | getScalarColumn (ArrayBase &dataPtr) const
| Get the array of all values in the column.
virtual void | getScalarColumnCells (const RefRows &rownrs, ArrayBase &dataPtr) const
| Get the array of some values in the column (on behalf of RefColumn).
virtual void | put (rownr_t rownr, const void *dataPtr)
| Put the value in a particular cell.
virtual void | putScalarColumn (const ArrayBase &dataPtr)
| Put the array of all values in the column.
virtual void | putScalarColumnCells (const RefRows &rownrs, const ArrayBase &dataPtr)
| Put the array of some values in the column (on behalf on RefColumn).
virtual void | makeSortKey (Sort &, std::shared_ptr< BaseCompare > &cmpObj, Int order, std::shared_ptr< ArrayBase > &dataSave)
| Add this column and its data to the Sort object.
virtual void | makeRefSortKey (Sort &, std::shared_ptr< BaseCompare > &cmpObj, Int order, const Vector< rownr_t > &rownrs, std::shared_ptr< ArrayBase > &dataSave)
| Do it only for the given row numbers.
virtual void | allocIterBuf (void *&lastVal, void *&curVal, std::shared_ptr< BaseCompare > &cmpObj)
| Allocate value buffers for the table iterator.
virtual void | freeIterBuf (void *&lastVal, void *&curVal)
| Free the value buffers allocated by allocIterBuf.
virtual void | createDataManagerColumn ()
| Create a data manager column object for this column.
Public Member Functions inherited from casacore::PlainColumn
| PlainColumn (const BaseColumnDesc *, ColumnSet *)
virtual | ~PlainColumn ()
virtual Bool | isWritable () const
| Test if the column is in principle writable.
virtual Bool | isStored () const
| Test if the column is stored (otherwise it is virtual).
TableRecord & | rwKeywordSet ()
| Get access to the column keyword set.
TableRecord & | keywordSet ()
rownr_t | nrow () const
| Get nr of rows in the column.
virtual void | setShapeColumn (const IPosition &shape)
| Define the shape of all arrays in the column.
virtual Bool | isBound () const
| Test if the column is bound to a storage manager or virtual column engine.
virtual void | bind (DataManager *)
| Bind the column to a data manager.
DataManager * | dataManager () const
| Get the pointer to the data manager.
DataManagerColumn *& | dataManagerColumn ()
| Get the pointer to the data manager column.
virtual ColumnCache & | columnCache ()
| Get a pointer to the underlying column cache.
virtual void | setMaximumCacheSize (uInt nbytes)
| Set the maximum cache size (in bytes) to be used by a storage manager.
void | putFile (AipsIO &, const TableAttr &)
| Write the column.
void | getFile (AipsIO &, const ColumnSet &, const TableAttr &)
| Read the column.
Public Member Functions inherited from casacore::BaseColumn
| BaseColumn (const BaseColumnDesc *)
| Construct it using the given column description.
virtual | ~BaseColumn ()
const ColumnDesc & | columnDesc () const
| Get const access to the column description.
virtual void | setShape (rownr_t rownr, const IPosition &shape)
| Set the shape of the array in the given row.
virtual void | setShape (rownr_t rownr, const IPosition &shape, const IPosition &tileShape)
| Set the shape and tile shape of the array in the given row.
virtual uInt | ndimColumn () const
| Get the global #dimensions of an array (ie.
virtual IPosition | shapeColumn () const
| Get the global shape of an array (ie.
virtual uInt | ndim (rownr_t rownr) const
| Get the #dimensions of an array in a particular cell.
virtual IPosition | shape (rownr_t rownr) const
| Get the shape of an array in a particular cell.
virtual IPosition | tileShape (rownr_t rownr) const
| Get the tile shape of an array in a particular cell.
virtual Bool | canChangeShape () const
| Ask the data manager if the shape of an existing array can be changed.
virtual void | getArray (rownr_t rownr, ArrayBase &dataPtr) const
| Get an array from a particular cell.
virtual void | getSlice (rownr_t rownr, const Slicer &, ArrayBase &dataPtr) const
| Get a slice of an N-dimensional array in a particular cell.
virtual void | getArrayColumn (ArrayBase &dataPtr) const
| Get the array of all array values in a column.
virtual void | getColumnSlice (const Slicer &, ArrayBase &dataPtr) const
| Get subsections from all arrays in the column.
virtual void | getArrayColumnCells (const RefRows &rownrs, ArrayBase &dataPtr) const
| Get the array of some array values in a column.
virtual void | getColumnSliceCells (const RefRows &rownrs, const Slicer &, ArrayBase &dataPtr) const
| Get subsections from some arrays in the column.
virtual void | putArray (rownr_t rownr, const ArrayBase &dataPtr)
| Put the array value in a particular cell.
virtual void | putSlice (rownr_t rownr, const Slicer &, const ArrayBase &dataPtr)
| Put a slice of an N-dimensional array in a particular cell.
virtual void | putArrayColumn (const ArrayBase &dataPtr)
| Put the array of all array values in the column.
virtual void | putColumnSlice (const Slicer &, const ArrayBase &dataPtr)
| Put into subsections of all table arrays in the column.
virtual void | putArrayColumnCells (const RefRows &rownrs, const ArrayBase &dataPtr)
| Get the array of some array values in a column.
virtual void | putColumnSliceCells (const RefRows &rownrs, const Slicer &, const ArrayBase &dataPtr)
| Put subsections of some arrays in the column.
void | getScalar (rownr_t rownr, Bool &value) const
| Get the value from the row and convert it to the required type.
void | getScalar (rownr_t rownr, uChar &value) const
void | getScalar (rownr_t rownr, Short &value) const
void | getScalar (rownr_t rownr, uShort &value) const
void | getScalar (rownr_t rownr, Int &value) const
void | getScalar (rownr_t rownr, uInt &value) const
void | getScalar (rownr_t rownr, Int64 &value) const
void | getScalar (rownr_t rownr, float &value) const
void | getScalar (rownr_t rownr, double &value) const
void | getScalar (rownr_t rownr, Complex &value) const
void | getScalar (rownr_t rownr, DComplex &value) const
void | getScalar (rownr_t rownr, String &value) const
void | getScalar (rownr_t rownr, TableRecord &value) const
void | getScalar (rownr_t rownr, void *value, const String &dataTypeId) const
| Get a scalar for the other data types.
void | putScalar (rownr_t rownr, const Bool &value)
| Put the value into the row and convert it from the given type.
void | putScalar (rownr_t rownr, const uChar &value)
void | putScalar (rownr_t rownr, const Short &value)
void | putScalar (rownr_t rownr, const uShort &value)
void | putScalar (rownr_t rownr, const Int &value)
void | putScalar (rownr_t rownr, const uInt &value)
void | putScalar (rownr_t rownr, const Int64 &value)
void | putScalar (rownr_t rownr, const float &value)
void | putScalar (rownr_t rownr, const double &value)
void | putScalar (rownr_t rownr, const Complex &value)
void | putScalar (rownr_t rownr, const DComplex &value)
void | putScalar (rownr_t rownr, const String &value)
void | putScalar (rownr_t rownr, const Char *value)
void | putScalar (rownr_t rownr, const TableRecord &value)

## Private Member Functions

virtual void | putFileDerived (AipsIO &)
| Write the column data.
virtual void | getFileDerived (AipsIO &, const ColumnSet &)
| Read the column data back.
void | getRecord (rownr_t rownr, TableRecord &rec) const
| Handle getting and putting a record.
void | putRecord (rownr_t rownr, const TableRecord &rec)

## Additional Inherited Members

Protected Member Functions inherited from casacore::PlainColumn
int | traceId () const
| Get the trace-id of the table.
void | checkValueLength (const void *) const
| Check the length of a value.
void | checkValueLength (const String *value) const
void | checkValueLength (const Array< String > *value) const
void | checkReadLock (Bool wait) const
| Lock the table before reading or writing.
void | checkWriteLock (Bool wait) const
void | autoReleaseLock () const
| Inspect the auto lock when the inspection interval has expired and release it when another process needs the lock.
Protected Member Functions inherited from casacore::BaseColumn
void | throwGetScalar () const
| Throw exceptions for invalid scalar get or put.
void | throwPutScalar () const
void | throwGetType (const String &type) const
void | throwPutType (const String &type) const
Protected Attributes inherited from casacore::PlainColumn
DataManager * | dataManPtr_p
DataManagerColumn * | dataColPtr_p
ColumnSet * | colSetPtr_p
String | originalName_p
Bool | rtraceColumn_p
Bool | wtraceColumn_p
Protected Attributes inherited from casacore::BaseColumn
const BaseColumnDesc * | colDescPtr_p

## Detailed Description

Access to a table column containing scalar records.

### Intended use:

Internal

### Review Status

Reviewed By:
  Wim Brouw
Date Reviewed:
  1998/12/09
Test programs:
  tRecordColumn

### Prerequisite

- PlainColumn
- ScalarRecordColumnDesc
- Table

### Etymology

ScalarRecordColumnData represents a table column containing scalars.

### Synopsis

The class ScalarRecordColumnData is derived from PlainColumn. It implements the virtual functions accessing a table column containing scalars holding records.
It is possible to access an scalar in an individual cell (i.e. table row) or in the entire column.

The main task of this class is to communicate with the data manager column object. This consists of:

- Binding itself to a data manager.
- Letting the data manager create its column object.
- Closing the data manager column object (in putFileDerived).
- Reconstructing the data manager object for an existing table (in getFileDerived).
- Transferring get/put calls to the data manager column object.

The class is hidden from the user by the envelope class ScalarColumn. If used directly by other Table classes, it should be done with care. It assumes that the arrays in the various get and put functions have the correct length. ScalarColumn does that check.

### To Do

- Introduce a class ArrayRecordColumnData to support arrays of records.

Definition at line 93 of file ScaRecordColData.h.

## Constructor & Destructor Documentation

## ScalarRecordColumnData() [1/2]

casacore::ScalarRecordColumnData::ScalarRecordColumnData | ( | const ScalarRecordColumnDesc * | ,
|  | ColumnSet * | )

Construct a scalar column object from the given description in the given column set.

This constructor is used by ScalarRecordColumnDesc::makeColumn.

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

## ~ScalarRecordColumnData()

casacore::ScalarRecordColumnData::~ScalarRecordColumnData | ( |  | ) |

## ScalarRecordColumnData() [2/2]

casacore::ScalarRecordColumnData::ScalarRecordColumnData | ( | const ScalarRecordColumnData & |  | ) |

delete

Copy constructor cannot be used.

References ScalarRecordColumnData().

## Member Function Documentation

## allocIterBuf()

virtual void casacore::ScalarRecordColumnData::allocIterBuf | ( | void *& | lastVal,
|  | void *& | curVal,
|  | std::shared_ptr< BaseCompare > & | cmpObj )

virtual

Allocate value buffers for the table iterator.

Iteration based on records is not supported, so an exception is thrown.

Reimplemented from casacore::BaseColumn.

## createDataManagerColumn()

virtual void casacore::ScalarRecordColumnData::createDataManagerColumn | ( |  | ) |

virtual

Create a data manager column object for this column.

Implements casacore::PlainColumn.

## freeIterBuf()

virtual void casacore::ScalarRecordColumnData::freeIterBuf | ( | void *& | lastVal,
|  | void *& | curVal )

virtual

Free the value buffers allocated by allocIterBuf.

Reimplemented from casacore::BaseColumn.

## get()

virtual void casacore::ScalarRecordColumnData::get | ( | rownr_t | rownr,
|  | void * | ) const

virtual

Get the value from a particular cell.

Reimplemented from casacore::BaseColumn.

## getFileDerived()

virtual void casacore::ScalarRecordColumnData::getFileDerived | ( | AipsIO & | ,
|  | const ColumnSet & | )

private virtual

Read the column data back.

The control information is read from the given AipsIO object. This is used to bind the column to the appropriate data manager. Thereafter the data manager gets opened.

Implements casacore::PlainColumn.

## getRecord()

void casacore::ScalarRecordColumnData::getRecord | ( | rownr_t | rownr,
|  | TableRecord & | rec ) const

private

Handle getting and putting a record.

It is stored as a Vector of uChar.

## getScalarColumn()

virtual void casacore::ScalarRecordColumnData::getScalarColumn | ( | ArrayBase & | dataPtr | ) | const

virtual

Get the array of all values in the column.

The length of the buffer pointed to by dataPtr must match the actual length. This is checked by ScalarColumn.

Reimplemented from casacore::BaseColumn.

## getScalarColumnCells()

virtual void casacore::ScalarRecordColumnData::getScalarColumnCells | ( | const RefRows & | rownrs,
|  | ArrayBase & | dataPtr ) const

virtual

Get the array of some values in the column (on behalf of RefColumn).

The length of the buffer pointed to by dataPtr must match the actual length. This is checked by ScalarColumn.

Reimplemented from casacore::BaseColumn.

## initialize()

virtual void casacore::ScalarRecordColumnData::initialize | ( | rownr_t | startRownr,
|  | rownr_t | endRownr )

virtual

Initialize the rows from startRownr till endRownr (inclusive) with the default value defined in the column description.

Implements casacore::BaseColumn.

## isDefined()

virtual Bool casacore::ScalarRecordColumnData::isDefined | ( | rownr_t | rownr | ) | const

virtual

Test if the given cell contains a defined value.

Implements casacore::BaseColumn.

## makeRefSortKey()

virtual void casacore::ScalarRecordColumnData::makeRefSortKey | ( | Sort & | ,
|  | std::shared_ptr< BaseCompare > & | cmpObj,
|  | Int | order,
|  | const Vector< rownr_t > & | rownrs,
|  | std::shared_ptr< ArrayBase > & | dataSave )

virtual

Do it only for the given row numbers.

Reimplemented from casacore::BaseColumn.

References casacore::order().

## makeSortKey()

virtual void casacore::ScalarRecordColumnData::makeSortKey | ( | Sort & | ,
|  | std::shared_ptr< BaseCompare > & | cmpObj,
|  | Int | order,
|  | std::shared_ptr< ArrayBase > & | dataSave )

virtual

Add this column and its data to the Sort object.

Sorting on records is not supported, so an exception is thrown.

Reimplemented from casacore::BaseColumn.

References casacore::order().

## operator=()

ScalarRecordColumnData & casacore::ScalarRecordColumnData::operator= | ( | const ScalarRecordColumnData & |  | ) |

delete

Assignment cannot be used.

References ScalarRecordColumnData().

## put()

virtual void casacore::ScalarRecordColumnData::put | ( | rownr_t | rownr,
|  | const void * | dataPtr )

virtual

Put the value in a particular cell.

The length of the buffer pointed to by dataPtr must match the actual length. This is checked by ScalarColumn.

Reimplemented from casacore::BaseColumn.

## putFileDerived()

virtual void casacore::ScalarRecordColumnData::putFileDerived | ( | AipsIO & |  | ) |

private virtual

Write the column data.

The control information is written into the given AipsIO object, while the data is written/flushed by the data manager.

Implements casacore::PlainColumn.

## putRecord()

void casacore::ScalarRecordColumnData::putRecord | ( | rownr_t | rownr,
|  | const TableRecord & | rec )

private

## putScalarColumn()

virtual void casacore::ScalarRecordColumnData::putScalarColumn | ( | const ArrayBase & | dataPtr | ) |

virtual

Put the array of all values in the column.

The length of the buffer pointed to by dataPtr must match the actual length. This is checked by ScalarColumn.

Reimplemented from casacore::BaseColumn.

## putScalarColumnCells()

virtual void casacore::ScalarRecordColumnData::putScalarColumnCells | ( | const RefRows & | rownrs,
|  | const ArrayBase & | dataPtr )

virtual

Put the array of some values in the column (on behalf on RefColumn).

The length of the buffer pointed to by dataPtr must match the actual length. This is checked by ScalarColumn.

Reimplemented from casacore::BaseColumn.

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

- tables/Tables/ScaRecordColData.h