28 #ifndef TABLES_EXPRGROUP_H 29 #define TABLES_EXPRGROUP_H 32 #include <casacore/casa/aips.h> 33 #include <casacore/casa/BasicSL/String.h> 34 #include <casacore/tables/TaQL/ExprAggrNode.h> 116 void fill (
const vector<TableExprNode>& nodes,
const TableExprId&
id);
155 const vector<
CountedPtr<vector<TableExprId> > >& ids);
158 {
return itsFuncSets.size(); }
161 {
return *itsFuncSets[group]; }
163 const vector<TableExprId>&
ids (
uInt group)
const 164 {
return *itsIds[group]; }
167 vector<CountedPtr<vector<TableExprId> > >
itsIds;
210 virtual Bool isLazy()
const;
216 { itsSeqnr = seqnr; }
222 virtual void finish();
231 virtual Bool getBool (
const vector<TableExprId>& = vector<TableExprId>());
232 virtual Int64 getInt (
const vector<TableExprId>& = vector<TableExprId>());
233 virtual Double getDouble (
const vector<TableExprId>& = vector<TableExprId>());
234 virtual DComplex getDComplex (
const vector<TableExprId>& = vector<TableExprId>());
235 virtual MVTime getDate (
const vector<TableExprId>& = vector<TableExprId>());
236 virtual String getString (
const vector<TableExprId>& = vector<TableExprId>());
237 virtual Array<Bool> getArrayBool (
const vector<TableExprId>& = vector<TableExprId>());
238 virtual Array<Int64> getArrayInt (
const vector<TableExprId>& = vector<TableExprId>());
239 virtual Array<Double> getArrayDouble (
const vector<TableExprId>& = vector<TableExprId>());
240 virtual Array<DComplex> getArrayDComplex (
const vector<TableExprId>& = vector<TableExprId>());
241 virtual Array<MVTime> getArrayDate (
const vector<TableExprId>& = vector<TableExprId>());
242 virtual Array<String> getArrayString (
const vector<TableExprId>& = vector<TableExprId>());
271 virtual Bool isLazy()
const;
291 virtual Bool getBool (
const vector<TableExprId>&);
292 virtual Int64 getInt (
const vector<TableExprId>&);
293 virtual Double getDouble (
const vector<TableExprId>&);
294 virtual DComplex getDComplex (
const vector<TableExprId>&);
295 virtual MVTime getDate (
const vector<TableExprId>&);
296 virtual String getString (
const vector<TableExprId>&);
297 virtual Array<Bool> getArrayBool (
const vector<TableExprId>&);
298 virtual Array<Int64> getArrayInt (
const vector<TableExprId>&);
299 virtual Array<Double> getArrayDouble (
const vector<TableExprId>&);
301 virtual Array<MVTime> getArrayDate (
const vector<TableExprId>&);
302 virtual Array<String> getArrayString (
const vector<TableExprId>&);
342 virtual Bool isLazy()
const;
363 virtual Bool isLazy()
const;
365 virtual Array<Int64> getArrayInt (
const vector<TableExprId>&);
383 virtual Bool isLazy()
const;
385 virtual Array<Bool> getArrayBool (
const vector<TableExprId>&);
386 virtual Array<Int64> getArrayInt (
const vector<TableExprId>&);
387 virtual Array<Double> getArrayDouble (
const vector<TableExprId>&);
389 virtual Array<MVTime> getArrayDate (
const vector<TableExprId>&);
390 virtual Array<String> getArrayString (
const vector<TableExprId>&);
398 for (
size_t i=0; i<ids.size(); ++i) {
399 itsOperand->get (ids[i], result[i]);
406 itsOperand->get (ids[0], arr);
414 while (! iter.pastEnd()) {
415 itsOperand->get (ids[i], iter.array());
448 virtual Bool getBool (
const vector<TableExprId>&);
474 virtual Int64 getInt (
const vector<TableExprId>&);
475 virtual Double getDouble (
const vector<TableExprId>&);
502 virtual Double getDouble (
const vector<TableExprId>&);
529 virtual DComplex getDComplex (
const vector<TableExprId>&);
556 virtual MVTime getDate (
const vector<TableExprId>&);
583 virtual String getString (
const vector<TableExprId>&);
608 virtual Array<Bool> getArrayBool (
const vector<TableExprId>&);
636 virtual Array<Int64> getArrayInt (
const vector<TableExprId>&);
664 virtual Array<Double> getArrayDouble (
const vector<TableExprId>&);
720 virtual Array<MVTime> getArrayDate (
const vector<TableExprId>&);
748 virtual Array<String> getArrayString (
const vector<TableExprId>&);
786 const vector<CountedPtr<TableExprGroupFuncBase> >&
getFuncs()
const 799 vector<CountedPtr<TableExprGroupFuncBase> >
itsFuncs;
A Vector of integers, for indexing into Array<T> objects.
TableExprGroupFuncDate(TableExprNodeRep *node, const MVTime &initValue=MVTime())
TableExprNodeRep * itsNode
uInt seqnr() const
Get the function's sequence nr.
A 1-D Specialization of the Array class.
long long Int64
Define the extra non-standard types used by Casacore (like proposed uSize, Size)
Abstract base class for aggregate functions giving a dcomplex scalar.
TableExprGroupKey(TableExprNodeRep::NodeDataType dtype)
Construct for a given data type.
Non-templated base class for templated Array class.
Class holding the results of groupby and aggregation.
vector< TableExprGroupKey > itsKeys
TableExprGroupFuncArrayString(TableExprNodeRep *node)
TableExprNodeRep * itsOperand
uInt ngroup() const
Get the nr of groups.
Class derived from TableExprGroupFuncBase representing a no function.
CountedPtr< vector< TableExprId > > itsIds
TableExprGroupFuncString(TableExprNodeRep *node, const String &initValue=String())
TableExprGroupFuncBool(TableExprNodeRep *node)
Abstract base class for aggregate functions giving a string scalar.
bool operator==(const TableExprGroupKey &) const
Compare this and that key.
TableExprGroupFuncArrayDComplex(TableExprNodeRep *node)
Class derived from TableExprGroupFuncBase collecting the ids in a group.
PtrHolder< T > & operator=(const PtrHolder< T > &other)
bool operator<(const TableExprGroupKey &) const
NodeDataType
Define the data types of a node.
Abstract base class for a node in a table column expression tree.
Abstract base class for aggregate functions giving a double scalar.
const TableExprId & getId() const
Get the TableExprId.
Class collecting the arrays in a group.
Iterate an Array cursor through another Array.
TableExprGroupFuncBool(TableExprNodeRep *node, Bool initValue)
void append(const IPosition &other)
Append this IPosition with another one (causing a resize).
TableExprGroupFuncInt(TableExprNodeRep *node, Int64 initValue=0)
Class derived from TableExprGroupFuncBase for the first value in a group.
TableExprNodeRep::NodeDataType dataType() const
Get the data type.
TableExprGroupFuncSet & funcSet(uInt group) const
Get the set of functions (and their results) for the given group.
void setSeqnr(uInt seqnr)
Set the function's sequence nr.
Abstract base class for aggregate functions giving a double array.
Abstract base class for aggregate functions giving a date/time scalar.
TableExprGroupFuncArrayInt(TableExprNodeRep *node)
TableExprGroupFuncArrayDate(TableExprNodeRep *node)
Referenced counted pointer for constant data.
Abstract base class for aggregate functions giving a bool array.
uInt ndim() const
The dimensionality of this array.
Abstract base class for aggregate functions giving a bool scalar.
vector< CountedPtr< TableExprGroupFuncBase > > itsFuncs
std::complex< Double > DComplex
Class derived from TableExprGroupFuncBase for the first value in a group.
vector< CountedPtr< vector< TableExprId > > > itsIds
TableExprNodeRep::NodeDataType itsDT
TableExprGroupFuncArrayBool(TableExprNodeRep *node)
bool Bool
Define the standard types used by Casacore.
Abstract base class for aggregate functions giving a date/time array.
const vector< TableExprId > & ids(uInt group) const
Get the set of TableExprIds for the given group.
vector< CountedPtr< TableExprGroupFuncSet > > itsFuncSets
Class containing the results of aggregated values in a group.
Array< T > getArray(const vector< TableExprId > &ids)
Array< DComplex > itsValue
TableExprGroupFuncArrayDouble(TableExprNodeRep *node)
Abstract base class for classes calculating an aggregated group result.
void addKey(TableExprNodeRep::NodeDataType dtype)
Add a key to end the set.
The identification of a TaQL selection subject.
Class representing all keys in the groupby clause.
Abstract base class for aggregate functions giving a dcomplex array.
Class representing a key in the groupby clause.
Abstract base class for aggregate functions giving an integer scalar.
String: the storage and methods of handling collections of characters.
TableExprGroupFuncDComplex(TableExprNodeRep *node, const DComplex &initValue=DComplex())
Abstract base class for aggregate functions giving an integer array.
Array< T > & array()
Return the cursor.
Class to handle date/time type conversions and I/O.
Class collecting the rowids of entries in a group.
Abstract base class for aggregate functions giving a string array.
TableExprGroupFuncDouble(TableExprNodeRep *node, Double initValue=0)
this file contains all the compiler specific defines
const IPosition & shape() const
The length of each axis.
const vector< CountedPtr< TableExprGroupFuncBase > > & getFuncs() const
Get the vector of functions.