Loading...
Searching...
No Matches
casacore::TableExprIdAggr Class Reference
tables package (libcasa_tables) » TaQL_module

More...

`#include <TableExprIdAggr.h>`

## Public Member Functions

| TableExprIdAggr (const std::shared_ptr< 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 correct).
Public Member Functions inherited from casacore::TableExprId
| TableExprId ()
| Default constructor sets rownr to -1.
| TableExprId (rownr_t rowNumber)
| Construct it from a row number.
| TableExprId (const RecordInterface &)
| Construct it from a Record object.
| TableExprId (const TableExprData &data)
| Construct it from pointers to data.
| ~TableExprId ()
Bool | byRow () const
| Is the id given by row number?
Bool | byRecord () const
| Is the id given as a RecordInterface?
Bool | byData () const
| Is the id given as a TableExprData?
Int64 | rownr () const
| Get the row number.
const RecordInterface & | record () const
| Get the Record reference.
const TableExprData & | data () const
| Get the data reference.
void | setRownr (rownr_t rownr)
| Set the row number.
void | setRecord (const RecordInterface &)
| Set the record.

## Static Public Member Functions

static const TableExprIdAggr & | cast (const TableExprId &id)
| Cast a TableExprId object to TableExprIdAggr.

## Private Attributes

uInt | itsMagicValue
std::shared_ptr< TableExprGroupResult > | itsResult

## Detailed Description

The Table Expression Selection id used with aggregation

### Intended use:

Public interface

### Review Status

Reviewed By:
  UNKNOWN
Date Reviewed:
  before2004/08/25
Test programs:
  tExprGroup

### Synopsis

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:

- An immediate aggregate function has calculated its value in its 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.
- A lazy aggregate function calculates the value as part of its 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.

### Motivation

This class makes it possible to retrieve aggregated values using the standard get functions taking an TableExprId.

Definition at line 83 of file TableExprIdAggr.h.

## Constructor & Destructor Documentation

## TableExprIdAggr()

casacore::TableExprIdAggr::TableExprIdAggr | ( | const std::shared_ptr< TableExprGroupResult > & | result | ) |

inline explicit

Construct it from the aggregation results.

Definition at line 87 of file TableExprIdAggr.h.

References itsMagicValue, itsResult, and result().

Referenced by cast().

## Member Function Documentation

## cast()

const TableExprIdAggr & casacore::TableExprIdAggr::cast | ( | const TableExprId & | id | ) |

inline static

Cast a TableExprId object to TableExprIdAggr.

It checks if the cast is correct by checking the magic value.

Definition at line 102 of file TableExprIdAggr.h.

References AlwaysAssert, getMagicValue(), casacore::TableExprId::TableExprId(), and TableExprIdAggr().

## getMagicValue()

uInt casacore::TableExprIdAggr::getMagicValue | ( |  | ) | const

inline

Get the magic value (to check if correct).

Definition at line 97 of file TableExprIdAggr.h.

References itsMagicValue.

Referenced by cast().

## result()

const TableExprGroupResult & casacore::TableExprIdAggr::result | ( |  | ) | const

inline

Get out the aggregation result object.

Definition at line 93 of file TableExprIdAggr.h.

References itsResult.

Referenced by TableExprIdAggr().

## Member Data Documentation

## itsMagicValue

uInt casacore::TableExprIdAggr::itsMagicValue

private

Definition at line 110 of file TableExprIdAggr.h.

Referenced by getMagicValue(), and TableExprIdAggr().

## itsResult

std::shared_ptr<TableExprGroupResult> casacore::TableExprIdAggr::itsResult

private

Definition at line 111 of file TableExprIdAggr.h.

Referenced by result(), and TableExprIdAggr().

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

- tables/TaQL/TableExprIdAggr.h