Qore Programming Language 0.8.8

- Main Page
- Related Pages
- Modules
- Classes
- Files

- File List
- File Members

All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
BuiltinFunctionList.h
Go to the documentation of this file.
1 /* -*- mode: c++; indent-tabs-mode: nil -*- */
2 /*
3 BuiltinFunctionList.h
4
5 Qore programming language
6
7 Copyright 2003 - 2013 David Nichols
8
9 This library is free software; you can redistribute it and/or
10 modify it under the terms of the GNU Lesser General Public
11 License as published by the Free Software Foundation; either
12 version 2.1 of the License, or (at your option) any later version.
13
14 This library is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 Lesser General Public License for more details.
18
19 You should have received a copy of the GNU Lesser General Public
20 License along with this library; if not, write to the Free Software
21 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 */
23
24 #ifndef _QORE_BUILTINFUNCTIONLIST_H
25
26 #define _QORE_BUILTINFUNCTIONLIST_H
27
28 #include <qore/common.h>
29 #include <qore/Restrictions.h>
30 #include <qore/QoreThreadLock.h>
31
32 #include <stdarg.h>
33
41 class QoreFunction;
42
44
47 class BuiltinFunctionList {
48 private:
49 // not implemented
50 DLLLOCAL BuiltinFunctionList(const BuiltinFunctionList&);
51 DLLLOCAL BuiltinFunctionList& operator=(const BuiltinFunctionList&);
52 DLLLOCAL void *operator new(size_t);
53
54 public:
55 DLLLOCAL BuiltinFunctionList();
56
58
65 DLLEXPORT static void add(const char *name, q_func_t f, int functional_domain = QDOM_DEFAULT);
66
68
80 DLLEXPORT static void add2(const char *name, q_func_t f, int64 code_flags = QC_NO_FLAGS, int64 functional_domain = QDOM_DEFAULT, const QoreTypeInfo *returnTypeInfo = 0, unsigned num_params = 0, ...);
81
83
96 DLLEXPORT static void add3(const char *name, q_func_t f, int64 code_flags = QC_NO_FLAGS, int64 functional_domain = QDOM_DEFAULT, const QoreTypeInfo *returnTypeInfo = 0, const type_vec_t &typeList = type_vec_t(), const arg_vec_t &defaultArgList = arg_vec_t());
97
99
101 DLLEXPORT static int size();
102
104
108 DLLEXPORT static const QoreFunction* find(const char *name);
109 };
110
112
114 DLLEXPORT extern BuiltinFunctionList builtinFunctions;
115
116 #endif // _QORE_BUILTINFUNCTIONLIST_H
BuiltinFunctionList::add2
static DLLEXPORT void add2(const char *name, q_func_t f, int64 code_flags=QC_NO_FLAGS, int64 functional_domain=QDOM_DEFAULT, const QoreTypeInfo *returnTypeInfo=0, unsigned num_params=0,...)
adds a new builtin function variant to the &quot;Qore&quot; namespace and allows for the return type and parame...
Restrictions.h
BuiltinFunctionList
the interface to the global list of all builtin functions in the library
Definition: BuiltinFunctionList.h:47
BuiltinFunctionList::add
static DLLEXPORT void add(const char *name, q_func_t f, int functional_domain=QDOM_DEFAULT)
adds a new builtin function variant to the &quot;Qore&quot; namespace
arg_vec_t
std::vector< AbstractQoreNode * > arg_vec_t
vector of value information for default argument lists
Definition: common.h:202
q_func_t
AbstractQoreNode *(* q_func_t)(const QoreListNode *args, ExceptionSink *xsink)
the type used for builtin function signatures
Definition: common.h:214
builtinFunctions
DLLEXPORT BuiltinFunctionList builtinFunctions
old interface to the compeltely-removed builtin function list; now functions are stored in namespaces...
BuiltinFunctionList::find
static DLLEXPORT const QoreFunction * find(const char *name)
finds a function by its name in the current QoreProgram object; if there is none, then returns 0 ...
num_params
static unsigned num_params(const QoreListNode *n)
returns the number of arguments passed to the function
Definition: params.h:46
BuiltinFunctionList::size
static DLLEXPORT int size()
always returns 0
BuiltinFunctionList::add3
static DLLEXPORT void add3(const char *name, q_func_t f, int64 code_flags=QC_NO_FLAGS, int64 functional_domain=QDOM_DEFAULT, const QoreTypeInfo *returnTypeInfo=0, const type_vec_t &typeList=type_vec_t(), const arg_vec_t &defaultArgList=arg_vec_t())
adds a new builtin function variant to the &quot;Qore&quot; and allows for the return type and parameter types ...
common.h
type_vec_t
std::vector< const QoreTypeInfo * > type_vec_t
vector of type information for parameter lists
Definition: common.h:199
QDOM_DEFAULT
#define QDOM_DEFAULT
the default domain (no domain)
Definition: Restrictions.h:102