casacore
Loading...
Searching...
No Matches
TableParseFunc.h
Go to the documentation of this file.
1//# TableParseFunc.h: Class handling TaQL functions
2//# Copyright (C) 1994-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_TABLEPARSEFUNC_H
27#define TABLES_TABLEPARSEFUNC_H
28
29//# Includes
30#include <casacore/casa/aips.h>
31#include <casacore/tables/TaQL/ExprNodeSet.h>
32#include <casacore/tables/TaQL/ExprFuncNode.h>
33#include <vector>
34
35namespace casacore { //# NAMESPACE CASACORE - BEGIN
36
37 //# Forward declarations
38 class TableParseQuery;
39 class TaQLStyle;
40
41
42 // <summary>
43 // Class containing static functions to handle TaQL functions.
44 // </summary>
45
46 // <use visibility=local>
47
48 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
49 // </reviewed>
50
51 // <synopsis>
52 // This class contains a few functions to recognize TaQL functions.
53 // A function name can be preceded by "shorthand.udflib." telling the
54 // table to operate on and the UDF shared library containing the function.
55 // Note that most functions are table agnostic, but a few (such as rowid())
56 // are not. Also User Defined Functions (UDFs) can be table aware.
57 // Both shorthand and udflib are optional. If a single part is given, it is
58 // first tried as a shorthand.
59 //
60 // It looks up the function name and creates a TableExprFuncNode object for it.
61 // If the function name is not standard, it is tried to create a TableExprUDFNode
62 // object. Otherwise an exception is thrown.
63 // </synopsis>
64
66 {
67 public:
68 // Make a function node.
69 // The name is split into shorthand, udflib and function as explained
70 // in the synopsis.
72 const String& name,
73 const TableExprNodeSet& arguments,
74 const Vector<int>& ignoreFuncs,
75 const TableExprInfo& tabInfo,
76 const TaQLStyle&);
77
78 // Try to make a UDF function node for the given function name and arguments.
79 // The function name can contain "shorthand." and must contain "udflib.".
81 const String& name,
82 const TableExprNodeSet& arguments,
83 const TableExprInfo& tabInfo,
84 const TaQLStyle&);
85
86 // Find the function code belonging to a function name.
87 // Functions to be ignored can be given (as function type values).
88 // If the function name is unknown, NRFUNC is returned.
90 uInt narguments,
91 const Vector<Int>& ignoreFuncs);
92 };
93
94
95} //# NAMESPACE CASACORE - END
96
97#endif
String: the storage and methods of handling collections of characters.
Definition String.h:223
Class to connect a Table and its alias name.
static TableExprFuncNode::FunctionType findFunc(const String &name, uInt narguments, const Vector< Int > &ignoreFuncs)
Find the function code belonging to a function name.
static TableExprNode makeUDFNode(TableParseQuery *, const String &name, const TableExprNodeSet &arguments, const TableExprInfo &tabInfo, const TaQLStyle &)
Try to make a UDF function node for the given function name and arguments.
static TableExprNode makeFuncNode(TableParseQuery *, const String &name, const TableExprNodeSet &arguments, const Vector< int > &ignoreFuncs, const TableExprInfo &tabInfo, const TaQLStyle &)
Make a function node.
this file contains all the compiler specific defines
Definition mainpage.dox:28
unsigned int uInt
Definition aipstype.h:49