casa
$Rev:20696$
|
Class representing a function in table select expression. More...
#include <ExprFuncNode.h>
Class representing a function in table select expression.
Internal
This class represents a function in a table select tree. The rownumber
function is represented by class TableExprNodeRownr . The rowid
function is represented by class TableExprNodeRowid . The rand
function is represented by class TableExprNodeRandom .
When one wants to add a function to the table selection grammar, the following has to be done:
Definition at line 75 of file ExprFuncNode.h.
piFUNC | |
eFUNC | |
cFUNC | |
near2FUNC |
for Int, or Double or Complex returning Bool (2 is with default tolerance) |
near3FUNC | |
nearabs2FUNC | |
nearabs3FUNC | |
sinFUNC |
for Int, Double or DComplex returning Double or Complex |
sinhFUNC | |
cosFUNC | |
coshFUNC | |
expFUNC | |
logFUNC | |
log10FUNC | |
sqrtFUNC | |
powFUNC | |
conjFUNC | |
squareFUNC |
for Int, Double or DComplex returning Int, Double or Complex |
cubeFUNC | |
minFUNC | |
maxFUNC | |
normFUNC |
for Int, Double or DComplex returning Int or Double |
absFUNC | |
argFUNC | |
realFUNC |
for Int, Double or DComplex returning Double |
imagFUNC | |
intFUNC |
for Int or Double returning Int (using floor) |
asinFUNC |
for Int or Double returning Double |
acosFUNC | |
atanFUNC | |
atan2FUNC | |
tanFUNC | |
tanhFUNC | |
signFUNC |
for Int or Double returning Int or Double |
roundFUNC | |
floorFUNC | |
ceilFUNC | |
fmodFUNC | |
complexFUNC |
for Int, Double or DComplex returning DComplex |
arrsumFUNC |
for Int, Double or Complex array returning the same |
arrsumsFUNC | |
arrproductFUNC | |
arrproductsFUNC | |
arrsumsqrFUNC | |
arrsumsqrsFUNC | |
arrminFUNC |
for Int or Double array returning Int or Double |
arrminsFUNC | |
runminFUNC | |
boxminFUNC | |
arrmaxFUNC | |
arrmaxsFUNC | |
runmaxFUNC | |
boxmaxFUNC | |
arrmeanFUNC |
for Int or Double array returning Double |
arrmeansFUNC | |
runmeanFUNC | |
boxmeanFUNC | |
arrvarianceFUNC | |
arrvariancesFUNC | |
runvarianceFUNC | |
boxvarianceFUNC | |
arrstddevFUNC | |
arrstddevsFUNC | |
runstddevFUNC | |
boxstddevFUNC | |
arravdevFUNC | |
arravdevsFUNC | |
runavdevFUNC | |
boxavdevFUNC | |
arrrmsFUNC | |
arrrmssFUNC | |
runrmsFUNC | |
boxrmsFUNC | |
arrmedianFUNC | |
arrmediansFUNC | |
runmedianFUNC | |
boxmedianFUNC | |
arrfractileFUNC | |
arrfractilesFUNC | |
anyFUNC |
for Bool array returning Bool |
anysFUNC | |
runanyFUNC | |
boxanyFUNC | |
allFUNC | |
allsFUNC | |
runallFUNC | |
boxallFUNC | |
ntrueFUNC |
for Bool array returning Int scalar |
ntruesFUNC | |
gnfalseFUNC | |
nfalseFUNC | |
nfalsesFUNC | |
arrayFUNC |
for any type returning array of that type |
transposeFUNC | |
isnanFUNC |
for Int, Double or DComplex array returning Bool |
isinfFUNC | |
isfiniteFUNC | |
isdefFUNC |
for any array returning Bool scalar |
ndimFUNC |
for any array returning Int scalar |
nelemFUNC | |
shapeFUNC |
for any array returning Int array |
strlengthFUNC |
for String |
upcaseFUNC | |
downcaseFUNC | |
trimFUNC | |
ltrimFUNC | |
rtrimFUNC | |
substrFUNC | |
replaceFUNC | |
regexFUNC | |
patternFUNC | |
sqlpatternFUNC | |
datetimeFUNC |
for Date |
mjdtodateFUNC | |
mjdFUNC | |
dateFUNC | |
timeFUNC | |
yearFUNC | |
monthFUNC | |
dayFUNC | |
cmonthFUNC | |
weekdayFUNC | |
cdowFUNC | |
weekFUNC | |
ctodFUNC | |
cdateFUNC | |
ctimeFUNC | |
hmsFUNC |
return angles as hms strings |
dmsFUNC |
return angles as dms strings |
hdmsFUNC |
return angles as hms/dms strings |
randFUNC |
special function returning a random Double number |
rownrFUNC |
special function returning Int row number |
rowidFUNC |
special function returning Int row id (meant for GIVING) |
iifFUNC |
special function resembling if statement |
angdistFUNC |
angular distance returning radians |
angdistxFUNC | |
conesFUNC |
other functions, implemented in derived class |
cones3FUNC | |
anyconeFUNC | |
anycone3FUNC | |
findconeFUNC | |
findcone3FUNC | |
NRFUNC |
Definition at line 79 of file ExprFuncNode.h.
casa::TableExprFuncNode::TableExprFuncNode | ( | FunctionType | , |
NodeDataType | , | ||
ValueType | , | ||
const TableExprNodeSet & | source | ||
) |
Constructor.
Destructor.
static double casa::TableExprFuncNode::angdist | ( | double | ra1, |
double | dec1, | ||
double | ra2, | ||
double | dec2 | ||
) | [inline, static] |
Get the angular distance between two positions on a sphere.
Definition at line 345 of file ExprFuncNode.h.
References casa::acos(), casa::cos(), and casa::sin().
NodeDataType casa::TableExprFuncNode::argDataType | ( | ) | const [inline] |
Definition at line 324 of file ExprFuncNode.h.
References argDataType_p.
Referenced by casa::TableExprFuncNodeArray::argDataType().
static NodeDataType casa::TableExprFuncNode::checkOperands | ( | Block< Int > & | dtypeOper, |
ValueType & | resVT, | ||
Block< Int > & | vtypeOper, | ||
FunctionType | , | ||
PtrBlock< TableExprNodeRep * > & | |||
) | [static] |
Check the data and value types of the operands.
It sets the exptected data and value types of the operands. Set the value type of the function result and returns the data type of the function result.
Reimplemented in casa::TableExprConeNode.
static void casa::TableExprFuncNode::fillChildNodes | ( | TableExprFuncNode * | thisNode, |
PtrBlock< TableExprNodeRep * > & | nodes, | ||
const Block< Int > & | dtypeOper | ||
) | [static] |
Link the children to the node and convert the children to constants if possible.
static TableExprNodeRep* casa::TableExprFuncNode::fillNode | ( | TableExprFuncNode * | thisNode, |
PtrBlock< TableExprNodeRep * > & | nodes, | ||
const Block< Int > & | dtypeOper | ||
) | [static] |
Link the children to the node and convert the children to constants if possible.
Also convert the node to constant if possible.
static Double casa::TableExprFuncNode::fillUnits | ( | TableExprNodeRep * | node, |
PtrBlock< TableExprNodeRep * > & | nodes, | ||
FunctionType | func | ||
) | [static] |
Fill the result unit in the node.
Adapt the children nodes if their units need to be converted. It returns a possible scale factor in case result unit is SI (for sqrt).
FunctionType casa::TableExprFuncNode::funcType | ( | ) | const [inline] |
Definition at line 322 of file ExprFuncNode.h.
References funcType_p.
Referenced by casa::TableExprFuncNodeArray::funcType().
Bool casa::TableExprFuncNode::getBool | ( | const TableExprId & | id | ) | [virtual] |
'get' Functions to get the desired result of a function
Reimplemented from casa::TableExprNodeRep.
Reimplemented in casa::TableExprConeNode.
MVTime casa::TableExprFuncNode::getDate | ( | const TableExprId & | id | ) | [virtual] |
Reimplemented from casa::TableExprNodeRep.
DComplex casa::TableExprFuncNode::getDComplex | ( | const TableExprId & | id | ) | [virtual] |
Reimplemented from casa::TableExprNodeRep.
Double casa::TableExprFuncNode::getDouble | ( | const TableExprId & | id | ) | [virtual] |
Reimplemented from casa::TableExprNodeRep.
Int64 casa::TableExprFuncNode::getInt | ( | const TableExprId & | id | ) | [virtual] |
Reimplemented from casa::TableExprNodeRep.
Reimplemented in casa::TableExprConeNode.
TaqlRegex casa::TableExprFuncNode::getRegex | ( | const TableExprId & | id | ) | [virtual] |
Reimplemented from casa::TableExprNodeRep.
Double casa::TableExprFuncNode::getScale | ( | ) | const [inline] |
Get possible unit scale factor (needed for sqrt).
Definition at line 313 of file ExprFuncNode.h.
References scale_p.
String casa::TableExprFuncNode::getString | ( | const TableExprId & | id | ) | [virtual] |
Reimplemented from casa::TableExprNodeRep.
virtual Bool casa::TableExprFuncNode::isSingleValue | ( | ) | const [virtual] |
Does the node result in a single value (for e.g.
GROUPBY)? This is the case for reduction functions and constant functions.
Reimplemented from casa::TableExprNodeRep.
static const Unit& casa::TableExprFuncNode::makeEqualUnits | ( | PtrBlock< TableExprNodeRep * > & | nodes, |
uInt | starg, | ||
uInt | endarg | ||
) | [static, private] |
Make the units of nodes from starg
till endarg
equal.
Return the unit found.
const PtrBlock<TableExprNodeRep*>& casa::TableExprFuncNode::operands | ( | ) | const [inline] |
Some functions to be used by TableExprNodeFuncArray.
Definition at line 318 of file ExprFuncNode.h.
References casa::TableExprNodeMulti::operands_p.
Referenced by casa::TableExprFuncNodeArray::operands().
PtrBlock<TableExprNodeRep*>& casa::TableExprFuncNode::rwOperands | ( | ) | [inline] |
Definition at line 320 of file ExprFuncNode.h.
References casa::TableExprNodeMulti::operands_p.
Referenced by casa::TableExprFuncNodeArray::rwOperands().
void casa::TableExprFuncNode::setScale | ( | Double | scale | ) | [inline] |
Set unit scale factor (needed for sqrt).
Definition at line 309 of file ExprFuncNode.h.
References scale_p.
Referenced by casa::TableExprFuncNodeArray::setScale().
static String casa::TableExprFuncNode::stringAngle | ( | double | val, |
Int | prec, | ||
MVAngle::formatTypes | type | ||
) | [static] |
Convert angle to a string (hms or dms).
static String casa::TableExprFuncNode::stringDate | ( | const MVTime & | dt | ) | [static] |
static String casa::TableExprFuncNode::stringDateTime | ( | const MVTime & | dt, |
Int | prec | ||
) | [static] |
static String casa::TableExprFuncNode::stringDMS | ( | double | val, |
Int | prec | ||
) | [static] |
static String casa::TableExprFuncNode::stringDT | ( | const MVTime & | dt, |
Int | prec, | ||
MVTime::formatTypes | |||
) | [static] |
Convert the date and/or time to a string.
static String casa::TableExprFuncNode::stringHMS | ( | double | val, |
Int | prec | ||
) | [static] |
static String casa::TableExprFuncNode::stringTime | ( | const MVTime & | dt, |
Int | prec | ||
) | [static] |
void casa::TableExprFuncNode::tryToConst | ( | ) | [private] |
Try if the function gives a constant result.
If so, set the expression type to Constant.
Reimplemented in casa::TableExprConeNode.
Definition at line 360 of file ExprFuncNode.h.
Referenced by argDataType().
Definition at line 359 of file ExprFuncNode.h.
Referenced by funcType().
Double casa::TableExprFuncNode::scale_p [private] |
Definition at line 361 of file ExprFuncNode.h.
Referenced by getScale(), and setScale().