casa
$Rev:20696$
|
Definition of a Measure in a Table. 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 |
Definition of a Measure in a Table.
Internal
Abstract base class for TableMeasDesc.
See class TableMeasDesc .
Creating the required keyword for the definition of a Measure in a Table is somewhat complicated. This class assists in that process.
Definition at line 92 of file TableMeasDescBase.h.
Null constructor.
casa::TableMeasDescBase::TableMeasDescBase | ( | const TableMeasValueDesc & | , |
const TableMeasRefDesc & | |||
) |
Constructor with value and reference descriptors.
Note that setMeasType is always called by the derived class.
casa::TableMeasDescBase::TableMeasDescBase | ( | const TableMeasDescBase & | that | ) |
Copy constructor.
virtual casa::TableMeasDescBase::~TableMeasDescBase | ( | ) | [virtual] |
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.
uInt casa::TableMeasDescBase::getRefCode | ( | ) | const [inline] |
Return the reference code.
Definition at line 128 of file TableMeasDescBase.h.
References casa::TableMeasRefDesc::getRefCode(), and itsRef.
const TableMeasRefDesc& casa::TableMeasDescBase::getRefDesc | ( | ) | const [inline] |
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?
Bool casa::TableMeasDescBase::hasOffset | ( | ) | const [inline] |
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.
Bool casa::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 159 of file TableMeasDescBase.h.
References casa::TableMeasRefDesc::isOffsetArray(), and itsRef.
Bool casa::TableMeasDescBase::isOffsetVariable | ( | ) | const [inline] |
Returns True if the offset is variable.
Definition at line 154 of file TableMeasDescBase.h.
References casa::TableMeasRefDesc::isOffsetVariable(), and itsRef.
Bool casa::TableMeasDescBase::isRefCodeVariable | ( | ) | const [inline] |
Returns True if the reference varies per row.
Definition at line 132 of file TableMeasDescBase.h.
References casa::TableMeasRefDesc::isRefCodeVariable(), and itsRef.
const String& casa::TableMeasDescBase::offsetColumnName | ( | ) | const [inline] |
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().
const String& casa::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 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().
void casa::TableMeasDescBase::write | ( | TableDesc & | ) |
Makes the descriptor persistent.
void casa::TableMeasDescBase::write | ( | Table & | ) |
void casa::TableMeasDescBase::writeIfOld | ( | const Table & | ) |
Make the descriptor persistent if there was no refcode vector.
This is only needed for old tables without such vectors.
Definition at line 214 of file TableMeasDescBase.h.
Definition at line 212 of file TableMeasDescBase.h.
Referenced by getOffset(), getRefCode(), getRefDesc(), hasOffset(), isOffsetArray(), isOffsetVariable(), isRefCodeVariable(), offsetColumnName(), refColumnName(), resetOffset(), and resetRefCode().
Vector<Unit> casa::TableMeasDescBase::itsUnits [private] |
Definition at line 215 of file TableMeasDescBase.h.
Referenced by getUnits().
Definition at line 211 of file TableMeasDescBase.h.
Referenced by columnName().