28 #ifndef TABLES_EXPRNODEREP_H 29 #define TABLES_EXPRNODEREP_H 32 #include <casacore/casa/aips.h> 33 #include <casacore/tables/Tables/Table.h> 34 #include <casacore/tables/TaQL/TableExprId.h> 35 #include <casacore/tables/TaQL/ExprRange.h> 36 #include <casacore/tables/TaQL/MArray.h> 37 #include <casacore/casa/BasicSL/Complex.h> 38 #include <casacore/casa/Quanta/MVTime.h> 39 #include <casacore/casa/Quanta/Unit.h> 40 #include <casacore/casa/Utilities/DataType.h> 41 #include <casacore/casa/Utilities/Regex.h> 42 #include <casacore/casa/Utilities/StringDistance.h> 43 #include <casacore/casa/iosfwd.h> 49 class TableExprNodeColumn;
50 class TableExprGroupFuncBase;
51 template<
class T>
class Block;
185 OtColumn, OtField, OtLiteral, OtFunc, OtSlice,
OtUndef,
191 NoArr, ArrArr, ArrSca, ScaArr
228 virtual void disableApplySelection();
232 virtual void applySelection (
const Vector<uInt>& rownrs);
236 virtual Double getUnitFactor()
const;
243 virtual void getAggrNodes (vector<TableExprNodeRep*>& aggr);
246 virtual void getColumnNodes (vector<TableExprNodeRep*>& cols);
256 virtual Bool isLazyAggregate()
const;
288 {
value = getBool (
id); }
290 {
value = getInt (
id); }
292 {
value = getDouble (
id); }
294 {
value = getDComplex (
id); }
296 {
value = getDate (
id); }
298 {
value = getString (
id); }
300 {
value = getArrayBool (
id); }
302 {
value = getArrayInt (
id); }
304 {
value = getArrayDouble (
id); }
306 {
value = getArrayDComplex (
id); }
308 {
value = getArrayDate (
id); }
310 {
value = getArrayString (
id); }
356 virtual Bool getColumnDataType (DataType&)
const;
410 Bool isConstant()
const;
413 const Unit& unit()
const;
417 void setUnit (
const Unit& unit);
434 virtual void show (ostream&,
uInt indent)
const;
441 const Table& table()
const;
446 virtual void adaptSetUnits (
const Unit&);
485 virtual void convertConstChild();
491 static void checkTablePtr (
Table& table,
506 Bool convertConstType);
564 virtual void show (ostream&,
uInt indent)
const;
567 virtual void getAggrNodes (vector<TableExprNodeRep*>& aggr);
570 virtual void getColumnNodes (vector<TableExprNodeRep*>& cols);
589 Bool convertConstType,
595 virtual void handleUnits();
600 void convertConstChild();
671 virtual void show (ostream&,
uInt indent)
const;
674 virtual void getAggrNodes (vector<TableExprNodeRep*>& aggr);
677 virtual void getColumnNodes (vector<TableExprNodeRep*>& cols);
687 {
return operands_p; }
706 {
return dtype_p==NTInt || dtype_p==NTDouble; }
722 {
return exprtype_p; }
726 {
return (exprtype_p == Constant); }
747 { checkTablePtr (table_p, node); }
749 { fillExprType (exprtype_p, node); }
A Vector of integers, for indexing into Array<T> objects.
long long Int64
Define the extra non-standard types used by Casacore (like proposed uSize, Size)
void fillExprType(const TableExprNodeRep *node)
Set expression type to Variable if node is Variable.
TaqlRegex(const Regex ®ex)
Construct from a regex.
Bool matches(const string &str, Int pos=0) const
Matches entire string from pos (or till pos if negative pos).
Main interface class to a read/write table.
const PtrBlock< TableExprNodeRep * > & getChildren() const
Get the child nodes.
Int ndim() const
Get the fixed dimensionality (same for all rows).
const TableExprNodeRep * getRightChild() const
Handle class for a table column expression tree.
A constant subexpression which can be evaluated immediately.
PtrHolder< T > & operator=(const PtrHolder< T > &other)
Scalar column in table select expression tree.
PtrBlock< TableExprNodeRep * > operands_p
Bool match(const String &str) const
Does the regex or maximum string distance match?
TaqlRegex(const StringDistance &dist)
Construct from a StringDistance.
NodeDataType
Define the data types of a node.
Abstract base class for a node in a table column expression tree.
const TableExprNodeRep * getLeftChild() const
Get the child nodes.
Bool empty() const
Test for empty.
ValueType valueType() const
Get the value type.
void setValueType(ValueType vtype)
Set the value type.
const IPosition & shape() const
Get the fixed shape (same for all rows).
ExprType
Define (sub-)expression type.
ArgType
Define the value types of the 2 arguments when arrays are involved.
NodeDataType dataType() const
Get the data type of the derived TableExprNode object.
Referenced counted pointer for constant data.
Abstract base class for a node having multiple child nodes.
std::complex< Double > DComplex
OperType
Define the operator types.
Regular expression class.
LatticeExprNode ndim(const LatticeExprNode &expr)
1-argument function to get the dimensionality of a lattice.
const Regex & regex() const
Return the regular expression.
OperType operType() const
Get the operator type.
TableExprNodeRep * rnode_p
const String & regexp() const
Get the regular expression string.
bool Bool
Define the standard types used by Casacore.
Bool isReal() const
Is the data type real (i.e., integer or double)?
ValueType
Define the value types.
const Unit & unit() const
Get the unit.
ExprType exprType() const
Get the expression type.
Bool match(const String &target) const
Test if the given target string is within the maximum distance.
A drop-in replacement for Block<T*>.
TableExprNode shape(const TableExprNode &array)
Function operating on any scalar or array resulting in a Double array containing the shape...
void checkTablePtr(const TableExprNodeRep *node)
Check if this node uses the same table pointer.
Bool isConstant() const
Is the expression a constant?
The identification of a TaQL selection subject.
Table & table()
Get table.
Class to handle a Regex or StringDistance.
String: the storage and methods of handling collections of characters.
Class to deal with Levensthein distance of strings.
Class to handle date/time type conversions and I/O.
Abstract base class for a node having 0, 1, or 2 child nodes.
this file contains all the compiler specific defines
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
TableExprNodeRep * lnode_p
TableExprNodeRep * link()
Link to this object, i.e.