TableMeasDescBase.h

Classes

TableMeasDescBase -- Definition of a Measure in a Table. (full description)

class TableMeasDescBase

Interface

Public Members
TableMeasDescBase()
TableMeasDescBase (const TableMeasValueDesc&, const TableMeasRefDesc&)
TableMeasDescBase (const TableMeasDescBase& that)
virtual ~TableMeasDescBase()
virtual TableMeasDescBase* clone() const
TableMeasDescBase& operator= (const TableMeasDescBase& that)
void write (TableDesc&)
void write (Table&)
const String& columnName() const
uInt getRefCode() const
Bool isRefCodeVariable() const
const String& refColumnName() const
const TableMeasRefDesc& getRefDesc()
const String& offsetColumnName() const
Bool hasOffset() const
Bool isOffsetVariable() const
Bool isOffsetArray() const
const Measure& getOffset() const
const String& type() const
uInt refCode (const String& refString) const
const String& refType (uInt refCode) const
const Vector<Unit>& getUnits() const
void resetRefCode (uInt refCode)
void resetOffset (const Measure& offset)
void resetUnits (const Vector<Unit>& units)
static TableMeasDescBase* reconstruct (const Table& tab, const String& columnName)
static Bool hasMeasures (const ROTableColumn& column)
Protected Members
void setMeasUnits (const Measure& meas, const Vector<Quantum<Double> >& val, const Vector<Unit>& units)

Description

Review Status

Reviewed By:
Bob Garwood
Date Reviewed:
1999/12/23
Programs:
Tests:

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

Member Description

TableMeasDescBase()

Null constructor.

TableMeasDescBase (const TableMeasValueDesc&, const TableMeasRefDesc&)

Constructor with value and reference descriptors. Note that setMeasType is always called by the derived class.

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&)
void write (Table&)

Makes the descriptor persistent.

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. The null string is returned if the ref code is not variable.

const TableMeasRefDesc& getRefDesc()

Returns a reference to its measure reference descriptor.

const String& offsetColumnName() const

Get the name of the offset column. Empty string is returned if no offset.

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. Throws an exception if the refString is invalid for this object.

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)
void resetOffset (const Measure& offset)
void resetUnits (const Vector<Unit>& units)

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.

static TableMeasDescBase* reconstruct (const Table& tab, const String& columnName)

Reconstructs the object for the given table and column name.

static Bool hasMeasures (const ROTableColumn& column)

Does this column contain table measures?

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

Set the measure and possible units.