casacore
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes | List of all members

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

Constructor & Destructor Documentation

◆ TableMeasDescBase() [1/3]

casacore::TableMeasDescBase::TableMeasDescBase ( )

Null constructor.

◆ 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.

◆ ~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 >.

◆ columnName()

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

Get the name of the underlying column.

Definition at line 125 of file TableMeasDescBase.h.

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

◆ getOffset()

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

Returns a reference to the offset.

Definition at line 164 of file TableMeasDescBase.h.

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

◆ getRefCode()

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

Return the reference code.

Definition at line 129 of file TableMeasDescBase.h.

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

◆ getRefDesc()

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

Returns a reference to its measure reference descriptor.

Definition at line 142 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 181 of file TableMeasDescBase.h.

References itsUnits.

◆ hasMeasures()

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

References casacore::TableMeasRefDesc::hasOffset(), and 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 160 of file TableMeasDescBase.h.

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

◆ isOffsetVariable()

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

Returns True if the offset is variable.

Definition at line 155 of file TableMeasDescBase.h.

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

◆ isRefCodeVariable()

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

Returns True if the reference varies per row.

Definition at line 133 of file TableMeasDescBase.h.

References casacore::TableMeasRefDesc::isRefCodeVariable(), and 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 147 of file TableMeasDescBase.h.

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

◆ operator=()

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

Assignment operator.

◆ reconstruct()

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

Reconstructs the object for the given table and column name.

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

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

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

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

◆ refType()

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

Translates the refCode for the descriptors measure type.

Definition at line 177 of file TableMeasDescBase.h.

References itsMeasType, refCode(), and casacore::TableMeasType::refType().

◆ resetOffset()

void casacore::TableMeasDescBase::resetOffset ( const Measure offset)
inline

Definition at line 190 of file TableMeasDescBase.h.

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

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

References itsRef, refCode(), and casacore::TableMeasRefDesc::resetRefCode().

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

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

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

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

◆ itsRef

TableMeasRefDesc casacore::TableMeasDescBase::itsRef
private

◆ itsUnits

Vector<Unit> casacore::TableMeasDescBase::itsUnits
private

Definition at line 216 of file TableMeasDescBase.h.

Referenced by getUnits().

◆ itsValue

TableMeasValueDesc casacore::TableMeasDescBase::itsValue
private

Definition at line 212 of file TableMeasDescBase.h.

Referenced by columnName().


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