BuiltinFunctionList Class Reference

the interface to the global list of all builtin functions in the library More...

#include <BuiltinFunctionList.h>

List of all members.

Static Public Member Functions

static DLLEXPORT void add (const char *name, q_func_t f, int functional_domain=QDOM_DEFAULT)
 adds a new builtin function to the list
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 to the list and allows for the return type and parameter types to be set
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 to the list and allows for the return type and parameter types to be set from lists
static DLLEXPORT int size ()
 returns the number of functions in the hash
static DLLEXPORT const
BuiltinFunction * 
find (const char *name)
 finds a function by its name

Detailed Description

the interface to the global list of all builtin functions in the library

The object is thread-safe; a hash or hash-map is used for lookups. There is only one of these, therefore we have static functions.


Member Function Documentation

static DLLEXPORT void BuiltinFunctionList::add ( const char *  name,
q_func_t  f,
int  functional_domain = QDOM_DEFAULT 
) [static]

adds a new builtin function to the list

Parameters:
name the name of the function
f a pointer to the actual C++ function to be executed when the function is called
functional_domain a capability mask of the function so that access to the function can be restricted if necessary; use QDOM_DEFAULT for none
static DLLEXPORT void BuiltinFunctionList::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,
  ... 
) [static]

adds a new builtin function to the list and allows for the return type and parameter types to be set

new in qore 0.8

Parameters:
name the name of the function
f a pointer to the actual C++ function to be executed when the function is called
code_flags flags for the function being added
functional_domain a capability mask of the function so that access to the function can be restricted if necessary; use QDOM_DEFAULT for none
returnTypeInfo the type information for the return value of this function
num_params the number of parameters specified for the function, there must be 2 arguments for each parameter, first, a const QoreTypeInfo *, giving the type information for the parameter, and second a const AbstractQoreNode * giving the default value if no argument is supplied by the caller
static DLLEXPORT void BuiltinFunctionList::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() 
) [static]

adds a new builtin function to the list and allows for the return type and parameter types to be set from lists

new in qore 0.8

Parameters:
name the name of the function
f a pointer to the actual C++ function to be executed when the function is called
code_flags flags for the function being added
functional_domain a capability mask of the function so that access to the function can be restricted if necessary; use QDOM_DEFAULT for none
returnTypeInfo the type information for the return value of this function
typeList a list of types for each parameter; must have num_param entries
defaultArgList a list of default argument values for each parameter if no argument is supplied by the caller
static DLLEXPORT const BuiltinFunction* BuiltinFunctionList::find ( const char *  name  )  [static]

finds a function by its name

Returns:
a pointer to the function found
static DLLEXPORT int BuiltinFunctionList::size (  )  [static]

returns the number of functions in the hash

Returns:
the number of functions in the hash

The documentation for this class was generated from the following file:

Generated on 14 Jun 2010 for Qore Programming Language by  doxygen 1.6.1