Loading...
Searching...
No Matches
casacore::TableMeasColumn Class Reference
measures package (libcasa_measures) » TableMeasures_module

More...

`#include <TableMeasColumn.h>`

## Public Member Functions

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

## Protected Attributes

uInt | itsNvals
std::shared_ptr< TableMeasDescBase > | itsDescPtr
TableColumn | itsTabDataCol
Bool | itsVarRefFlag
Bool | itsVarOffFlag

## Private Member Functions

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

## 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

- Measures
- Tables
- TableMeasDesc

### 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;
}
casacore::TableMeasColumn::TableMeasColumn
TableMeasColumn()
The default constructor creates a null object.

### Motivation

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

Definition at line 96 of file TableMeasColumn.h.

## Constructor & Destructor Documentation

## TableMeasColumn() [1/3]

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.

Referenced by operator=(), reference(), and TableMeasColumn().

## TableMeasColumn() [2/3]

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

Create the ScalarMeasColumn from the table and column Name.

References columnName().

## TableMeasColumn() [3/3]

casacore::TableMeasColumn::TableMeasColumn | ( | const TableMeasColumn & | that | ) |

Copy constructor (copy semantics).

References TableMeasColumn().

## ~TableMeasColumn()

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

virtual

## Member Function Documentation

## attach()

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

Attach another column to the object.

References columnName().

## columnName()

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

Get the name of the column.

Referenced by casacore::ArrayMeasColumn< MBaseline >::ArrayMeasColumn(), casacore::ArrayMeasColumn< MBaseline >::attach(), casacore::ScalarMeasColumn< MBaseline >::attach(), attach(), casacore::ScalarMeasColumn< MBaseline >::ScalarMeasColumn(), and TableMeasColumn().

## isDefined()

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

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

## isNull()

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

inline

Test if the object is null.

Definition at line 134 of file TableMeasColumn.h.

References itsDescPtr.

## isScalar()

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;

## measDesc() [1/2]

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

inline

Definition at line 129 of file TableMeasColumn.h.

References itsDescPtr.

## measDesc() [2/2]

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

inline

Get access to the TableMeasDescBase describing the column.

Definition at line 127 of file TableMeasColumn.h.

References itsDescPtr.

## operator=()

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

private

Assignment makes no sense in a readonly class.

Declaring this operator private makes it unusable.

References TableMeasColumn().

## reference()

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

Change the reference to another column.

References TableMeasColumn().

## table()

Table casacore::TableMeasColumn::table | ( |  | ) | const

Get the Table object this column belongs to.

## throwIfNull()

void casacore::TableMeasColumn::throwIfNull | ( |  | ) | const

Throw an exception if the object is null.

## Member Data Documentation

## itsDescPtr

std::shared_ptr<TableMeasDescBase> casacore::TableMeasColumn::itsDescPtr

protected

Definition at line 162 of file TableMeasColumn.h.

Referenced by isNull(), measDesc(), and measDesc().

## itsNvals

uInt casacore::TableMeasColumn::itsNvals

protected

Definition at line 160 of file TableMeasColumn.h.

## itsTabDataCol

TableColumn casacore::TableMeasColumn::itsTabDataCol

protected

Definition at line 164 of file TableMeasColumn.h.

## itsVarOffFlag

Bool casacore::TableMeasColumn::itsVarOffFlag

protected

Definition at line 167 of file TableMeasColumn.h.

## itsVarRefFlag

Bool casacore::TableMeasColumn::itsVarRefFlag

protected

Definition at line 166 of file TableMeasColumn.h.

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

- measures/TableMeasures/TableMeasColumn.h