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
33
34namespace casacore { //# NAMESPACE CASACORE - BEGIN
35
36 //# Forward Declarations.
37 class TableExprGroupFuncBase;
38 class TableExprGroupFuncSet;
39
40// <summary>
41// TaQL node representing an array aggregate function
42// </summary>
43
44// <use visibility=local>
45
46// <reviewed reviewer="" date="" tests="tTaQLNode">
47// </reviewed>
48
49// <synopsis>
50// This class is similar to TableExprAggrNode, but its result is an array
51// instead of a scalar value.
52// There are few aggregate functions resulting in an array. An example
53// is <src>gaggr</src>, which aggregates the non-empty arrays in a group
54// into a single array. Other functions (like medians, runningmean, etc.)
55// can be applied to its result making it quite versatile.
56//
57// Most array aggregate functions are lazy to avoid using too much memory.
58// </synopsis>
59
61 {
62 public:
63 // Constructor.
66 const TableExprNodeSet& source,
67 const vector<TENShPtr>& nodes,
68 const Block<Int>& dtypeOper,
69 const TaQLStyle& style);
70
71 // This node does aggregation.
72 virtual Bool isAggregate() const;
73
74 // Get the operand node.
76 { return (operands().empty() ? TENShPtr() : operands()[0]); }
77
78 // Create the correct aggregate function object.
79 virtual std::shared_ptr<TableExprGroupFuncBase> makeGroupAggrFunc();
80
81 // Is the array aggregate function lazy?
82 virtual Bool isLazyAggregate() const;
83
84 // Functions to get the result of an aggregate function.
85 // <group>
92 // </group>
93
94 private:
95 // Create the correct aggregate function object.
96 std::shared_ptr<TableExprGroupFuncBase> doMakeGroupAggrFunc();
97
98 //# Data members.
99 std::shared_ptr<TableExprGroupFuncBase> itsFunc;
100 };
101
102
103} //# NAMESPACE CASACORE - END
104
105#endif
simple 1-D array
Definition Block.h:198
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.
const std::vector< TENShPtr > & operands() const
Some functions to be used by TableExprNodeFuncArray.
NodeDataType
Define the data types of a node.
ValueType
Define the value types.
this file contains all the compiler specific defines
Definition mainpage.dox:28
std::shared_ptr< TableExprNodeRep > TENShPtr
Definition ExprNodeRep.h:55
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40