casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Private Member Functions | Private Attributes
casa::ScalarQuantColumn< T > Class Template Reference

Provides read/write access to Scalar Quantum Columns in Tables. More...

#include <ScalarQuantColumn.h>

Inheritance diagram for casa::ScalarQuantColumn< T >:
casa::ROScalarQuantColumn< T >

List of all members.

Public Member Functions

 ScalarQuantColumn ()
 The default constructor creates a null object.
 ScalarQuantColumn (const Table &tab, const String &columnName)
 Create the ROScalarQuantColumn from the specified table and column name.
 ScalarQuantColumn (const ScalarQuantColumn< T > &that)
 Copy constructor (copy semantics).
 ~ScalarQuantColumn ()
void reference (const ScalarQuantColumn< T > &that)
 Change the reference to another column.
void put (uInt rownr, const Quantum< T > &q)
 Put a quantum into the table.
void attach (const Table &tab, const String &columnName)
 Attach a column to the object.

Private Member Functions

ScalarQuantColumnoperator= (const ScalarQuantColumn< T > &that)
 Assignment facility offered via reference() member.
Bool operator== (const ScalarQuantColumn< T > &that)
 Comparison is not defined, since its semantics are unclear.
void cleanUp ()
 Deletes allocated memory etc.

Private Attributes

ScalarColumn< T > * itsDataCol
ScalarColumn< String > * itsUnitsCol

Detailed Description

template<class T>
class casa::ScalarQuantColumn< T >

Provides read/write access to Scalar Quantum Columns in Tables.

Intended use:

Public interface

Review Status

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

Prerequisite

Synopsis

The ScalarQuantColumn class provides read/write access to Quanta stored in a Quantum Table column. The column should previously have been defined as a Quantum column by means of the TableQuantumDesc object. In addition to the operations provided by its read-only partner, ROScalarQuantColumn , use of a ScalarQuantColumn object allows the insertion of Quanta into a column.

Quantum Units

The underlying Quantum column will have been defined to have either variable or fixed Units. If the Quantum column's Unit is fixed then writing quanta converts the data to that unit. If the column's unit is variable, the data is written unconverted and the unit is written into the unit column defined in the TableQuantumDesc object.

Example

        Quantum<Double> q(5.3, "keV");
        // "QuantScalar" has previously been defined as a Quantum column
        // by means of a TableQuantumDesc.
        ScalarQuantColumn<Double> qCol(qtab, "QuantScalar");
        for (uInt i=0; i < qtab.nrow(); i++) {
            qCol.put(i, q);
        }

Motivation

Add support for Quanta in the Tables system.

Thrown Exceptions

To Do

Definition at line 292 of file ScalarQuantColumn.h.


Constructor & Destructor Documentation

template<class T>
casa::ScalarQuantColumn< T >::ScalarQuantColumn ( )

The default constructor creates a null object.

Useful for creating arrays of ScalarQuantColumn objects. Attempting to use a null object will produce a segmentation fault so care needs to be taken to initialise the objects by using the attach() member before any attempt is made to use the object. The isNull() member can be used to test if a ScalarQuantColumn object is null.

template<class T>
casa::ScalarQuantColumn< T >::ScalarQuantColumn ( const Table tab,
const String columnName 
)

Create the ROScalarQuantColumn from the specified table and column name.

The default unit for data retrieved is the unit in which they were stored.

template<class T>
casa::ScalarQuantColumn< T >::ScalarQuantColumn ( const ScalarQuantColumn< T > &  that)

Copy constructor (copy semantics).

template<class T>
casa::ScalarQuantColumn< T >::~ScalarQuantColumn ( )

Member Function Documentation

template<class T>
void casa::ScalarQuantColumn< T >::attach ( const Table tab,
const String columnName 
)

Attach a column to the object.

Reimplemented from casa::ROScalarQuantColumn< T >.

template<class T>
void casa::ScalarQuantColumn< T >::cleanUp ( ) [private]

Deletes allocated memory etc.

Called by destructor and any member which needs to reallocate data.

Reimplemented from casa::ROScalarQuantColumn< T >.

template<class T>
ScalarQuantColumn& casa::ScalarQuantColumn< T >::operator= ( const ScalarQuantColumn< T > &  that) [private]

Assignment facility offered via reference() member.

Declaring this operator private makes it unusable.

template<class T>
Bool casa::ScalarQuantColumn< T >::operator== ( const ScalarQuantColumn< T > &  that) [private]

Comparison is not defined, since its semantics are unclear.

template<class T>
void casa::ScalarQuantColumn< T >::put ( uInt  rownr,
const Quantum< T > &  q 
)

Put a quantum into the table.

If the column supports variable units the q's unit is stored into the unit column defined in the TableQuantumDesc object. If units are fixed for the column, the quantum is converted as needed.

template<class T>
void casa::ScalarQuantColumn< T >::reference ( const ScalarQuantColumn< T > &  that)

Change the reference to another column.


Member Data Documentation

template<class T>
ScalarColumn<T>* casa::ScalarQuantColumn< T >::itsDataCol [private]

Reimplemented from casa::ROScalarQuantColumn< T >.

Definition at line 328 of file ScalarQuantColumn.h.

template<class T>
ScalarColumn<String>* casa::ScalarQuantColumn< T >::itsUnitsCol [private]

Reimplemented from casa::ROScalarQuantColumn< T >.

Definition at line 330 of file ScalarQuantColumn.h.


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