Loading...
Searching...
No Matches
casacore::TableMeasDescBase Class Reference
measures package (libcasa_measures) » TableMeasures_module » TableMeasures_module_internal_classes

More...

`#include <TableMeasDescBase.h>`

## Public Member Functions

| TableMeasDescBase ()
| Null constructor.
| TableMeasDescBase (const TableMeasValueDesc &, const TableMeasRefDesc &)
| Constructor with value and reference descriptors.
| TableMeasDescBase (const TableMeasDescBase &that)
| Copy constructor.
virtual | ~TableMeasDescBase ()
virtual TableMeasDescBase * | clone () const
| Clone the object.
TableMeasDescBase & | operator= (const TableMeasDescBase &that)
| Assignment operator.
void | write (TableDesc &)
| Makes the descriptor persistent.
void | write (Table &)
void | writeIfOld (const Table &)
| Make the descriptor persistent if there was no refcode vector.
const String & | columnName () const
| Get the name of the underlying column.
uInt | getRefCode () const
| Return the reference code.
Bool | isRefCodeVariable () const
| Returns True if the reference varies per row.
const String & | refColumnName () const
| Returns the name of the ref code column when the ref code is variable.
const TableMeasRefDesc & | getRefDesc () const
| Returns a reference to its measure reference descriptor.
const String & | offsetColumnName () const
| Get the name of the offset column.
Bool | hasOffset () const
| Returns True if an offset has been defined.
Bool | isOffsetVariable () const
| Returns True if the offset is variable.
Bool | isOffsetArray () const
| Returns True if the offset is variable and is stored in an ArrayMeasColumn, i.e., offsets are stored per element.
const Measure & | getOffset () const
| Returns a reference to the offset.
const String & | type () const
| Returns the descriptors measure type as a String.
uInt | refCode (const String &refString) const
| Returns the reference code for this object given a string.
const String & | refType (uInt refCode) const
| Translates the refCode for the descriptors measure type.
const Vector< Unit > & | getUnits () const
| Return the Units of the Measure values.
void | resetRefCode (uInt refCode)
| Reset the refCode, offset, or units.
void | resetOffset (const Measure &offset)
void | resetUnits (const Vector< Unit > &units)

## Static Public Member Functions

static TableMeasDescBase * | reconstruct (const Table &tab, const String &columnName)
| Reconstructs the object for the given table and column name.
static Bool | hasMeasures (const TableColumn &column)
| Does this column contain table measures?

## Protected Member Functions

void | initTabRef (const MeasureHolder &measHolder)
| Set the initial reference codes and types in the table.
void | setMeasUnits (const Measure &meas, const Vector< Quantum< Double > > &val, const Vector< Unit > &units)
| Set the measure and possible units.

## Private Attributes

TableMeasValueDesc | itsValue
TableMeasRefDesc | itsRef
TableMeasType | itsMeasType
Vector< Unit > | itsUnits

## Detailed Description

Definition of a Measure in a Table.

### Intended use:

Internal

### Review Status

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

### Prerequisite

- Measures
- Tables
- TableMeasDesc

### Synopsis

Abstract base class for TableMeasDesc.

### Example

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

- AipsError during reconstruction if the column doesn't contain a MEASINFO record.
- AipsError during reconstruction if the column has a MEASINFO but it Measure type is invalid.

Definition at line 91 of file TableMeasDescBase.h.

## Constructor & Destructor Documentation

## TableMeasDescBase() [1/3]

casacore::TableMeasDescBase::TableMeasDescBase | ( |  | ) |

Null constructor.

Referenced by casacore::TableMeasDesc< M >::clone(), clone(), operator=(), reconstruct(), and TableMeasDescBase().

## TableMeasDescBase() [2/3]

casacore::TableMeasDescBase::TableMeasDescBase | ( | const TableMeasValueDesc & | ,
|  | const TableMeasRefDesc & | )

Constructor with value and reference descriptors.

Note that setMeasType is always called by the derived class.

## TableMeasDescBase() [3/3]

casacore::TableMeasDescBase::TableMeasDescBase | ( | const TableMeasDescBase & | that | ) |

Copy constructor.

References TableMeasDescBase().

## ~TableMeasDescBase()

virtual casacore::TableMeasDescBase::~TableMeasDescBase | ( |  | ) |

virtual

## Member Function Documentation

## clone()

virtual TableMeasDescBase * casacore::TableMeasDescBase::clone | ( |  | ) | const

virtual

Clone the object.

Reimplemented in casacore::TableMeasDesc< M >.

References TableMeasDescBase().

## columnName()

const String & casacore::TableMeasDescBase::columnName | ( |  | ) | const

inline

Get the name of the underlying column.

Definition at line 123 of file TableMeasDescBase.h.

References itsValue.

Referenced by reconstruct().

## getOffset()

const Measure & casacore::TableMeasDescBase::getOffset | ( |  | ) | const

inline

Returns a reference to the offset.

Definition at line 162 of file TableMeasDescBase.h.

References itsRef.

## getRefCode()

uInt casacore::TableMeasDescBase::getRefCode | ( |  | ) | const

inline

Return the reference code.

Definition at line 127 of file TableMeasDescBase.h.

References itsRef.

## getRefDesc()

const TableMeasRefDesc & casacore::TableMeasDescBase::getRefDesc | ( |  | ) | const

inline

Returns a reference to its measure reference descriptor.

Definition at line 140 of file TableMeasDescBase.h.

References itsRef.

## getUnits()

const Vector< Unit > & casacore::TableMeasDescBase::getUnits | ( |  | ) | const

inline

Return the Units of the Measure values.

Definition at line 179 of file TableMeasDescBase.h.

References itsUnits.

## hasMeasures()

Bool casacore::TableMeasDescBase::hasMeasures | ( | const TableColumn & | column | ) |

static

Does this column contain table measures?

## hasOffset()

Bool casacore::TableMeasDescBase::hasOffset | ( |  | ) | const

inline

Returns True if an offset has been defined.

Definition at line 149 of file TableMeasDescBase.h.

References itsRef.

## initTabRef()

void casacore::TableMeasDescBase::initTabRef | ( | const MeasureHolder & | measHolder | ) |

protected

Set the initial reference codes and types in the table.

## isOffsetArray()

Bool casacore::TableMeasDescBase::isOffsetArray | ( |  | ) | const

inline

Returns True if the offset is variable and is stored in an ArrayMeasColumn, i.e., offsets are stored per element.

Definition at line 158 of file TableMeasDescBase.h.

References itsRef.

## isOffsetVariable()

Bool casacore::TableMeasDescBase::isOffsetVariable | ( |  | ) | const

inline

Returns True if the offset is variable.

Definition at line 153 of file TableMeasDescBase.h.

References itsRef.

## isRefCodeVariable()

Bool casacore::TableMeasDescBase::isRefCodeVariable | ( |  | ) | const

inline

Returns True if the reference varies per row.

Definition at line 131 of file TableMeasDescBase.h.

References itsRef.

## offsetColumnName()

const String & casacore::TableMeasDescBase::offsetColumnName | ( |  | ) | const

inline

Get the name of the offset column.

Empty string is returned if no offset.

Definition at line 145 of file TableMeasDescBase.h.

References itsRef.

## operator=()

TableMeasDescBase & casacore::TableMeasDescBase::operator= | ( | const TableMeasDescBase & | that | ) |

Assignment operator.

References TableMeasDescBase().

## reconstruct()

TableMeasDescBase * casacore::TableMeasDescBase::reconstruct | ( | const Table & | tab,
|  | const String & | columnName )

static

Reconstructs the object for the given table and column name.

References columnName(), and TableMeasDescBase().

## refCode()

uInt casacore::TableMeasDescBase::refCode | ( | const String & | refString | ) | const

inline

Returns the reference code for this object given a string.

Throws an exception if the refString is invalid for this object.

Definition at line 171 of file TableMeasDescBase.h.

References itsMeasType.

Referenced by refType(), and resetRefCode().

## refColumnName()

const String & casacore::TableMeasDescBase::refColumnName | ( |  | ) | const

inline

Returns the name of the ref code column when the ref code is variable.

The null string is returned if the ref code is not variable.

Definition at line 136 of file TableMeasDescBase.h.

References itsRef.

## refType()

const String & casacore::TableMeasDescBase::refType | ( | uInt | refCode | ) | const

inline

Translates the refCode for the descriptors measure type.

Definition at line 175 of file TableMeasDescBase.h.

References itsMeasType, and refCode().

## resetOffset()

void casacore::TableMeasDescBase::resetOffset | ( | const Measure & | offset | ) |

inline

Definition at line 188 of file TableMeasDescBase.h.

References itsRef, and casacore::offset().

## resetRefCode()

void casacore::TableMeasDescBase::resetRefCode | ( | uInt | refCode | ) |

inline

Reset the refCode, offset, or units.

It overwrites the value used when defining the TableMeasDesc. It is only possible if it was defined as fixed for the entire column.

Definition at line 186 of file TableMeasDescBase.h.

References itsRef, and refCode().

## resetUnits()

void casacore::TableMeasDescBase::resetUnits | ( | const Vector< Unit > & | units | ) |

## setMeasUnits()

void casacore::TableMeasDescBase::setMeasUnits | ( | const Measure & | meas,
|  | const Vector< Quantum< Double > > & | val,
|  | const Vector< Unit > & | units )

protected

Set the measure and possible units.

## type()

const String & casacore::TableMeasDescBase::type | ( |  | ) | const

inline

Returns the descriptors measure type as a String.

Definition at line 166 of file TableMeasDescBase.h.

References itsMeasType.

## write() [1/2]

void casacore::TableMeasDescBase::write | ( | Table & |  | ) |

## write() [2/2]

void casacore::TableMeasDescBase::write | ( | TableDesc & |  | ) |

Makes the descriptor persistent.

## writeIfOld()

void casacore::TableMeasDescBase::writeIfOld | ( | const Table & |  | ) |

Make the descriptor persistent if there was no refcode vector.

This is only needed for old tables without such vectors.

## Member Data Documentation

## itsMeasType

TableMeasType casacore::TableMeasDescBase::itsMeasType

private

Definition at line 213 of file TableMeasDescBase.h.

Referenced by refCode(), refType(), and type().

## itsRef

TableMeasRefDesc casacore::TableMeasDescBase::itsRef

private

Definition at line 211 of file TableMeasDescBase.h.

Referenced by getOffset(), getRefCode(), getRefDesc(), hasOffset(), isOffsetArray(), isOffsetVariable(), isRefCodeVariable(), offsetColumnName(), refColumnName(), resetOffset(), and resetRefCode().

## itsUnits

Vector<Unit> casacore::TableMeasDescBase::itsUnits

private

Definition at line 214 of file TableMeasDescBase.h.

Referenced by getUnits().

## itsValue

TableMeasValueDesc casacore::TableMeasDescBase::itsValue

private

Definition at line 210 of file TableMeasDescBase.h.

Referenced by columnName().

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

- measures/TableMeasures/TableMeasDescBase.h