The Table Expression Selection id used with aggregation. More...
#include <TableExprIdAggr.h>
Public Member Functions | |
TableExprIdAggr (const CountedPtr< TableExprGroupResult > &result) | |
Construct it from the aggregation results. | |
const TableExprGroupResult & | result () const |
Get out the aggregation result object. | |
uInt | getMagicValue () const |
Get the magic value (to check if it correct). | |
Static Public Member Functions | |
static const TableExprIdAggr & | cast (const TableExprId &id) |
Cast a TableExprId object to TableExprIdAggr. | |
Private Attributes | |
uInt | itsMagicValue |
CountedPtr< TableExprGroupResult > | itsResult |
The Table Expression Selection id used with aggregation.
Public interface
This class provides the user the ability to identify the data objects to test in a TaQL expression using aggregate functions.
It adds a TableExprGroupResult object to the TableExprId class which is used by the various classes derived from TableExprGroupFuncBase to get or evaluate the aggregated value. An aggregated value can be determined in two ways:
apply
function. Each group has a TableExprGroupFuncSet containing the values of all immediate aggregate functions of that group. A vector of these objects is part of of TableExprGroupResult and is used by the TableExprAggrNode(Array) get
functions to return the correct value. get
function. It uses the vector of TableExprId objects in TableExprGroupResult to know which rows (or records) belong to which group. Note that UDF aggregate functions are always lazy. TableExprIdAggr contains a static function to (statically) cast a TableExprId object to TableExprIdAggr. A magic value is used to check that the cast is valid.
No dynamic_cast is used, because it requires TableExprId to contain virtual functions making the object larger. TaQL can hold quite large vectors of TableExprId objects, so such overhead is unacceptably large.
This class makes it possible to retrieve aggregated values using the standard get
functions taking an TableExprId.
Definition at line 87 of file TableExprIdAggr.h.
casacore::TableExprIdAggr::TableExprIdAggr | ( | const CountedPtr< TableExprGroupResult > & | result | ) | [inline, explicit] |
Construct it from the aggregation results.
Definition at line 91 of file TableExprIdAggr.h.
static const TableExprIdAggr& casacore::TableExprIdAggr::cast | ( | const TableExprId & | id | ) | [inline, static] |
Cast a TableExprId object to TableExprIdAggr.
It check if the cast if correct by checking the magic value.
Definition at line 106 of file TableExprIdAggr.h.
References AlwaysAssert, and getMagicValue().
uInt casacore::TableExprIdAggr::getMagicValue | ( | ) | const [inline] |
Get the magic value (to check if it correct).
Definition at line 101 of file TableExprIdAggr.h.
References itsMagicValue.
Referenced by cast().
const TableExprGroupResult& casacore::TableExprIdAggr::result | ( | ) | const [inline] |
Get out the aggregation result object.
Definition at line 97 of file TableExprIdAggr.h.
References itsResult.
uInt casacore::TableExprIdAggr::itsMagicValue [private] |
Definition at line 114 of file TableExprIdAggr.h.
Referenced by getMagicValue().
Definition at line 115 of file TableExprIdAggr.h.
Referenced by result().