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 MArray<Bool> getArrayBool (
const vector<TableExprId>& = vector<TableExprId>());
238 virtual MArray<Int64> getArrayInt (
const vector<TableExprId>& = vector<TableExprId>());
239 virtual MArray<Double> getArrayDouble (
const vector<TableExprId>& = vector<TableExprId>());
240 virtual MArray<DComplex> getArrayDComplex (
const vector<TableExprId>& = vector<TableExprId>());
241 virtual MArray<MVTime> getArrayDate (
const vector<TableExprId>& = vector<TableExprId>());
242 virtual MArray<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 MArray<Bool> getArrayBool (
const vector<TableExprId>&);
298 virtual MArray<Int64> getArrayInt (
const vector<TableExprId>&);
299 virtual MArray<Double> getArrayDouble (
const vector<TableExprId>&);
302 virtual MArray<String> getArrayString (
const vector<TableExprId>&);
342 virtual Bool isLazy()
const;
363 virtual Bool isLazy()
const;
365 virtual MArray<Int64> getArrayInt (
const vector<TableExprId>&);
383 virtual Bool isLazy()
const;
385 virtual MArray<Bool> getArrayBool (
const vector<TableExprId>&);
386 virtual MArray<Int64> getArrayInt (
const vector<TableExprId>&);
387 virtual MArray<Double> getArrayDouble (
const vector<TableExprId>&);
390 virtual MArray<String> getArrayString (
const vector<TableExprId>&);
398 for (
size_t i=0; i<ids.size(); ++i) {
399 itsOperand->get (ids[i], result[i]);
409 for (
id=0;
id<ids.size(); ++id) {
410 itsOperand->get (ids[
id], arr);
419 if (
id == ids.size()) {
431 for (;
id<ids.size(); ++id) {
433 itsOperand->get (ids[
id], values);
439 miter->array() = values.
mask();
444 if (ndef < ids.size()) {
445 shp[shp.
size() - 1] = ndef;
448 mask.resize (shp,
True);
480 virtual Bool getBool (
const vector<TableExprId>&);
506 virtual Int64 getInt (
const vector<TableExprId>&);
507 virtual Double getDouble (
const vector<TableExprId>&);
534 virtual Double getDouble (
const vector<TableExprId>&);
561 virtual DComplex getDComplex (
const vector<TableExprId>&);
588 virtual MVTime getDate (
const vector<TableExprId>&);
615 virtual String getString (
const vector<TableExprId>&);
640 virtual MArray<Bool> getArrayBool (
const vector<TableExprId>&);
668 virtual MArray<Int64> getArrayInt (
const vector<TableExprId>&);
696 virtual MArray<Double> getArrayDouble (
const vector<TableExprId>&);
780 virtual MArray<String> getArrayString (
const vector<TableExprId>&);
818 const vector<CountedPtr<TableExprGroupFuncBase> >&
getFuncs()
const 831 vector<CountedPtr<TableExprGroupFuncBase> >
itsFuncs;
A Vector of integers, for indexing into Array<T> objects.
TableExprGroupFuncDate(TableExprNodeRep *node, const MVTime &initValue=MVTime())
TableExprNodeRep * itsNode
Bool isNull() const
Is the array null?
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.
Class holding the results of groupby and aggregation.
vector< TableExprGroupKey > itsKeys
TableExprGroupFuncArrayString(TableExprNodeRep *node)
TableExprNodeRep * itsOperand
MArray< MVTime > itsValue
LatticeExprNode mask(const LatticeExprNode &expr)
This function returns the mask of the given expression.
Class derived from TableExprGroupFuncBase representing a no function.
bool operator<(const TableExprGroupKey &) const
CountedPtr< vector< TableExprId > > itsIds
TableExprGroupFuncString(TableExprNodeRep *node, const String &initValue=String())
uInt ngroup() const
Get the nr of groups.
TableExprGroupFuncBool(TableExprNodeRep *node)
Abstract base class for aggregate functions giving a string scalar.
TableExprGroupFuncArrayDComplex(TableExprNodeRep *node)
MArray< String > itsValue
Class derived from TableExprGroupFuncBase collecting the ids in a group.
PtrHolder< T > & operator=(const PtrHolder< T > &other)
const TableExprId & getId() const
Get the TableExprId.
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.
Class collecting the arrays in a group.
Iterate an Array cursor through another Array.
const Array< Bool > & mask() const
Get the mask.
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.
void setSeqnr(uInt seqnr)
Set the function's sequence nr.
Abstract base class for aggregate functions giving a double array.
const vector< CountedPtr< TableExprGroupFuncBase > > & getFuncs() const
Get the vector of functions.
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.
const Array< T > & array() const
Get access to the 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.
MArray< Double > itsValue
vector< CountedPtr< vector< TableExprId > > > itsIds
TableExprNodeRep::NodeDataType itsDT
TableExprGroupFuncArrayBool(TableExprNodeRep *node)
bool Bool
Define the standard types used by Casacore.
const vector< TableExprId > & ids(uInt group) const
Get the set of TableExprIds for the given group.
Abstract base class for aggregate functions giving a date/time array.
vector< CountedPtr< TableExprGroupFuncSet > > itsFuncSets
TableExprNodeRep::NodeDataType dataType() const
Get the data type.
Class containing the results of aggregated values in a group.
void resize(const IPosition &shape, Bool useMask)
Resize the array and optionally the mask.
template <class T, class U> class vector;
TableExprGroupFuncArrayDouble(TableExprNodeRep *node)
Abstract base class for classes calculating an aggregated group result.
uInt seqnr() const
Get the function's sequence nr.
void addKey(TableExprNodeRep::NodeDataType dtype)
Add a key to end the set.
The identification of a TaQL selection subject.
TableExprGroupFuncSet & funcSet(uInt group) const
Get the set of functions (and their results) for the given group.
Class representing all keys in the groupby clause.
Abstract base class for aggregate functions giving a dcomplex array.
MArray< DComplex > itsValue
const IPosition & shape() const
Get the shape.
Bool hasMask() const
Is there a mask?
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.
Base class for an array with an optional mask.
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)
uInt ndim() const
Get the dimensionality.
bool operator==(const TableExprGroupKey &) const
Compare this and that key.
this file contains all the compiler specific defines
MArray< T > getArray(const vector< TableExprId > &ids)