26#ifndef TABLES_EXPRNODEARRAY_H
27#define TABLES_EXPRNODEARRAY_H
30#include <casacore/tables/TaQL/ExprNodeRep.h>
31#include <casacore/tables/TaQL/TaQLStyle.h>
32#include <casacore/tables/Tables/Table.h>
33#include <casacore/tables/Tables/ArrayColumn.h>
34#include <casacore/casa/Arrays/Slicer.h>
39class TableExprNodeSet;
183 const DComplex&
value);
833 void show (ostream& os,
uInt indent)
const override;
Non-templated base class for templated Array class.
String: the storage and methods of handling collections of characters.
Class to connect a Table and its alias name.
Bool array column in table select expression.
void applySelection(const Vector< rownr_t > &rownrs) override
Re-create the column object for a selection of rows.
~TableExprNodeArrayColumnBool() override=default
ArrayColumn< Bool > col_p
Array< Bool > getElemColumnBool(const Vector< rownr_t > &rownrs, const Slicer &) override
Get a single element for the entire column (used by sort).
MArray< Bool > getArrayBool(const TableExprId &id) override
Get an array value for this node in the given row.
MArray< Bool > getSliceBool(const TableExprId &id, const Slicer &) override
Get a slice of the array in the given row.
Bool getElemBool(const TableExprId &id, const Slicer &index) override
Get a single element from the array in the given row.
TableExprNodeArrayColumnBool(const TableColumn &, const TableExprInfo &)
Complex array column in table select expression.
ArrayColumn< Complex > col_p
MArray< DComplex > getSliceDComplex(const TableExprId &id, const Slicer &) override
void applySelection(const Vector< rownr_t > &rownrs) override
Re-create the column object for a selection of rows.
DComplex getElemDComplex(const TableExprId &id, const Slicer &index) override
Array< Complex > getElemColumnComplex(const Vector< rownr_t > &rownrs, const Slicer &) override
~TableExprNodeArrayColumnComplex() override=default
MArray< DComplex > getArrayDComplex(const TableExprId &id) override
The default implementation of getArrayDComplex does getArrayDouble and converts the result.
TableExprNodeArrayColumnComplex(const TableColumn &, const TableExprInfo &)
DComplex array column in table select expression.
Array< DComplex > getElemColumnDComplex(const Vector< rownr_t > &rownrs, const Slicer &) override
MArray< DComplex > getArrayDComplex(const TableExprId &id) override
The default implementation of getArrayDComplex does getArrayDouble and converts the result.
DComplex getElemDComplex(const TableExprId &id, const Slicer &index) override
~TableExprNodeArrayColumnDComplex() override=default
TableExprNodeArrayColumnDComplex(const TableColumn &, const TableExprInfo &)
ArrayColumn< DComplex > col_p
MArray< DComplex > getSliceDComplex(const TableExprId &id, const Slicer &) override
void applySelection(const Vector< rownr_t > &rownrs) override
Re-create the column object for a selection of rows.
Double array column in table select expression.
MArray< Double > getArrayDouble(const TableExprId &id) override
The default implementation of getArrayDouble does getArrayInt and converts the result.
Double getElemDouble(const TableExprId &id, const Slicer &index) override
void applySelection(const Vector< rownr_t > &rownrs) override
Re-create the column object for a selection of rows.
ArrayColumn< Double > col_p
MArray< Double > getSliceDouble(const TableExprId &id, const Slicer &) override
Array< Double > getElemColumnDouble(const Vector< rownr_t > &rownrs, const Slicer &) override
~TableExprNodeArrayColumnDouble() override=default
TableExprNodeArrayColumnDouble(const TableColumn &, const TableExprInfo &)
Float array column in table select expression.
MArray< Double > getArrayDouble(const TableExprId &id) override
The default implementation of getArrayDouble does getArrayInt and converts the result.
void applySelection(const Vector< rownr_t > &rownrs) override
Re-create the column object for a selection of rows.
~TableExprNodeArrayColumnFloat() override=default
Array< Float > getElemColumnFloat(const Vector< rownr_t > &rownrs, const Slicer &) override
ArrayColumn< Float > col_p
MArray< Double > getSliceDouble(const TableExprId &id, const Slicer &) override
TableExprNodeArrayColumnFloat(const TableColumn &, const TableExprInfo &)
Double getElemDouble(const TableExprId &id, const Slicer &index) override
Int64 array column in table select expression.
void applySelection(const Vector< rownr_t > &rownrs) override
Re-create the column object for a selection of rows.
Array< Int64 > getElemColumnInt64(const Vector< rownr_t > &rownrs, const Slicer &) override
TableExprNodeArrayColumnInt64(const TableColumn &, const TableExprInfo &)
MArray< Int64 > getArrayInt(const TableExprId &id) override
ArrayColumn< Int64 > col_p
~TableExprNodeArrayColumnInt64() override=default
Int64 getElemInt(const TableExprId &id, const Slicer &index) override
MArray< Int64 > getSliceInt(const TableExprId &id, const Slicer &) override
Int array column in table select expression.
void applySelection(const Vector< rownr_t > &rownrs) override
Re-create the column object for a selection of rows.
TableExprNodeArrayColumnInt(const TableColumn &, const TableExprInfo &)
MArray< Int64 > getArrayInt(const TableExprId &id) override
Int64 getElemInt(const TableExprId &id, const Slicer &index) override
Array< Int > getElemColumnInt(const Vector< rownr_t > &rownrs, const Slicer &) override
~TableExprNodeArrayColumnInt() override=default
MArray< Int64 > getSliceInt(const TableExprId &id, const Slicer &) override
Short array column in table select expression.
Array< Short > getElemColumnShort(const Vector< rownr_t > &rownrs, const Slicer &) override
MArray< Int64 > getArrayInt(const TableExprId &id) override
ArrayColumn< Short > col_p
void applySelection(const Vector< rownr_t > &rownrs) override
Re-create the column object for a selection of rows.
Int64 getElemInt(const TableExprId &id, const Slicer &index) override
MArray< Int64 > getSliceInt(const TableExprId &id, const Slicer &) override
TableExprNodeArrayColumnShort(const TableColumn &, const TableExprInfo &)
~TableExprNodeArrayColumnShort() override=default
String array column in table select expression.
~TableExprNodeArrayColumnString() override=default
TableExprNodeArrayColumnString(const TableColumn &, const TableExprInfo &)
String getElemString(const TableExprId &id, const Slicer &index) override
ArrayColumn< String > col_p
MArray< String > getArrayString(const TableExprId &id) override
void applySelection(const Vector< rownr_t > &rownrs) override
Re-create the column object for a selection of rows.
MArray< String > getSliceString(const TableExprId &id, const Slicer &) override
Array< String > getElemColumnString(const Vector< rownr_t > &rownrs, const Slicer &) override
Base class for Array column in table select expression.
const IPosition & getShape(const TableExprId &id) override
Get the shape of the array in the given row.
void applySelection(const Vector< rownr_t > &rownrs) override
Re-create the column object for a selection of rows.
TableExprInfo tableInfo_p
const TableColumn & getColumn() const
Get the TableColumn object.
Bool isDefined(const TableExprId &id) override
Is the value in the given row defined?
~TableExprNodeArrayColumn() override=default
void disableApplySelection() override
Do not apply the selection.
Bool getColumnDataType(DataType &) const override
Get the data type of this column.
TableExprInfo getTableInfo() const override
Get the table info for this column.
TableExprNodeArrayColumn(const TableColumn &tablecol, const TableExprInfo &)
Create the object for the given column and table.
uChar array column in table select expression
TableExprNodeArrayColumnuChar(const TableColumn &, const TableExprInfo &)
Array< uChar > getElemColumnuChar(const Vector< rownr_t > &rownrs, const Slicer &) override
~TableExprNodeArrayColumnuChar() override=default
MArray< Int64 > getArrayInt(const TableExprId &id) override
ArrayColumn< uChar > col_p
MArray< Int64 > getSliceInt(const TableExprId &id, const Slicer &) override
Int64 getElemInt(const TableExprId &id, const Slicer &index) override
void applySelection(const Vector< rownr_t > &rownrs) override
Re-create the column object for a selection of rows.
uInt array column in table select expression
Int64 getElemInt(const TableExprId &id, const Slicer &index) override
MArray< Int64 > getSliceInt(const TableExprId &id, const Slicer &) override
TableExprNodeArrayColumnuInt(const TableColumn &, const TableExprInfo &)
ArrayColumn< uInt > col_p
Array< uInt > getElemColumnuInt(const Vector< rownr_t > &rownrs, const Slicer &) override
MArray< Int64 > getArrayInt(const TableExprId &id) override
~TableExprNodeArrayColumnuInt() override=default
void applySelection(const Vector< rownr_t > &rownrs) override
Re-create the column object for a selection of rows.
uShort array column in table select expression
Array< uShort > getElemColumnuShort(const Vector< rownr_t > &rownrs, const Slicer &) override
~TableExprNodeArrayColumnuShort() override=default
TableExprNodeArrayColumnuShort(const TableColumn &, const TableExprInfo &)
MArray< Int64 > getArrayInt(const TableExprId &id) override
ArrayColumn< uShort > col_p
void applySelection(const Vector< rownr_t > &rownrs) override
Re-create the column object for a selection of rows.
Int64 getElemInt(const TableExprId &id, const Slicer &index) override
MArray< Int64 > getSliceInt(const TableExprId &id, const Slicer &) override
Array column part in table select expression.
Array< Int64 > getColumnInt64(const Vector< rownr_t > &rownrs) override
MArray< MVTime > getArrayDate(const TableExprId &id) override
~TableExprNodeArrayPart() override=default
void show(ostream &os, uInt indent) const override
Show the node.
Array< DComplex > getColumnDComplex(const Vector< rownr_t > &rownrs) override
Array< uShort > getColumnuShort(const Vector< rownr_t > &rownrs) override
Bool getColumnDataType(DataType &) const override
Get the data type of this column (if possible).
Array< Float > getColumnFloat(const Vector< rownr_t > &rownrs) override
Array< Bool > getColumnBool(const Vector< rownr_t > &rownrs) override
Get the value of the expression evaluated for the entire column.
Bool getBool(const TableExprId &id) override
Get a scalar value for this node in the given row.
TableExprNodeArrayColumn * colNode_p
TableExprNodeArrayPart(const TENShPtr &arrayNode, const TENShPtr &indexNode)
MArray< DComplex > getArrayDComplex(const TableExprId &id) override
The default implementation of getArrayDComplex does getArrayDouble and converts the result.
const TableExprNodeArrayColumn * getColumnNode() const
Get the array column node.
MArray< Double > getArrayDouble(const TableExprId &id) override
The default implementation of getArrayDouble does getArrayInt and converts the result.
DComplex getDComplex(const TableExprId &id) override
Array< String > getColumnString(const Vector< rownr_t > &rownrs) override
MArray< Int64 > getArrayInt(const TableExprId &id) override
Array< uChar > getColumnuChar(const Vector< rownr_t > &rownrs) override
Double getDouble(const TableExprId &id) override
const TableExprNodeIndex * getIndexNode() const
Get the index node.
MVTime getDate(const TableExprId &id) override
Array< Double > getColumnDouble(const Vector< rownr_t > &rownrs) override
TableExprNodeArray * arrNode_p
String getString(const TableExprId &id) override
Array< Int > getColumnInt(const Vector< rownr_t > &rownrs) override
Array< Short > getColumnShort(const Vector< rownr_t > &rownrs) override
MArray< String > getArrayString(const TableExprId &id) override
TableExprNodeIndex * inxNode_p
Array< Complex > getColumnComplex(const Vector< rownr_t > &rownrs) override
Array< uInt > getColumnuInt(const Vector< rownr_t > &rownrs) override
MArray< Bool > getArrayBool(const TableExprId &id) override
Get an array value for this node in the given row.
Int64 getInt(const TableExprId &id) override
~TableExprNodeArray() override=default
virtual Array< DComplex > getElemColumnDComplex(const Vector< rownr_t > &rownrs, const Slicer &)
virtual Double getElemDouble(const TableExprId &id, const Slicer &index)
virtual Array< Double > getElemColumnDouble(const Vector< rownr_t > &rownrs, const Slicer &)
MArray< DComplex > getArrayDComplex(const TableExprId &id) override
The default implementation of getArrayDComplex does getArrayDouble and converts the result.
const IPosition & getShape(const TableExprId &id) override
Get the shape of the array in the given row.
virtual Array< Int > getElemColumnInt(const Vector< rownr_t > &rownrs, const Slicer &)
Bool contains(const TableExprId &id, Double value) override
MArray< Bool > contains(const TableExprId &id, const MArray< MVTime > &value) override
virtual MArray< String > getSliceString(const TableExprId &id, const Slicer &)
TableExprNodeArray(NodeDataType, OperType, const IPosition &shape)
MArray< Bool > contains(const TableExprId &id, const MArray< Double > &value) override
virtual Int64 getElemInt(const TableExprId &id, const Slicer &index)
virtual String getElemString(const TableExprId &id, const Slicer &index)
virtual Array< uInt > getElemColumnuInt(const Vector< rownr_t > &rownrs, const Slicer &)
virtual Array< Int64 > getElemColumnInt64(const Vector< rownr_t > &rownrs, const Slicer &)
virtual MArray< Bool > getSliceBool(const TableExprId &id, const Slicer &)
Get a slice of the array in the given row.
MArray< Bool > contains(const TableExprId &id, const MArray< String > &value) override
virtual MArray< DComplex > getSliceDComplex(const TableExprId &id, const Slicer &)
virtual DComplex getElemDComplex(const TableExprId &id, const Slicer &index)
virtual Array< uChar > getElemColumnuChar(const Vector< rownr_t > &rownrs, const Slicer &)
virtual MVTime getElemDate(const TableExprId &id, const Slicer &index)
TableExprNodeArray(const TableExprNodeRep &node, NodeDataType, OperType)
virtual Bool getElemBool(const TableExprId &id, const Slicer &index)
Get a single element from the array in the given row.
static MArray< Double > makeArray(const IPosition &shape, Double value)
MArray< Bool > contains(const TableExprId &id, const MArray< Int64 > &value) override
Bool contains(const TableExprId &id, String value) override
virtual MArray< MVTime > getSliceDate(const TableExprId &id, const Slicer &)
virtual Array< uShort > getElemColumnuShort(const Vector< rownr_t > &rownrs, const Slicer &)
virtual TENShPtr makeConstantScalar()
Turn a constant array with one element into a scalar.
Bool contains(const TableExprId &id, MVTime value) override
virtual Array< String > getElemColumnString(const Vector< rownr_t > &rownrs, const Slicer &)
IPosition validateIndex(const IPosition &index, const ArrayBase &arr) const
Validate the given index against the array's shape.
MArray< Bool > contains(const TableExprId &id, const MArray< DComplex > &value) override
static MArray< DComplex > makeArray(const IPosition &shape, const DComplex &value)
TableExprNodeArray(NodeDataType, OperType)
Create the object.
MArray< Bool > contains(const TableExprId &id, const MArray< Bool > &value) override
MArray< Double > getArrayDouble(const TableExprId &id) override
The default implementation of getArrayDouble does getArrayInt and converts the result.
static MArray< Int64 > makeArray(const IPosition &shape, Int64 value)
Make an array with the given shape and fill it with the value.
virtual Array< Bool > getElemColumnBool(const Vector< rownr_t > &rownrs, const Slicer &)
Get a single element for the entire column (used by sort).
virtual Array< Short > getElemColumnShort(const Vector< rownr_t > &rownrs, const Slicer &)
Bool contains(const TableExprId &id, DComplex value) override
virtual MArray< Double > getSliceDouble(const TableExprId &id, const Slicer &)
virtual MArray< Int64 > getSliceInt(const TableExprId &id, const Slicer &)
virtual Array< Complex > getElemColumnComplex(const Vector< rownr_t > &rownrs, const Slicer &)
Bool contains(const TableExprId &id, Bool value) override
Does a value occur in the set?
virtual Array< Float > getElemColumnFloat(const Vector< rownr_t > &rownrs, const Slicer &)
Bool contains(const TableExprId &id, Int64 value) override
Abstract base class for a node having 0, 1, or 2 child nodes.
The index of an array element in a table select expression.
Bool isSingle() const
Does it index a single element?
void fillIndex(const TableExprNodeSet &indices)
Link all the operands and check datatype.
const Slicer & getSlicer(const TableExprId &id)
Get the Slicer value for the slice.
TableExprNodeIndex(const TableExprNodeSet &indices, const TaQLStyle &=TaQLStyle(0))
Constructor.
IPosition getNodeShape(const TENShPtr &arrayNode) const
Get the shape of the node involved.
~TableExprNodeIndex() override=default
Destructor.
void fillSlicer(const TableExprId &id)
Fill the slicer for this row.
const Slicer & getConstantSlicer() const
Get the Slicer value for a constant index.
void convertConstIndex()
Precalculate the constant indices and store them.
void checkIndexValues(const TENShPtr &arrayNode)
Check if the index values match the dimensionality and shape of fixed-shaped array.
Abstract base class for a node having multiple child nodes.
Abstract base class for a node in a table column expression tree.
OperType
Define the operator types.
Bool isConstant() const
Is the expression a constant?
NodeDataType
Define the data types of a node.
const IPosition & shape() const
Get the fixed shape (same for all rows).
this file contains all the compiler specific defines
long long Int64
Define the extra non-standard types used by Casacore (like proposed uSize, Size)
std::shared_ptr< TableExprNodeRep > TENShPtr
bool Bool
Define the standard types used by Casacore.
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.