casa
5.7.0-16
|
Abstract base class for classes calculating an aggregated group result. More...
#include <ExprGroup.h>
Public Member Functions | |
TableExprGroupFuncBase (TableExprNodeRep *node) | |
Construct from the TaQL aggregation node. More... | |
virtual | ~TableExprGroupFuncBase () |
virtual Bool | isLazy () const |
Does the aggregate function use lazy semantics? The default implementation returns False. More... | |
uInt | seqnr () const |
Get the function's sequence nr. More... | |
void | setSeqnr (uInt seqnr) |
Set the function's sequence nr. More... | |
virtual void | apply (const TableExprId &id)=0 |
Get the operand's value for the given row and apply it to the aggregation. More... | |
virtual void | finish () |
If needed, finish the aggregation. More... | |
virtual CountedPtr< vector < TableExprId > > | getIds () const |
Get the assembled TableExprIds of a group. More... | |
virtual Bool | getBool (const vector< TableExprId > &=vector< TableExprId >()) |
Get the aggregated value. More... | |
virtual Int64 | getInt (const vector< TableExprId > &=vector< TableExprId >()) |
virtual Double | getDouble (const vector< TableExprId > &=vector< TableExprId >()) |
virtual DComplex | getDComplex (const vector< TableExprId > &=vector< TableExprId >()) |
virtual MVTime | getDate (const vector< TableExprId > &=vector< TableExprId >()) |
virtual String | getString (const vector< TableExprId > &=vector< TableExprId >()) |
virtual MArray< Bool > | getArrayBool (const vector< TableExprId > &=vector< TableExprId >()) |
virtual MArray< Int64 > | getArrayInt (const vector< TableExprId > &=vector< TableExprId >()) |
virtual MArray< Double > | getArrayDouble (const vector< TableExprId > &=vector< TableExprId >()) |
virtual MArray< DComplex > | getArrayDComplex (const vector< TableExprId > &=vector< TableExprId >()) |
virtual MArray< MVTime > | getArrayDate (const vector< TableExprId > &=vector< TableExprId >()) |
virtual MArray< String > | getArrayString (const vector< TableExprId > &=vector< TableExprId >()) |
Protected Attributes | |
TableExprNodeRep * | itsNode |
TableExprNodeRep * | itsOperand |
uInt | itsSeqnr |
Private Member Functions | |
TableExprGroupFuncBase (const TableExprGroupFuncBase &) | |
Copying is not needed, thus not allowed. More... | |
TableExprGroupFuncBase & | operator= (const TableExprGroupFuncBase &) |
Abstract base class for classes calculating an aggregated group result.
Internal
The GROUPBY clause divides a table into groups for which aggregated results can be calculated like the mean or minimum. These results are calculated in classes derived from this abstract base class.
There is one such function object per aggregation per group. All aggregation objects of a group are combined in a std::vector. This vector is mapped to a TableExprGroupKeySet object to keep track of all groups and aggregations.
There are two types of aggregation function classes.
Most derived classes are immediate classes.
Definition at line 201 of file ExprGroup.h.
|
explicit |
Construct from the TaQL aggregation node.
It keeps the operand of the aggregation node.
|
virtual |
|
private |
Copying is not needed, thus not allowed.
|
pure virtual |
Get the operand's value for the given row and apply it to the aggregation.
This function should not be called for lazy classes.
Implemented in casacore::TableExprGroupHistDouble, casacore::TableExprGroupHistInt, casacore::TableExprGroupHistScalar, casacore::TableExprGroupVariancesArrayDComplex, casacore::TableExprGroupMeansArrayDComplex, casacore::TableExprGroupSumSqrsArrayDComplex, casacore::TableExprGroupProductsArrayDComplex, casacore::TableExprGroupSumsArrayDComplex, casacore::TableExprGroupRmssArrayDouble, casacore::TableExprGroupVariancesArrayDouble, casacore::TableExprGroupMeansArrayDouble, casacore::TableExprGroupSumSqrsArrayDouble, casacore::TableExprGroupProductsArrayDouble, casacore::TableExprGroupSumsArrayDouble, casacore::TableExprGroupMaxsArrayDouble, casacore::TableExprGroupMinsArrayDouble, casacore::TableExprGroupSumSqrsArrayInt, casacore::TableExprGroupProductsArrayInt, casacore::TableExprGroupSumsArrayInt, casacore::TableExprGroupMaxsArrayInt, casacore::TableExprGroupMinsArrayInt, casacore::TableExprGroupArrayNFalses, casacore::TableExprGroupArrayNTrues, casacore::TableExprGroupArrayAlls, casacore::TableExprGroupArrayAnys, casacore::TableExprGroupVarianceDComplex, casacore::TableExprGroupMeanDComplex, casacore::TableExprGroupVarianceArrayDComplex, casacore::TableExprGroupSumSqrDComplex, casacore::TableExprGroupMeanArrayDComplex, casacore::TableExprGroupProductDComplex, casacore::TableExprGroupSumSqrArrayDComplex, casacore::TableExprGroupSumDComplex, casacore::TableExprGroupProductArrayDComplex, casacore::TableExprGroupFractileDouble, casacore::TableExprGroupSumArrayDComplex, casacore::TableExprGroupRmsDouble, casacore::TableExprGroupFractileArrayDouble, casacore::TableExprGroupAggr, casacore::TableExprGroupRowid, casacore::TableExprGroupRmsArrayDouble, casacore::TableExprGroupVarianceDouble, casacore::TableExprGroupExprId, casacore::TableExprGroupMeanDouble, casacore::TableExprGroupLast, casacore::TableExprGroupVarianceArrayDouble, casacore::TableExprGroupSumSqrDouble, casacore::TableExprGroupProductDouble, casacore::TableExprGroupMeanArrayDouble, casacore::TableExprGroupFirst, casacore::TableExprGroupSumDouble, casacore::TableExprGroupSumSqrArrayDouble, casacore::TableExprGroupNull, casacore::TableExprGroupMaxDouble, casacore::TableExprGroupProductArrayDouble, casacore::TableExprGroupMinDouble, casacore::TableExprGroupSumArrayDouble, casacore::TableExprGroupSumSqrInt, casacore::TableExprGroupMaxArrayDouble, casacore::TableExprGroupProductInt, casacore::TableExprGroupMinArrayDouble, casacore::TableExprGroupSumInt, casacore::TableExprGroupSumSqrArrayInt, casacore::TableExprGroupMaxInt, casacore::TableExprGroupProductArrayInt, casacore::TableExprGroupMinInt, casacore::TableExprGroupSumArrayInt, casacore::TableExprGroupNFalse, casacore::TableExprGroupMaxArrayInt, casacore::TableExprGroupNTrue, casacore::TableExprGroupMinArrayInt, casacore::TableExprGroupAll, casacore::TableExprGroupArrayNFalse, casacore::TableExprGroupAny, casacore::TableExprGroupArrayNTrue, casacore::TableExprGroupCount, casacore::TableExprGroupArrayAll, casacore::TableExprGroupCountAll, and casacore::TableExprGroupArrayAny.
|
virtual |
If needed, finish the aggregation.
By default nothing is done.
Reimplemented in casacore::TableExprGroupStdDevsArrayDComplex, casacore::TableExprGroupVariancesArrayDComplex, casacore::TableExprGroupMeansArrayDComplex, casacore::TableExprGroupProductsArrayDComplex, casacore::TableExprGroupRmssArrayDouble, casacore::TableExprGroupStdDevsArrayDouble, casacore::TableExprGroupVariancesArrayDouble, casacore::TableExprGroupMeansArrayDouble, casacore::TableExprGroupProductsArrayDouble, casacore::TableExprGroupMaxsArrayDouble, casacore::TableExprGroupMinsArrayDouble, casacore::TableExprGroupProductsArrayInt, casacore::TableExprGroupMaxsArrayInt, casacore::TableExprGroupMinsArrayInt, casacore::TableExprGroupStdDevDComplex, casacore::TableExprGroupVarianceDComplex, casacore::TableExprGroupStdDevArrayDComplex, casacore::TableExprGroupMeanDComplex, casacore::TableExprGroupVarianceArrayDComplex, casacore::TableExprGroupMeanArrayDComplex, casacore::TableExprGroupRmsDouble, casacore::TableExprGroupStdDevDouble, casacore::TableExprGroupRmsArrayDouble, casacore::TableExprGroupVarianceDouble, casacore::TableExprGroupStdDevArrayDouble, casacore::TableExprGroupMeanDouble, casacore::TableExprGroupVarianceArrayDouble, and casacore::TableExprGroupMeanArrayDouble.
|
virtual |
Reimplemented in casacore::TableExprGroupFuncArrayBool, casacore::TableExprGroupAggr, and casacore::TableExprGroupFirst.
|
virtual |
Reimplemented in casacore::TableExprGroupFuncArrayDate, casacore::TableExprGroupAggr, and casacore::TableExprGroupFirst.
|
virtual |
Reimplemented in casacore::TableExprGroupFuncArrayDComplex, casacore::TableExprGroupAggr, and casacore::TableExprGroupFirst.
|
virtual |
Reimplemented in casacore::TableExprGroupFuncArrayDouble, casacore::TableExprGroupAggr, and casacore::TableExprGroupFirst.
|
virtual |
|
virtual |
Reimplemented in casacore::TableExprGroupFuncArrayString, casacore::TableExprGroupAggr, and casacore::TableExprGroupFirst.
|
virtual |
Get the aggregated value.
Immediate classes can return the already calculated value, while lazy classes will get the values of all rows given by the TableExprIds and do the aggregation.
Reimplemented in casacore::TableExprGroupFuncBool, and casacore::TableExprGroupFirst.
|
virtual |
Reimplemented in casacore::TableExprGroupFuncDate, and casacore::TableExprGroupFirst.
|
virtual |
Reimplemented in casacore::TableExprGroupFuncDComplex, and casacore::TableExprGroupFirst.
|
virtual |
|
virtual |
Get the assembled TableExprIds of a group.
It is specifically meant for TableExprGroupExprId used for lazy aggregation.
Reimplemented in casacore::TableExprGroupExprId.
|
virtual |
Reimplemented in casacore::TableExprGroupFuncInt, and casacore::TableExprGroupFirst.
|
virtual |
Reimplemented in casacore::TableExprGroupFuncString, and casacore::TableExprGroupFirst.
|
virtual |
Does the aggregate function use lazy semantics? The default implementation returns False.
Reimplemented in casacore::TableExprGroupFractileDouble, casacore::TableExprGroupFractileArrayDouble, casacore::TableExprGroupAggr, casacore::TableExprGroupRowid, casacore::TableExprGroupExprId, and casacore::TableExprGroupNull.
|
private |
|
inline |
Get the function's sequence nr.
Definition at line 212 of file ExprGroup.h.
References itsSeqnr.
Referenced by setSeqnr().
|
inline |
Set the function's sequence nr.
Definition at line 215 of file ExprGroup.h.
|
protected |
Definition at line 250 of file ExprGroup.h.
|
protected |
Definition at line 251 of file ExprGroup.h.
Referenced by casacore::TableExprGroupAggr::getArray().
|
protected |
Definition at line 252 of file ExprGroup.h.
Referenced by seqnr(), and setSeqnr().