All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
BuiltinFunctionList.h
Go to the documentation of this file.
/* -*- mode: c++; indent-tabs-mode: nil -*- */
/*
BuiltinFunctionList.h
Qore programming language
Copyright (C) 2003 - 2015 David Nichols
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
Note that the Qore library is released under a choice of three open-source
licenses: MIT (as above), LGPL 2+, or GPL 2+; see README-LICENSE for more
information.
*/
#ifndef _QORE_BUILTINFUNCTIONLIST_H
#define _QORE_BUILTINFUNCTIONLIST_H
#include <qore/common.h>
#include <qore/Restrictions.h>
#include <qore/QoreThreadLock.h>
#include <stdarg.h>
class QoreFunction;
class BuiltinFunctionList {
private:
// not implemented
DLLLOCAL BuiltinFunctionList(const BuiltinFunctionList&);
DLLLOCAL BuiltinFunctionList& operator=(const BuiltinFunctionList&);
DLLLOCAL void *operator new(size_t);
public:
DLLLOCAL BuiltinFunctionList();
DLLEXPORT static void add(const char *name, q_func_t f, int functional_domain = QDOM_DEFAULT);
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, ...);
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());
DLLEXPORT static int size();
DLLEXPORT static const QoreFunction* find(const char *name);
};
DLLEXPORT extern BuiltinFunctionList builtinFunctions;
#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:55
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
q_func_t
AbstractQoreNode *(* q_func_t)(const QoreListNode *args, ExceptionSink *xsink)
the type used for builtin function signatures
Definition: common.h:261
builtinFunctions
DLLEXPORT BuiltinFunctionList builtinFunctions
old interface to the compeltely-removed builtin function list; now functions are stored in namespaces...
arg_vec_t
std::vector< AbstractQoreNode * > arg_vec_t
vector of value information for default argument lists
Definition: common.h:235
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:62
BuiltinFunctionList::size
static DLLEXPORT int size()
always returns 0
int64
long long int64
64bit integer type, cannot use int64_t here since it breaks the API on some 64-bit systems due to equ...
Definition: common.h:241
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:232
QDOM_DEFAULT
#define QDOM_DEFAULT
the default domain (no domain)
Definition: Restrictions.h:146