#include <TableColumn.h>
Inheritance diagram for casa::TableColumn:


Part of API
The class TableColumn augments the class ROTableColumn with write access to a table column.
The classes ScalarColumn<T> and ArrayColumn<T> can be used to put typed data in the column cells.
A default constructor is defined to allow construction of an array of TableColumn objects. However, this constructs an object not referencing a column. Functions like get, etc. will fail (i.e. result in a segmentation fault) is used on such objects. The functions isNull and throwIfNull can be used to test on this. The functions attach and reference can fill in the object.
The assignment operator is not defined for this class, because it was felt it would be too confusing. Instead the function reference can be used to do assignment with reference semantics. An assignment with copy semantics can be done with a putColumn function.
See module Tables .
Definition at line 368 of file TableColumn.h.
Public Member Functions | |
| TableColumn () | |
| The default constructor creates a null object, i.e. | |
| TableColumn (const Table &, const String &columnName) | |
| Construct the object for a column in the table using its name. | |
| TableColumn (const Table &, uInt columnIndex) | |
| Construct the object for a column in the table using its index. | |
| TableColumn (const TableColumn &) | |
| Copy constructor (reference semantics). | |
| ~TableColumn () | |
| virtual ROTableColumn * | clone () const |
| Clone the object. | |
| void | reference (const TableColumn &) |
| Change the reference to another column. | |
| TableRecord & | rwKeywordSet () |
| Get access to the column keyword set. | |
| void | putColumn (const ROTableColumn &that) |
| Copy the values of that column to this column. | |
| void | attach (const Table &table, const String &columnName) |
| Attach a column to the object. | |
| void | attach (const Table &table, uInt columnIndex) |
| void | put (uInt rownr, const ROTableColumn &that) |
| Use the same row numbers for both cells. | |
| virtual void | put (uInt thisRownr, const ROTableColumn &that, uInt thatRownr) |
| Use possibly different row numbers for that (i.e. | |
| void | putScalar (uInt rownr, const Bool &value) |
| Put the value of a scalar in the given row. | |
| void | putScalar (uInt rownr, const uChar &value) |
| void | putScalar (uInt rownr, const Short &value) |
| void | putScalar (uInt rownr, const uShort &value) |
| void | putScalar (uInt rownr, const Int &value) |
| void | putScalar (uInt rownr, const uInt &value) |
| void | putScalar (uInt rownr, const float &value) |
| void | putScalar (uInt rownr, const double &value) |
| void | putScalar (uInt rownr, const Complex &value) |
| void | putScalar (uInt rownr, const DComplex &value) |
| void | putScalar (uInt rownr, const String &value) |
| void | putScalar (uInt rownr, const Char *value) |
Private Member Functions | |
| TableColumn & | operator= (const TableColumn &) |
| Assigning one column to another suggests a deep copy. | |
| casa::TableColumn::TableColumn | ( | ) |
The default constructor creates a null object, i.e.
it does not reference a table column. The sole purpose of this constructor is to allow construction of an array of TableColumn objects. The functions reference and attach can be used to make a null object reference a column. Note that get functions, etc. will cause a segmentation fault when operating on a null object. It was felt it was too expensive to test on null over and over again. The user should use the isNull function in case of doubt.
Construct the object for a column in the table using its name.
Construct the object for a column in the table using its index.
This allows to loop through all columns in a table as:
for (uInt=0; i<tab.ncolumn(); i++) { TableColumn tabcol(tab,i); }
| casa::TableColumn::TableColumn | ( | const TableColumn & | ) |
Copy constructor (reference semantics).
| casa::TableColumn::~TableColumn | ( | ) |
| virtual ROTableColumn* casa::TableColumn::clone | ( | ) | const [virtual] |
| void casa::TableColumn::reference | ( | const TableColumn & | ) |
Change the reference to another column.
This is in fact an assignment operator with reference semantics. It removes the reference to the current column and creates a reference to the column referenced in the other object. It will handle null objects correctly.
Referenced by attach().
Attach a column to the object.
This is in fact only a shorthand for
reference (TableColumn (table, columnName));
Reimplemented from casa::ROTableColumn.
Definition at line 415 of file TableColumn.h.
References reference(), and casa::ROTableColumn::table().
Reimplemented from casa::ROTableColumn.
Definition at line 417 of file TableColumn.h.
References reference(), and casa::ROTableColumn::table().
| TableRecord& casa::TableColumn::rwKeywordSet | ( | ) | [inline] |
Get access to the column keyword set.
Definition at line 422 of file TableColumn.h.
References casa::ROTableColumn::baseColPtr_p, and casa::BaseColumn::rwKeywordSet().
| void casa::TableColumn::put | ( | uInt | rownr, | |
| const ROTableColumn & | that | |||
| ) | [inline] |
Use the same row numbers for both cells.
Definition at line 431 of file TableColumn.h.
References TABLECOLUMNCHECKROW.
| virtual void casa::TableColumn::put | ( | uInt | thisRownr, | |
| const ROTableColumn & | that, | |||
| uInt | thatRownr | |||
| ) | [virtual] |
Use possibly different row numbers for that (i.e.
input) and and this (i.e. output) cell.
| void casa::TableColumn::putColumn | ( | const ROTableColumn & | that | ) |
Copy the values of that column to this column.
The numbers of rows in both columns must be equal. Data type promotion is possible. An exception is thrown if the data cannot be converted. This function is useful to copy one column to another without knowing their data types. In fact, this function is an assignment operator with copy semantics.
Put the value of a scalar in the given row.
Data type promotion is possible. These functions only work for the standard data types.
Definition at line 452 of file TableColumn.h.
References casa::ROTableColumn::baseColPtr_p, casa::BaseColumn::putScalar(), and TABLECOLUMNCHECKROW.
Referenced by putScalar().
Definition at line 454 of file TableColumn.h.
References casa::ROTableColumn::baseColPtr_p, casa::BaseColumn::putScalar(), and TABLECOLUMNCHECKROW.
Definition at line 456 of file TableColumn.h.
References casa::ROTableColumn::baseColPtr_p, casa::BaseColumn::putScalar(), and TABLECOLUMNCHECKROW.
Definition at line 458 of file TableColumn.h.
References casa::ROTableColumn::baseColPtr_p, casa::BaseColumn::putScalar(), and TABLECOLUMNCHECKROW.
Definition at line 460 of file TableColumn.h.
References casa::ROTableColumn::baseColPtr_p, casa::BaseColumn::putScalar(), and TABLECOLUMNCHECKROW.
Definition at line 462 of file TableColumn.h.
References casa::ROTableColumn::baseColPtr_p, casa::BaseColumn::putScalar(), and TABLECOLUMNCHECKROW.
| void casa::TableColumn::putScalar | ( | uInt | rownr, | |
| const float & | value | |||
| ) | [inline] |
Definition at line 464 of file TableColumn.h.
References casa::ROTableColumn::baseColPtr_p, casa::BaseColumn::putScalar(), and TABLECOLUMNCHECKROW.
| void casa::TableColumn::putScalar | ( | uInt | rownr, | |
| const double & | value | |||
| ) | [inline] |
Definition at line 466 of file TableColumn.h.
References casa::ROTableColumn::baseColPtr_p, casa::BaseColumn::putScalar(), and TABLECOLUMNCHECKROW.
| void casa::TableColumn::putScalar | ( | uInt | rownr, | |
| const Complex & | value | |||
| ) | [inline] |
Definition at line 468 of file TableColumn.h.
References casa::ROTableColumn::baseColPtr_p, casa::BaseColumn::putScalar(), and TABLECOLUMNCHECKROW.
| void casa::TableColumn::putScalar | ( | uInt | rownr, | |
| const DComplex & | value | |||
| ) | [inline] |
Definition at line 470 of file TableColumn.h.
References casa::ROTableColumn::baseColPtr_p, casa::BaseColumn::putScalar(), and TABLECOLUMNCHECKROW.
Definition at line 472 of file TableColumn.h.
References casa::ROTableColumn::baseColPtr_p, casa::BaseColumn::putScalar(), TABLECOLUMNCHECKROW, and casa::value().
| TableColumn& casa::TableColumn::operator= | ( | const TableColumn & | ) | [private] |
Assigning one column to another suggests a deep copy.
Because the copy constructor has reference semantics, it was felt it would be too confusing to allow assignment. Instead the function reference (with reference semantics) and putColumn (with copy semantics) exist. Declaring this operator private, makes it unusable.
1.5.1