casa
$Rev:20696$
|
Handle class for a table column expression tree. More...
#include <ExprNode.h>
Handle class for a table column expression tree.
Public interface
TableExprNode represents a node in the tree reflecting a table select expression.
TableExprNode is the class to store a table select expression, which allows to select rows from the table. The selected rows form a table which is a view of the original table.
TableExprNode is a handle class for the counted referenced class TableExprNodeRep. Classes (like TableExprNodePlusXX) derived from TableExprNodeRep hold the individual nodes in the expression, i.e. the operators and operands. The nodes form a binary tree reflecting the expression. E.g. the expression 2*COLUMN results in the node TableExprNodeTimes with its children TableExprNodeConst and TableExprNodeColumn. Constant subexpressions (like 2*3) are evaluated immediately and only the result is stored as a node.
There are a few TableExprNode constructors taking a constant scalar or array. In this way constant value are automatically converted to the appropriate TableExprNodeConst object.
The derived classes also reflect the data type of the node. Data types Bool, Double, DComplex and String are used. Char, uChar, Short, uShort, Int, uInt and float are converted to Double and Complex to DComplex. Binary operators +, -, *, /, %, &, }, ^, ==, >=, >, <, <= and != are recognized. Also &&, ||, parentheses and unary +, -, ~ and ! are recognized. For strings the binary operator + can also be used. The operators have the normal C++ precedence. Furthermore functions (like sin, max, ceil) can be used in an expression.
Operator() can be used to take a slice from an array.
The Table function col has to be used to create a TableExprNode object for a column in the table. The Table operator() can be used the do the actual selection from the top TableExprNode object.
// Select from table X all rows where column RA<5 and where column // SWITCH is true. Table table("X"); Table subtable = table(table.col("RA") < 5 && table.col("SWITCH")); // Select from that result all rows where the concatenation of // the strings in columns STR1 and STR2 is equal to the string // in keyword STRKEY. Table subsub = subtable(subtable.col("STR1") + subtable.col("STR2") == subtable.key("STRKEY"));
Having TableExprNode as a handle class makes it possible to handle temporary objects created by the compiler in a smooth way. TableExprNode and its derivations allow to store an expression before actually evaluating it. This also allows the classes to be 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 the designed for these purposes.
Definition at line 558 of file ExprNode.h.
casa::TableExprNode::TableExprNode | ( | const Bool & | value | ) |
Constructors to convert a constant value to a TableExprNode.
The constructor for char* is also supported to convert a character-array to a string, since a two step conversion is not done automatically.
casa::TableExprNode::TableExprNode | ( | const Int64 & | value | ) |
casa::TableExprNode::TableExprNode | ( | const Int & | value | ) |
casa::TableExprNode::TableExprNode | ( | const uInt & | value | ) |
casa::TableExprNode::TableExprNode | ( | const Float & | value | ) |
casa::TableExprNode::TableExprNode | ( | const Double & | value | ) |
casa::TableExprNode::TableExprNode | ( | const Complex & | value | ) |
casa::TableExprNode::TableExprNode | ( | const DComplex & | value | ) |
casa::TableExprNode::TableExprNode | ( | const String & | value | ) |
casa::TableExprNode::TableExprNode | ( | const std::string & | value | ) |
casa::TableExprNode::TableExprNode | ( | const char * | ) |
casa::TableExprNode::TableExprNode | ( | const Regex & | value | ) |
casa::TableExprNode::TableExprNode | ( | const StringDistance & | value | ) |
casa::TableExprNode::TableExprNode | ( | const TaqlRegex & | value | ) |
casa::TableExprNode::TableExprNode | ( | const MVTime & | value | ) |
casa::TableExprNode::TableExprNode | ( | const Array< Bool > & | value | ) |
casa::TableExprNode::TableExprNode | ( | const Array< uChar > & | value | ) |
casa::TableExprNode::TableExprNode | ( | const Array< Short > & | value | ) |
casa::TableExprNode::TableExprNode | ( | const Array< uShort > & | value | ) |
casa::TableExprNode::TableExprNode | ( | const Array< Int > & | value | ) |
casa::TableExprNode::TableExprNode | ( | const Array< uInt > & | value | ) |
casa::TableExprNode::TableExprNode | ( | const Array< Float > & | value | ) |
casa::TableExprNode::TableExprNode | ( | const Array< Double > & | value | ) |
casa::TableExprNode::TableExprNode | ( | const Array< Complex > & | value | ) |
casa::TableExprNode::TableExprNode | ( | const Array< DComplex > & | value | ) |
casa::TableExprNode::TableExprNode | ( | const Array< String > & | value | ) |
casa::TableExprNode::TableExprNode | ( | const Array< MVTime > & | value | ) |
Construct a node from a node representation.
casa::TableExprNode::TableExprNode | ( | const TableExprNode & | ) |
copy constructor (reference semantics).
The destructor deletes all the underlying TableExprNode objects,.
void casa::TableExprNode::adaptUnit | ( | const Unit & | ) |
Adapt the unit of the expression to the given unit (if not empty).
Referenced by casa::TableParseUpdate::adaptUnit().
Bool casa::TableExprNode::checkTableSize | ( | const Table & | table, |
Bool | canBeConst | ||
) | const |
Check if tables used in expression have the same number of rows as the given table.
static PtrBlock<TableExprNodeRep*> casa::TableExprNode::convertBlockTEN | ( | Block< TableExprNode > & | nodes | ) | [static, private] |
convert Block of TableExprNode to PtrBlock of TableExprNodeRep*.
DataType casa::TableExprNode::dataType | ( | ) | const |
Get the data type of the expression.
Currently the only possible values are TpBool, TpInt, TpDouble, TpDComplex, TpString, and TpOther. The latter is returned for a date or regex.
void casa::TableExprNode::get | ( | const TableExprId & | id, |
Bool & | value | ||
) | const [inline] |
Get a value for this node in the given row.
These functions are implemented in the derived classes and will usually invoke the get in their children and apply the operator on the resulting values.
Definition at line 1103 of file ExprNode.h.
References casa::TableExprNodeRep::getBool(), and node_p.
void casa::TableExprNode::get | ( | const TableExprId & | id, |
Int64 & | value | ||
) | const [inline] |
Definition at line 1105 of file ExprNode.h.
References casa::TableExprNodeRep::getInt(), and node_p.
void casa::TableExprNode::get | ( | const TableExprId & | id, |
Double & | value | ||
) | const [inline] |
Definition at line 1107 of file ExprNode.h.
References casa::TableExprNodeRep::getDouble(), and node_p.
void casa::TableExprNode::get | ( | const TableExprId & | id, |
DComplex & | value | ||
) | const [inline] |
Definition at line 1109 of file ExprNode.h.
References casa::TableExprNodeRep::getDComplex(), and node_p.
void casa::TableExprNode::get | ( | const TableExprId & | id, |
String & | value | ||
) | const [inline] |
Definition at line 1111 of file ExprNode.h.
References casa::TableExprNodeRep::getString(), and node_p.
void casa::TableExprNode::get | ( | const TableExprId & | id, |
TaqlRegex & | value | ||
) | const [inline] |
Definition at line 1113 of file ExprNode.h.
References casa::TableExprNodeRep::getRegex(), and node_p.
void casa::TableExprNode::get | ( | const TableExprId & | id, |
MVTime & | value | ||
) | const [inline] |
Definition at line 1115 of file ExprNode.h.
References casa::TableExprNodeRep::getDate(), and node_p.
void casa::TableExprNode::get | ( | const TableExprId & | id, |
Array< Bool > & | value | ||
) | const [inline] |
Definition at line 1117 of file ExprNode.h.
References casa::TableExprNodeRep::getArrayBool(), and node_p.
void casa::TableExprNode::get | ( | const TableExprId & | id, |
Array< Int64 > & | value | ||
) | const [inline] |
Definition at line 1120 of file ExprNode.h.
References casa::TableExprNodeRep::getArrayInt(), and node_p.
void casa::TableExprNode::get | ( | const TableExprId & | id, |
Array< Double > & | value | ||
) | const [inline] |
Definition at line 1123 of file ExprNode.h.
References casa::TableExprNodeRep::getArrayDouble(), and node_p.
void casa::TableExprNode::get | ( | const TableExprId & | id, |
Array< DComplex > & | value | ||
) | const [inline] |
Definition at line 1126 of file ExprNode.h.
References casa::TableExprNodeRep::getArrayDComplex(), and node_p.
void casa::TableExprNode::get | ( | const TableExprId & | id, |
Array< String > & | value | ||
) | const [inline] |
Definition at line 1129 of file ExprNode.h.
References casa::TableExprNodeRep::getArrayString(), and node_p.
void casa::TableExprNode::get | ( | const TableExprId & | id, |
Array< MVTime > & | value | ||
) | const [inline] |
Definition at line 1132 of file ExprNode.h.
References casa::TableExprNodeRep::getArrayDate(), and node_p.
Array< Bool > casa::TableExprNode::getArrayBool | ( | const TableExprId & | id | ) | const [inline] |
Definition at line 1145 of file ExprNode.h.
References casa::TableExprNodeRep::getArrayBool(), and node_p.
Array< DComplex > casa::TableExprNode::getArrayDComplex | ( | const TableExprId & | id | ) | const [inline] |
Definition at line 1151 of file ExprNode.h.
References casa::TableExprNodeRep::getArrayDComplex(), and node_p.
Array< Double > casa::TableExprNode::getArrayDouble | ( | const TableExprId & | id | ) | const [inline] |
Definition at line 1149 of file ExprNode.h.
References casa::TableExprNodeRep::getArrayDouble(), and node_p.
Array< Int64 > casa::TableExprNode::getArrayInt | ( | const TableExprId & | id | ) | const [inline] |
Definition at line 1147 of file ExprNode.h.
References casa::TableExprNodeRep::getArrayInt(), and node_p.
Array< String > casa::TableExprNode::getArrayString | ( | const TableExprId & | id | ) | const [inline] |
Definition at line 1153 of file ExprNode.h.
References casa::TableExprNodeRep::getArrayString(), and node_p.
Bool casa::TableExprNode::getBool | ( | const TableExprId & | id | ) | const [inline] |
Definition at line 1135 of file ExprNode.h.
References casa::TableExprNodeRep::getBool(), and node_p.
Array< Bool > casa::TableExprNode::getBoolAS | ( | const TableExprId & | id | ) | const [inline] |
Get a value as an array, even it it is a scalar.
This is useful in case one can give an argument as scalar or array.
Definition at line 1155 of file ExprNode.h.
References casa::TableExprNodeRep::getBoolAS(), and node_p.
Array< Bool > casa::TableExprNode::getColumnBool | ( | const Vector< uInt > & | rownrs | ) | const [inline] |
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
.
Definition at line 1166 of file ExprNode.h.
References casa::TableExprNodeRep::getColumnBool(), and node_p.
Array< Complex > casa::TableExprNode::getColumnComplex | ( | const Vector< uInt > & | rownrs | ) | const [inline] |
Definition at line 1182 of file ExprNode.h.
References casa::TableExprNodeRep::getColumnComplex(), and node_p.
DataType casa::TableExprNode::getColumnDataType | ( | ) | const |
Get the data type for doing a getColumn on the expression.
This is the data type of the column if the expression consists of a single column only. Otherwise it is the expression data type as returned by function dataType
.
Array< DComplex > casa::TableExprNode::getColumnDComplex | ( | const Vector< uInt > & | rownrs | ) | const [inline] |
Definition at line 1184 of file ExprNode.h.
References casa::TableExprNodeRep::getColumnDComplex(), and node_p.
Array< Double > casa::TableExprNode::getColumnDouble | ( | const Vector< uInt > & | rownrs | ) | const [inline] |
Definition at line 1180 of file ExprNode.h.
References casa::TableExprNodeRep::getColumnDouble(), and node_p.
Array< Float > casa::TableExprNode::getColumnFloat | ( | const Vector< uInt > & | rownrs | ) | const [inline] |
Definition at line 1178 of file ExprNode.h.
References casa::TableExprNodeRep::getColumnFloat(), and node_p.
Array< Int > casa::TableExprNode::getColumnInt | ( | const Vector< uInt > & | rownrs | ) | const [inline] |
Definition at line 1174 of file ExprNode.h.
References casa::TableExprNodeRep::getColumnInt(), and node_p.
Array< Short > casa::TableExprNode::getColumnShort | ( | const Vector< uInt > & | rownrs | ) | const [inline] |
Definition at line 1170 of file ExprNode.h.
References casa::TableExprNodeRep::getColumnShort(), and node_p.
Array< String > casa::TableExprNode::getColumnString | ( | const Vector< uInt > & | rownrs | ) | const [inline] |
Definition at line 1186 of file ExprNode.h.
References casa::TableExprNodeRep::getColumnString(), and node_p.
Array< uChar > casa::TableExprNode::getColumnuChar | ( | const Vector< uInt > & | rownrs | ) | const [inline] |
Definition at line 1168 of file ExprNode.h.
References casa::TableExprNodeRep::getColumnuChar(), and node_p.
Array< uInt > casa::TableExprNode::getColumnuInt | ( | const Vector< uInt > & | rownrs | ) | const [inline] |
Definition at line 1176 of file ExprNode.h.
References casa::TableExprNodeRep::getColumnuInt(), and node_p.
Array< uShort > casa::TableExprNode::getColumnuShort | ( | const Vector< uInt > & | rownrs | ) | const [inline] |
Definition at line 1172 of file ExprNode.h.
References casa::TableExprNodeRep::getColumnuShort(), and node_p.
DComplex casa::TableExprNode::getDComplex | ( | const TableExprId & | id | ) | const [inline] |
Definition at line 1141 of file ExprNode.h.
References casa::TableExprNodeRep::getDComplex(), and node_p.
Array< DComplex > casa::TableExprNode::getDComplexAS | ( | const TableExprId & | id | ) | const [inline] |
Definition at line 1161 of file ExprNode.h.
References casa::TableExprNodeRep::getDComplexAS(), and node_p.
Double casa::TableExprNode::getDouble | ( | const TableExprId & | id | ) | const [inline] |
Definition at line 1139 of file ExprNode.h.
References casa::TableExprNodeRep::getDouble(), and node_p.
Array< Double > casa::TableExprNode::getDoubleAS | ( | const TableExprId & | id | ) | const [inline] |
Definition at line 1159 of file ExprNode.h.
References casa::TableExprNodeRep::getDoubleAS(), and node_p.
Int64 casa::TableExprNode::getInt | ( | const TableExprId & | id | ) | const [inline] |
Definition at line 1137 of file ExprNode.h.
References casa::TableExprNodeRep::getInt(), and node_p.
Array< Int64 > casa::TableExprNode::getIntAS | ( | const TableExprId & | id | ) | const [inline] |
Definition at line 1157 of file ExprNode.h.
References casa::TableExprNodeRep::getIntAS(), and node_p.
const TableExprNodeRep * casa::TableExprNode::getNodeRep | ( | ) | const [inline] |
returns pointer to the representation-object of it
Definition at line 1966 of file ExprNode.h.
References node_p.
TableExprNodeRep * casa::TableExprNode::getRep | ( | ) | [inline, private] |
returns pointer to the representation-object of it
Definition at line 1970 of file ExprNode.h.
References node_p.
String casa::TableExprNode::getString | ( | const TableExprId & | id | ) | const [inline] |
Definition at line 1143 of file ExprNode.h.
References casa::TableExprNodeRep::getString(), and node_p.
Array< String > casa::TableExprNode::getStringAS | ( | const TableExprId & | id | ) | const [inline] |
Definition at line 1163 of file ExprNode.h.
References casa::TableExprNodeRep::getStringAS(), and node_p.
TableExprNode casa::TableExprNode::in | ( | const TableExprNode & | array | ) | const [inline] |
The IN operator to test if a value is contained in an array or set.
The array can also be a scalar.
Definition at line 1260 of file ExprNode.h.
TableExprNode casa::TableExprNode::in | ( | const TableExprNodeSet & | set | ) | const |
Bool casa::TableExprNode::isNull | ( | ) | const [inline] |
Does the node contain no actual node?
Definition at line 862 of file ExprNode.h.
References node_p.
Referenced by casa::TaQLResult::isTable().
Bool casa::TableExprNode::isResultDefined | ( | const TableExprId & | id | ) | const [inline] |
Is the result value defined? Normally it is, but not for a column with an undefined value.
Definition at line 887 of file ExprNode.h.
References casa::TableExprNodeRep::isDefined(), and node_p.
Bool casa::TableExprNode::isScalar | ( | ) | const [inline] |
Is the expression a scalar?
Definition at line 876 of file ExprNode.h.
References node_p, casa::TableExprNodeRep::valueType(), and casa::TableExprNodeRep::VTScalar.
TableExprNodeRep* casa::TableExprNode::newAND | ( | TableExprNodeRep * | right | ) | const [private] |
static TableExprNode casa::TableExprNode::newArrayPartNode | ( | const TableExprNode & | arrayNode, |
const TableExprNodeSet & | indices, | ||
const TaQLStyle & | = TaQLStyle(0) |
||
) | [static] |
Create ArrayElement node for the given array with the given index.
The origin is 0 for C++ and 1 for TaQL.
Referenced by operator()().
TableExprNodeRep* casa::TableExprNode::newBitAnd | ( | TableExprNodeRep * | right | ) | const [private] |
Referenced by casa::operator&().
TableExprNodeRep* casa::TableExprNode::newBitOr | ( | TableExprNodeRep * | right | ) | const [private] |
Referenced by casa::operator|().
TableExprNodeRep* casa::TableExprNode::newBitXor | ( | TableExprNodeRep * | right | ) | const [private] |
Referenced by casa::operator^().
static TableExprNode casa::TableExprNode::newColumnNode | ( | const Table & | tab, |
const String & | name, | ||
const Vector< String > & | fieldNames | ||
) | [static] |
Create a column node on behalf of the Table class.
For builtin data types another type of node is created than for other data types. isArray indicates if the column should be an array column.
static TableExprNode casa::TableExprNode::newConeNode | ( | TableExprFuncNode::FunctionType | , |
const TableExprNodeSet & | set, | ||
uInt | origin = 0 |
||
) | [static] |
Create cone function node of the given type with the given arguments.
Referenced by casa::anyCone(), casa::cones(), and casa::findCone().
static TableExprNode casa::TableExprNode::newConeNode | ( | TableExprFuncNode::FunctionType | , |
const TableExprNode & | node1, | ||
const TableExprNode & | node2 | ||
) | [static] |
static TableExprNode casa::TableExprNode::newConeNode | ( | TableExprFuncNode::FunctionType | , |
const TableExprNode & | node1, | ||
const TableExprNode & | node2, | ||
const TableExprNode & | node3 | ||
) | [static] |
TableExprNodeRep* casa::TableExprNode::newDivide | ( | TableExprNodeRep * | right | ) | const [private] |
Referenced by casa::operator/().
TableExprNodeRep* casa::TableExprNode::newEQ | ( | TableExprNodeRep * | right | ) | const [private] |
Referenced by casa::operator==().
static TableExprNode casa::TableExprNode::newFunctionNode | ( | TableExprFuncNode::FunctionType | , |
const TableExprNodeSet & | set, | ||
const Table & | table, | ||
const TaQLStyle & | = TaQLStyle(0) |
||
) | [static] |
Create function node of the given type with the given arguments.
Referenced by casa::abs(), casa::acos(), casa::all(), casa::alls(), casa::amplitude(), casa::angdist(), casa::any(), casa::anys(), casa::arg(), casa::array(), casa::asin(), casa::atan(), casa::atan2(), casa::avdev(), casa::avdevs(), casa::boxedAll(), casa::boxedAny(), casa::boxedAvdev(), casa::boxedMax(), casa::boxedMean(), casa::boxedMedian(), casa::boxedMin(), casa::boxedRms(), casa::boxedStddev(), casa::boxedVariance(), casa::cdate(), casa::cdow(), casa::ceil(), casa::cmonth(), casa::conj(), casa::cos(), casa::cosh(), casa::ctime(), casa::ctodt(), casa::cube(), casa::date(), casa::datetime(), casa::day(), casa::dms(), casa::downcase(), casa::exp(), casa::floor(), casa::fmod(), casa::formComplex(), casa::fractile(), casa::fractiles(), casa::hdms(), casa::hms(), casa::iif(), casa::imag(), casa::integer(), casa::isdefined(), casa::isFinite(), casa::isInf(), casa::isNaN(), casa::log(), casa::log10(), casa::ltrim(), casa::max(), casa::maxs(), casa::mean(), casa::means(), casa::median(), casa::medians(), casa::min(), casa::mins(), casa::mjd(), casa::mjdtodate(), casa::month(), casa::ndim(), casa::near(), casa::nearAbs(), casa::nelements(), casa::nfalse(), casa::nfalses(), casa::norm(), casa::ntrue(), casa::ntrues(), casa::pattern(), casa::phase(), casa::pow(), casa::product(), casa::products(), casa::real(), casa::regex(), casa::replace(), casa::rms(), casa::rmss(), casa::round(), casa::rtrim(), casa::runningAll(), casa::runningAny(), casa::runningAvdev(), casa::runningMax(), casa::runningMean(), casa::runningMedian(), casa::runningMin(), casa::runningRms(), casa::runningStddev(), casa::runningVariance(), casa::shape(), casa::sign(), casa::sin(), casa::sinh(), casa::sqlpattern(), casa::sqrt(), casa::square(), casa::stddev(), casa::stddevs(), casa::strlength(), casa::substr(), casa::sum(), casa::sums(), casa::sumSquare(), casa::sumSquares(), casa::tan(), casa::tanh(), casa::trim(), casa::upcase(), casa::variance(), casa::variances(), casa::week(), casa::weekday(), and casa::year().
static TableExprNode casa::TableExprNode::newFunctionNode | ( | TableExprFuncNode::FunctionType | , |
const TableExprNode & | node | ||
) | [static] |
static TableExprNode casa::TableExprNode::newFunctionNode | ( | TableExprFuncNode::FunctionType | , |
const TableExprNode & | node1, | ||
const TableExprNode & | node2 | ||
) | [static] |
static TableExprNode casa::TableExprNode::newFunctionNode | ( | TableExprFuncNode::FunctionType | , |
const TableExprNode & | node1, | ||
const TableExprNode & | node2, | ||
const TableExprNode & | node3 | ||
) | [static] |
static TableExprNode casa::TableExprNode::newFunctionNode | ( | TableExprFuncNode::FunctionType | , |
const TableExprNode & | array, | ||
const TableExprNodeSet & | axes | ||
) | [static] |
static TableExprNode casa::TableExprNode::newFunctionNode | ( | TableExprFuncNode::FunctionType | , |
const TableExprNode & | array, | ||
const TableExprNode & | node, | ||
const TableExprNodeSet & | axes | ||
) | [static] |
TableExprNodeRep* casa::TableExprNode::newGE | ( | TableExprNodeRep * | right | ) | const [private] |
Referenced by casa::operator<=(), and casa::operator>=().
TableExprNodeRep* casa::TableExprNode::newGT | ( | TableExprNodeRep * | right | ) | const [private] |
Referenced by casa::operator<(), and casa::operator>().
TableExprNodeRep* casa::TableExprNode::newIN | ( | TableExprNodeRep * | right | ) | const [private] |
Referenced by in().
static TableExprNode casa::TableExprNode::newKeyConst | ( | const TableRecord & | , |
const Vector< String > & | fieldNames | ||
) | [static] |
Create a TableExprNodeConst for a table keyword (which is handled as a constant).
TableExprNodeRep* casa::TableExprNode::newMinus | ( | TableExprNodeRep * | right | ) | const [private] |
Referenced by casa::operator-().
TableExprNodeRep* casa::TableExprNode::newModulo | ( | TableExprNodeRep * | right | ) | const [private] |
Referenced by casa::operator%().
TableExprNodeRep* casa::TableExprNode::newNE | ( | TableExprNodeRep * | right | ) | const [private] |
Referenced by casa::operator!=().
TableExprNodeRep* casa::TableExprNode::newOR | ( | TableExprNodeRep * | right | ) | const [private] |
TableExprNodeRep* casa::TableExprNode::newPlus | ( | TableExprNodeRep * | right | ) | const [private] |
Construct a new node for the given operation.
Referenced by casa::operator+().
static TableExprNode casa::TableExprNode::newRandomNode | ( | const Table & | table | ) | [static] |
Create rand() function node.
static TableExprNode casa::TableExprNode::newRowidNode | ( | const Table & | table | ) | [static] |
Create rowid() function node.
Origin is always 0.
static TableExprNode casa::TableExprNode::newRownrNode | ( | const Table & | table, |
uInt | origin | ||
) | [static] |
Create rownumber() function node.
Origin indicates whether the first row should be zero (for C++ binding) or an other value (one for TaQL binding).
TableExprNodeRep* casa::TableExprNode::newTimes | ( | TableExprNodeRep * | right | ) | const [private] |
Referenced by casa::operator*().
static TableExprNode casa::TableExprNode::newUDFNode | ( | const String & | name, |
const TableExprNodeSet & | set, | ||
const Table & | table, | ||
const TaQLStyle & | = TaQLStyle(0) |
||
) | [static] |
Create a user defined function node.
uInt casa::TableExprNode::nrow | ( | ) | const [inline] |
Get the number of rows in the table associated with this expression.
One is returned if the expression is a constant. Zero is returned if no table is associated with it.
Definition at line 882 of file ExprNode.h.
References node_p, and casa::TableExprNodeRep::nrow().
TableExprNode casa::TableExprNode::operator! | ( | ) | const |
Unary NOT-operator on boolean TableExprNode's.
TableExprNode casa::TableExprNode::operator() | ( | const TableExprNodeSet & | indices | ) | [inline] |
Slicing in a node containing an array.
It is possible to address a single pixel or an n-dimensional subarray. In case of a single pixel the result is a scalar node. Otherwise the result is an array node with the same dimensionality as the source.
Note that there exist TableExprNodeSet constructors to convert an IPosition
or Slicer
object automatically to a TableExprNodeSet
. An IPosition
addresses a single element and results in a scalar node, while a Slicer
can address multiple elements and always results in an array node.
C++ indexing is 0-based.
Definition at line 1264 of file ExprNode.h.
References newArrayPartNode().
TableExprNode casa::TableExprNode::operator+ | ( | ) | const |
Unary operators on numeric TableExprNode's.
TableExprNode casa::TableExprNode::operator- | ( | ) | const |
TableExprNode& casa::TableExprNode::operator= | ( | const TableExprNode & | ) |
Assignment (reference semantics).
TableExprNode casa::TableExprNode::operator~ | ( | ) | const |
Unary bitwise negate-operator on integer TableExprNode's.
void casa::TableExprNode::ranges | ( | Block< TableExprRange > & | blrange | ) | [inline] |
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 ||.
Definition at line 1095 of file ExprNode.h.
References node_p, and casa::TableExprNodeRep::ranges().
void casa::TableExprNode::show | ( | ostream & | os | ) | const [inline] |
Show the tree.
Definition at line 1962 of file ExprNode.h.
References node_p, and casa::TableExprNodeRep::show().
const Table & casa::TableExprNode::table | ( | ) | const [inline] |
Get table.
This gets the Table object to which a TableExprNode belongs. A TableExprNode belongs to the Table to which the column(s) used in an expression belong. Note that all columns in an expression have to belong to the same table.
Definition at line 1099 of file ExprNode.h.
References node_p, and casa::TableExprNodeRep::table().
static void casa::TableExprNode::throwInvDT | ( | const String & | message | ) | [static] |
Throw invalid data type exception.
const Unit& casa::TableExprNode::unit | ( | ) | const [inline] |
Get the unit of the expression.
Definition at line 866 of file ExprNode.h.
References node_p, and casa::TableExprNodeRep::unit().
TableExprNode casa::TableExprNode::useUnit | ( | const Unit & | unit | ) | const |
Use a unit for the given TableExprNode.
Note that if a column has a unit, it is automatically set. In that case this can be used to convert units.
TableExprNode abs | ( | const TableExprNode & | node | ) | [friend] |
TableExprNode acos | ( | const TableExprNode & | node | ) | [friend] |
TableExprNode all | ( | const TableExprNode & | array | ) | [friend] |
TableExprNode alls | ( | const TableExprNode & | array, |
const TableExprNodeSet & | collapseAxes | ||
) | [friend] |
TableExprNode amplitude | ( | const TableExprNode & | node | ) | [friend] |
The amplitude (i.e.
sqrt(re*re + im*im)) of a complex node. This is a synonym for function abs. Defined for scalars and arrays.
TableExprNode angdist | ( | const TableExprNode & | pos1, |
const TableExprNode & | pos2 | ||
) | [friend] |
Angular distance between positions.
Both arguments have to be arrays. If both arrays contain 2 values (ra and dec), the result is a scalar. Otherwise the arrays have to contain a multiple of 2 values and the result is a 2-dim array giving the distance of each position in the first array to each position in the second array.
TableExprNode any | ( | const TableExprNode & | array | ) | [friend] |
TableExprNode anyCone | ( | const TableExprNode & | sourcePos, |
const TableExprNode & | cones | ||
) | [friend] |
The result is always a Bool scalar telling if any cone contains the source.
TableExprNode anyCone | ( | const TableExprNode & | sourcePos, |
const TableExprNode & | conePos, | ||
const TableExprNode & | radii | ||
) | [friend] |
TableExprNode anys | ( | const TableExprNode & | array, |
const TableExprNodeSet & | collapseAxes | ||
) | [friend] |
TableExprNode arg | ( | const TableExprNode & | node | ) | [friend] |
The arg (i.e.
atan2(im, re)) of a complex node. Defined for scalars and arrays.
TableExprNode array | ( | const TableExprNode & | values, |
const TableExprNodeSet & | shape | ||
) | [friend] |
Create an array of the given shape and fill it with the values.
The values
array is rewound as needed.
TableExprNode asin | ( | const TableExprNode & | node | ) | [friend] |
Transcendental functions applied to to nodes containing scalars or arrays with double values.
They are invalid for Complex nodes.
TableExprNode atan | ( | const TableExprNode & | node | ) | [friend] |
TableExprNode atan2 | ( | const TableExprNode & | y, |
const TableExprNode & | x | ||
) | [friend] |
TableExprNode avdev | ( | const TableExprNode & | array | ) | [friend] |
TableExprNode avdevs | ( | const TableExprNode & | array, |
const TableExprNodeSet & | collapseAxes | ||
) | [friend] |
TableExprNode cdate | ( | const TableExprNode & | node | ) | [friend] |
TableExprNode cdow | ( | const TableExprNode & | node | ) | [friend] |
TableExprNode ceil | ( | const TableExprNode & | node | ) | [friend] |
TableExprNode cmonth | ( | const TableExprNode & | node | ) | [friend] |
TableExprNode cones | ( | const TableExprNode & | sourcePos, |
const TableExprNode & | cones | ||
) | [friend] |
Cone search; test if the position of a source is inside a cone.
Argument sourcePos
must be a double array containing two values (ra and dec of source) in radians.
Argument cones
must be a double array specifying the position of the cone centers and radii in radians. So the array must contain three values (ra,dec,radius) or a multiple of it.
The result is a bool array telling for each cone if it contains the source. If there is only one cone, the result is a scalar.
TableExprNode cones | ( | const TableExprNode & | sourcePos, |
const TableExprNode & | conePos, | ||
const TableExprNode & | radii | ||
) | [friend] |
Cone search as above.
However, the cone positions and radii are specified separately and (virtually) a larger array containing every combination of position/radius is formed.
TableExprNode conj | ( | const TableExprNode & | node | ) | [friend] |
The complex conjugate of a complex node.
Defined for scalars and arrays.
TableExprNode cos | ( | const TableExprNode & | node | ) | [friend] |
TableExprNode cosh | ( | const TableExprNode & | node | ) | [friend] |
TableExprNode ctime | ( | const TableExprNode & | node | ) | [friend] |
TableExprNode ctodt | ( | const TableExprNode & | node | ) | [friend] |
TableExprNode cube | ( | const TableExprNode & | node | ) | [friend] |
TableExprNode date | ( | const TableExprNode & | node | ) | [friend] |
TableExprNode datetime | ( | const TableExprNode & | node | ) | [friend] |
Functions for date-values.
Defined for scalars and arrays.
TableExprNode day | ( | const TableExprNode & | node | ) | [friend] |
TableExprNode downcase | ( | const TableExprNode & | node | ) | [friend] |
TableExprNode exp | ( | const TableExprNode & | node | ) | [friend] |
TableExprNode findCone | ( | const TableExprNode & | sourcePos, |
const TableExprNode & | cones | ||
) | [friend] |
The sourcePos can contain multiple sources.
The result is a double array giving the index of the first cone containing the corresponding source. If there is one source, the result is a double scalar.
TableExprNode findCone | ( | const TableExprNode & | sourcePos, |
const TableExprNode & | conePos, | ||
const TableExprNode & | radii | ||
) | [friend] |
TableExprNode floor | ( | const TableExprNode & | node | ) | [friend] |
TableExprNode fmod | ( | const TableExprNode & | x, |
const TableExprNode & | y | ||
) | [friend] |
TableExprNode formComplex | ( | const TableExprNode & | real, |
const TableExprNode & | imag | ||
) | [friend] |
Form a complex number from two Doubles.
One or both arguments can be scalar or array.
TableExprNode fractile | ( | const TableExprNode & | array, |
const TableExprNode & | fraction | ||
) | [friend] |
TableExprNode fractiles | ( | const TableExprNode & | array, |
const TableExprNode & | fraction, | ||
const TableExprNodeSet & | collapseAxes | ||
) | [friend] |
TableExprNode iif | ( | const TableExprNode & | condition, |
const TableExprNode & | arg1, | ||
const TableExprNode & | arg2 | ||
) | [friend] |
Function resembling the ternary ?:
construct in C++.
The argument "condition" has to be a Bool value. If an element in "condition" is True, the corresponding element from "arg1" is taken, otherwise it is taken from "arg2". The arguments can be scalars or array or any combination.
TableExprNode imag | ( | const TableExprNode & | node | ) | [friend] |
The imaginary part of a complex node.
Defined for scalars and arrays.
TableExprNode isdefined | ( | const TableExprNode & | array | ) | [friend] |
Function operating on a field resulting in a bool scalar.
It can be used to test if a column has an array in the current row. It can also be used to test if a record contains a field.
TableExprNode isFinite | ( | const TableExprNode & | node | ) | [friend] |
Function to test if a scalar or array is finite.
It results in a Bool scalar or array.
TableExprNode isNaN | ( | const TableExprNode & | node | ) | [friend] |
Function to test if a scalar or array is NaN (not-a-number).
It results in a Bool scalar or array.
TableExprNode log | ( | const TableExprNode & | node | ) | [friend] |
TableExprNode log10 | ( | const TableExprNode & | node | ) | [friend] |
TableExprNode ltrim | ( | const TableExprNode & | node | ) | [friend] |
TableExprNode max | ( | const TableExprNode & | a, |
const TableExprNode & | b | ||
) | [friend] |
TableExprNode max | ( | const TableExprNode & | array | ) | [friend] |
TableExprNode maxs | ( | const TableExprNode & | array, |
const TableExprNodeSet & | collapseAxes | ||
) | [friend] |
TableExprNode mean | ( | const TableExprNode & | array | ) | [friend] |
TableExprNode means | ( | const TableExprNode & | array, |
const TableExprNodeSet & | collapseAxes | ||
) | [friend] |
TableExprNode median | ( | const TableExprNode & | array | ) | [friend] |
TableExprNode medians | ( | const TableExprNode & | array, |
const TableExprNodeSet & | collapseAxes | ||
) | [friend] |
TableExprNode min | ( | const TableExprNode & | a, |
const TableExprNode & | b | ||
) | [friend] |
Minimum or maximum of 2 nodes.
Makes sense for numeric and String values. For Complex values the norm is compared. One or both arguments can be scalar or array.
TableExprNode min | ( | const TableExprNode & | array | ) | [friend] |
Functions operating on a Double scalar or array resulting in a Double scalar.
TableExprNode mins | ( | const TableExprNode & | array, |
const TableExprNodeSet & | collapseAxes | ||
) | [friend] |
TableExprNode mjd | ( | const TableExprNode & | node | ) | [friend] |
TableExprNode mjdtodate | ( | const TableExprNode & | node | ) | [friend] |
TableExprNode month | ( | const TableExprNode & | node | ) | [friend] |
TableExprNode ndim | ( | const TableExprNode & | array | ) | [friend] |
TableExprNode near | ( | const TableExprNode & | left, |
const TableExprNode & | right | ||
) | [friend] |
Functions to return whether a value is "relatively" near another.
Returns tol > abs(val2 - val1)/max(abs(val1),(val2))
. If tol <= 0, returns val1 == val2. If either val is 0.0, takes care of area around the minimum number that can be represented.
The nearAbs functions return whether a value is "absolutely" near another. Returns tol > abs(val2 - val1)
. Default tolerance is 1.0e-13. They operate on scalars and arrays.
TableExprNode near | ( | const TableExprNode & | left, |
const TableExprNode & | right, | ||
const TableExprNode & | tolerance | ||
) | [friend] |
TableExprNode nearAbs | ( | const TableExprNode & | left, |
const TableExprNode & | right | ||
) | [friend] |
TableExprNode nearAbs | ( | const TableExprNode & | left, |
const TableExprNode & | right, | ||
const TableExprNode & | tolerance | ||
) | [friend] |
TableExprNode nelements | ( | const TableExprNode & | array | ) | [friend] |
Functions operating on any scalar or array resulting in a Double scalar.
A scalar has 1 element and dimensionality 0.
TableExprNode nfalse | ( | const TableExprNode & | array | ) | [friend] |
TableExprNode nfalses | ( | const TableExprNode & | array, |
const TableExprNodeSet & | collapseAxes | ||
) | [friend] |
TableExprNode norm | ( | const TableExprNode & | node | ) | [friend] |
TableExprNode ntrue | ( | const TableExprNode & | array | ) | [friend] |
TableExprNode ntrues | ( | const TableExprNode & | array, |
const TableExprNodeSet & | collapseAxes | ||
) | [friend] |
TableExprNode operator!= | ( | const TableExprNode & | left, |
const TableExprNode & | right | ||
) | [friend] |
TableExprNode operator% | ( | const TableExprNode & | left, |
const TableExprNode & | right | ||
) | [friend] |
TableExprNode operator& | ( | const TableExprNode & | left, |
const TableExprNode & | right | ||
) | [friend] |
TableExprNode operator&& | ( | const TableExprNode & | left, |
const TableExprNode & | right | ||
) | [friend] |
Logical operators to combine boolean TableExprNode's.
A null TableExprNode object is ignored, so it is possible to build up a full expression gradually.
TableExprNode operator* | ( | const TableExprNode & | left, |
const TableExprNode & | right | ||
) | [friend] |
TableExprNode operator+ | ( | const TableExprNode & | left, |
const TableExprNode & | right | ||
) | [friend] |
Define all global functions as friends.
Arithmetic operators for numeric TableExprNode's.
+ is also defined for strings (means concatenation).
TableExprNode operator- | ( | const TableExprNode & | left, |
const TableExprNode & | right | ||
) | [friend] |
TableExprNode operator/ | ( | const TableExprNode & | left, |
const TableExprNode & | right | ||
) | [friend] |
TableExprNode operator< | ( | const TableExprNode & | left, |
const TableExprNode & | right | ||
) | [friend] |
TableExprNode operator<= | ( | const TableExprNode & | left, |
const TableExprNode & | right | ||
) | [friend] |
TableExprNode operator== | ( | const TableExprNode & | left, |
const TableExprNode & | right | ||
) | [friend] |
Comparison operators.
TableExprNode operator> | ( | const TableExprNode & | left, |
const TableExprNode & | right | ||
) | [friend] |
TableExprNode operator>= | ( | const TableExprNode & | left, |
const TableExprNode & | right | ||
) | [friend] |
Not defined for Bool.
TableExprNode operator^ | ( | const TableExprNode & | left, |
const TableExprNode & | right | ||
) | [friend] |
TableExprNode operator| | ( | const TableExprNode & | left, |
const TableExprNode & | right | ||
) | [friend] |
TableExprNode operator|| | ( | const TableExprNode & | left, |
const TableExprNode & | right | ||
) | [friend] |
TableExprNode pattern | ( | const TableExprNode & | node | ) | [friend] |
TableExprNode phase | ( | const TableExprNode & | node | ) | [friend] |
The phase (i.e.
atan2(im, re)) of a complex node. This is a synonym for function arg. Defined for scalars and arrays.
TableExprNode pow | ( | const TableExprNode & | x, |
const TableExprNode & | exp | ||
) | [friend] |
TableExprNode product | ( | const TableExprNode & | array | ) | [friend] |
TableExprNode products | ( | const TableExprNode & | array, |
const TableExprNodeSet & | collapseAxes | ||
) | [friend] |
TableExprNode real | ( | const TableExprNode & | node | ) | [friend] |
The real part of a complex node.
Defined for scalars and arrays.
TableExprNode regex | ( | const TableExprNode & | node | ) | [friend] |
Functions for regular expression matching and pattern matching.
Defined for scalars and arrays.
pattern
is for a file name like pattern.
sqlpattern
is for an SQL like pattern.
TableExprNode replace | ( | const TableExprNode & | str, |
const TableExprNode & | patt | ||
) | [friend] |
TableExprNode replace | ( | const TableExprNode & | str, |
const TableExprNode & | patt, | ||
const TableExprNode & | repl | ||
) | [friend] |
TableExprNode rms | ( | const TableExprNode & | array | ) | [friend] |
TableExprNode rmss | ( | const TableExprNode & | array, |
const TableExprNodeSet & | collapseAxes | ||
) | [friend] |
TableExprNode round | ( | const TableExprNode & | node | ) | [friend] |
TableExprNode rtrim | ( | const TableExprNode & | node | ) | [friend] |
TableExprNode runningAll | ( | const TableExprNode & | array | ) | [friend] |
TableExprNode runningAny | ( | const TableExprNode & | array | ) | [friend] |
TableExprNode runningAvdev | ( | const TableExprNode & | array | ) | [friend] |
TableExprNode runningMax | ( | const TableExprNode & | array | ) | [friend] |
TableExprNode runningMean | ( | const TableExprNode & | array | ) | [friend] |
TableExprNode runningMedian | ( | const TableExprNode & | array | ) | [friend] |
TableExprNode runningMin | ( | const TableExprNode & | array | ) | [friend] |
TableExprNode runningRms | ( | const TableExprNode & | array | ) | [friend] |
TableExprNode runningStddev | ( | const TableExprNode & | array | ) | [friend] |
TableExprNode runningVariance | ( | const TableExprNode & | array | ) | [friend] |
TableExprNode shape | ( | const TableExprNode & | array | ) | [friend] |
Function operating on any scalar or array resulting in a Double array containing the shape.
A scalar has shape [1].
TableExprNode sign | ( | const TableExprNode & | node | ) | [friend] |
TableExprNode sin | ( | const TableExprNode & | node | ) | [friend] |
Transcendental functions that can be applied to essentially all numeric nodes containing scalars or arrays.
TableExprNode sinh | ( | const TableExprNode & | node | ) | [friend] |
TableExprNode sqlpattern | ( | const TableExprNode & | node | ) | [friend] |
TableExprNode sqrt | ( | const TableExprNode & | node | ) | [friend] |
TableExprNode square | ( | const TableExprNode & | node | ) | [friend] |
TableExprNode stddev | ( | const TableExprNode & | array | ) | [friend] |
TableExprNode stddevs | ( | const TableExprNode & | array, |
const TableExprNodeSet & | collapseAxes | ||
) | [friend] |
TableExprNode strlength | ( | const TableExprNode & | node | ) | [friend] |
String functions on scalars or arrays.
TableExprNode substr | ( | const TableExprNode & | str, |
const TableExprNode & | pos | ||
) | [friend] |
TableExprNode substr | ( | const TableExprNode & | str, |
const TableExprNode & | pos, | ||
const TableExprNode & | npos | ||
) | [friend] |
TableExprNode sum | ( | const TableExprNode & | array | ) | [friend] |
Functions operating on a Double or Complex scalar or array resulting in a scalar with the same data type.
TableExprNode sums | ( | const TableExprNode & | array, |
const TableExprNodeSet & | collapseAxes | ||
) | [friend] |
The partial version of the functions above.
They are applied to the array subsets defined by the axes in the set using the partialXXX functions in ArrayMath. The axes must be 0-relative.
TableExprNode sumSquare | ( | const TableExprNode & | array | ) | [friend] |
TableExprNode sumSquares | ( | const TableExprNode & | array, |
const TableExprNodeSet & | collapseAxes | ||
) | [friend] |
friend class TableExprNodeRep [friend] |
Definition at line 561 of file ExprNode.h.
friend class TableParse [friend] |
Definition at line 562 of file ExprNode.h.
TableExprNode tan | ( | const TableExprNode & | node | ) | [friend] |
TableExprNode tanh | ( | const TableExprNode & | node | ) | [friend] |
TableExprNode time | ( | const TableExprNode & | node | ) | [friend] |
TableExprNode trim | ( | const TableExprNode & | node | ) | [friend] |
TableExprNode upcase | ( | const TableExprNode & | node | ) | [friend] |
TableExprNode variance | ( | const TableExprNode & | array | ) | [friend] |
TableExprNode variances | ( | const TableExprNode & | array, |
const TableExprNodeSet & | collapseAxes | ||
) | [friend] |
TableExprNode week | ( | const TableExprNode & | node | ) | [friend] |
TableExprNode weekday | ( | const TableExprNode & | node | ) | [friend] |
TableExprNode year | ( | const TableExprNode & | node | ) | [friend] |
TableExprNodeRep* casa::TableExprNode::node_p [private] |
The actual (counted referenced) representation of a node.
Definition at line 1090 of file ExprNode.h.
Referenced by get(), getArrayBool(), getArrayDComplex(), getArrayDouble(), getArrayInt(), getArrayString(), getBool(), getBoolAS(), getColumnBool(), getColumnComplex(), getColumnDComplex(), getColumnDouble(), getColumnFloat(), getColumnInt(), getColumnShort(), getColumnString(), getColumnuChar(), getColumnuInt(), getColumnuShort(), getDComplex(), getDComplexAS(), getDouble(), getDoubleAS(), getInt(), getIntAS(), getNodeRep(), getRep(), getString(), getStringAS(), in(), isNull(), isResultDefined(), isScalar(), nrow(), casa::operator!=(), casa::operator%(), casa::operator&(), casa::operator*(), casa::operator+(), casa::operator-(), casa::operator/(), casa::operator<(), casa::operator<=(), casa::operator==(), casa::operator>(), casa::operator>=(), casa::operator^(), casa::operator|(), ranges(), show(), table(), and unit().