SeExpr
|
Function Definition, used in parse tree and func table. More...
#include <ExprFunc.h>
Public Types | |
typedef void(* | Define )(const char *name, ExprFunc f) |
typedef void(* | Define3 )(const char *name, ExprFunc f, const char *docString) |
Static Public Member Functions | |
static void | init () |
call to define built-in funcs and load standard plugins More... | |
static void | cleanup () |
cleanup all functions More... | |
static void | loadPlugins (const char *path) |
load all plugins in a given path More... | |
static void | loadPlugin (const char *path) |
load a given plugin More... | |
static void | define (const char *name, ExprFunc f, const char *docString) |
static void | define (const char *name, 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 |
int | _minargs |
int | _maxargs |
Function Definition, used in parse tree and func table.
This class in a static setting manages all builtin functions defined by SeExpr internally or through the use of shared object plugins. 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 44 of file ExprFunc.h.
Definition at line 64 of file ExprFunc.h.
Definition at line 65 of file ExprFunc.h.
|
inline |
Definition at line 84 of file ExprFunc.h.
|
inline |
User defined function with custom argument parsing.
Definition at line 87 of file ExprFunc.h.
|
inline |
Definition at line 89 of file ExprFunc.h.
|
inline |
Definition at line 91 of file ExprFunc.h.
|
inline |
Definition at line 93 of file ExprFunc.h.
|
inline |
Definition at line 95 of file ExprFunc.h.
|
inline |
Definition at line 97 of file ExprFunc.h.
|
inline |
Definition at line 99 of file ExprFunc.h.
|
inline |
Definition at line 101 of file ExprFunc.h.
|
inline |
Definition at line 103 of file ExprFunc.h.
|
inline |
Definition at line 105 of file ExprFunc.h.
|
inline |
Definition at line 107 of file ExprFunc.h.
|
inline |
Definition at line 109 of file ExprFunc.h.
|
inline |
Definition at line 111 of file ExprFunc.h.
|
inline |
Definition at line 113 of file ExprFunc.h.
|
inline |
Definition at line 115 of file ExprFunc.h.
|
inline |
Definition at line 117 of file ExprFunc.h.
|
static |
cleanup all functions
Definition at line 115 of file ExprFunc.cpp.
References SeExpr2::mutex.
Referenced by main().
|
static |
Definition at line 160 of file ExprFunc.cpp.
References SeExpr2::defineInternal3(), initInternal(), SeExprInternal2::DebugLock< T >::lock(), SeExpr2::mutex, and SeExprInternal2::DebugLock< T >::unlock().
Referenced by main().
|
static |
Definition at line 153 of file ExprFunc.cpp.
References SeExpr2::defineInternal(), initInternal(), SeExprInternal2::DebugLock< T >::lock(), SeExpr2::mutex, and SeExprInternal2::DebugLock< T >::unlock().
|
inline |
return pointer to the funcx
Definition at line 125 of file ExprFunc.h.
References _func, and _standardFunc.
Referenced by SeExpr2::ExprFuncNode::buildInterpreter(), SeExpr2::ExprFuncNode::prep(), and SeExpr2LLVMEvalCustomFunction().
|
static |
Get doc string for a specific function.
Definition at line 174 of file ExprFunc.cpp.
References initInternal(), SeExprInternal2::DebugLock< T >::lock(), SeExpr2::mutex, and SeExprInternal2::DebugLock< T >::unlock().
Referenced by ExprCompletionModel::data(), and ExprCompletionModel::getDocString().
|
static |
Get a list of registered builtin and DSO generated functions.
Definition at line 167 of file ExprFunc.cpp.
References initInternal(), SeExprInternal2::DebugLock< T >::lock(), SeExpr2::mutex, and SeExprInternal2::DebugLock< T >::unlock().
Referenced by ExprCompletionModel::ExprCompletionModel().
|
static |
call to define built-in funcs and load standard plugins
In addition to initializing all builtins, this loads all plugins given in a a colon delimited SE_EXPR_PLUGINS environment variable
Definition at line 110 of file ExprFunc.cpp.
References initInternal(), and SeExpr2::mutex.
Referenced by SeExpr2::Expression::Expression().
|
staticprivate |
Definition at line 141 of file ExprFunc.cpp.
References SeExpr2::defineBuiltins(), SeExpr2::defineInternal(), SeExpr2::defineInternal3(), and loadPlugins().
Referenced by define(), getDocString(), getFunctionNames(), init(), lookup(), sizeInBytes(), and statistics().
|
static |
load a given plugin
Definition at line 243 of file ExprFunc.cpp.
References SeExpr2::defineInternal3().
Referenced by loadPlugins().
|
static |
load all plugins in a given path
Definition at line 208 of file ExprFunc.cpp.
References loadPlugin(), and SeExpr2::MatchPluginName().
Referenced by initInternal().
|
static |
Lookup a builtin function by name.
Definition at line 121 of file ExprFunc.cpp.
References initInternal(), SeExprInternal2::DebugLock< T >::lock(), lookup(), SeExpr2::mutex, and SeExprInternal2::DebugLock< T >::unlock().
Referenced by lookup(), SeExpr2::ExprFuncNode::prep(), and BasicExpression::resolveFunc().
|
inline |
return the maximum number of acceptable arguments
Definition at line 123 of file ExprFunc.h.
References _maxargs.
Referenced by SeExpr2::ExprFuncNode::prep().
|
inline |
return the minimum number of acceptable arguments
Definition at line 121 of file ExprFunc.h.
References _minargs.
Referenced by SeExpr2::ExprFuncNode::prep().
|
static |
Get the total size estimate of all plugins.
Definition at line 182 of file ExprFunc.cpp.
References initInternal(), and SeExpr2::mutex.
|
static |
Dump statistics.
Definition at line 188 of file ExprFunc.cpp.
References initInternal(), and SeExpr2::mutex.
|
private |
Definition at line 129 of file ExprFunc.h.
Referenced by funcx().
|
private |
Definition at line 131 of file ExprFunc.h.
Referenced by maxArgs().
|
private |
Definition at line 130 of file ExprFunc.h.
Referenced by minArgs().
|
private |
Definition at line 128 of file ExprFunc.h.
Referenced by funcx().