casacore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
casacore::TableExprIdAggr Class Reference

The Table Expression Selection id used with aggregation. More...

#include <TableExprIdAggr.h>

Inheritance diagram for casacore::TableExprIdAggr:
casacore::TableExprId

Public Member Functions

 TableExprIdAggr (const CountedPtr< TableExprGroupResult > &result)
 Construct it from the aggregation results. More...
 
const TableExprGroupResultresult () const
 Get out the aggregation result object. More...
 
uInt getMagicValue () const
 Get the magic value (to check if correct). More...
 
- Public Member Functions inherited from casacore::TableExprId
 TableExprId ()
 Default constructor sets rownr to -1. More...
 
 TableExprId (rownr_t rowNumber)
 Construct it from a row number. More...
 
 TableExprId (const RecordInterface &)
 Construct it from a Record object. More...
 
 TableExprId (const TableExprData &data)
 Construct it from pointers to data. More...
 
 ~TableExprId ()
 
Bool byRow () const
 Is the id given by row number? More...
 
Bool byRecord () const
 Is the id given as a RecordInterface? More...
 
Bool byData () const
 Is the id given as a TableExprData? More...
 
Int64 rownr () const
 Get the row number. More...
 
const RecordInterfacerecord () const
 Get the Record reference. More...
 
const TableExprDatadata () const
 Get the data reference. More...
 
void setRownr (rownr_t rownr)
 Set the row number. More...
 
void setRecord (const RecordInterface &)
 Set the record. More...
 

Static Public Member Functions

static const TableExprIdAggrcast (const TableExprId &id)
 Cast a TableExprId object to TableExprIdAggr. More...
 

Private Attributes

uInt itsMagicValue
 
CountedPtr< TableExprGroupResultitsResult
 

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:

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 86 of file TableExprIdAggr.h.

Constructor & Destructor Documentation

casacore::TableExprIdAggr::TableExprIdAggr ( const CountedPtr< TableExprGroupResult > &  result)
inlineexplicit

Construct it from the aggregation results.

Definition at line 90 of file TableExprIdAggr.h.

Member Function Documentation

static const TableExprIdAggr& casacore::TableExprIdAggr::cast ( const TableExprId id)
inlinestatic

Cast a TableExprId object to TableExprIdAggr.

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

Definition at line 105 of file TableExprIdAggr.h.

References AlwaysAssert, and getMagicValue().

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

Get the magic value (to check if correct).

Definition at line 100 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 96 of file TableExprIdAggr.h.

References itsResult.

Member Data Documentation

uInt casacore::TableExprIdAggr::itsMagicValue
private

Definition at line 113 of file TableExprIdAggr.h.

Referenced by getMagicValue().

CountedPtr<TableExprGroupResult> casacore::TableExprIdAggr::itsResult
private

Definition at line 114 of file TableExprIdAggr.h.

Referenced by result().


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