casacore
Loading...
Searching...
No Matches
ExprNodeUtil.h
Go to the documentation of this file.
1//# ExprNodeUtil.h: Utility functions for TableExprNodeRep objects
2//# Copyright (C) 2022
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_EXPRNODEUTIL_H
27#define TABLES_EXPRNODEUTIL_H
28
29//# Includes
30#include <casacore/casa/aips.h>
31#include <casacore/tables/TaQL/ExprNodeRep.h>
32#include <vector>
33
34namespace casacore { //# NAMESPACE CASACORE - BEGIN
35
36// <summary>
37// Class to handle a Regex or StringDistance.
38// </summary>
39
40// <use visibility=local>
41
42// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
43// </reviewed>
44
45// <prerequisite>
46//# Classes you should understand before using this one.
47// <li> <linkto class=Regex>Regex</linkto>
48// <li> <linkto class=StringDistance>StringDistance</linkto>
49// </prerequisite>
50
51// <synopsis>
52// A StringDistance (Levensthein distance) in TaQL is given in the same way
53// as a Regex. This class is needed to have a single object in the parse tree
54// objects containing them (in class TableExprNodeConstRegex).
55// </synopsis>
56
57 namespace TableExprNodeUtil
58 {
59 // Throw an exception if an aggregate function is used in
60 // the expression node or its children.
62
63 // Get the aggregate function nodes used in the node and its children.
64 std::vector<TableExprNodeRep*> getAggrNodes (TableExprNodeRep* node);
65
66 // Get the column nodes used in the node and its children.
67 std::vector<TableExprNodeRep*> getColumnNodes (TableExprNodeRep* node);
68
69 // Get the (unique) tables used in the node and its children.
70 // If <src>properMain</src> only proper main tables (i.e., tables
71 // specified in the FROM clause) are returned.
72 std::vector<Table> getNodeTables (TableExprNodeRep* node,
73 Bool properMain);
74
75 // Get the nr of rows in the tables used.
76 // An exception is thrown if the tables differ in the nr of rows.
77 rownr_t getCheckNRow (const std::vector<Table>&);
78}
79
80
81} //# NAMESPACE CASACORE - END
82
83#endif
Abstract base class for a node in a table column expression tree.
std::vector< Table > getNodeTables(TableExprNodeRep *node, Bool properMain)
Get the (unique) tables used in the node and its children.
std::vector< TableExprNodeRep * > getColumnNodes(TableExprNodeRep *node)
Get the column nodes used in the node and its children.
std::vector< TableExprNodeRep * > getAggrNodes(TableExprNodeRep *node)
Get the aggregate function nodes used in the node and its children.
void checkAggrFuncs(TableExprNodeRep *node)
Throw an exception if an aggregate function is used in the expression node or its children.
rownr_t getCheckNRow(const std::vector< Table > &)
Get the nr of rows in the tables used.
this file contains all the compiler specific defines
Definition mainpage.dox:28
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40
uInt64 rownr_t
Define the type of a row number in a table.
Definition aipsxtype.h:44