casacore
Public Member Functions | Protected Attributes | Private Member Functions | List of all members
casacore::TableExprGroupFuncBase Class Referenceabstract

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< BoolgetArrayBool (const vector< TableExprId > &=vector< TableExprId >())
 
virtual MArray< Int64getArrayInt (const vector< TableExprId > &=vector< TableExprId >())
 
virtual MArray< DoublegetArrayDouble (const vector< TableExprId > &=vector< TableExprId >())
 
virtual MArray< DComplex > getArrayDComplex (const vector< TableExprId > &=vector< TableExprId >())
 
virtual MArray< MVTimegetArrayDate (const vector< TableExprId > &=vector< TableExprId >())
 
virtual MArray< StringgetArrayString (const vector< TableExprId > &=vector< TableExprId >())
 

Protected Attributes

TableExprNodeRepitsNode
 
TableExprNodeRepitsOperand
 
uInt itsSeqnr
 

Private Member Functions

 TableExprGroupFuncBase (const TableExprGroupFuncBase &)
 Copying is not needed, thus not allowed. More...
 
TableExprGroupFuncBaseoperator= (const TableExprGroupFuncBase &)
 

Detailed Description

Abstract base class for classes calculating an aggregated group result.

Intended use:

Internal

Review Status

Test programs:
tExprGroup

Synopsis

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.

Constructor & Destructor Documentation

◆ TableExprGroupFuncBase() [1/2]

casacore::TableExprGroupFuncBase::TableExprGroupFuncBase ( TableExprNodeRep node)
explicit

Construct from the TaQL aggregation node.

It keeps the operand of the aggregation node.

◆ ~TableExprGroupFuncBase()

virtual casacore::TableExprGroupFuncBase::~TableExprGroupFuncBase ( )
virtual

◆ TableExprGroupFuncBase() [2/2]

casacore::TableExprGroupFuncBase::TableExprGroupFuncBase ( const TableExprGroupFuncBase )
private

Copying is not needed, thus not allowed.

Member Function Documentation

◆ apply()

virtual void casacore::TableExprGroupFuncBase::apply ( const TableExprId id)
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::TableExprGroupVarianceArrayDComplex, casacore::TableExprGroupMeanArrayDComplex, casacore::TableExprGroupSumSqrArrayDComplex, casacore::TableExprGroupProductArrayDComplex, casacore::TableExprGroupSumArrayDComplex, casacore::TableExprGroupFractileArrayDouble, casacore::TableExprGroupRmsArrayDouble, casacore::TableExprGroupVarianceArrayDouble, casacore::TableExprGroupMeanArrayDouble, casacore::TableExprGroupSumSqrArrayDouble, casacore::TableExprGroupProductArrayDouble, casacore::TableExprGroupSumArrayDouble, casacore::TableExprGroupMaxArrayDouble, casacore::TableExprGroupMinArrayDouble, casacore::TableExprGroupSumSqrArrayInt, casacore::TableExprGroupProductArrayInt, casacore::TableExprGroupSumArrayInt, casacore::TableExprGroupMaxArrayInt, casacore::TableExprGroupMinArrayInt, casacore::TableExprGroupArrayNFalse, casacore::TableExprGroupArrayNTrue, casacore::TableExprGroupArrayAll, casacore::TableExprGroupArrayAny, casacore::TableExprGroupVarianceDComplex, casacore::TableExprGroupMeanDComplex, casacore::TableExprGroupSumSqrDComplex, casacore::TableExprGroupProductDComplex, casacore::TableExprGroupSumDComplex, casacore::TableExprGroupFractileDouble, casacore::TableExprGroupRmsDouble, casacore::TableExprGroupVarianceDouble, casacore::TableExprGroupMeanDouble, casacore::TableExprGroupSumSqrDouble, casacore::TableExprGroupProductDouble, casacore::TableExprGroupSumDouble, casacore::TableExprGroupMaxDouble, casacore::TableExprGroupMinDouble, casacore::TableExprGroupSumSqrInt, casacore::TableExprGroupProductInt, casacore::TableExprGroupSumInt, casacore::TableExprGroupMaxInt, casacore::TableExprGroupMinInt, casacore::TableExprGroupNFalse, casacore::TableExprGroupNTrue, casacore::TableExprGroupAll, casacore::TableExprGroupAny, casacore::TableExprGroupCount, casacore::TableExprGroupCountAll, casacore::TableExprGroupAggr, casacore::TableExprGroupRowid, casacore::TableExprGroupExprId, casacore::TableExprGroupLast, casacore::TableExprGroupFirst, and casacore::TableExprGroupNull.

◆ finish()

virtual void casacore::TableExprGroupFuncBase::finish ( )
virtual

◆ getArrayBool()

virtual MArray<Bool> casacore::TableExprGroupFuncBase::getArrayBool ( const vector< TableExprId > &  = vector< TableExprId >())
virtual

◆ getArrayDate()

virtual MArray<MVTime> casacore::TableExprGroupFuncBase::getArrayDate ( const vector< TableExprId > &  = vector< TableExprId >())
virtual

◆ getArrayDComplex()

virtual MArray<DComplex> casacore::TableExprGroupFuncBase::getArrayDComplex ( const vector< TableExprId > &  = vector< TableExprId >())
virtual

◆ getArrayDouble()

virtual MArray<Double> casacore::TableExprGroupFuncBase::getArrayDouble ( const vector< TableExprId > &  = vector< TableExprId >())
virtual

◆ getArrayInt()

virtual MArray<Int64> casacore::TableExprGroupFuncBase::getArrayInt ( const vector< TableExprId > &  = vector< TableExprId >())
virtual

◆ getArrayString()

virtual MArray<String> casacore::TableExprGroupFuncBase::getArrayString ( const vector< TableExprId > &  = vector< TableExprId >())
virtual

◆ getBool()

virtual Bool casacore::TableExprGroupFuncBase::getBool ( const vector< TableExprId > &  = vector< TableExprId >())
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.

◆ getDate()

virtual MVTime casacore::TableExprGroupFuncBase::getDate ( const vector< TableExprId > &  = vector< TableExprId >())
virtual

◆ getDComplex()

virtual DComplex casacore::TableExprGroupFuncBase::getDComplex ( const vector< TableExprId > &  = vector< TableExprId >())
virtual

◆ getDouble()

virtual Double casacore::TableExprGroupFuncBase::getDouble ( const vector< TableExprId > &  = vector< TableExprId >())
virtual

◆ getIds()

virtual CountedPtr<vector<TableExprId> > casacore::TableExprGroupFuncBase::getIds ( ) const
virtual

Get the assembled TableExprIds of a group.

It is specifically meant for TableExprGroupExprId used for lazy aggregation.

Reimplemented in casacore::TableExprGroupExprId.

◆ getInt()

virtual Int64 casacore::TableExprGroupFuncBase::getInt ( const vector< TableExprId > &  = vector< TableExprId >())
virtual

◆ getString()

virtual String casacore::TableExprGroupFuncBase::getString ( const vector< TableExprId > &  = vector< TableExprId >())
virtual

◆ isLazy()

virtual Bool casacore::TableExprGroupFuncBase::isLazy ( ) const
virtual

◆ operator=()

TableExprGroupFuncBase& casacore::TableExprGroupFuncBase::operator= ( const TableExprGroupFuncBase )
private

◆ seqnr()

uInt casacore::TableExprGroupFuncBase::seqnr ( ) const
inline

Get the function's sequence nr.

Definition at line 212 of file ExprGroup.h.

References itsSeqnr.

Referenced by setSeqnr().

◆ setSeqnr()

void casacore::TableExprGroupFuncBase::setSeqnr ( uInt  seqnr)
inline

Set the function's sequence nr.

Definition at line 215 of file ExprGroup.h.

References itsSeqnr, and seqnr().

Member Data Documentation

◆ itsNode

TableExprNodeRep* casacore::TableExprGroupFuncBase::itsNode
protected

Definition at line 250 of file ExprGroup.h.

◆ itsOperand

TableExprNodeRep* casacore::TableExprGroupFuncBase::itsOperand
protected

Definition at line 251 of file ExprGroup.h.

Referenced by casacore::TableExprGroupAggr::getArray().

◆ itsSeqnr

uInt casacore::TableExprGroupFuncBase::itsSeqnr
protected

Definition at line 252 of file ExprGroup.h.

Referenced by seqnr(), and setSeqnr().


The documentation for this class was generated from the following file: