casacore
Loading...
Searching...
No Matches
ExprAggrNodeArray.h
Go to the documentation of this file.
1// # ExprAggrNodeArray.h: TaQL node representing an array aggregate function
2// # Copyright (C) 2013
3// # Associated Universities, Inc. Washington DC, USA.
4// #
5// # This library is free software; you can redistribute it and/or modify it
6// # under the terms of the GNU Library General Public License as published by
7// # the Free Software Foundation; either version 2 of the License, or (at your
8// # option) any later version.
9// #
10// # This library is distributed in the hope that it will be useful, but WITHOUT
11// # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12// # FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13// # License for more details.
14// #
15// # You should have received a copy of the GNU Library General Public License
16// # along with this library; if not, write to the Free Software Foundation,
17// # Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18// #
19// # Correspondence concerning AIPS++ should be addressed as follows:
20// # Internet email: casa-feedback@nrao.edu.
21// # Postal address: AIPS++ Project Office
22// # National Radio Astronomy Observatory
23// # 520 Edgemont Road
24// # Charlottesville, VA 22903-2475 USA
25
26#ifndef TABLES_EXPRAGGRNODEARRAY_H
27#define TABLES_EXPRAGGRNODEARRAY_H
28
29// # Includes
30#include <casacore/casa/aips.h>
31#include <casacore/tables/TaQL/ExprFuncNodeArray.h>
32
33namespace casacore { // # NAMESPACE CASACORE - BEGIN
34
35// # Forward Declarations.
38
39// <summary>
40// TaQL node representing an array aggregate function
41// </summary>
42
43// <use visibility=local>
44
45// <reviewed reviewer="" date="" tests="tTaQLNode">
46// </reviewed>
47
48// <synopsis>
49// This class is similar to TableExprAggrNode, but its result is an array
50// instead of a scalar value.
51// There are few aggregate functions resulting in an array. An example
52// is <src>gaggr</src>, which aggregates the non-empty arrays in a group
53// into a single array. Other functions (like medians, runningmean, etc.)
54// can be applied to its result making it quite versatile.
55//
56// Most array aggregate functions are lazy to avoid using too much memory.
57// </synopsis>
58
60 public:
61 // Constructor.
63 const TableExprNodeSet& source, const vector<TENShPtr>& nodes,
64 const Block<Int>& dtypeOper, const TaQLStyle& style);
65
66 // This node does aggregation.
67 virtual Bool isAggregate() const;
68
69 // Get the operand node.
70 TENShPtr operand() { return (operands().empty() ? TENShPtr() : operands()[0]); }
71
72 // Create the correct aggregate function object.
73 virtual std::shared_ptr<TableExprGroupFuncBase> makeGroupAggrFunc();
74
75 // Is the array aggregate function lazy?
76 virtual Bool isLazyAggregate() const;
77
78 // Functions to get the result of an aggregate function.
79 // <group>
86 // </group>
87
88 private:
89 // Create the correct aggregate function object.
90 std::shared_ptr<TableExprGroupFuncBase> doMakeGroupAggrFunc();
91
92 // # Data members.
93 std::shared_ptr<TableExprGroupFuncBase> itsFunc;
94};
95
96} // namespace casacore
97
98#endif
virtual MArray< MVTime > getArrayDate(const TableExprId &id)
virtual Bool isLazyAggregate() const
Is the array aggregate function lazy?
std::shared_ptr< TableExprGroupFuncBase > doMakeGroupAggrFunc()
Create the correct aggregate function object.
virtual MArray< String > getArrayString(const TableExprId &id)
std::shared_ptr< TableExprGroupFuncBase > itsFunc
virtual MArray< Double > getArrayDouble(const TableExprId &id)
virtual Bool isAggregate() const
This node does aggregation.
TENShPtr operand()
Get the operand node.
virtual MArray< DComplex > getArrayDComplex(const TableExprId &id)
virtual MArray< Bool > getArrayBool(const TableExprId &id)
Functions to get the result of an aggregate function.
virtual std::shared_ptr< TableExprGroupFuncBase > makeGroupAggrFunc()
Create the correct aggregate function object.
virtual MArray< Int64 > getArrayInt(const TableExprId &id)
TableExprAggrNodeArray(TableExprFuncNode::FunctionType, NodeDataType, ValueType, const TableExprNodeSet &source, const vector< TENShPtr > &nodes, const Block< Int > &dtypeOper, const TaQLStyle &style)
Constructor.
TableExprFuncNodeArray(TableExprFuncNode::FunctionType, NodeDataType, ValueType, const TableExprNodeSet &source, const vector< TENShPtr > &nodes, const Block< Int > &dtypeOper, const TaQLStyle &)
Constructor.
const std::vector< TENShPtr > & operands() const
Some functions to be used by TableExprNodeFuncArray.
Abstract base class for classes calculating an aggregated group result.
Definition ExprGroup.h:180
Class containing the results of aggregated values in a group.
Definition ExprGroup.h:740
NodeDataType
Define the data types of a node.
ValueType
Define the value types.
For temporary backward namespace compatibility, use casa as alias for casacore.
Definition mainpage.dox:28
Bool empty() const
Is the block empty (i.e.
Definition Block.h:574
std::shared_ptr< TableExprNodeRep > TENShPtr
Definition ExprNodeRep.h:56
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40