28 #ifndef TABLES_EXPRFUNCNODE_H 29 #define TABLES_EXPRFUNCNODE_H 32 #include <casacore/casa/aips.h> 33 #include <casacore/tables/TaQL/ExprNodeRep.h> 34 #include <casacore/casa/Quanta/MVAngle.h> 39 class TableExprNodeSet;
393 const std::pair<int,int>& mvFormat,
401 const std::pair<int,int>& mvFormat);
416 static double angdist (
double ra1,
double dec1,
double ra2,
double dec2)
Class representing a function in table select expression.
static String stringDateTime(const MVTime &dt, Int prec)
long long Int64
Define the extra non-standard types used by Casacore (like proposed uSize, Size)
return angles as dms strings
special function returning Int row id (meant for GIVING)
Int64 getInt(const TableExprId &id)
for Int or Double returning Double
static double angdist(double ra1, double dec1, double ra2, double dec2)
Get the angular distance between two positions on a sphere.
for any array returning Bool scalar
for Bool array returning Bool
other functions, implemented in derived class
DComplex getDComplex(const TableExprId &id)
Double getScale() const
Get possible unit scale factor (needed for sqrt).
static TableExprNodeRep * fillNode(TableExprFuncNode *thisNode, PtrBlock< TableExprNodeRep *> &nodes, const Block< Int > &dtypeOper)
Link the children to the node and convert the children to constants if possible.
Class to hold multiple table expression nodes.
MVTime getDate(const TableExprId &id)
void setScale(Double scale)
Set unit scale factor (needed for sqrt).
PtrBlock< TableExprNodeRep * > operands_p
PtrBlock< TableExprNodeRep * > & rwOperands()
angular distance returning radians
String getString(const TableExprId &id)
NodeDataType
Define the data types of a node.
Abstract base class for a node in a table column expression tree.
void tryToConst()
Try if the function gives a constant result.
const PtrBlock< TableExprNodeRep * > & operands() const
Some functions to be used by TableExprNodeFuncArray.
static String stringDMS(double val, Int prec)
FunctionType funcType() const
LatticeExprNode cos(const LatticeExprNode &expr)
static String stringTime(const MVTime &dt, Int prec)
for any array returning Int scalar
for any array returning Int array
for Int or Double returning Int (using floor)
static void getPrintFormat(String &fmt, Int &width, Int &prec, const PtrBlock< TableExprNodeRep *> &operands, const TableExprId &id)
Get the possible print format, width, and/or precision.
for any type returning array of that type
for Int, Double or DComplex returning Int, Double or Complex
special function resembling if statement
special function returning Int row number
for Int, Double or DComplex array returning Bool
for Int, Double or DComplex returning Double or Complex
Abstract base class for a node having multiple child nodes.
for Int, or Double or Complex returning Bool (2 is with default tolerance)
std::complex< Double > DComplex
static String stringAngle(double val, Int prec, MVAngle::formatTypes type)
Convert angle to a string (hms or dms).
TaqlRegex getRegex(const TableExprId &id)
return angles as hms/dms strings
for Bool array returning Int scalar
static void fillChildNodes(TableExprFuncNode *thisNode, PtrBlock< TableExprNodeRep *> &nodes, const Block< Int > &dtypeOper)
Link the children to the node and convert the children to constants if possible.
TableExprFuncNode(FunctionType, NodeDataType, ValueType, const TableExprNodeSet &source)
Constructor.
Double getDouble(const TableExprId &id)
NodeDataType argDataType() const
for Int, Double or Complex array returning the same
for Int or Double returning Int or Double
bool Bool
Define the standard types used by Casacore.
static std::pair< int, int > getMVFormat(const String &fmt)
Get the MVTime/Angle format and optional precision.
NodeDataType argDataType_p
ValueType
Define the value types.
static Double fillUnits(TableExprNodeRep *node, PtrBlock< TableExprNodeRep *> &nodes, FunctionType func)
Fill the result unit in the node.
static String stringHMS(double val, Int prec)
for Int, Double or DComplex returning DComplex
special function returning a random Double number
return angles as hms strings
const Unit & unit() const
Get the unit.
A drop-in replacement for Block<T*>.
~TableExprFuncNode()
Destructor.
static String stringValue(Bool val, const String &fmt, Int width)
Convert a value to a string.
Bool getBool(const TableExprId &id)
'get' Functions to get the desired result of a function
for Int or Double array returning Int or Double
static const Unit & makeEqualUnits(PtrBlock< TableExprNodeRep *> &nodes, uInt starg, uInt endarg)
Make the units of nodes from starg till endarg equal.
static String stringDT(const MVTime &dt, Int prec, MVTime::formatTypes)
Convert the date and/or time to a string.
The identification of a TaQL selection subject.
for Int, Double or DComplex returning Int or Double
Class to handle a Regex or StringDistance.
LatticeExprNode acos(const LatticeExprNode &expr)
String: the storage and methods of handling collections of characters.
static String stringDate(const MVTime &dt)
for Int or Double array returning Double
Class to handle date/time type conversions and I/O.
static NodeDataType checkOperands(Block< Int > &dtypeOper, ValueType &resVT, Block< Int > &vtypeOper, FunctionType, PtrBlock< TableExprNodeRep *> &)
Check the data and value types of the operands.
this file contains all the compiler specific defines
LatticeExprNode sin(const LatticeExprNode &expr)
Numerical 1-argument functions.
for Int, Double or DComplex returning Double