casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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>

Inheritance diagram for casacore::TableExprGroupFuncBase:
casacore::TableExprGroupAggr casacore::TableExprGroupExprId casacore::TableExprGroupFirst casacore::TableExprGroupFuncArrayBool casacore::TableExprGroupFuncArrayDate casacore::TableExprGroupFuncArrayDComplex casacore::TableExprGroupFuncArrayDouble casacore::TableExprGroupFuncArrayInt casacore::TableExprGroupFuncArrayString casacore::TableExprGroupFuncBool casacore::TableExprGroupFuncDate casacore::TableExprGroupFuncDComplex casacore::TableExprGroupFuncDouble casacore::TableExprGroupFuncInt casacore::TableExprGroupFuncString casacore::TableExprGroupHistBase casacore::TableExprGroupNull casacore::TableExprGroupRowid

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

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

Construct from the TaQL aggregation node.

It keeps the operand of the aggregation node.

virtual casacore::TableExprGroupFuncBase::~TableExprGroupFuncBase ( )
virtual
casacore::TableExprGroupFuncBase::TableExprGroupFuncBase ( const TableExprGroupFuncBase )
private

Copying is not needed, thus not allowed.

Member Function Documentation

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::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 void casacore::TableExprGroupFuncBase::finish ( )
virtual
virtual MArray<Bool> casacore::TableExprGroupFuncBase::getArrayBool ( const vector< TableExprId > &  = vector< TableExprId >())
virtual
virtual MArray<MVTime> casacore::TableExprGroupFuncBase::getArrayDate ( const vector< TableExprId > &  = vector< TableExprId >())
virtual
virtual MArray<DComplex> casacore::TableExprGroupFuncBase::getArrayDComplex ( const vector< TableExprId > &  = vector< TableExprId >())
virtual
virtual MArray<Double> casacore::TableExprGroupFuncBase::getArrayDouble ( const vector< TableExprId > &  = vector< TableExprId >())
virtual
virtual MArray<Int64> casacore::TableExprGroupFuncBase::getArrayInt ( const vector< TableExprId > &  = vector< TableExprId >())
virtual
virtual MArray<String> casacore::TableExprGroupFuncBase::getArrayString ( const vector< TableExprId > &  = vector< TableExprId >())
virtual
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.

virtual MVTime casacore::TableExprGroupFuncBase::getDate ( const vector< TableExprId > &  = vector< TableExprId >())
virtual
virtual DComplex casacore::TableExprGroupFuncBase::getDComplex ( const vector< TableExprId > &  = vector< TableExprId >())
virtual
virtual Double casacore::TableExprGroupFuncBase::getDouble ( const vector< TableExprId > &  = vector< TableExprId >())
virtual
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.

virtual Int64 casacore::TableExprGroupFuncBase::getInt ( const vector< TableExprId > &  = vector< TableExprId >())
virtual
virtual String casacore::TableExprGroupFuncBase::getString ( const vector< TableExprId > &  = vector< TableExprId >())
virtual
virtual Bool casacore::TableExprGroupFuncBase::isLazy ( ) const
virtual
TableExprGroupFuncBase& casacore::TableExprGroupFuncBase::operator= ( const TableExprGroupFuncBase )
private
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().

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

TableExprNodeRep* casacore::TableExprGroupFuncBase::itsNode
protected

Definition at line 250 of file ExprGroup.h.

TableExprNodeRep* casacore::TableExprGroupFuncBase::itsOperand
protected

Definition at line 251 of file ExprGroup.h.

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

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: