casa
$Rev:20696$
|
Provides read/write access to Array Quantum columns in Tables. More...
#include <ArrayQuantColumn.h>
Public Member Functions | |
ArrayQuantColumn () | |
The default constructor creates a null object. | |
ArrayQuantColumn (const Table &tab, const String &columnName) | |
Create the ArrayQuantColumn from the supplied table and column name. | |
ArrayQuantColumn (const ArrayQuantColumn< T > &that) | |
Copy constructor (copy semantics). | |
~ArrayQuantColumn () | |
void | reference (const ArrayQuantColumn< T > &that) |
Make this object reference the column in "that". | |
void | put (uInt rownr, const Array< Quantum< T > > &q) |
Put an array of quanta into the specified row of the table. | |
void | attach (const Table &tab, const String &columnName) |
Attach a column to the object. | |
Private Member Functions | |
ArrayQuantColumn & | operator= (const ArrayQuantColumn< T > &that) |
reference() can be used for assignment. | |
Bool | operator== (const ArrayQuantColumn< T > &that) |
Comparison is not defined, since its semantics are unclear. | |
void | cleanUp () |
Deletes allocated memory etc. | |
Private Attributes | |
ArrayColumn< T > * | itsDataCol |
ArrayColumn< String > * | itsArrUnitsCol |
ScalarColumn< String > * | itsScaUnitsCol |
Provides read/write access to Array Quantum columns in Tables.
Public interface
The ArrayQuantColumn 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, ROArrayQuantColumn , use of a ArrayQuantColumn object allows the insertion of Quanta into a column.
The underlying Quantum column will have been defined to have either variable or fixed Units. A variable unit can be variable per row (thus the same for an entire array in that row) or it can be variable per array element. 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.
See TableQuantumDesc for more details.
(See TableQuantumDesc class for an example of how to define a Quantum column).
// This creates the Quantum array object. ArrayQuantColumn<Double> aqCol(qtab, "ArrQuantDouble"); // Test if the column has variable of fixed units if (aqCol.isUnitVariable()) { cout << "Quantum column supports variable units!" << endl; } else { cout << "Unit for the column is: ", << aqCol.getUnits() << endl; } // need an array of Quanta. IPosition shape(2, 3, 2); Array<Quantum<Double> > qArr(shape); Bool deleteIt; Quantum<Double>* q_p = qArr.getStorage(deleteIt); q_p->setValue(1.41212); q_p->setUnit("GHz"); q_p++; q_p->setValue(1.4921); q_p->setUnit("deg"); q_p++; q_p->setValue(1.4111); q_p->setUnit("ms-1"); q_p++; q_p->setValue(1.4003); q_p->setUnit("Jy"); q_p++; q_p->setValue(1.22); q_p->setUnit("GHz"); q_p++; q_p->setValue(1.090909); q_p->setUnit("g"); qArr.putStorage(q_p, deleteIt); // put the quantum array in the column at row 0. If the column has // fixed units the Unit component of each quantum will be lost. Just // their values will be stored. aqCol.put(0, qArr);
Add support for Quanta in the Tables system.
Definition at line 357 of file ArrayQuantColumn.h.
casa::ArrayQuantColumn< T >::ArrayQuantColumn | ( | ) |
The default constructor creates a null object.
Useful for creating arrays of ArrayQuantColumn objects. Attempting to use a null object will produce a segmentation fault, so care needs to be taken to initialize 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 ArrayQuantColumn object is null.
casa::ArrayQuantColumn< T >::ArrayQuantColumn | ( | const Table & | tab, |
const String & | columnName | ||
) |
Create the ArrayQuantColumn from the supplied table and column name.
The default unit for data retrieved is the unit in which they were stored.
casa::ArrayQuantColumn< T >::ArrayQuantColumn | ( | const ArrayQuantColumn< T > & | that | ) |
Copy constructor (copy semantics).
casa::ArrayQuantColumn< T >::~ArrayQuantColumn | ( | ) |
void casa::ArrayQuantColumn< T >::attach | ( | const Table & | tab, |
const String & | columnName | ||
) |
void casa::ArrayQuantColumn< T >::cleanUp | ( | ) | [private] |
Deletes allocated memory etc.
Called by destructor and any member which needs to reallocate data.
Reimplemented from casa::ROArrayQuantColumn< T >.
ArrayQuantColumn& casa::ArrayQuantColumn< T >::operator= | ( | const ArrayQuantColumn< T > & | that | ) | [private] |
reference() can be used for assignment.
Declaring this operator private makes it unusable.
Bool casa::ArrayQuantColumn< T >::operator== | ( | const ArrayQuantColumn< T > & | that | ) | [private] |
Comparison is not defined, since its semantics are unclear.
void casa::ArrayQuantColumn< T >::put | ( | uInt | rownr, |
const Array< Quantum< T > > & | q | ||
) |
Put an array of quanta into the specified row of the table.
If the column supports variable units, the units are stored as well. Otherwise the quanta are converted to the column's units.
void casa::ArrayQuantColumn< T >::reference | ( | const ArrayQuantColumn< T > & | that | ) |
Make this object reference the column in "that".
ArrayColumn<String>* casa::ArrayQuantColumn< T >::itsArrUnitsCol [private] |
Reimplemented from casa::ROArrayQuantColumn< T >.
Definition at line 394 of file ArrayQuantColumn.h.
ArrayColumn<T>* casa::ArrayQuantColumn< T >::itsDataCol [private] |
Reimplemented from casa::ROArrayQuantColumn< T >.
Definition at line 392 of file ArrayQuantColumn.h.
ScalarColumn<String>* casa::ArrayQuantColumn< T >::itsScaUnitsCol [private] |
Reimplemented from casa::ROArrayQuantColumn< T >.
Definition at line 396 of file ArrayQuantColumn.h.