KSeExpr
4.0.4.0
|
Function Definition, used in parse tree and func table. More...
#include <ExprFunc.h>
Public Types | |
using | Define = void(*)(const char *, const ExprFunc &) |
using | Define3 = void(*)(const char *, const ExprFunc &, const char *) |
Static Public Member Functions | |
static void | init () |
call to define built-in funcs More... | |
static void | cleanup () |
cleanup all functions More... | |
static void | define (const char *name, const ExprFunc &f, const char *docString) |
static void | define (const char *name, const ExprFunc &f) |
static const ExprFunc * | lookup (const std::string &name) |
Lookup a builtin function by name. More... | |
static void | getFunctionNames (std::vector< std::string > &names) |
Get a list of registered builtin and DSO generated functions. More... | |
static std::string | getDocString (const char *functionName) |
Get doc string for a specific function. More... | |
static size_t | sizeInBytes () |
Get the total size estimate of all plugins. More... | |
static Statistics | statistics () |
Dump statistics. More... | |
Static Private Member Functions | |
static void | initInternal () |
Private Attributes | |
ExprFuncStandard | _standardFunc |
ExprFuncX * | _func {nullptr} |
int | _minargs {0} |
int | _maxargs {0} |
Function Definition, used in parse tree and func table.
This class in a static setting manages all builtin functions defined by SeExpr internally. These can be queried by name for documentation.
Users can create their own custom functions by creating one of these with the appropriate argument template. Any function that doesn't work within the given templates can be written using a ExprFuncX template instead
Note: If you use the convenience prototypes instead of ExprFuncX, the user defined function will be assumed to be thread safe. If you have a thread unsafe function be sure to use ExprFuncX and call the base constructor with false.
Definition at line 34 of file ExprFunc.h.
using KSeExpr::ExprFunc::Define = void (*)(const char *, const ExprFunc &) |
Definition at line 49 of file ExprFunc.h.
using KSeExpr::ExprFunc::Define3 = void (*)(const char *, const ExprFunc &, const char *) |
Definition at line 50 of file ExprFunc.h.
|
default |
|
inline |
User defined function with custom argument parsing.
Definition at line 72 of file ExprFunc.h.
|
inline |
Definition at line 77 of file ExprFunc.h.
|
inline |
Definition at line 81 of file ExprFunc.h.
|
inline |
Definition at line 87 of file ExprFunc.h.
|
inline |
Definition at line 93 of file ExprFunc.h.
|
inline |
Definition at line 99 of file ExprFunc.h.
|
inline |
Definition at line 105 of file ExprFunc.h.
|
inline |
Definition at line 111 of file ExprFunc.h.
|
inline |
Definition at line 117 of file ExprFunc.h.
|
inline |
Definition at line 123 of file ExprFunc.h.
|
inline |
Definition at line 129 of file ExprFunc.h.
|
inline |
Definition at line 135 of file ExprFunc.h.
|
inline |
Definition at line 141 of file ExprFunc.h.
|
inline |
Definition at line 147 of file ExprFunc.h.
|
inline |
Definition at line 153 of file ExprFunc.h.
|
inline |
Definition at line 159 of file ExprFunc.h.
|
static |
cleanup all functions
Definition at line 110 of file ExprFunc.cpp.
References KSeExpr::mutex.
Referenced by main().
|
static |
Definition at line 150 of file ExprFunc.cpp.
References KSeExpr::defineInternal(), initInternal(), and KSeExpr::mutex.
|
static |
Definition at line 158 of file ExprFunc.cpp.
References KSeExpr::defineInternal3(), initInternal(), and KSeExpr::mutex.
Referenced by main().
|
inline |
return pointer to the funcx
Definition at line 177 of file ExprFunc.h.
References _func, and _standardFunc.
Referenced by KSeExpr::ExprFuncNode::buildInterpreter(), KSeExprLLVMEvalCustomFunction(), and KSeExpr::ExprFuncNode::prep().
|
static |
Get doc string for a specific function.
Definition at line 174 of file ExprFunc.cpp.
References initInternal(), and KSeExpr::mutex.
Referenced by ExprCompletionModel::data(), and ExprCompletionModel::getDocString().
|
static |
Get a list of registered builtin and DSO generated functions.
Definition at line 166 of file ExprFunc.cpp.
References initInternal(), and KSeExpr::mutex.
Referenced by ExprCompletionModel::ExprCompletionModel().
|
static |
call to define built-in funcs
Definition at line 104 of file ExprFunc.cpp.
References initInternal(), and KSeExpr::mutex.
Referenced by KSeExpr::Expression::Expression().
|
staticprivate |
Definition at line 139 of file ExprFunc.cpp.
References KSeExpr::defineBuiltins(), KSeExpr::defineInternal(), and KSeExpr::defineInternal3().
Referenced by define(), getDocString(), getFunctionNames(), init(), lookup(), sizeInBytes(), and statistics().
|
static |
Lookup a builtin function by name.
Definition at line 116 of file ExprFunc.cpp.
References initInternal(), lookup(), and KSeExpr::mutex.
Referenced by lookup(), KSeExpr::ExprFuncNode::prep(), and BasicExpression::resolveFunc().
|
inline |
return the maximum number of acceptable arguments
Definition at line 172 of file ExprFunc.h.
References _maxargs.
Referenced by KSeExpr::ExprFuncNode::prep().
|
inline |
return the minimum number of acceptable arguments
Definition at line 167 of file ExprFunc.h.
References _minargs.
Referenced by KSeExpr::ExprFuncNode::prep().
|
static |
Get the total size estimate of all plugins.
Definition at line 183 of file ExprFunc.cpp.
References initInternal(), and KSeExpr::mutex.
|
static |
Dump statistics.
Definition at line 191 of file ExprFunc.cpp.
References initInternal(), and KSeExpr::mutex.
|
private |
Definition at line 184 of file ExprFunc.h.
Referenced by funcx().
|
private |
Definition at line 186 of file ExprFunc.h.
Referenced by maxArgs().
|
private |
Definition at line 185 of file ExprFunc.h.
Referenced by minArgs().
|
private |
Definition at line 183 of file ExprFunc.h.
Referenced by funcx().