A default constructor is defined to allow construction of an array of ROScalarColumn objects. However, this constructs an object not referencing a column. Functions like get, etc. will fail (i.e. result in a segmentation fault) when used on such objects. The functions isNull and throwIfNull can be used to test on this.
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 makes no sense for a readonly column.
Construct for the given column in the given table.
Construct from the given table column. This constructor is useful if first a table column was constructed, its type is determined and thereafter used to construct the correct column object.
Copy constructor (reference semantics).
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.
Get the data from a particular cell (i.e. table row). The row numbers count from 0 until #rows-1.
Get the vector of all values in the column.
Referencing any other typed column cannot be done. If we do not put this function here, the conversion constructor ROScalarColumn (const ROTableColumn&) will be used and no compile error is given.
A default constructor is defined to allow construction of an array of ScalarColumn objects. However, this constructs an object not referencing a column. Functions like get, etc. will fail (i.e. result in a segmentation fault) when used on such objects. The functions ROTableColumn::isNull and throwIfNull can be used to test on this.
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.
Construct the scalar column object for the table column.
Construct from the given table column. This constructor is useful if first a table column was constructed, its type is determined and thereafter used to construct the correct column object.
Copy constructor (reference semantics).
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.
Put the value in a particular cell (i.e. table row). The row numbers count from 0 until #rows-1.
Copy the value of a cell of that column to a cell of this column.
The data types of both columns must be the same.
Use the same row numbers for both cells.
Copy the value of a cell of that column to a cell of this column.
The data types of both columns must be the same.
Use possibly different row numbers for that (i.e. input) and and this (i.e. output) cell.
Copy the value of a cell of that column to a cell of this column.
This function uses a generic ROTableColumn object as input. If possible the data will be promoted to the data type of this column. Otherwise an exception is thrown.
Use possibly different row numbers for that (i.e. input) and and this (i.e. output) cell.
Copy the value of a cell of that column to a cell of this column.
Put the vector of all values in the column. The length of the vector must be the number of cells in the column (i.e. the number of rows in the table).
Put the same value in all cells of the column.
Put the contents of a column with the same data type into this column. To put the contents of a column with a different data type into this column, the function TableColumn::putColumn can be used (provided the data type promotion is possible). In fact, this function is an assignment operator with copy semantics.
Referencing any other typed column cannot be done. If we do not put this function here, the conversion constructor ROScalarColumn (const TableColumn&) will be used and no compile error is given.
Copyright © 1995 Associated Universities Inc., Washington, D.C.