- NTBool
- NTDouble
- NTComplex
- NTString
- NTRegex
- NTDate
- NTNumeric
- NTAny
- # NTDouble or NTComplex
- VTScalar
- VTArray
- VTRecord
- VTSetElem
- VTSet
- VTIndex
- OtPlus
- OtMinus
- OtTimes
- OtDivide
- OtModulo
- OtEQ
- OtGE
- OtGT
- OtNE
- OtIN
- OtAND
- OtOR
- OtNOT
- OtMIN
- OtColumn
- OtField
- OtLiteral
- OtFunc
- OtSlice
- OtUndef
- OtRownr
- OtRandom
- NoArr
- ArrArr
- ArrSca
- ScaArr
- Constant
- A constant subexpression which can be evaluated immediately.
- Variable
- A variable (i.e. row dependent) subexpression which has to be evaluated for each table row.
The objects of this class are reference-counted to make it possible that the same object is reused.
This constructor is called from the derived TableExprNodeRep.
Copy constructor.
The destructor deletes all the underlying TableExprNode objects.
Link to this object, i.e. increase its reference count.
Unlink from the given object. If its reference count is zero, delete it.
Get a scalar value for this node in the given row. The appropriate functions are implemented in the derived classes and will usually invoke the get in their children and apply the operator on the resulting values.
Get an array value for this node in the given row. The appropriate functions are implemented in the derived classes and will usually invoke the get in their children and apply the operator on the resulting values.
Does a value occur in an array or set? The default implementation tests if it is in an array.
Get the number of rows in the table associated with this expression. Zero is returned when no table is associated with it.
Get the data type of the column. It returns True when it could set the data type (which it can if the expression is a scalar column or a constant array column pixel). Otherwise it returns False.
Get the value of the expression evaluated for the entire column. The data of function called should match the data type as returned by function getColumnDataType.
Convert the tree to a number of range vectors which at least select the same things. This function is very useful to convert the expression to some intervals covering the select expression. This can be used to do a rough fast selection via an index and do the the slower final selection on that much smaller subset. The function can only convert direct comparisons of columns with constants (via ==, !=, >, >=, < or <=) and their combinations using && or ||.
Get the data type of the derived TableExprNode object.
This is the data type of the resulting value. E.g. a compare
of 2 numeric values results in a Bool, thus the data type
of, say, TableExprNodeEQ
Get the value type.
Set the value type.
Get the operator type.
Get the expression type.
Is the exprerssion a constant?
Get the fixed dimensionality (same for all rows).
Get the fixed shape (same for all rows).
Get the shape for the given row.
It returns the fixed shape if defined, otherwise getShape(id).
Is the value in the given row defined?
The default implementation returns True.
Show the expression tree.
Get basetable. This gets a pointer to the BaseTable to which a
TableExprNode belongs. A TableExprNode belongs to the BaseTable to
which the column(s) used in an expression belong. Note that
all columns in an expression have to belong to the same table.
Replace the Table pointer in this node and all its children.
Create a range object from a column and an interval.
Create a empty range object.
Get pointer to REPresentation object.
This is used by derived classes.
When one of the children is a constant, convert its data type
to that of the other operand. This avoids that conversions are
done for each get.
The default implementation does nothing.
Check if this node uses the same table pointer.
Fill the pointer if it is still zero.
Set expression type to Variable if node is Variable.
When the node is constant, it is evaluated and replaced by
the appropriate TableExprNodeConst object.
If not constant, it calls the virtual ConvertConstChild function
which can convert a constant child when appropriate.
Destructor
Show the expression tree.
Check the data types and get the common one.
Check the data and value types and get the common one.
Link the children to the node and convert the children
to constants if needed and possible. Also convert the node to
constant if possible.
When one of the children is a constant, convert its data type
to that of the other operand. This avoids that conversions are
done for each get.
Replace the Table pointer in this node and all its children.
Destructor
Show the expression tree.
Check number of arguments
low <= number_of_args <= high
It throws an exception if wrong number of arguments.
Replace the Table pointer in this node and all its children.
Check datatype of nodes and return output type.
It also sets the expected data type of the operands (from dtIn).
ValueType valueType() const
void setValueType (ValueType vtype)
OperType operType() const
ExprType exprType() const
Bool isConstant() const
Int ndim() const
const IPosition& shape() const
const IPosition& shape (const TableExprId& id)
virtual Bool isDefined (const TableExprId& id)
virtual void show (ostream&, uInt indent) const
const BaseTable* baseTablePtr() const
virtual void replaceTablePtr (const Table&, const BaseTable*)
static void createRange (Block<TableExprRange>&, TableExprNodeColumn*, Double start, Double end)
static void createRange (Block<TableExprRange>&)
virtual const IPosition& getShape (const TableExprId& id)
Get the shape for the given row.
static TableExprNodeRep* getRep (TableExprNode&)
virtual void convertConstChild()
void checkTablePtr (const TableExprNodeRep* node)
static void checkTablePtr (const BaseTable*& baseTablePtr, const TableExprNodeRep* node)
void fillExprType (const TableExprNodeRep* node)
static void fillExprType (ExprType&, const TableExprNodeRep* node)
static TableExprNodeRep* convertNode (TableExprNodeRep* thisNode, Bool convertConstType)
TableExprNodeRep& operator= (const TableExprNodeRep&)
A copy of a TableExprNodeRep cannot be made.
class TableExprNodeBinary : public TableExprNodeRep
Interface
Description
Prerequisite
Etymology
TableExprNodeBinary is a node in the table expression tree
representing a binary node (i.e. having 2 operands).
Synopsis
TableExprNodeBinary is the abstract base class for all nodes in a table
expression tree using up to 2 operands.
It is used as the base class for the node classes representing
operator +, -, etc..
Motivation
This class contains the common functionality for the classes
representing a binary (or unary) operator.
Member Description
TableExprNodeBinary (NodeDataType, ValueType, OperType, const BaseTable*)
Constructor
TableExprNodeBinary (NodeDataType, const TableExprNodeRep&, OperType)
virtual ~TableExprNodeBinary()
virtual void show (ostream&, uInt indent) const
static NodeDataType getDT (NodeDataType leftDtype, NodeDataType rightDype, OperType operType)
static TableExprNodeRep getTypes (const TableExprNodeRep& left, const TableExprNodeRep& right, OperType operType)
static TableExprNodeRep* fillNode (TableExprNodeBinary* thisNode, TableExprNodeRep* left, TableExprNodeRep* right, Bool convertConstType)
void convertConstChild()
virtual void replaceTablePtr (const Table&, const BaseTable*)
class TableExprNodeMulti : public TableExprNodeRep
Interface
Description
Prerequisite
Etymology
TableExprNodeMulti is a node in the table expression tree
which can have MULTIple child nodes.
Synopsis
TableExprNodeMulti is the abstract base class for all nodes in a table
expression tree using multiple operands.
It is used as the base class for the node classes representing
functions, sets, indices, etc..
Motivation
This class contains the common functionality for the classes
representing a node with multiple operands.
Member Description
TableExprNodeMulti (NodeDataType, ValueType, OperType, const TableExprNodeRep& source)
Constructor
virtual ~TableExprNodeMulti()
virtual void show (ostream&, uInt indent) const
static uInt checkNumOfArg (uInt low, uInt high, const PtrBlock<TableExprNodeRep*>& nodes)
virtual void replaceTablePtr (const Table&, const BaseTable*)
static NodeDataType checkDT (Block<Int>& dtypeOper, NodeDataType dtIn, NodeDataType dtOut, const PtrBlock<TableExprNodeRep*>& nodes)