casacore
Loading...
Searching...
No Matches
ExprUDFNodeArray.h
Go to the documentation of this file.
1//# ExprUDFNodeArray.h: Class representing an array UDF in select expression
2//# Copyright (C) 2010
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_EXPRUDFNODEARRAY_H
27#define TABLES_EXPRUDFNODEARRAY_H
28
29//# Includes
30#include <casacore/tables/TaQL/ExprNodeArray.h>
31#include <casacore/tables/TaQL/UDFBase.h>
32
33namespace casacore { //# NAMESPACE CASACORE - BEGIN
34
35 //# Forward Declarations
36 class TableExprNodeSet;
37
38 // <summary>
39 // Class representing an array UDF in select expression
40 // </summary>
41
42 // <use visibility=local>
43
44 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
45 // </reviewed>
46 // <prerequisite>
47 //# Classes you should understand before using this one.
48 // <li> <linkto class=TableExprNodeMulti>TableExprNodeMulti</linkto>
49 // </prerequisite>
50
51 // <synopsis>
52 // This class represents a function in a table select tree.
53 // The <src>rownumber</src> function is represented by class
54 // <linkto class=TableExprNodeRownr>TableExprNodeRownr</linkto>.
55 // The <src>rowid</src> function is represented by class
56 // <linkto class=TableExprNodeRowid>TableExprNodeRowid</linkto>.
57 // The <src>rand</src> function is represented by class
58 // <linkto class=TableExprNodeRandom>TableExprNodeRandom</linkto>.
59 // <p>
60 // When one wants to add a function to the table selection grammar,
61 // the following has to be done:
62 // <ul>
63 // <li> Add the function to the enum below.
64 // <li> Implement the function in the get functions in ExprFuncNode(Array).cc.
65 // <li> Implement the function in the checkOperands in ExprFuncNode.cc.
66 // <li> Declare and define the function in ExprNode.h (for C++ binding).
67 // <li> Add the function to findFunc in TableParse.cc (for TaQL).
68 // </ul>
69 // </synopsis>
70
71
73 {
74 public:
75
76 // Constructor
77 TableExprUDFNodeArray (const std::shared_ptr<UDFBase>& udf,
78 const TableExprInfo&,
79 const TableExprNodeSet& source);
80
81 // Destructor
82 ~TableExprUDFNodeArray() override = default;
83
84 // Flatten the node tree by adding the node and its children to the vector.
85 void flattenTree (std::vector<TableExprNodeRep*>&) override;
86
87 // Get the table info.
88 TableExprInfo getTableInfo() const override;
89
90 // Do not apply the selection.
91 void disableApplySelection() override;
92
93 // If needed, let the UDF re-create column objects for a selection of rows.
94 // It calls the function recreateColumnObjects.
95 void applySelection (const Vector<rownr_t>& rownrs) override;
96
97 // UDFs do not need a TableExprGroupFuncBase, so null is returned.
98 std::shared_ptr<TableExprGroupFuncBase> makeGroupAggrFunc() override;
99
100 // Functions to get the desired result of a function
101 // <group>
108 // </group>
109
110 private:
112 std::shared_ptr<UDFBase> itsUDF;
113 };
114
115
116} //# NAMESPACE CASACORE - END
117
118#endif
Class to connect a Table and its alias name.
MArray< Int64 > getArrayInt(const TableExprId &id) override
MArray< String > getArrayString(const TableExprId &id) override
void disableApplySelection() override
Do not apply the selection.
std::shared_ptr< UDFBase > itsUDF
void flattenTree(std::vector< TableExprNodeRep * > &) override
Flatten the node tree by adding the node and its children to the vector.
void applySelection(const Vector< rownr_t > &rownrs) override
If needed, let the UDF re-create column objects for a selection of rows.
MArray< DComplex > getArrayDComplex(const TableExprId &id) override
The default implementation of getArrayDComplex does getArrayDouble and converts the result.
~TableExprUDFNodeArray() override=default
Destructor.
TableExprUDFNodeArray(const std::shared_ptr< UDFBase > &udf, const TableExprInfo &, const TableExprNodeSet &source)
Constructor.
std::shared_ptr< TableExprGroupFuncBase > makeGroupAggrFunc() override
UDFs do not need a TableExprGroupFuncBase, so null is returned.
MArray< Double > getArrayDouble(const TableExprId &id) override
The default implementation of getArrayDouble does getArrayInt and converts the result.
MArray< MVTime > getArrayDate(const TableExprId &id) override
MArray< Bool > getArrayBool(const TableExprId &id) override
Functions to get the desired result of a function.
TableExprInfo getTableInfo() const override
Get the table info.
this file contains all the compiler specific defines
Definition mainpage.dox:28