All Classes 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 2003 - 2013 David Nichols
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#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: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:203
q_func_t
AbstractQoreNode *(* q_func_t)(const QoreListNode *args, ExceptionSink *xsink)
the type used for builtin function signatures
Definition: common.h:215
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:200
QDOM_DEFAULT
#define QDOM_DEFAULT
the default domain (no domain)
Definition: Restrictions.h:102