casacore
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
casacore::TableExprNodeRep Class Reference

Abstract base class for a node in a table column expression tree. More...

#include <ExprNodeRep.h>

Public Types

enum  NodeDataType {
  NTBool ,
  NTInt ,
  NTDouble ,
  NTComplex ,
  NTString ,
  NTRegex ,
  NTDate ,
  NTReal ,
  NTDouCom ,
  NTNumeric ,
  NTAny
}
 Define the data types of a node. More...
 
enum  ValueType {
  VTScalar ,
  VTArray ,
  VTRecord ,
  VTSetElem ,
  VTSet ,
  VTIndex
}
 Define the value types. More...
 
enum  OperType {
  OtPlus ,
  OtMinus ,
  OtTimes ,
  OtDivide ,
  OtModulo ,
  OtBitAnd ,
  OtBitOr ,
  OtBitXor ,
  OtBitNegate ,
  OtEQ ,
  OtGE ,
  OtGT ,
  OtNE ,
  OtIN ,
  OtAND ,
  OtOR ,
  OtNOT ,
  OtMIN ,
  OtColumn ,
  OtField ,
  OtLiteral ,
  OtFunc ,
  OtSlice ,
  OtUndef ,
  OtRownr ,
  OtRandom
}
 Define the operator types. More...
 
enum  ArgType {
  NoArr ,
  ArrArr ,
  ArrSca ,
  ScaArr
}
 Define the value types of the 2 arguments when arrays are involved. More...
 
enum  ExprType {
  Constant ,
  Variable
}
 Define (sub-)expression type. More...
 

Public Member Functions

 TableExprNodeRep (NodeDataType, ValueType, OperType, ArgType, ExprType, Int ndim, const IPosition &shape)
 Construct a node.
 
 TableExprNodeRep (NodeDataType, ValueType, OperType, ExprType)
 This constructor is called from the derived TableExprNodeRep.
 
 TableExprNodeRep (const TableExprNodeRep &)=default
 Copy constructor.
 
TableExprNodeRepoperator= (const TableExprNodeRep &)=delete
 Assign to a TableExprNodeRep cannot be done.
 
virtual ~TableExprNodeRep ()=default
 The destructor deletes all the underlying TableExprNode objects.
 
virtual Bool isAggregate () const
 Is the node an aggegation node.
 
virtual TableExprInfo getTableInfo () const
 Get the table info.
 
virtual void optimize ()
 Try to optimize the node (meant for the right hand of the IN operator).
 
virtual void disableApplySelection ()
 Do not apply the selection.
 
virtual void applySelection (const Vector< rownr_t > &rownrs)
 Re-create the column object for a selection of rows.
 
virtual Double getUnitFactor () const
 Get the unit conversion factor.
 
virtual void flattenTree (std::vector< TableExprNodeRep * > &)
 Flatten the node tree by adding the node and its children to the vector.
 
virtual std::shared_ptr< TableExprGroupFuncBasemakeGroupAggrFunc ()
 Create the correct immediate aggregate function object.
 
virtual Bool isLazyAggregate () const
 Is the aggregate function a lazy or an immediate one? The default implementation returns True (because all UDF aggregate functions have to be lazy).
 
virtual Bool getBool (const TableExprId &id)
 Get a scalar value for this node in the given row.
 
virtual Int64 getInt (const TableExprId &id)
 
virtual Double getDouble (const TableExprId &id)
 
virtual DComplex getDComplex (const TableExprId &id)
 
virtual String getString (const TableExprId &id)
 
virtual TaqlRegex getRegex (const TableExprId &id)
 
virtual MVTime getDate (const TableExprId &id)
 
virtual MArray< BoolgetArrayBool (const TableExprId &id)
 Get an array value for this node in the given row.
 
virtual MArray< Int64getArrayInt (const TableExprId &id)
 
virtual MArray< DoublegetArrayDouble (const TableExprId &id)
 
virtual MArray< DComplex > getArrayDComplex (const TableExprId &id)
 
virtual MArray< StringgetArrayString (const TableExprId &id)
 
virtual MArray< MVTimegetArrayDate (const TableExprId &id)
 
void get (const TableExprId &id, Bool &value)
 General get functions for template purposes.
 
void get (const TableExprId &id, Int64 &value)
 
void get (const TableExprId &id, Double &value)
 
void get (const TableExprId &id, DComplex &value)
 
void get (const TableExprId &id, MVTime &value)
 
void get (const TableExprId &id, String &value)
 
void get (const TableExprId &id, MArray< Bool > &value)
 
void get (const TableExprId &id, MArray< Int64 > &value)
 
void get (const TableExprId &id, MArray< Double > &value)
 
void get (const TableExprId &id, MArray< DComplex > &value)
 
void get (const TableExprId &id, MArray< MVTime > &value)
 
void get (const TableExprId &id, MArray< String > &value)
 
MArray< BoolgetBoolAS (const TableExprId &id)
 Get a value as an array, even it it is a scalar.
 
MArray< Int64getIntAS (const TableExprId &id)
 
MArray< DoublegetDoubleAS (const TableExprId &id)
 
MArray< DComplex > getDComplexAS (const TableExprId &id)
 
MArray< StringgetStringAS (const TableExprId &id)
 
MArray< MVTimegetDateAS (const TableExprId &id)
 
virtual Bool contains (const TableExprId &id, Bool value)
 Does a set or array contain the value? The default implementation assumes the set is a single scalar, thus tests if it is equal to the given value.
 
virtual Bool contains (const TableExprId &id, Int64 value)
 
virtual Bool contains (const TableExprId &id, Double value)
 
virtual Bool contains (const TableExprId &id, DComplex value)
 
virtual Bool contains (const TableExprId &id, String value)
 
virtual Bool contains (const TableExprId &id, MVTime value)
 
virtual MArray< Boolcontains (const TableExprId &id, const MArray< Bool > &value)
 
virtual MArray< Boolcontains (const TableExprId &id, const MArray< Int64 > &value)
 
virtual MArray< Boolcontains (const TableExprId &id, const MArray< Double > &value)
 
virtual MArray< Boolcontains (const TableExprId &id, const MArray< DComplex > &value)
 
virtual MArray< Boolcontains (const TableExprId &id, const MArray< String > &value)
 
virtual MArray< Boolcontains (const TableExprId &id, const MArray< MVTime > &value)
 
rownr_t nrow ()
 Get the number of rows in the table associated with this expression.
 
virtual Bool getColumnDataType (DataType &) const
 Get the data type of the column.
 
virtual Array< BoolgetColumnBool (const Vector< rownr_t > &rownrs)
 Get the value of the expression evaluated for the entire column.
 
virtual Array< uChargetColumnuChar (const Vector< rownr_t > &rownrs)
 
virtual Array< ShortgetColumnShort (const Vector< rownr_t > &rownrs)
 
virtual Array< uShortgetColumnuShort (const Vector< rownr_t > &rownrs)
 
virtual Array< IntgetColumnInt (const Vector< rownr_t > &rownrs)
 
virtual Array< uIntgetColumnuInt (const Vector< rownr_t > &rownrs)
 
virtual Array< Int64getColumnInt64 (const Vector< rownr_t > &rownrs)
 
virtual Array< FloatgetColumnFloat (const Vector< rownr_t > &rownrs)
 
virtual Array< DoublegetColumnDouble (const Vector< rownr_t > &rownrs)
 
virtual Array< Complex > getColumnComplex (const Vector< rownr_t > &rownrs)
 
virtual Array< DComplex > getColumnDComplex (const Vector< rownr_t > &rownrs)
 
virtual Array< StringgetColumnString (const Vector< rownr_t > &rownrs)
 
virtual void ranges (Block< TableExprRange > &)
 Convert the tree to a number of range vectors which at least select the same things.
 
NodeDataType dataType () const
 Get the data type of the derived TableExprNode object.
 
Bool isReal () const
 Is the data type real (i.e., integer or double)?
 
ValueType valueType () const
 Get the value type.
 
void setValueType (ValueType vtype)
 Set the value type.
 
OperType operType () const
 Get the operator type.
 
ExprType exprType () const
 Get the expression type.
 
Bool isConstant () const
 Is the expression a constant?
 
const Unitunit () const
 Get the unit.
 
void setUnit (const Unit &unit)
 Set the unit.
 
const Recordattributes () const
 Get the attributes.
 
void setAttributes (const Record &)
 Set the attributes.
 
Int ndim () const
 Get the fixed dimensionality (same for all rows).
 
const IPositionshape () const
 Get the fixed shape (same for all rows).
 
const IPositionshape (const TableExprId &id)
 Get the shape for the given row.
 
virtual Bool isDefined (const TableExprId &id)
 Is the value in the given row defined? The default implementation returns True.
 
virtual void show (ostream &, uInt indent) const
 Show the expression tree.
 
virtual void adaptSetUnits (const Unit &)
 Let a set node convert itself to the given unit.
 

Static Public Member Functions

static TENShPtr replaceConstNode (const TENShPtr &node)
 Replace a node with a constant expression by node with its value.
 
static void createRange (Block< TableExprRange > &, TableExprNodeColumn *, Double start, Double end)
 Create a range object from a column and an interval.
 
static void createRange (Block< TableExprRange > &)
 Create a empty range object.
 
static String typeString (NodeDataType)
 Convert a NodeDataType to a string.
 
static String typeString (ValueType)
 Convert a ValueType to a string.
 

Protected Member Functions

virtual const IPositiongetShape (const TableExprId &id)
 Get the shape for the given row.
 
void fillExprType (const TableExprNodeRep *node)
 Set expression type to Variable if node is Variable.
 

Static Protected Member Functions

static TENShPtr convertNode (const TENShPtr &thisNode, Bool convertConstType)
 If the node is constant, it is evaluated and replaced by the appropriate TableExprNodeConst object.
 

Protected Attributes

NodeDataType dtype_p
 
ValueType vtype_p
 
OperType optype_p
 
ArgType argtype_p
 
ExprType exprtype_p
 
Int ndim_p
 
IPosition shape_p
 
Unit unit_p
 
Record attributes_p
 

Detailed Description

Abstract base class for a node in a table column expression tree.

Intended use:

Internal

Review Status

Reviewed By:
UNKNOWN
Date Reviewed:
before2004/08/25

Prerequisite

Etymology

TableExprNodeRep is the (abstract) REPresentation of a node in a table expression tree.

Synopsis

TableExprNodeRep is the base class for all nodes in a table expression tree. It is used by the handle class TableExprNode.

The objects of this class are reference-counted to make it possible that the same object is reused.

Motivation

TableExprNodeRep and its derivations store a table select expression before actually evaluating it. It is also possible that the classes are used by the table expression parser defined in TableParse and TableGram.
For each operator a special derived class is implemented. Another approach could have been to store the operator as a flag and switch on that. However, that causes extra overhead and the C++ virtual function mechanism is designed for these purposes.

To Do

Definition at line 201 of file ExprNodeRep.h.

Member Enumeration Documentation

◆ ArgType

Define the value types of the 2 arguments when arrays are involved.

Enumerator
NoArr 
ArrArr 
ArrSca 
ScaArr 

Definition at line 240 of file ExprNodeRep.h.

◆ ExprType

Define (sub-)expression type.

Enumerator
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. An expensive constant subexpression which should only be evaluated when needed (e.g. a subquery). Lazy

Definition at line 245 of file ExprNodeRep.h.

◆ NodeDataType

Define the data types of a node.

Enumerator
NTBool 
NTInt 
NTDouble 
NTComplex 
NTString 
NTRegex 
NTDate 
NTReal 
NTDouCom 
NTNumeric 
NTAny 

Definition at line 205 of file ExprNodeRep.h.

◆ OperType

Define the operator types.

LE and LT are handled as GE and GT with swapped operands.

Enumerator
OtPlus 
OtMinus 
OtTimes 
OtDivide 
OtModulo 
OtBitAnd 
OtBitOr 
OtBitXor 
OtBitNegate 
OtEQ 
OtGE 
OtGT 
OtNE 
OtIN 
OtAND 
OtOR 
OtNOT 
OtMIN 
OtColumn 
OtField 
OtLiteral 
OtFunc 
OtSlice 
OtUndef 
OtRownr 
OtRandom 

Definition at line 231 of file ExprNodeRep.h.

◆ ValueType

Define the value types.

Enumerator
VTScalar 
VTArray 
VTRecord 
VTSetElem 
VTSet 
VTIndex 

Definition at line 220 of file ExprNodeRep.h.

Constructor & Destructor Documentation

◆ TableExprNodeRep() [1/3]

casacore::TableExprNodeRep::TableExprNodeRep ( NodeDataType  ,
ValueType  ,
OperType  ,
ArgType  ,
ExprType  ,
Int  ndim,
const IPosition shape 
)

Construct a node.

◆ TableExprNodeRep() [2/3]

casacore::TableExprNodeRep::TableExprNodeRep ( NodeDataType  ,
ValueType  ,
OperType  ,
ExprType   
)

This constructor is called from the derived TableExprNodeRep.

◆ TableExprNodeRep() [3/3]

casacore::TableExprNodeRep::TableExprNodeRep ( const TableExprNodeRep )
default

Copy constructor.

◆ ~TableExprNodeRep()

virtual casacore::TableExprNodeRep::~TableExprNodeRep ( )
virtualdefault

The destructor deletes all the underlying TableExprNode objects.

Member Function Documentation

◆ adaptSetUnits()

virtual void casacore::TableExprNodeRep::adaptSetUnits ( const Unit )
virtual

Let a set node convert itself to the given unit.

The default implementation does nothing.

Reimplemented in casacore::TableExprNodeSet, and casacore::TableExprNodeSetElemBase.

◆ applySelection()

virtual void casacore::TableExprNodeRep::applySelection ( const Vector< rownr_t > &  rownrs)
virtual

◆ attributes()

const Record & casacore::TableExprNodeRep::attributes ( ) const
inline

Get the attributes.

Definition at line 751 of file ExprNodeRep.h.

References attributes_p.

Referenced by setAttributes().

◆ contains() [1/12]

virtual Bool casacore::TableExprNodeRep::contains ( const TableExprId id,
Bool  value 
)
virtual

Does a set or array contain the value? The default implementation assumes the set is a single scalar, thus tests if it is equal to the given value.

Reimplemented in casacore::TableExprNodeArray, and casacore::TableExprNodeSet.

◆ contains() [2/12]

virtual MArray< Bool > casacore::TableExprNodeRep::contains ( const TableExprId id,
const MArray< Bool > &  value 
)
virtual

◆ contains() [3/12]

virtual MArray< Bool > casacore::TableExprNodeRep::contains ( const TableExprId id,
const MArray< DComplex > &  value 
)
virtual

◆ contains() [4/12]

virtual MArray< Bool > casacore::TableExprNodeRep::contains ( const TableExprId id,
const MArray< Double > &  value 
)
virtual

◆ contains() [5/12]

virtual MArray< Bool > casacore::TableExprNodeRep::contains ( const TableExprId id,
const MArray< Int64 > &  value 
)
virtual

◆ contains() [6/12]

virtual MArray< Bool > casacore::TableExprNodeRep::contains ( const TableExprId id,
const MArray< MVTime > &  value 
)
virtual

◆ contains() [7/12]

virtual MArray< Bool > casacore::TableExprNodeRep::contains ( const TableExprId id,
const MArray< String > &  value 
)
virtual

◆ contains() [8/12]

virtual Bool casacore::TableExprNodeRep::contains ( const TableExprId id,
DComplex  value 
)
virtual

◆ contains() [9/12]

virtual Bool casacore::TableExprNodeRep::contains ( const TableExprId id,
Double  value 
)
virtual

◆ contains() [10/12]

virtual Bool casacore::TableExprNodeRep::contains ( const TableExprId id,
Int64  value 
)
virtual

◆ contains() [11/12]

virtual Bool casacore::TableExprNodeRep::contains ( const TableExprId id,
MVTime  value 
)
virtual

◆ contains() [12/12]

virtual Bool casacore::TableExprNodeRep::contains ( const TableExprId id,
String  value 
)
virtual

◆ convertNode()

static TENShPtr casacore::TableExprNodeRep::convertNode ( const TENShPtr thisNode,
Bool  convertConstType 
)
staticprotected

If 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 if appropriate.

◆ createRange() [1/2]

static void casacore::TableExprNodeRep::createRange ( Block< TableExprRange > &  )
static

Create a empty range object.

◆ createRange() [2/2]

static void casacore::TableExprNodeRep::createRange ( Block< TableExprRange > &  ,
TableExprNodeColumn ,
Double  start,
Double  end 
)
static

Create a range object from a column and an interval.

◆ dataType()

TableExprNodeRep::NodeDataType casacore::TableExprNodeRep::dataType ( ) const
inline

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<T> is always Bool. Function getInternalDT gives the internal data type, thus in the example above the data type of T.

Definition at line 721 of file ExprNodeRep.h.

References dtype_p.

◆ disableApplySelection()

virtual void casacore::TableExprNodeRep::disableApplySelection ( )
virtual

◆ exprType()

TableExprNodeRep::ExprType casacore::TableExprNodeRep::exprType ( ) const
inline

Get the expression type.

Definition at line 740 of file ExprNodeRep.h.

References exprtype_p.

◆ fillExprType()

void casacore::TableExprNodeRep::fillExprType ( const TableExprNodeRep node)
protected

Set expression type to Variable if node is Variable.

◆ flattenTree()

virtual void casacore::TableExprNodeRep::flattenTree ( std::vector< TableExprNodeRep * > &  )
virtual

◆ get() [1/12]

void casacore::TableExprNodeRep::get ( const TableExprId id,
Bool value 
)
inline

General get functions for template purposes.

Definition at line 337 of file ExprNodeRep.h.

References getBool(), and casacore::value().

Referenced by casacore::TableExprGroupAggr::getArray(), and casacore::TableExprNode::getNodeRep().

◆ get() [2/12]

void casacore::TableExprNodeRep::get ( const TableExprId id,
DComplex &  value 
)
inline

Definition at line 343 of file ExprNodeRep.h.

References getDComplex(), and casacore::value().

◆ get() [3/12]

void casacore::TableExprNodeRep::get ( const TableExprId id,
Double value 
)
inline

Definition at line 341 of file ExprNodeRep.h.

References getDouble(), and casacore::value().

◆ get() [4/12]

void casacore::TableExprNodeRep::get ( const TableExprId id,
Int64 value 
)
inline

Definition at line 339 of file ExprNodeRep.h.

References getInt(), and casacore::value().

◆ get() [5/12]

void casacore::TableExprNodeRep::get ( const TableExprId id,
MArray< Bool > &  value 
)
inline

Definition at line 349 of file ExprNodeRep.h.

References getArrayBool(), and casacore::value().

◆ get() [6/12]

void casacore::TableExprNodeRep::get ( const TableExprId id,
MArray< DComplex > &  value 
)
inline

Definition at line 355 of file ExprNodeRep.h.

References getArrayDComplex(), and casacore::value().

◆ get() [7/12]

void casacore::TableExprNodeRep::get ( const TableExprId id,
MArray< Double > &  value 
)
inline

Definition at line 353 of file ExprNodeRep.h.

References getArrayDouble(), and casacore::value().

◆ get() [8/12]

void casacore::TableExprNodeRep::get ( const TableExprId id,
MArray< Int64 > &  value 
)
inline

Definition at line 351 of file ExprNodeRep.h.

References getArrayInt(), and casacore::value().

◆ get() [9/12]

void casacore::TableExprNodeRep::get ( const TableExprId id,
MArray< MVTime > &  value 
)
inline

Definition at line 357 of file ExprNodeRep.h.

References getArrayDate(), and casacore::value().

◆ get() [10/12]

void casacore::TableExprNodeRep::get ( const TableExprId id,
MArray< String > &  value 
)
inline

Definition at line 359 of file ExprNodeRep.h.

References getArrayString(), and casacore::value().

◆ get() [11/12]

void casacore::TableExprNodeRep::get ( const TableExprId id,
MVTime value 
)
inline

Definition at line 345 of file ExprNodeRep.h.

References getDate(), and casacore::value().

◆ get() [12/12]

void casacore::TableExprNodeRep::get ( const TableExprId id,
String value 
)
inline

Definition at line 347 of file ExprNodeRep.h.

References getString(), and casacore::value().

◆ getArrayBool()

virtual MArray< Bool > casacore::TableExprNodeRep::getArrayBool ( const TableExprId id)
virtual

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.

Reimplemented in casacore::TableExprAggrNodeArray, casacore::TableExprConeNodeArray, casacore::TableExprNodeArrayConstBool, casacore::TableExprFuncNodeArray, casacore::TableExprNodeArrayEQBool, casacore::TableExprNodeArrayEQInt, casacore::TableExprNodeArrayEQDouble, casacore::TableExprNodeArrayEQDComplex, casacore::TableExprNodeArrayEQString, casacore::TableExprNodeArrayEQRegex, casacore::TableExprNodeArrayEQDate, casacore::TableExprNodeArrayNEBool, casacore::TableExprNodeArrayNEInt, casacore::TableExprNodeArrayNEDouble, casacore::TableExprNodeArrayNEDComplex, casacore::TableExprNodeArrayNEString, casacore::TableExprNodeArrayNERegex, casacore::TableExprNodeArrayNEDate, casacore::TableExprNodeArrayGTInt, casacore::TableExprNodeArrayGTDouble, casacore::TableExprNodeArrayGTDComplex, casacore::TableExprNodeArrayGTString, casacore::TableExprNodeArrayGTDate, casacore::TableExprNodeArrayGEInt, casacore::TableExprNodeArrayGEDouble, casacore::TableExprNodeArrayGEDComplex, casacore::TableExprNodeArrayGEString, casacore::TableExprNodeArrayGEDate, casacore::TableExprNodeArrayINDComplex, casacore::TableExprNodeArrayOR, casacore::TableExprNodeArrayAND, casacore::TableExprNodeArrayNOT, casacore::TableExprNodeRecordFieldArray, casacore::TableExprNodeArrayINInt, casacore::TableExprNodeArrayINDouble, casacore::TableExprNodeArrayINString, casacore::TableExprNodeArrayINDate, casacore::TableExprNodeArrayColumnBool, casacore::TableExprNodeArrayPart, casacore::TableExprNodeSet, casacore::TableExprUDFNodeArray, and casacore::TaQLJoinColumn.

Referenced by get().

◆ getArrayDate()

virtual MArray< MVTime > casacore::TableExprNodeRep::getArrayDate ( const TableExprId id)
virtual

◆ getArrayDComplex()

virtual MArray< DComplex > casacore::TableExprNodeRep::getArrayDComplex ( const TableExprId id)
virtual

◆ getArrayDouble()

virtual MArray< Double > casacore::TableExprNodeRep::getArrayDouble ( const TableExprId id)
virtual

◆ getArrayInt()

virtual MArray< Int64 > casacore::TableExprNodeRep::getArrayInt ( const TableExprId id)
virtual

◆ getArrayString()

virtual MArray< String > casacore::TableExprNodeRep::getArrayString ( const TableExprId id)
virtual

◆ getBool()

virtual Bool casacore::TableExprNodeRep::getBool ( const TableExprId id)
virtual

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.

Reimplemented in casacore::TableExprAggrNode, casacore::TableExprConeNode, casacore::TableExprFuncNode, casacore::TableExprNodeRecordField, casacore::TableExprNodeConstBool, casacore::TableExprNodeColumn, casacore::TableExprNodeEQBool, casacore::TableExprNodeEQInt, casacore::TableExprNodeEQDouble, casacore::TableExprNodeEQDComplex, casacore::TableExprNodeEQString, casacore::TableExprNodeEQRegex, casacore::TableExprNodeEQDate, casacore::TableExprNodeNEBool, casacore::TableExprNodeNEInt, casacore::TableExprNodeNEDouble, casacore::TableExprNodeNEDComplex, casacore::TableExprNodeNEString, casacore::TableExprNodeNERegex, casacore::TableExprNodeNEDate, casacore::TableExprNodeGTInt, casacore::TableExprNodeGTDouble, casacore::TableExprNodeGTDComplex, casacore::TableExprNodeGTString, casacore::TableExprNodeGTDate, casacore::TableExprNodeGEInt, casacore::TableExprNodeGEDouble, casacore::TableExprNodeGEDComplex, casacore::TableExprNodeGEString, casacore::TableExprNodeGEDate, casacore::TableExprNodeINInt, casacore::TableExprNodeINDouble, casacore::TableExprNodeINDComplex, casacore::TableExprNodeINString, casacore::TableExprNodeINDate, casacore::TableExprNodeOR, casacore::TableExprNodeAND, casacore::TableExprNodeNOT, casacore::TableExprNodeArrayPart, casacore::TableExprUDFNode, and casacore::TaQLJoinColumnBool.

Referenced by get().

◆ getBoolAS()

MArray< Bool > casacore::TableExprNodeRep::getBoolAS ( const TableExprId id)

Get a value as an array, even it it is a scalar.

This is useful if one could give an argument as scalar or array.

◆ getColumnBool()

virtual Array< Bool > casacore::TableExprNodeRep::getColumnBool ( const Vector< rownr_t > &  rownrs)
virtual

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.

Reimplemented in casacore::TableExprNodeColumn, and casacore::TableExprNodeArrayPart.

◆ getColumnComplex()

virtual Array< Complex > casacore::TableExprNodeRep::getColumnComplex ( const Vector< rownr_t > &  rownrs)
virtual

◆ getColumnDataType()

virtual Bool casacore::TableExprNodeRep::getColumnDataType ( DataType &  ) const
virtual

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.

Reimplemented in casacore::TableExprNodeColumn, casacore::TableExprNodeArrayColumn, and casacore::TableExprNodeArrayPart.

◆ getColumnDComplex()

virtual Array< DComplex > casacore::TableExprNodeRep::getColumnDComplex ( const Vector< rownr_t > &  rownrs)
virtual

◆ getColumnDouble()

virtual Array< Double > casacore::TableExprNodeRep::getColumnDouble ( const Vector< rownr_t > &  rownrs)
virtual

◆ getColumnFloat()

virtual Array< Float > casacore::TableExprNodeRep::getColumnFloat ( const Vector< rownr_t > &  rownrs)
virtual

◆ getColumnInt()

virtual Array< Int > casacore::TableExprNodeRep::getColumnInt ( const Vector< rownr_t > &  rownrs)
virtual

◆ getColumnInt64()

virtual Array< Int64 > casacore::TableExprNodeRep::getColumnInt64 ( const Vector< rownr_t > &  rownrs)
virtual

◆ getColumnShort()

virtual Array< Short > casacore::TableExprNodeRep::getColumnShort ( const Vector< rownr_t > &  rownrs)
virtual

◆ getColumnString()

virtual Array< String > casacore::TableExprNodeRep::getColumnString ( const Vector< rownr_t > &  rownrs)
virtual

◆ getColumnuChar()

virtual Array< uChar > casacore::TableExprNodeRep::getColumnuChar ( const Vector< rownr_t > &  rownrs)
virtual

◆ getColumnuInt()

virtual Array< uInt > casacore::TableExprNodeRep::getColumnuInt ( const Vector< rownr_t > &  rownrs)
virtual

◆ getColumnuShort()

virtual Array< uShort > casacore::TableExprNodeRep::getColumnuShort ( const Vector< rownr_t > &  rownrs)
virtual

◆ getDate()

virtual MVTime casacore::TableExprNodeRep::getDate ( const TableExprId id)
virtual

◆ getDateAS()

MArray< MVTime > casacore::TableExprNodeRep::getDateAS ( const TableExprId id)

◆ getDComplex()

virtual DComplex casacore::TableExprNodeRep::getDComplex ( const TableExprId id)
virtual

◆ getDComplexAS()

MArray< DComplex > casacore::TableExprNodeRep::getDComplexAS ( const TableExprId id)

◆ getDouble()

virtual Double casacore::TableExprNodeRep::getDouble ( const TableExprId id)
virtual

◆ getDoubleAS()

MArray< Double > casacore::TableExprNodeRep::getDoubleAS ( const TableExprId id)

◆ getInt()

virtual Int64 casacore::TableExprNodeRep::getInt ( const TableExprId id)
virtual

◆ getIntAS()

MArray< Int64 > casacore::TableExprNodeRep::getIntAS ( const TableExprId id)

◆ getRegex()

virtual TaqlRegex casacore::TableExprNodeRep::getRegex ( const TableExprId id)
virtual

◆ getShape()

virtual const IPosition & casacore::TableExprNodeRep::getShape ( const TableExprId id)
protectedvirtual

◆ getString()

virtual String casacore::TableExprNodeRep::getString ( const TableExprId id)
virtual

◆ getStringAS()

MArray< String > casacore::TableExprNodeRep::getStringAS ( const TableExprId id)

◆ getTableInfo()

virtual TableExprInfo casacore::TableExprNodeRep::getTableInfo ( ) const
virtual

◆ getUnitFactor()

virtual Double casacore::TableExprNodeRep::getUnitFactor ( ) const
virtual

Get the unit conversion factor.

Default 1 is returned.

Reimplemented in casacore::TableExprNodeUnit, and casacore::TableExprNodeArrayUnit.

◆ isAggregate()

virtual Bool casacore::TableExprNodeRep::isAggregate ( ) const
virtual

Is the node an aggegation node.

The default implementation returns False.

Reimplemented in casacore::TableExprAggrNode, casacore::TableExprAggrNodeArray, and casacore::TableExprUDFNode.

◆ isConstant()

Bool casacore::TableExprNodeRep::isConstant ( ) const
inline

Is the expression a constant?

Definition at line 744 of file ExprNodeRep.h.

References Constant, and exprtype_p.

Referenced by casacore::TableExprNodeIndex::getSlicer().

◆ isDefined()

virtual Bool casacore::TableExprNodeRep::isDefined ( const TableExprId id)
virtual

Is the value in the given row defined? The default implementation returns True.

Reimplemented in casacore::TableExprNodeRecordField, casacore::TableExprNodeRecordFieldArray, and casacore::TableExprNodeArrayColumn.

◆ isLazyAggregate()

virtual Bool casacore::TableExprNodeRep::isLazyAggregate ( ) const
virtual

Is the aggregate function a lazy or an immediate one? The default implementation returns True (because all UDF aggregate functions have to be lazy).

Reimplemented in casacore::TableExprAggrNode, and casacore::TableExprAggrNodeArray.

◆ isReal()

Bool casacore::TableExprNodeRep::isReal ( ) const
inline

Is the data type real (i.e., integer or double)?

Definition at line 724 of file ExprNodeRep.h.

References dtype_p, NTDouble, and NTInt.

◆ makeGroupAggrFunc()

virtual std::shared_ptr< TableExprGroupFuncBase > casacore::TableExprNodeRep::makeGroupAggrFunc ( )
virtual

Create the correct immediate aggregate function object.

The default implementation throws an exception, because it should only be called for TableExprAggrNode(Array).

Reimplemented in casacore::TableExprAggrNode, casacore::TableExprAggrNodeArray, casacore::TableExprUDFNode, and casacore::TableExprUDFNodeArray.

◆ ndim()

Int casacore::TableExprNodeRep::ndim ( ) const
inline

Get the fixed dimensionality (same for all rows).

Definition at line 758 of file ExprNodeRep.h.

References ndim_p.

◆ nrow()

rownr_t casacore::TableExprNodeRep::nrow ( )

Get the number of rows in the table associated with this expression.

One is returned if the expression is a constant or no table is associated with it.

◆ operator=()

TableExprNodeRep & casacore::TableExprNodeRep::operator= ( const TableExprNodeRep )
delete

Assign to a TableExprNodeRep cannot be done.

◆ operType()

TableExprNodeRep::OperType casacore::TableExprNodeRep::operType ( ) const
inline

Get the operator type.

Definition at line 736 of file ExprNodeRep.h.

References optype_p.

◆ optimize()

virtual void casacore::TableExprNodeRep::optimize ( )
virtual

◆ ranges()

virtual void casacore::TableExprNodeRep::ranges ( Block< TableExprRange > &  )
virtual

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 ||.

Reimplemented in casacore::TableExprNodeEQDouble, casacore::TableExprNodeGTDouble, casacore::TableExprNodeGEDouble, casacore::TableExprNodeOR, and casacore::TableExprNodeAND.

◆ replaceConstNode()

static TENShPtr casacore::TableExprNodeRep::replaceConstNode ( const TENShPtr node)
static

Replace a node with a constant expression by node with its value.

◆ setAttributes()

void casacore::TableExprNodeRep::setAttributes ( const Record attributes)
inline

Set the attributes.

Definition at line 754 of file ExprNodeRep.h.

References attributes(), and attributes_p.

◆ setUnit()

void casacore::TableExprNodeRep::setUnit ( const Unit unit)

Set the unit.

It also sets the datatype to NTDouble if it is NTInt.

◆ setValueType()

void casacore::TableExprNodeRep::setValueType ( TableExprNodeRep::ValueType  vtype)
inline

Set the value type.

Definition at line 732 of file ExprNodeRep.h.

References vtype_p.

◆ shape() [1/2]

const IPosition & casacore::TableExprNodeRep::shape ( ) const
inline

Get the fixed shape (same for all rows).

Definition at line 762 of file ExprNodeRep.h.

References shape_p.

◆ shape() [2/2]

const IPosition & casacore::TableExprNodeRep::shape ( const TableExprId id)

Get the shape for the given row.

It returns the fixed shape if defined, otherwise getShape(id).

◆ show()

virtual void casacore::TableExprNodeRep::show ( ostream &  ,
uInt  indent 
) const
virtual

◆ typeString() [1/2]

static String casacore::TableExprNodeRep::typeString ( NodeDataType  )
static

Convert a NodeDataType to a string.

◆ typeString() [2/2]

static String casacore::TableExprNodeRep::typeString ( ValueType  )
static

Convert a ValueType to a string.

◆ unit()

const Unit & casacore::TableExprNodeRep::unit ( ) const
inline

Get the unit.

Definition at line 748 of file ExprNodeRep.h.

References unit_p.

◆ valueType()

TableExprNodeRep::ValueType casacore::TableExprNodeRep::valueType ( ) const
inline

Get the value type.

Definition at line 728 of file ExprNodeRep.h.

References vtype_p.

Referenced by casacore::TableExprGroupAggr::getArray(), and casacore::TableExprNodeSet::toArray().

Member Data Documentation

◆ argtype_p

ArgType casacore::TableExprNodeRep::argtype_p
protected

Definition at line 518 of file ExprNodeRep.h.

◆ attributes_p

Record casacore::TableExprNodeRep::attributes_p
protected

Definition at line 524 of file ExprNodeRep.h.

Referenced by attributes(), and setAttributes().

◆ dtype_p

NodeDataType casacore::TableExprNodeRep::dtype_p
protected

Definition at line 515 of file ExprNodeRep.h.

Referenced by dataType(), and isReal().

◆ exprtype_p

ExprType casacore::TableExprNodeRep::exprtype_p
protected

Definition at line 519 of file ExprNodeRep.h.

Referenced by exprType(), and isConstant().

◆ ndim_p

Int casacore::TableExprNodeRep::ndim_p
protected

Definition at line 520 of file ExprNodeRep.h.

Referenced by ndim().

◆ optype_p

OperType casacore::TableExprNodeRep::optype_p
protected

Definition at line 517 of file ExprNodeRep.h.

Referenced by operType().

◆ shape_p

IPosition casacore::TableExprNodeRep::shape_p
protected

Definition at line 522 of file ExprNodeRep.h.

Referenced by shape().

◆ unit_p

Unit casacore::TableExprNodeRep::unit_p
protected

Definition at line 523 of file ExprNodeRep.h.

Referenced by unit().

◆ vtype_p

ValueType casacore::TableExprNodeRep::vtype_p
protected

Definition at line 516 of file ExprNodeRep.h.

Referenced by setValueType(), and valueType().


The documentation for this class was generated from the following file: