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 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 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).
Clone the object.
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.
Attach a column to the object.
This is in fact only a shorthand for
reference (ROScalarColumn<T> (table, columnName));
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. According to the assignment rules of class Array, the destination vector must be empty or its length must be the number of cells in the column (i.e. the number of rows in the table).
Get the vector of all values in the column.
Get the vector of a range of values in the column. The Slicer object can be used to specify start, end (or length), and stride of the rows to get. According to the assignment rules of class Array, the destination vector must be empty or its length must be the number of cells in the column (i.e. the number of rows in the slicer).
Get the vector of a range of values in the column. The Slicer object can be used to specify start, end (or length), and stride of the rows to get..
Get the vector of some values in the column. The Slicer object can be used to specify start, end (or length), and stride of the rows to get. According to the assignment rules of class Array, the destination vector must be empty or its length must be the number of cells in the column (i.e. the number of rows in the RefRows object).
Get the vector of some 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.
Check if the data type matches the column data type.
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 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.
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).
Clone the object.
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.
Attach a column to the object.
This is in fact only a shorthand for
reference (ScalarColumn<T> (table, columnName));
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. 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.
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 vector of a range of values in the column. The Slicer object can be used to specify start, end (or length), and stride of the rows to put. The length of the vector must be the number of cells in the slice.
Put the vector of some values in the column. The length of the vector must be the number of cells in the RefRows object.
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.