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

Definition of a Measure Value in a Table. More...

#include <TableMeasValueDesc.h>

Public Member Functions

 TableMeasValueDesc ()
 Null constructor. More...
 
 TableMeasValueDesc (const TableDesc &, const String &columnName)
 Construct the MeasValue column descriptor for the given column. More...
 
 TableMeasValueDesc (const String &columnName)
 Construct the MeasValue column descriptor for the given column. More...
 
 TableMeasValueDesc (const Char *columnName)
 
 TableMeasValueDesc (const TableMeasValueDesc &that)
 Copy constructor. More...
 
 ~TableMeasValueDesc ()
 
TableMeasValueDescoperator= (const TableMeasValueDesc &that)
 Assignment operator. More...
 
void write (TableDesc &, const TableRecord &measInfo)
 Write the type, unit, and MEASINFO record into the column keywords. More...
 
void write (Table &, const TableRecord &measInfo)
 
const StringcolumnName () const
 Get the name of the underlying column. More...
 

Private Member Functions

void writeKeys (TableRecord &columnKeyset, const TableRecord &measInfo)
 Write the actual keywords. More...
 
void checkColumn (const TableDesc &td) const
 Throw an exception if the quantum column doesn't exist or is of the wrong type. More...
 

Private Attributes

String itsColumn
 

Detailed Description

Definition of a Measure Value in a Table.

Intended use:

Public interface

Review Status

Reviewed By:
Bob Garwood
Date Reviewed:
1999/12/23
Test programs:
tTableMeasures

Prerequisite

Synopsis

TableMeasValueDesc is a class for setting up the Measure value component of the TableMeasDesc in the TableMeasures system. Its purpose it to specify the Table column to be used as a Measure column through which Measures are subsequently written to and read from via either an ArrayMeasColumn or ScalarMeasColumn object.

The column used as the Measure column is always an ArrayColumn<Double> irrespective of whether it is to store scalars or arrays of Measures and irrespective of the type of Measure.

Example

  1. // Add a column to the table. This column is to be used to store
    // MPositions. Measure columns are alway ArrayColumn<Double>
    ArrayColumnDesc<Double> cdPosCol("MPosColumn", "MPosition column");
    td.addColumn(cdPosCol);
    ..\.
    // create the TableMeasValueDesc object
    TableMeasValueDesc valueDesc(td, "MPosColumn");

For an example of the use of the TableMeasValueDesc class in the context of a full TableMeasDesc declaration see class TableMeasDesc.

Motivation

Creating the required keyword for the definition of a Measure in a Table is somewhat complicated. This class assists in that process.

Thrown Exceptions

Definition at line 107 of file TableMeasValueDesc.h.

Constructor & Destructor Documentation

casacore::TableMeasValueDesc::TableMeasValueDesc ( )

Null constructor.

casacore::TableMeasValueDesc::TableMeasValueDesc ( const TableDesc ,
const String columnName 
)

Construct the MeasValue column descriptor for the given column.

The column must be a column of type Double and should exist in the TableDesc.

casacore::TableMeasValueDesc::TableMeasValueDesc ( const String columnName)
inline

Construct the MeasValue column descriptor for the given column.

Checking if the column exists is done in the write function.

Definition at line 121 of file TableMeasValueDesc.h.

casacore::TableMeasValueDesc::TableMeasValueDesc ( const Char columnName)
inline

Definition at line 123 of file TableMeasValueDesc.h.

casacore::TableMeasValueDesc::TableMeasValueDesc ( const TableMeasValueDesc that)

Copy constructor.

casacore::TableMeasValueDesc::~TableMeasValueDesc ( )

Member Function Documentation

void casacore::TableMeasValueDesc::checkColumn ( const TableDesc td) const
private

Throw an exception if the quantum column doesn't exist or is of the wrong type.

const String& casacore::TableMeasValueDesc::columnName ( ) const
inline

Get the name of the underlying column.

Definition at line 143 of file TableMeasValueDesc.h.

References itsColumn.

Referenced by casacore::TableMeasDescBase::columnName().

TableMeasValueDesc& casacore::TableMeasValueDesc::operator= ( const TableMeasValueDesc that)

Assignment operator.

void casacore::TableMeasValueDesc::write ( TableDesc ,
const TableRecord measInfo 
)

Write the type, unit, and MEASINFO record into the column keywords.

It checks if the column exists in the given table description.

void casacore::TableMeasValueDesc::write ( Table ,
const TableRecord measInfo 
)
void casacore::TableMeasValueDesc::writeKeys ( TableRecord columnKeyset,
const TableRecord measInfo 
)
private

Write the actual keywords.

Member Data Documentation

String casacore::TableMeasValueDesc::itsColumn
private

Definition at line 147 of file TableMeasValueDesc.h.

Referenced by columnName().


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