casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes
casa::TableMeasDescBase Class Reference

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

#include <TableMeasDescBase.h>

Inheritance diagram for casa::TableMeasDescBase:
casa::TableMeasDesc< M >

List of all members.

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 TableMeasDescBaseclone () const
 Clone the object.
TableMeasDescBaseoperator= (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 StringcolumnName () 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 StringrefColumnName () const
 Returns the name of the ref code column when the ref code is variable.
const TableMeasRefDescgetRefDesc () const
 Returns a reference to its measure reference descriptor.
const StringoffsetColumnName () 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 MeasuregetOffset () const
 Returns a reference to the offset.
const Stringtype () 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 StringrefType (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 TableMeasDescBasereconstruct (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< UnititsUnits

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

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

Definition at line 92 of file TableMeasDescBase.h.


Constructor & Destructor Documentation

Null constructor.

Constructor with value and reference descriptors.

Note that setMeasType is always called by the derived class.

Copy constructor.


Member Function Documentation

virtual TableMeasDescBase* casa::TableMeasDescBase::clone ( ) const [virtual]

Clone the object.

Reimplemented in casa::TableMeasDesc< M >.

const String& casa::TableMeasDescBase::columnName ( ) const [inline]

Get the name of the underlying column.

Definition at line 124 of file TableMeasDescBase.h.

References casa::TableMeasValueDesc::columnName(), and itsValue.

const Measure& casa::TableMeasDescBase::getOffset ( ) const [inline]

Returns a reference to the offset.

Definition at line 163 of file TableMeasDescBase.h.

References casa::TableMeasRefDesc::getOffset(), and itsRef.

Return the reference code.

Definition at line 128 of file TableMeasDescBase.h.

References casa::TableMeasRefDesc::getRefCode(), and itsRef.

Returns a reference to its measure reference descriptor.

Definition at line 141 of file TableMeasDescBase.h.

References itsRef.

const Vector<Unit>& casa::TableMeasDescBase::getUnits ( ) const [inline]

Return the Units of the Measure values.

Definition at line 180 of file TableMeasDescBase.h.

References itsUnits.

static Bool casa::TableMeasDescBase::hasMeasures ( const TableColumn column) [static]

Does this column contain table measures?

Returns True if an offset has been defined.

Definition at line 150 of file TableMeasDescBase.h.

References casa::TableMeasRefDesc::hasOffset(), and itsRef.

void casa::TableMeasDescBase::initTabRef ( const MeasureHolder measHolder) [protected]

Set the initial reference codes and types in the table.

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

Definition at line 159 of file TableMeasDescBase.h.

References casa::TableMeasRefDesc::isOffsetArray(), and itsRef.

Returns True if the offset is variable.

Definition at line 154 of file TableMeasDescBase.h.

References casa::TableMeasRefDesc::isOffsetVariable(), and itsRef.

Returns True if the reference varies per row.

Definition at line 132 of file TableMeasDescBase.h.

References casa::TableMeasRefDesc::isRefCodeVariable(), and itsRef.

Get the name of the offset column.

Empty string is returned if no offset.

Definition at line 146 of file TableMeasDescBase.h.

References itsRef, and casa::TableMeasRefDesc::offsetColumnName().

TableMeasDescBase& casa::TableMeasDescBase::operator= ( const TableMeasDescBase that)

Assignment operator.

static TableMeasDescBase* casa::TableMeasDescBase::reconstruct ( const Table tab,
const String columnName 
) [static]

Reconstructs the object for the given table and column name.

uInt casa::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 172 of file TableMeasDescBase.h.

References itsMeasType, and casa::TableMeasType::refCode().

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 137 of file TableMeasDescBase.h.

References casa::TableMeasRefDesc::columnName(), and itsRef.

const String& casa::TableMeasDescBase::refType ( uInt  refCode) const [inline]

Translates the refCode for the descriptors measure type.

Definition at line 176 of file TableMeasDescBase.h.

References itsMeasType, and casa::TableMeasType::refType().

void casa::TableMeasDescBase::resetOffset ( const Measure offset) [inline]

Definition at line 189 of file TableMeasDescBase.h.

References itsRef, and casa::TableMeasRefDesc::resetOffset().

void casa::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 187 of file TableMeasDescBase.h.

References itsRef, and casa::TableMeasRefDesc::resetRefCode().

void casa::TableMeasDescBase::resetUnits ( const Vector< Unit > &  units)
void casa::TableMeasDescBase::setMeasUnits ( const Measure meas,
const Vector< Quantum< Double > > &  val,
const Vector< Unit > &  units 
) [protected]

Set the measure and possible units.

const String& casa::TableMeasDescBase::type ( ) const [inline]

Returns the descriptors measure type as a String.

Definition at line 167 of file TableMeasDescBase.h.

References itsMeasType, and casa::TableMeasType::type().

Makes the descriptor persistent.

Make the descriptor persistent if there was no refcode vector.

This is only needed for old tables without such vectors.


Member Data Documentation

Definition at line 214 of file TableMeasDescBase.h.

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

Definition at line 215 of file TableMeasDescBase.h.

Referenced by getUnits().

Definition at line 211 of file TableMeasDescBase.h.

Referenced by columnName().


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