casacore
|
Definition of a Measure in a Table. More...
#include <TableMeasDescBase.h>
Public Member Functions | |
TableMeasDescBase () | |
Null constructor. More... | |
TableMeasDescBase (const TableMeasValueDesc &, const TableMeasRefDesc &) | |
Constructor with value and reference descriptors. More... | |
TableMeasDescBase (const TableMeasDescBase &that) | |
Copy constructor. More... | |
virtual | ~TableMeasDescBase () |
virtual TableMeasDescBase * | clone () const |
Clone the object. More... | |
TableMeasDescBase & | operator= (const TableMeasDescBase &that) |
Assignment operator. More... | |
void | write (TableDesc &) |
Makes the descriptor persistent. More... | |
void | write (Table &) |
void | writeIfOld (const Table &) |
Make the descriptor persistent if there was no refcode vector. More... | |
const String & | columnName () const |
Get the name of the underlying column. More... | |
uInt | getRefCode () const |
Return the reference code. More... | |
Bool | isRefCodeVariable () const |
Returns True if the reference varies per row. More... | |
const String & | refColumnName () const |
Returns the name of the ref code column when the ref code is variable. More... | |
const TableMeasRefDesc & | getRefDesc () const |
Returns a reference to its measure reference descriptor. More... | |
const String & | offsetColumnName () const |
Get the name of the offset column. More... | |
Bool | hasOffset () const |
Returns True if an offset has been defined. More... | |
Bool | isOffsetVariable () const |
Returns True if the offset is variable. More... | |
Bool | isOffsetArray () const |
Returns True if the offset is variable and is stored in an ArrayMeasColumn, i.e., offsets are stored per element. More... | |
const Measure & | getOffset () const |
Returns a reference to the offset. More... | |
const String & | type () const |
Returns the descriptors measure type as a String. More... | |
uInt | refCode (const String &refString) const |
Returns the reference code for this object given a string. More... | |
const String & | refType (uInt refCode) const |
Translates the refCode for the descriptors measure type. More... | |
const Vector< Unit > & | getUnits () const |
Return the Units of the Measure values. More... | |
void | resetRefCode (uInt refCode) |
Reset the refCode, offset, or units. More... | |
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. More... | |
static Bool | hasMeasures (const TableColumn &column) |
Does this column contain table measures? More... | |
Protected Member Functions | |
void | initTabRef (const MeasureHolder &measHolder) |
Set the initial reference codes and types in the table. More... | |
void | setMeasUnits (const Measure &meas, const Vector< Quantum< Double > > &val, const Vector< Unit > &units) |
Set the measure and possible units. More... | |
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 93 of file TableMeasDescBase.h.
casacore::TableMeasDescBase::TableMeasDescBase | ( | ) |
Null constructor.
casacore::TableMeasDescBase::TableMeasDescBase | ( | const TableMeasValueDesc & | , |
const TableMeasRefDesc & | |||
) |
Constructor with value and reference descriptors.
Note that setMeasType is always called by the derived class.
casacore::TableMeasDescBase::TableMeasDescBase | ( | const TableMeasDescBase & | that | ) |
Copy constructor.
|
virtual |
|
virtual |
Clone the object.
Reimplemented in casacore::TableMeasDesc< M >.
|
inline |
Get the name of the underlying column.
Definition at line 125 of file TableMeasDescBase.h.
References casacore::TableMeasValueDesc::columnName(), and itsValue.
|
inline |
Returns a reference to the offset.
Definition at line 164 of file TableMeasDescBase.h.
References casacore::TableMeasRefDesc::getOffset(), and itsRef.
|
inline |
Return the reference code.
Definition at line 129 of file TableMeasDescBase.h.
References casacore::TableMeasRefDesc::getRefCode(), and itsRef.
|
inline |
Returns a reference to its measure reference descriptor.
Definition at line 142 of file TableMeasDescBase.h.
References itsRef.
Return the Units of the Measure values.
Definition at line 181 of file TableMeasDescBase.h.
References itsUnits.
|
static |
Does this column contain table measures?
|
inline |
Returns True if an offset has been defined.
Definition at line 151 of file TableMeasDescBase.h.
References casacore::TableMeasRefDesc::hasOffset(), and itsRef.
|
protected |
Set the initial reference codes and types in the table.
|
inline |
Returns True if the offset is variable and is stored in an ArrayMeasColumn, i.e., offsets are stored per element.
Definition at line 160 of file TableMeasDescBase.h.
References casacore::TableMeasRefDesc::isOffsetArray(), and itsRef.
|
inline |
Returns True if the offset is variable.
Definition at line 155 of file TableMeasDescBase.h.
References casacore::TableMeasRefDesc::isOffsetVariable(), and itsRef.
|
inline |
Returns True if the reference varies per row.
Definition at line 133 of file TableMeasDescBase.h.
References casacore::TableMeasRefDesc::isRefCodeVariable(), and itsRef.
|
inline |
Get the name of the offset column.
Empty string is returned if no offset.
Definition at line 147 of file TableMeasDescBase.h.
References itsRef, and casacore::TableMeasRefDesc::offsetColumnName().
TableMeasDescBase& casacore::TableMeasDescBase::operator= | ( | const TableMeasDescBase & | that | ) |
Assignment operator.
|
static |
Reconstructs the object for the given table and column name.
Returns the reference code for this object given a string.
Throws an exception if the refString is invalid for this object.
Definition at line 173 of file TableMeasDescBase.h.
References itsMeasType, and casacore::TableMeasType::refCode().
|
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 138 of file TableMeasDescBase.h.
References casacore::TableMeasRefDesc::columnName(), and itsRef.
Translates the refCode for the descriptors measure type.
Definition at line 177 of file TableMeasDescBase.h.
References itsMeasType, and casacore::TableMeasType::refType().
|
inline |
Definition at line 190 of file TableMeasDescBase.h.
References itsRef, and casacore::TableMeasRefDesc::resetOffset().
|
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 188 of file TableMeasDescBase.h.
References itsRef, and casacore::TableMeasRefDesc::resetRefCode().
|
protected |
Set the measure and possible units.
|
inline |
Returns the descriptors measure type as a String.
Definition at line 168 of file TableMeasDescBase.h.
References itsMeasType, and casacore::TableMeasType::type().
void casacore::TableMeasDescBase::write | ( | TableDesc & | ) |
Makes the descriptor persistent.
void casacore::TableMeasDescBase::write | ( | Table & | ) |
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.
|
private |
Definition at line 215 of file TableMeasDescBase.h.
|
private |
Definition at line 213 of file TableMeasDescBase.h.
Referenced by getOffset(), getRefCode(), getRefDesc(), hasOffset(), isOffsetArray(), isOffsetVariable(), isRefCodeVariable(), offsetColumnName(), refColumnName(), resetOffset(), and resetRefCode().
Definition at line 216 of file TableMeasDescBase.h.
Referenced by getUnits().
|
private |
Definition at line 212 of file TableMeasDescBase.h.
Referenced by columnName().