casacore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Attributes | Private Member Functions | List of all members
casacore::TableMeasColumn Class Reference

Read only access to table scalar Measure columns. More...

#include <TableMeasColumn.h>

Inheritance diagram for casacore::TableMeasColumn:
casacore::ArrayMeasColumn< casacore::MDirection > casacore::ArrayMeasColumn< casacore::MEpoch > casacore::ArrayMeasColumn< casacore::MFrequency > casacore::ArrayMeasColumn< casacore::MRadialVelocity > casacore::ArrayMeasColumn< MDirection > casacore::ArrayMeasColumn< MDoppler > casacore::ArrayMeasColumn< MEarthMagnetic > casacore::ArrayMeasColumn< MEpoch > casacore::ArrayMeasColumn< MFrequency > casacore::ArrayMeasColumn< MPosition > casacore::ArrayMeasColumn< MRadialVelocity > casacore::ArrayMeasColumn< M > casacore::ScalarMeasColumn< M > casacore::ScalarMeasColumn< casacore::MDirection > casacore::ScalarMeasColumn< casacore::MDoppler > casacore::ScalarMeasColumn< casacore::MEpoch > casacore::ScalarMeasColumn< casacore::MFrequency > casacore::ScalarMeasColumn< casacore::MPosition > casacore::ScalarMeasColumn< casacore::MRadialVelocity > casacore::ScalarMeasColumn< casacore::Muvw > casacore::ScalarMeasColumn< MDirection > casacore::ScalarMeasColumn< MDoppler > casacore::ScalarMeasColumn< MEarthMagnetic > casacore::ScalarMeasColumn< MEpoch > casacore::ScalarMeasColumn< MFrequency > casacore::ScalarMeasColumn< MPosition > casacore::ScalarMeasColumn< MRadialVelocity >

Public Member Functions

 TableMeasColumn ()
 The default constructor creates a null object. More...
 
 TableMeasColumn (const Table &tab, const String &columnName)
 Create the ScalarMeasColumn from the table and column Name. More...
 
 TableMeasColumn (const TableMeasColumn &that)
 Copy constructor (copy semantics). More...
 
virtual ~TableMeasColumn ()
 
void reference (const TableMeasColumn &that)
 Change the reference to another column. More...
 
void attach (const Table &tab, const String &columnName)
 Attach another column to the object. More...
 
Bool isDefined (rownr_t rownr) const
 Tests if a row contains a Measure (i.e., if the row has a defined value). More...
 
const TableMeasDescBasemeasDesc () const
 Get access to the TableMeasDescBase describing the column. More...
 
TableMeasDescBasemeasDesc ()
 
Bool isNull () const
 Test if the object is null. More...
 
void throwIfNull () const
 Throw an exception if the object is null. More...
 
const StringcolumnName () const
 Get the name of the column. More...
 
Table table () const
 Get the Table object this column belongs to. More...
 
Bool isScalar () const
 Is the column a scalar measures column? It is if the underlying column is a scalar column or an array column with a fixed 1-dimensional shape. More...
 

Protected Attributes

uInt itsNvals
 
CountedPtr< TableMeasDescBaseitsDescPtr
 
TableColumn itsTabDataCol
 
Bool itsVarRefFlag
 
Bool itsVarOffFlag
 

Private Member Functions

TableMeasColumnoperator= (const TableMeasColumn &that)
 Assignment makes no sense in a readonly class. More...
 

Detailed Description

Read only access to table scalar Measure columns.

Intended use:

Public interface

Review Status

Reviewed By:
Bob Garwood
Date Reviewed:
1999/12/23
Test programs:
tTableMeasures

Prerequisite

Synopsis

TableMeasColumn is the base class for the templated classes ScalarMeasColumn and ArrayMeasColumn which give access to table columns containing measures.

This base class offers some common functionality like getting the column name and testing if a row of the column contains a value. Its main function is measDesc(), which gives access to the TableMeasDescBase object containing a description of the measure column.

Example

// Create the object for measure column Time1.
TableMeasColumn timeCol(tab, "Time1");
// print some details about the column
if (timeCol.measDesc().isRefCodeVariable()) {
cout << "The column has variable references." << endl;
} else {
cout << "The fixed MeasRef for the column is: "
<< timeCol.getMeasRef() << endl;
}

Motivation

This class contains the common functionality for the templated derived classes.

Definition at line 98 of file TableMeasColumn.h.

Constructor & Destructor Documentation

casacore::TableMeasColumn::TableMeasColumn ( )

The default constructor creates a null object.

Useful for creating arrays of ScalarMeasColumn objects. Attempting to use a null object will produce a segmentation fault so care needs to be taken to initialise the objects first by using attach(). An ScalarMeasColumn object can be tested if it is null by using the isNull() member.

casacore::TableMeasColumn::TableMeasColumn ( const Table tab,
const String columnName 
)

Create the ScalarMeasColumn from the table and column Name.

casacore::TableMeasColumn::TableMeasColumn ( const TableMeasColumn that)

Copy constructor (copy semantics).

virtual casacore::TableMeasColumn::~TableMeasColumn ( )
virtual

Member Function Documentation

void casacore::TableMeasColumn::attach ( const Table tab,
const String columnName 
)

Attach another column to the object.

const String& casacore::TableMeasColumn::columnName ( ) const

Get the name of the column.

Bool casacore::TableMeasColumn::isDefined ( rownr_t  rownr) const

Tests if a row contains a Measure (i.e., if the row has a defined value).

Bool casacore::TableMeasColumn::isNull ( ) const
inline

Test if the object is null.

Definition at line 136 of file TableMeasColumn.h.

References itsDescPtr.

Bool casacore::TableMeasColumn::isScalar ( ) const

Is the column a scalar measures column? It is if the underlying column is a scalar column or an array column with a fixed 1-dimensional shape.


Otherwise it is an array measures column.
Caution: It is not 100% determined if a measure column is an array or a scalar; If the underlying table column is an array with a variable shape, this function will see it as an array measure column; However, it might be accessible as a scalar measure column;

const TableMeasDescBase& casacore::TableMeasColumn::measDesc ( ) const
inline

Get access to the TableMeasDescBase describing the column.

Definition at line 129 of file TableMeasColumn.h.

References itsDescPtr.

TableMeasDescBase& casacore::TableMeasColumn::measDesc ( )
inline

Definition at line 131 of file TableMeasColumn.h.

References itsDescPtr.

TableMeasColumn& casacore::TableMeasColumn::operator= ( const TableMeasColumn that)
private

Assignment makes no sense in a readonly class.

Declaring this operator private makes it unusable.

void casacore::TableMeasColumn::reference ( const TableMeasColumn that)

Change the reference to another column.

Table casacore::TableMeasColumn::table ( ) const

Get the Table object this column belongs to.

void casacore::TableMeasColumn::throwIfNull ( ) const

Throw an exception if the object is null.

Member Data Documentation

CountedPtr<TableMeasDescBase> casacore::TableMeasColumn::itsDescPtr
protected

Definition at line 164 of file TableMeasColumn.h.

Referenced by isNull(), and measDesc().

uInt casacore::TableMeasColumn::itsNvals
protected

Definition at line 162 of file TableMeasColumn.h.

TableColumn casacore::TableMeasColumn::itsTabDataCol
protected

Definition at line 166 of file TableMeasColumn.h.

Bool casacore::TableMeasColumn::itsVarOffFlag
protected

Definition at line 169 of file TableMeasColumn.h.

Bool casacore::TableMeasColumn::itsVarRefFlag
protected

Definition at line 168 of file TableMeasColumn.h.


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