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/casa/BasicSL/Complex.h> 37 #include <casacore/casa/Quanta/MVTime.h> 38 #include <casacore/casa/Quanta/Unit.h> 39 #include <casacore/casa/Utilities/DataType.h> 40 #include <casacore/casa/Utilities/Regex.h> 41 #include <casacore/casa/Utilities/StringDistance.h> 42 #include <casacore/casa/iosfwd.h> 48 class TableExprNodeColumn;
49 class TableExprGroupFuncBase;
50 template<
class T>
class Block;
184 OtColumn, OtField, OtLiteral, OtFunc, OtSlice,
OtUndef,
190 NoArr, ArrArr, ArrSca, ScaArr
227 virtual void disableApplySelection();
231 virtual void applySelection (
const Vector<uInt>& rownrs);
235 virtual Double getUnitFactor()
const;
242 virtual void getAggrNodes (vector<TableExprNodeRep*>& aggr);
245 virtual void getColumnNodes (vector<TableExprNodeRep*>& cols);
255 virtual Bool isLazyAggregate()
const;
287 {
value = getBool (
id); }
289 {
value = getInt (
id); }
291 {
value = getDouble (
id); }
293 {
value = getDComplex (
id); }
295 {
value = getDate (
id); }
297 {
value = getString (
id); }
299 {
value = getArrayBool (
id); }
301 {
value = getArrayInt (
id); }
303 {
value = getArrayDouble (
id); }
305 {
value = getArrayDComplex (
id); }
307 {
value = getArrayDate (
id); }
309 {
value = getArrayString (
id); }
355 virtual Bool getColumnDataType (DataType&)
const;
406 Bool isConstant()
const;
409 const Unit& unit()
const;
413 void setUnit (
const Unit& unit);
430 virtual void show (ostream&,
uInt indent)
const;
437 const Table& table()
const;
442 virtual void adaptSetUnits (
const Unit&);
481 virtual void convertConstChild();
487 static void checkTablePtr (
Table& table,
502 Bool convertConstType);
560 virtual void show (ostream&,
uInt indent)
const;
563 virtual void getAggrNodes (vector<TableExprNodeRep*>& aggr);
566 virtual void getColumnNodes (vector<TableExprNodeRep*>& cols);
585 Bool convertConstType,
591 virtual void handleUnits();
596 void convertConstChild();
667 virtual void show (ostream&,
uInt indent)
const;
670 virtual void getAggrNodes (vector<TableExprNodeRep*>& aggr);
673 virtual void getColumnNodes (vector<TableExprNodeRep*>& cols);
683 {
return operands_p; }
715 {
return exprtype_p; }
719 {
return (exprtype_p == Constant); }
740 { checkTablePtr (table_p, node); }
742 { 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.
Int ndim() const
Get the fixed dimensionality (same for all rows).
const TableExprNodeRep * getLeftChild() const
Get the child nodes.
TaqlRegex(const Regex ®ex)
Construct from a regex.
ExprType exprType() const
Get the expression type.
Main interface class to a read/write table.
Handle class for a table column expression tree.
A constant subexpression which can be evaluated immediately.
Bool isConstant() const
Is the expression a constant?
PtrHolder< T > & operator=(const PtrHolder< T > &other)
Scalar column in table select expression tree.
PtrBlock< TableExprNodeRep * > operands_p
OperType operType() const
Get the operator type.
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.
void setValueType(ValueType vtype)
Set the value type.
ExprType
Define (sub-)expression type.
ArgType
Define the value types of the 2 arguments when arrays are involved.
Referenced counted pointer for constant data.
Abstract base class for a node having multiple child nodes.
NodeDataType dataType() const
Get the data type of the derived TableExprNode object.
std::complex< Double > DComplex
OperType
Define the operator types.
Regular expression class.
const TableExprNodeRep * getRightChild() const
LatticeExprNode ndim(const LatticeExprNode &expr)
1-argument function to get the dimensionality of a lattice.
TableExprNodeRep * rnode_p
ValueType valueType() const
Get the value type.
bool Bool
Define the standard types used by Casacore.
ValueType
Define the value types.
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 match(const String &str) const
Does the regex or maximum string distance match?
const Unit & unit() const
Get the unit.
const Regex & regex() const
Return the regular expression.
const String & regexp() const
Get the regular expression string.
The identification of a TaQL selection subject.
Bool match(const String &target) const
Test if the given target string is within the maximum distance.
Table & table()
Get table.
Class to handle a Regex or StringDistance.
Bool matches(const string &str, Int pos=0) const
Matches entire string from pos (or till pos if negative pos).
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.
const IPosition & shape() const
Get the fixed shape (same for all rows).
Abstract base class for a node having 0, 1, or 2 child nodes.
this file contains all the compiler specific defines
const PtrBlock< TableExprNodeRep * > & getChildren() const
Get the child nodes.
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.
Bool empty() const
Test for empty.