casacore
|
#include <TableParseUpdate.h>
Public Member Functions | |
TableParseUpdate () | |
TableParseUpdate (const String &columnName, const String &columnNameMask, const TableExprNode &, Bool checkAggr=True) | |
Construct from a column name and expression. | |
TableParseUpdate (const String &columnName, const String &columnNameMask, const TableExprNodeSet &indices, const TableExprNode &, const TaQLStyle &) | |
Construct from a column name, subscripts or mask, and expression. | |
TableParseUpdate (const String &columnName, const String &columnNameMask, const TableExprNodeSet &indices1, const TableExprNodeSet &indices2, const TableExprNode &, const TaQLStyle &) | |
Construct from a column name, subscripts and mask, and expression. | |
void | handleIndices (const TableExprNodeSet &indices, const TaQLStyle &style) |
Handle the subscripts or mask. | |
void | setNode (const TableExprNode &node) |
Set the node expression (used by TableParseQuery::doInsert). | |
void | setColumnName (const String &name) |
Set the column name. | |
void | setColumnNameMask (const String &name) |
Set the column name for the mask. | |
const String & | columnName () const |
Get the column name. | |
const String & | columnNameMask () const |
Get the possible column name for the mask. | |
void | adaptUnit (const Unit &columnUnit) |
Adapt the possible unit of the expression to the possible unit of the column. | |
void | check (const Table &origTable, const Table &updTable) const |
Check if the update column and expression specifications match. | |
void | updateColumn (TableColumn &col, ArrayColumn< Bool > &maskCol, rownr_t row, const TableExprId &rowid) |
Update the values in the column with the values of the node_p expression. | |
Private Member Functions | |
template<typename TCOL , typename TNODE > | |
void | updateValue (rownr_t row, const TableExprId &rowid, Bool isScalarCol, const TableExprNode &node, const Array< Bool > &mask, TableColumn &col, const Slicer *slicerPtr, ArrayColumn< Bool > &maskCol) |
Update the values in the columns (helpers of updateColumn). | |
template<typename TCOL , typename TNODE > | |
void | updateScalar (rownr_t row, const TableExprId &rowid, const TableExprNode &node, TableColumn &col) |
template<typename TCOL , typename TNODE > | |
void | updateArray (rownr_t row, const TableExprId &rowid, const TableExprNode &node, const Array< TNODE > &res, ArrayColumn< TCOL > &col) |
template<typename TCOL , typename TNODE > | |
void | updateSlice (rownr_t row, const TableExprId &rowid, const TableExprNode &node, const Array< TNODE > &res, const Slicer &slice, ArrayColumn< TCOL > &col) |
template<typename TCOL , typename TNODE > | |
void | copyMaskedValue (rownr_t row, ArrayColumn< TCOL > &acol, const Slicer *slicerPtr, const TNODE *val, size_t incr, const Array< Bool > &mask) |
Array< Bool > | makeMaskSlice (const Array< Bool > &mask, const IPosition &shapeCol, const Slicer *slicerPtr) |
void | checkMaskColumn (Bool hasMask, const ArrayColumn< Bool > &maskCol, const TableColumn &col) |
Private Attributes | |
String | columnName_p |
String | columnNameMask_p |
Bool | maskFirst_p |
TableExprNodeIndex * | indexPtr_p |
TableExprNode | indexNode_p |
TableExprNode | mask_p |
TableExprNode | node_p |
Manage TaQL UPDATE command handling
Internal
TableParseUpdate holds the column name, optional indices, optional mask, and new value expression of a column to be updated. Furthermore, it has functions to perform updates in the column and possibly mask column using the expression and possible slice.
Definition at line 62 of file TableParseUpdate.h.
|
inline |
Definition at line 65 of file TableParseUpdate.h.
casacore::TableParseUpdate::TableParseUpdate | ( | const String & | columnName, |
const String & | columnNameMask, | ||
const TableExprNode & | , | ||
Bool | checkAggr = True |
||
) |
Construct from a column name and expression.
By default it checks if no aggregate functions are used.
casacore::TableParseUpdate::TableParseUpdate | ( | const String & | columnName, |
const String & | columnNameMask, | ||
const TableExprNodeSet & | indices, | ||
const TableExprNode & | , | ||
const TaQLStyle & | |||
) |
Construct from a column name, subscripts or mask, and expression.
It checks if no aggregate functions are used.
casacore::TableParseUpdate::TableParseUpdate | ( | const String & | columnName, |
const String & | columnNameMask, | ||
const TableExprNodeSet & | indices1, | ||
const TableExprNodeSet & | indices2, | ||
const TableExprNode & | , | ||
const TaQLStyle & | |||
) |
Construct from a column name, subscripts and mask, and expression.
It checks if no aggregate functions are used. It checks if one of the indices represents subscripts, the other a mask.
|
inline |
Adapt the possible unit of the expression to the possible unit of the column.
Definition at line 121 of file TableParseUpdate.h.
References casacore::TableExprNode::adaptUnit(), and node_p.
Check if the update column and expression specifications match.
Also check if the number of rows is correct.
|
private |
|
inline |
|
inline |
Get the possible column name for the mask.
Definition at line 116 of file TableParseUpdate.h.
References columnNameMask_p.
|
private |
void casacore::TableParseUpdate::handleIndices | ( | const TableExprNodeSet & | indices, |
const TaQLStyle & | style | ||
) |
Handle the subscripts or mask.
It checks if subscripts or mask is not already used.
|
private |
|
inline |
|
inline |
Set the column name for the mask.
Definition at line 108 of file TableParseUpdate.h.
References columnNameMask_p.
|
inline |
Set the node expression (used by TableParseQuery::doInsert).
Definition at line 100 of file TableParseUpdate.h.
References node_p.
|
private |
void casacore::TableParseUpdate::updateColumn | ( | TableColumn & | col, |
ArrayColumn< Bool > & | maskCol, | ||
rownr_t | row, | ||
const TableExprId & | rowid | ||
) |
Update the values in the column with the values of the node_p expression.
The column can contain scalars of arrays. Possible only array slices are updated. The mask column values are also updated if a mask is used.
|
private |
|
private |
|
private |
Update the values in the columns (helpers of updateColumn).
It converts the data type of the expression to that opf the column.
|
private |
Definition at line 174 of file TableParseUpdate.h.
Referenced by columnName(), and setColumnName().
|
private |
Definition at line 175 of file TableParseUpdate.h.
Referenced by columnNameMask(), and setColumnNameMask().
|
private |
Definition at line 178 of file TableParseUpdate.h.
|
private |
Definition at line 177 of file TableParseUpdate.h.
|
private |
Definition at line 179 of file TableParseUpdate.h.
|
private |
Definition at line 176 of file TableParseUpdate.h.
|
private |
Definition at line 180 of file TableParseUpdate.h.
Referenced by adaptUnit(), and setNode().