![]() |
GemaLuaCoreLib
The GeMA Lua Core library
|
Aux functions used by several of the task classes. More...
Functions | |
| bool | pushParameter (LuaEnv *env, const QVariant &v) |
| Pushes v on the stack. More... | |
| bool | setInTable (LuaTable &t, const QVariant &index, const QVariant &v) |
| Aux function used by pushParameter() to set a field in a table (integer or string) to the value v, following the same rules as in pushParameter(). Can not use LuaTable::fromVariantMap() due to the differences in treatment for user data values. | |
| GmThreadTaskResult | callLuaTaskFunction (void *dataSet, const GmThread *thread, const QString &luaName, const QVariantList &extraPars, const GmLogCategory &logger, bool loggerIsUpvalue, int(*iteratorClosure)(lua_State *), const char *fname) |
| Aux function used by the GmLuaXxxTask classes to call a Lua function sending as parameters an iterator over the given data set + any additional extra parameters. | |
| template<class T > | |
| void | parseExecOptions (LuaEnv *env, int stackPos, T(*str2Strat)(QString), T defStrategy, const char *fname, int *ntasks, int *nworkers, T *strategy, QVector< int > &taskAffinity) |
| Parses the contents of the options Lua table at stackPos, using the function str2Strat() function to transform strings to a strategy enum value. On errors, this function calls luaL_error() and doesn't returns. More... | |
Aux functions used by several of the task classes.
| void GmLuaTaskUtils::parseExecOptions | ( | LuaEnv * | env, |
| int | stackPos, | ||
| T(*)(QString) | str2Strat, | ||
| T | defStrategy, | ||
| const char * | fname, | ||
| int * | ntasks, | ||
| int * | nworkers, | ||
| T * | strategy, | ||
| QVector< int > & | taskAffinity | ||
| ) |
Parses the contents of the options Lua table at stackPos, using the function str2Strat() function to transform strings to a strategy enum value. On errors, this function calls luaL_error() and doesn't returns.
| env | The Lua environment |
| stackPos | The position of the Lua table on the stack |
| str2Strat | Pointer to the string to enumerate translation function. Expects that the function returns defStrategy on errors. |
| defStrategy | The default strategy enum value |
| fname | The name of the called Lua function. Used on error messages. |
| ntasks | Filled with the configured number of tasks. Default = 0. |
| nworkers | Filled with the configured number of workers. Default = -1. |
| strategy | Filled with the configured strategy enum value. Default = defStrategy. |
| taskAffinity | Vector filled with the contents of the 'affinity' table. Default = empty. |
Pushes v on the stack.
Expects values to be:
1.8.15