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
38class TableParseQuery;
39class TaQLStyle;
40
41// <summary>
42// Class containing static functions to handle TaQL functions.
43// </summary>
44
45// <use visibility=local>
46
47// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
48// </reviewed>
49
50// <synopsis>
51// This class contains a few functions to recognize TaQL functions.
52// A function name can be preceded by "shorthand.udflib." telling the
53// table to operate on and the UDF shared library containing the function.
54// Note that most functions are table agnostic, but a few (such as rowid())
55// are not. Also User Defined Functions (UDFs) can be table aware.
56// Both shorthand and udflib are optional. If a single part is given, it is
57// first tried as a shorthand.
58//
59// It looks up the function name and creates a TableExprFuncNode object for it.
60// If the function name is not standard, it is tried to create a TableExprUDFNode
61// object. Otherwise an exception is thrown.
62// </synopsis>
63
65 public:
66 // Make a function node.
67 // The name is split into shorthand, udflib and function as explained
68 // in the synopsis.
70 const TableExprNodeSet& arguments,
71 const Vector<int>& ignoreFuncs, const TableExprInfo& tabInfo,
72 const TaQLStyle&);
73
74 // Try to make a UDF function node for the given function name and arguments.
75 // The function name can contain "shorthand." and must contain "udflib.".
77 const TableExprNodeSet& arguments, const TableExprInfo& tabInfo,
78 const TaQLStyle&);
79
80 // Find the function code belonging to a function name.
81 // Functions to be ignored can be given (as function type values).
82 // If the function name is unknown, NRFUNC is returned.
84 const Vector<Int>& ignoreFuncs);
85};
86
87} // namespace casacore
88
89#endif
String: the storage and methods of handling collections of characters.
Definition String.h:355
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.
For temporary backward namespace compatibility, use casa as alias for casacore.
Definition mainpage.dox:28
unsigned int uInt
Definition aipstype.h:49
String name() const
Return the name of the field.