casa
$Rev:20696$
|
Provides read/write access to Scalar Quantum Columns in Tables. More...
#include <ScalarQuantColumn.h>
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 | |
ScalarQuantColumn & | operator= (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 |
Provides read/write access to Scalar Quantum Columns in Tables.
Public interface
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.
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.
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); }
Add support for Quanta in the Tables system.
Definition at line 292 of file ScalarQuantColumn.h.
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.
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.
casa::ScalarQuantColumn< T >::ScalarQuantColumn | ( | const ScalarQuantColumn< T > & | that | ) |
Copy constructor (copy semantics).
casa::ScalarQuantColumn< T >::~ScalarQuantColumn | ( | ) |
void casa::ScalarQuantColumn< T >::attach | ( | const Table & | tab, |
const String & | columnName | ||
) |
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 >.
ScalarQuantColumn& casa::ScalarQuantColumn< T >::operator= | ( | const ScalarQuantColumn< T > & | that | ) | [private] |
Assignment facility offered via reference() member.
Declaring this operator private makes it unusable.
Bool casa::ScalarQuantColumn< T >::operator== | ( | const ScalarQuantColumn< T > & | that | ) | [private] |
Comparison is not defined, since its semantics are unclear.
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.
void casa::ScalarQuantColumn< T >::reference | ( | const ScalarQuantColumn< T > & | that | ) |
Change the reference to another column.
ScalarColumn<T>* casa::ScalarQuantColumn< T >::itsDataCol [private] |
Reimplemented from casa::ROScalarQuantColumn< T >.
Definition at line 328 of file ScalarQuantColumn.h.
ScalarColumn<String>* casa::ScalarQuantColumn< T >::itsUnitsCol [private] |
Reimplemented from casa::ROScalarQuantColumn< T >.
Definition at line 330 of file ScalarQuantColumn.h.