28 #ifndef TABLES_EXPRNODEARRAY_H
29 #define TABLES_EXPRNODEARRAY_H
32 #include <casacore/tables/TaQL/ExprNodeRep.h>
33 #include <casacore/tables/TaQL/TaQLStyle.h>
34 #include <casacore/tables/Tables/Table.h>
35 #include <casacore/tables/Tables/ArrayColumn.h>
36 #include <casacore/casa/Arrays/Slicer.h>
41 class TableExprNodeSet;
835 virtual void show (ostream& os,
uInt indent)
const;
Non-templated base class for templated Array class.
String: the storage and methods of handling collections of characters.
Bool array column in table select expression.
ArrayColumn< Bool > col_p
virtual Bool getElemBool(const TableExprId &id, const Slicer &index)
Get a single element from the array in the given row.
TableExprNodeArrayColumnBool(const TableColumn &, const Table &)
virtual Array< Bool > getElemColumnBool(const Vector< rownr_t > &rownrs, const Slicer &)
Get a single element for the entire column (used by sort).
~TableExprNodeArrayColumnBool()
virtual void applySelection(const Vector< rownr_t > &rownrs)
Re-create the column object for a selection of rows.
virtual MArray< Bool > getSliceBool(const TableExprId &id, const Slicer &)
Get a slice of the array in the given row.
virtual MArray< Bool > getArrayBool(const TableExprId &id)
Get an array value for this node in the given row.
Complex array column in table select expression.
~TableExprNodeArrayColumnComplex()
virtual DComplex getElemDComplex(const TableExprId &id, const Slicer &index)
ArrayColumn< Complex > col_p
virtual void applySelection(const Vector< rownr_t > &rownrs)
Re-create the column object for a selection of rows.
TableExprNodeArrayColumnComplex(const TableColumn &, const Table &)
virtual MArray< DComplex > getArrayDComplex(const TableExprId &id)
The default implementation of getArrayDComplex does getArrayDouble and converts the result.
virtual Array< Complex > getElemColumnComplex(const Vector< rownr_t > &rownrs, const Slicer &)
virtual MArray< DComplex > getSliceDComplex(const TableExprId &id, const Slicer &)
DComplex array column in table select expression.
TableExprNodeArrayColumnDComplex(const TableColumn &, const Table &)
virtual MArray< DComplex > getSliceDComplex(const TableExprId &id, const Slicer &)
virtual void applySelection(const Vector< rownr_t > &rownrs)
Re-create the column object for a selection of rows.
ArrayColumn< DComplex > col_p
virtual MArray< DComplex > getArrayDComplex(const TableExprId &id)
The default implementation of getArrayDComplex does getArrayDouble and converts the result.
virtual DComplex getElemDComplex(const TableExprId &id, const Slicer &index)
~TableExprNodeArrayColumnDComplex()
virtual Array< DComplex > getElemColumnDComplex(const Vector< rownr_t > &rownrs, const Slicer &)
Double array column in table select expression.
virtual void applySelection(const Vector< rownr_t > &rownrs)
Re-create the column object for a selection of rows.
virtual MArray< Double > getArrayDouble(const TableExprId &id)
The default implementation of getArrayDouble does getArrayInt and converts the result.
virtual MArray< Double > getSliceDouble(const TableExprId &id, const Slicer &)
ArrayColumn< Double > col_p
virtual Array< Double > getElemColumnDouble(const Vector< rownr_t > &rownrs, const Slicer &)
TableExprNodeArrayColumnDouble(const TableColumn &, const Table &)
virtual Double getElemDouble(const TableExprId &id, const Slicer &index)
~TableExprNodeArrayColumnDouble()
Float array column in table select expression.
virtual MArray< Double > getArrayDouble(const TableExprId &id)
The default implementation of getArrayDouble does getArrayInt and converts the result.
virtual Double getElemDouble(const TableExprId &id, const Slicer &index)
TableExprNodeArrayColumnFloat(const TableColumn &, const Table &)
virtual void applySelection(const Vector< rownr_t > &rownrs)
Re-create the column object for a selection of rows.
~TableExprNodeArrayColumnFloat()
ArrayColumn< Float > col_p
virtual Array< Float > getElemColumnFloat(const Vector< rownr_t > &rownrs, const Slicer &)
virtual MArray< Double > getSliceDouble(const TableExprId &id, const Slicer &)
Int64 array column in table select expression.
~TableExprNodeArrayColumnInt64()
virtual MArray< Int64 > getArrayInt(const TableExprId &id)
ArrayColumn< Int64 > col_p
virtual Int64 getElemInt(const TableExprId &id, const Slicer &index)
virtual void applySelection(const Vector< rownr_t > &rownrs)
Re-create the column object for a selection of rows.
virtual Array< Int64 > getElemColumnInt64(const Vector< rownr_t > &rownrs, const Slicer &)
virtual MArray< Int64 > getSliceInt(const TableExprId &id, const Slicer &)
TableExprNodeArrayColumnInt64(const TableColumn &, const Table &)
Int array column in table select expression.
virtual Int64 getElemInt(const TableExprId &id, const Slicer &index)
~TableExprNodeArrayColumnInt()
TableExprNodeArrayColumnInt(const TableColumn &, const Table &)
virtual MArray< Int64 > getArrayInt(const TableExprId &id)
virtual MArray< Int64 > getSliceInt(const TableExprId &id, const Slicer &)
virtual Array< Int > getElemColumnInt(const Vector< rownr_t > &rownrs, const Slicer &)
virtual void applySelection(const Vector< rownr_t > &rownrs)
Re-create the column object for a selection of rows.
Short array column in table select expression.
ArrayColumn< Short > col_p
TableExprNodeArrayColumnShort(const TableColumn &, const Table &)
virtual void applySelection(const Vector< rownr_t > &rownrs)
Re-create the column object for a selection of rows.
virtual Array< Short > getElemColumnShort(const Vector< rownr_t > &rownrs, const Slicer &)
~TableExprNodeArrayColumnShort()
virtual Int64 getElemInt(const TableExprId &id, const Slicer &index)
virtual MArray< Int64 > getSliceInt(const TableExprId &id, const Slicer &)
virtual MArray< Int64 > getArrayInt(const TableExprId &id)
String array column in table select expression.
virtual Array< String > getElemColumnString(const Vector< rownr_t > &rownrs, const Slicer &)
virtual MArray< String > getArrayString(const TableExprId &id)
ArrayColumn< String > col_p
TableExprNodeArrayColumnString(const TableColumn &, const Table &)
virtual MArray< String > getSliceString(const TableExprId &id, const Slicer &)
~TableExprNodeArrayColumnString()
virtual void applySelection(const Vector< rownr_t > &rownrs)
Re-create the column object for a selection of rows.
virtual String getElemString(const TableExprId &id, const Slicer &index)
Base class for Array column in table select expression.
virtual const IPosition & getShape(const TableExprId &id)
Get the shape of the array in the given row.
TableExprNodeArrayColumn(const TableColumn &tablecol, const Table &table)
Create the object for the given column and table.
virtual Bool isDefined(const TableExprId &id)
Is the value in the given row defined?
~TableExprNodeArrayColumn()
const TableColumn & getColumn() const
Get the TableColumn object.
virtual void disableApplySelection()
Do not apply the selection.
virtual void getColumnNodes(std::vector< TableExprNodeRep * > &cols)
This node represents a table column.
virtual Bool getColumnDataType(DataType &) const
Get the data type of this column.
virtual void applySelection(const Vector< rownr_t > &rownrs)
Re-create the column object for a selection of rows.
uChar array column in table select expression
virtual Array< uChar > getElemColumnuChar(const Vector< rownr_t > &rownrs, const Slicer &)
~TableExprNodeArrayColumnuChar()
ArrayColumn< uChar > col_p
virtual void applySelection(const Vector< rownr_t > &rownrs)
Re-create the column object for a selection of rows.
virtual MArray< Int64 > getSliceInt(const TableExprId &id, const Slicer &)
virtual MArray< Int64 > getArrayInt(const TableExprId &id)
virtual Int64 getElemInt(const TableExprId &id, const Slicer &index)
TableExprNodeArrayColumnuChar(const TableColumn &, const Table &)
uInt array column in table select expression
~TableExprNodeArrayColumnuInt()
TableExprNodeArrayColumnuInt(const TableColumn &, const Table &)
virtual void applySelection(const Vector< rownr_t > &rownrs)
Re-create the column object for a selection of rows.
ArrayColumn< uInt > col_p
virtual Int64 getElemInt(const TableExprId &id, const Slicer &index)
virtual MArray< Int64 > getArrayInt(const TableExprId &id)
virtual MArray< Int64 > getSliceInt(const TableExprId &id, const Slicer &)
virtual Array< uInt > getElemColumnuInt(const Vector< rownr_t > &rownrs, const Slicer &)
uShort array column in table select expression
virtual MArray< Int64 > getArrayInt(const TableExprId &id)
virtual Array< uShort > getElemColumnuShort(const Vector< rownr_t > &rownrs, const Slicer &)
virtual void applySelection(const Vector< rownr_t > &rownrs)
Re-create the column object for a selection of rows.
TableExprNodeArrayColumnuShort(const TableColumn &, const Table &)
ArrayColumn< uShort > col_p
virtual MArray< Int64 > getSliceInt(const TableExprId &id, const Slicer &)
~TableExprNodeArrayColumnuShort()
virtual Int64 getElemInt(const TableExprId &id, const Slicer &index)
Array column part in table select expression.
virtual MVTime getDate(const TableExprId &id)
virtual Bool getBool(const TableExprId &id)
Get a scalar value for this node in the given row.
virtual Array< Int > getColumnInt(const Vector< rownr_t > &rownrs)
virtual void show(ostream &os, uInt indent) const
Show the node.
virtual Array< Int64 > getColumnInt64(const Vector< rownr_t > &rownrs)
virtual MArray< String > getArrayString(const TableExprId &id)
virtual MArray< Bool > getArrayBool(const TableExprId &id)
Get an array value for this node in the given row.
TableExprNodeArrayColumn * colNode_p
virtual Array< uChar > getColumnuChar(const Vector< rownr_t > &rownrs)
virtual Int64 getInt(const TableExprId &id)
TableExprNodeArrayPart(const TENShPtr &arrayNode, const TENShPtr &indexNode)
~TableExprNodeArrayPart()
virtual Double getDouble(const TableExprId &id)
virtual DComplex getDComplex(const TableExprId &id)
const TableExprNodeArrayColumn * getColumnNode() const
Get the array column node.
virtual Bool getColumnDataType(DataType &) const
Get the data type of this column (if possible).
virtual Array< uShort > getColumnuShort(const Vector< rownr_t > &rownrs)
virtual String getString(const TableExprId &id)
virtual Array< Double > getColumnDouble(const Vector< rownr_t > &rownrs)
virtual Array< String > getColumnString(const Vector< rownr_t > &rownrs)
const TableExprNodeIndex * getIndexNode() const
Get the index node.
TableExprNodeArray * arrNode_p
virtual MArray< DComplex > getArrayDComplex(const TableExprId &id)
The default implementation of getArrayDComplex does getArrayDouble and converts the result.
virtual MArray< Double > getArrayDouble(const TableExprId &id)
The default implementation of getArrayDouble does getArrayInt and converts the result.
virtual Array< Complex > getColumnComplex(const Vector< rownr_t > &rownrs)
virtual Array< uInt > getColumnuInt(const Vector< rownr_t > &rownrs)
virtual MArray< Int64 > getArrayInt(const TableExprId &id)
virtual Array< DComplex > getColumnDComplex(const Vector< rownr_t > &rownrs)
virtual Array< Bool > getColumnBool(const Vector< rownr_t > &rownrs)
Get the value of the expression evaluated for the entire column.
TableExprNodeIndex * inxNode_p
virtual Array< Short > getColumnShort(const Vector< rownr_t > &rownrs)
virtual Array< Float > getColumnFloat(const Vector< rownr_t > &rownrs)
virtual MArray< MVTime > getArrayDate(const TableExprId &id)
virtual MArray< Bool > hasArrayBool(const TableExprId &id, const MArray< Bool > &value)
virtual Double getElemDouble(const TableExprId &id, const Slicer &index)
virtual Array< uChar > getElemColumnuChar(const Vector< rownr_t > &rownrs, const Slicer &)
static MArray< Double > makeArray(const IPosition &shape, Double value)
virtual MArray< Bool > getSliceBool(const TableExprId &id, const Slicer &)
Get a slice of the array in the given row.
virtual MArray< Double > getSliceDouble(const TableExprId &id, const Slicer &)
virtual Array< uShort > getElemColumnuShort(const Vector< rownr_t > &rownrs, const Slicer &)
TableExprNodeArray(NodeDataType, OperType, const IPosition &shape)
virtual Array< uInt > getElemColumnuInt(const Vector< rownr_t > &rownrs, const Slicer &)
virtual MArray< DComplex > getSliceDComplex(const TableExprId &id, const Slicer &)
virtual Int64 getElemInt(const TableExprId &id, const Slicer &index)
virtual String getElemString(const TableExprId &id, const Slicer &index)
virtual MArray< Bool > hasArrayString(const TableExprId &id, const MArray< String > &value)
virtual Array< Int64 > getElemColumnInt64(const Vector< rownr_t > &rownrs, const Slicer &)
virtual MArray< Bool > hasArrayDate(const TableExprId &id, const MArray< MVTime > &value)
static MArray< DComplex > makeArray(const IPosition &shape, const DComplex &value)
virtual Bool hasDComplex(const TableExprId &id, const DComplex &value)
virtual DComplex getElemDComplex(const TableExprId &id, const Slicer &index)
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.
virtual Bool hasDouble(const TableExprId &id, Double value)
virtual Array< Float > getElemColumnFloat(const Vector< rownr_t > &rownrs, const Slicer &)
virtual Array< Int > getElemColumnInt(const Vector< rownr_t > &rownrs, const Slicer &)
virtual Array< Complex > getElemColumnComplex(const Vector< rownr_t > &rownrs, const Slicer &)
virtual Array< Short > getElemColumnShort(const Vector< rownr_t > &rownrs, const Slicer &)
virtual MArray< Bool > hasArrayDComplex(const TableExprId &id, const MArray< DComplex > &value)
virtual MArray< Int64 > getSliceInt(const TableExprId &id, const Slicer &)
virtual Bool hasBool(const TableExprId &id, Bool value)
Does a value occur in the set?
virtual Array< Double > getElemColumnDouble(const Vector< rownr_t > &rownrs, const Slicer &)
virtual Bool hasInt(const TableExprId &id, Int64 value)
virtual MArray< MVTime > getSliceDate(const TableExprId &id, const Slicer &)
static MArray< Int64 > makeArray(const IPosition &shape, Int64 value)
Make an array with the given shape and fill it with the value.
virtual Array< String > getElemColumnString(const Vector< rownr_t > &rownrs, const Slicer &)
virtual MArray< Bool > hasArrayInt(const TableExprId &id, const MArray< Int64 > &value)
virtual TENShPtr makeConstantScalar()
Turn a constant array with one element into a scalar.
virtual MArray< Bool > hasArrayDouble(const TableExprId &id, const MArray< Double > &value)
IPosition validateIndex(const IPosition &index, const ArrayBase &arr) const
Validate the given index against the array's shape.
virtual MArray< Double > getArrayDouble(const TableExprId &id)
The default implementation of getArrayDouble does getArrayInt and converts the result.
TableExprNodeArray(NodeDataType, OperType)
Create the object.
virtual Bool hasDate(const TableExprId &id, const MVTime &value)
virtual Bool hasString(const TableExprId &id, const String &value)
virtual Array< Bool > getElemColumnBool(const Vector< rownr_t > &rownrs, const Slicer &)
Get a single element for the entire column (used by sort).
virtual const IPosition & getShape(const TableExprId &id)
Get the shape of the array in the given row.
virtual MArray< String > getSliceString(const TableExprId &id, const Slicer &)
virtual Array< DComplex > getElemColumnDComplex(const Vector< rownr_t > &rownrs, const Slicer &)
virtual MArray< DComplex > getArrayDComplex(const TableExprId &id)
The default implementation of getArrayDComplex does getArrayDouble and converts the result.
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.
virtual ~TableExprNodeIndex()
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).
Table & table()
Get table.
Class to hold multiple table expression nodes.
std::complex< Double > DComplex
this file contains all the compiler specific defines
long long Int64
Define the extra non-standard types used by Casacore (like proposed uSize, Size)
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.