GemaLuaCoreLib
The GeMA Lua Core library
Loading...
Searching...
No Matches
GmLuaTask Class Reference

A Thread task that is responsible for calling a Lua function that gets as parameters a single parameter with a per task value and a set of additional parameters that are common to all tasks. More...

#include <gmLuaTask.h>

Inheritance diagram for GmLuaTask:
Collaboration diagram for GmLuaTask:

Public Member Functions

 GmLuaTask (const QString &fname, const QVariant &taskPars, const QVariantList &extraPars, const GmLogCategory &logger)
 Constructor.
 
virtual GmThreadTaskResult run (const GmThread *thread)
 The main thread function, responsible for calling the Lua function.
 
- Public Member Functions inherited from GmThreadTask
virtual QString taskDescription ()
 
int taskIndex () const
 
void setTaskIndex (int index)
 

Private Attributes

const QString_fname
 The name of the function to be called.
 
const QVariant_taskPars
 The set of task parameters.
 
const QVariantList & _extraPars
 The set of extra parameters, common to all tasks.
 
const GmLogCategory_logger
 A logger for error messages.
 

Detailed Description

A Thread task that is responsible for calling a Lua function that gets as parameters a single parameter with a per task value and a set of additional parameters that are common to all tasks.

Constructor & Destructor Documentation

◆ GmLuaTask()

GmLuaTask::GmLuaTask ( const QString & fname,
const QVariant & taskPars,
const QVariantList & extraPars,
const GmLogCategory & logger )

Constructor.

Parameters
fnameThe name of the function to be called
taskParsA variant, without any Lua references, with the per task parameter.
Can be a QVariantList or a QVariantMap and is usually the result of a call to LuaEnv::clearReferences()
extraParsA list with the set of extra parameters, global to all tasks. Like in taskPars, each list entry is a variant without any Lua references.
loggerA logger that can be used to report errors.

Member Function Documentation

◆ run()

GmThreadTaskResult GmLuaTask::run ( const GmThread * thread)
virtual

The main thread function, responsible for calling the Lua function.

Implements GmThreadTask.


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