#include <ArrayQuantColumn.h>
Inheritance diagram for casa::ROArrayQuantColumn< T >:

Part of API
The ROArrayQuantColumn class provides read-only access to quanta stored in a array Quantum Table column. The Quantum column should already exist in the table and would have been defined by means of a TableQuantumDesc object . In addition, for a ROArrayQuantColumn object to be useful the column should contain Quanta. Inserting Quanta into a column requires the use of a ArrayQuantColumn object.
The ROArrayQuantColumn class is the array version of the ROScalarQuantColumn class.
Quanta retrieved from the column will normally have the Unit that was specified when the Quantum column was defined. However, it is possible to override the default column Unit by supplying a Unit in the ROArrayQuantColumn constructor. When constructed in this fashion the retrieved Quanta will by default be retrieved in this unit, i.e. they will by default be converted to this unit.
By giving a unit (as a Unit or Quantum object) to a get function, the data can be retrieved in another unit than the default.
(See TableQuantumDesc class for an example of how to define a Quantum column).
// Create the column object with default units "deg". // It gets the quantum array from row 0 and prints it to stdout. ROArrayQuantColumn<Double> roaqCol(qtab, "ArrQuantDouble", "deg"); cout << roaqCol(0) << endl; // This retrieves the same array with units converted to "m/s". cout << roaqCol(0, "m/s") << endl;
Add support for Quanta in the Tables system.
Quantum<Array<T>>.
Definition at line 122 of file ArrayQuantColumn.h.
Public Member Functions | |
| ROArrayQuantColumn () | |
| The default constructor creates a null object. | |
| ROArrayQuantColumn (const Table &tab, const String &columnName) | |
| Create the ROArrayQuantColumn from the supplied table and column name. | |
| ROArrayQuantColumn (const ROArrayQuantColumn< T > &that) | |
| Copy constructor (copy semantics). | |
| ~ROArrayQuantColumn () | |
| void | reference (const ROArrayQuantColumn< T > &that) |
| Make this object reference the column in "that". | |
| Bool | isUnitVariable () const |
| Test whether the Quantum column has variable units. | |
| Vector< String > | getUnits () const |
| Returns the column's units as a vector of strings. | |
| Bool | isNull () const |
| Test if the object is null. | |
| void | throwIfNull () const |
| Throw an exception if the object is null. | |
| ROArrayQuantColumn (const Table &tab, const String &columnName, const Unit &) | |
| Create the ROArrayQuantColumn from the supplied table and column name. | |
| ROArrayQuantColumn (const Table &tab, const String &columnName, const Vector< Unit > &) | |
| void | attach (const Table &tab, const String &columnName) |
| Attach a column to the object. | |
| void | attach (const Table &tab, const String &columnName, const Unit &) |
| void | attach (const Table &tab, const String &columnName, const Vector< Unit > &) |
| void | get (uInt rownr, Array< Quantum< T > > &q, Bool resize=False) const |
| Get the quantum array in the specified row. | |
| void | get (uInt rownr, Array< Quantum< T > > &q, const Unit &, Bool resize=False) const |
| Get the quantum array in the specified row. | |
| void | get (uInt rownr, Array< Quantum< T > > &q, const Vector< Unit > &, Bool resize=False) const |
| Get the quantum array in the specified row. | |
| void | get (uInt rownr, Array< Quantum< T > > &q, const Quantum< T > &other, Bool resize=False) const |
| Get the quantum array in the specified row. | |
| Array< Quantum< T > > | operator() (uInt rownr) const |
| Return the quantum array stored in the specified row. | |
| Array< Quantum< T > > | operator() (uInt rownr, const Unit &) const |
| Return the quantum array stored in the specified row, converted to the given unit. | |
| Array< Quantum< T > > | operator() (uInt rownr, const Vector< Unit > &) const |
| Return the quantum array stored in the specified row, converted to the given units. | |
| Array< Quantum< T > > | operator() (uInt rownr, const Quantum< T > &other) const |
| Return the quantum array stored in the specified row, converted to the unit in other. | |
Protected Member Functions | |
| const ROArrayColumn< String > * | arrUnitsCol () const |
| Get access to itsUnitsCol. | |
| const ROScalarColumn< String > * | scaUnitsCol () const |
Protected Attributes | |
| Vector< Unit > | itsUnit |
Private Member Functions | |
| void | init (const Table &tab, const String &columnName) |
| Initialize the ROArrayQuantColumn from the specified table and column. | |
| void | cleanUp () |
| Deletes allocated memory etc. | |
| void | getData (uInt rownr, Array< Quantum< T > > &q, Bool resize) const |
| Get the data without possible conversion. | |
| ROArrayQuantColumn & | operator= (const ROArrayQuantColumn< T > &that) |
| Assignment makes no sense in a read only class. | |
| Bool | operator== (const ROArrayQuantColumn< T > &that) |
| Comparison is not defined, since its semantics are unclear. | |
Private Attributes | |
| ROArrayColumn< T > * | itsDataCol |
| ROArrayColumn< String > * | itsArrUnitsCol |
| ROScalarColumn< String > * | itsScaUnitsCol |
| Vector< Unit > | itsUnitOut |
| Bool | itsConvOut |
| casa::ROArrayQuantColumn< T >::ROArrayQuantColumn | ( | ) |
The default constructor creates a null object.
It is useful for creating arrays of ROArrayQuantColumn 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 ROArrayQuantColumn object is null.
| casa::ROArrayQuantColumn< T >::ROArrayQuantColumn | ( | const Table & | tab, | |
| const String & | columnName | |||
| ) |
Create the ROArrayQuantColumn from the supplied table and column name.
The default unit for data retrieved is the unit in which they were stored.
| casa::ROArrayQuantColumn< T >::ROArrayQuantColumn | ( | const Table & | tab, | |
| const String & | columnName, | |||
| const Unit & | ||||
| ) |
Create the ROArrayQuantColumn from the supplied table and column name.
The default unit for data retrieved is the given unit (the data is converted as needed).
| casa::ROArrayQuantColumn< T >::ROArrayQuantColumn | ( | const Table & | tab, | |
| const String & | columnName, | |||
| const Vector< Unit > & | ||||
| ) |
| casa::ROArrayQuantColumn< T >::ROArrayQuantColumn | ( | const ROArrayQuantColumn< T > & | that | ) |
Copy constructor (copy semantics).
| casa::ROArrayQuantColumn< T >::~ROArrayQuantColumn | ( | ) |
| void casa::ROArrayQuantColumn< T >::reference | ( | const ROArrayQuantColumn< T > & | that | ) |
Make this object reference the column in "that".
| void casa::ROArrayQuantColumn< T >::attach | ( | const Table & | tab, | |
| const String & | columnName | |||
| ) |
| void casa::ROArrayQuantColumn< T >::attach | ( | const Table & | tab, | |
| const String & | columnName, | |||
| const Unit & | ||||
| ) |
| void casa::ROArrayQuantColumn< T >::attach | ( | const Table & | tab, | |
| const String & | columnName, | |||
| const Vector< Unit > & | ||||
| ) |
| void casa::ROArrayQuantColumn< T >::get | ( | uInt | rownr, | |
| Array< Quantum< T > > & | q, | |||
| const Unit & | , | |||
| Bool | resize = False | |||
| ) | const |
Get the quantum array in the specified row.
Each quantum is converted to the given unit.
| void casa::ROArrayQuantColumn< T >::get | ( | uInt | rownr, | |
| Array< Quantum< T > > & | q, | |||
| const Vector< Unit > & | , | |||
| Bool | resize = False | |||
| ) | const |
Get the quantum array in the specified row.
Each quantum is converted to the given units.
| void casa::ROArrayQuantColumn< T >::get | ( | uInt | rownr, | |
| Array< Quantum< T > > & | q, | |||
| const Quantum< T > & | other, | |||
| Bool | resize = False | |||
| ) | const |
Get the quantum array in the specified row.
Each quantum is converted to the unit in other.
| Array<Quantum<T> > casa::ROArrayQuantColumn< T >::operator() | ( | uInt | rownr | ) | const |
Return the quantum array stored in the specified row.
| Array<Quantum<T> > casa::ROArrayQuantColumn< T >::operator() | ( | uInt | rownr, | |
| const Unit & | ||||
| ) | const |
Return the quantum array stored in the specified row, converted to the given unit.
| Array<Quantum<T> > casa::ROArrayQuantColumn< T >::operator() | ( | uInt | rownr, | |
| const Vector< Unit > & | ||||
| ) | const |
Return the quantum array stored in the specified row, converted to the given units.
| Array<Quantum<T> > casa::ROArrayQuantColumn< T >::operator() | ( | uInt | rownr, | |
| const Quantum< T > & | other | |||
| ) | const |
Return the quantum array stored in the specified row, converted to the unit in other.
| Bool casa::ROArrayQuantColumn< T >::isUnitVariable | ( | ) | const [inline] |
Test whether the Quantum column has variable units.
Definition at line 200 of file ArrayQuantColumn.h.
| Vector<String> casa::ROArrayQuantColumn< T >::getUnits | ( | ) | const |
Returns the column's units as a vector of strings.
An empty vector is returned if the column has no fixed units.
| Bool casa::ROArrayQuantColumn< T >::isNull | ( | ) | const [inline] |
| void casa::ROArrayQuantColumn< T >::throwIfNull | ( | ) | const |
Throw an exception if the object is null.
| const ROArrayColumn<String>* casa::ROArrayQuantColumn< T >::arrUnitsCol | ( | ) | const [inline, protected] |
| const ROScalarColumn<String>* casa::ROArrayQuantColumn< T >::scaUnitsCol | ( | ) | const [inline, protected] |
Definition at line 222 of file ArrayQuantColumn.h.
| void casa::ROArrayQuantColumn< T >::init | ( | const Table & | tab, | |
| const String & | columnName | |||
| ) | [private] |
Initialize the ROArrayQuantColumn from the specified table and column.
| void casa::ROArrayQuantColumn< T >::cleanUp | ( | ) | [private] |
Deletes allocated memory etc.
Called by ~tor and any member which needs to reallocate data.
| void casa::ROArrayQuantColumn< T >::getData | ( | uInt | rownr, | |
| Array< Quantum< T > > & | q, | |||
| Bool | resize | |||
| ) | const [private] |
Get the data without possible conversion.
| ROArrayQuantColumn& casa::ROArrayQuantColumn< T >::operator= | ( | const ROArrayQuantColumn< T > & | that | ) | [private] |
Assignment makes no sense in a read only class.
Declaring this operator private makes it unusable.
| Bool casa::ROArrayQuantColumn< T >::operator== | ( | const ROArrayQuantColumn< T > & | that | ) | [private] |
Comparison is not defined, since its semantics are unclear.
Vector<Unit> casa::ROArrayQuantColumn< T >::itsUnit [protected] |
Definition at line 216 of file ArrayQuantColumn.h.
ROArrayColumn<T>* casa::ROArrayQuantColumn< T >::itsDataCol [private] |
Definition at line 229 of file ArrayQuantColumn.h.
Referenced by casa::ROArrayQuantColumn< float >::isNull().
ROArrayColumn<String>* casa::ROArrayQuantColumn< T >::itsArrUnitsCol [private] |
Definition at line 231 of file ArrayQuantColumn.h.
Referenced by casa::ROArrayQuantColumn< float >::arrUnitsCol(), and casa::ROArrayQuantColumn< float >::isUnitVariable().
ROScalarColumn<String>* casa::ROArrayQuantColumn< T >::itsScaUnitsCol [private] |
Definition at line 233 of file ArrayQuantColumn.h.
Referenced by casa::ROArrayQuantColumn< float >::isUnitVariable(), and casa::ROArrayQuantColumn< float >::scaUnitsCol().
Vector<Unit> casa::ROArrayQuantColumn< T >::itsUnitOut [private] |
Definition at line 235 of file ArrayQuantColumn.h.
Bool casa::ROArrayQuantColumn< T >::itsConvOut [private] |
Definition at line 237 of file ArrayQuantColumn.h.
1.5.1