![]() |
Carousel
|
This interface describes an abstract factory for the QScriptEngine. More...
#include <IScriptEngineFactory.h>
Inherited by ScriptingService.
Public Member Functions | |
IScriptEngineFactory () | |
virtual QScriptEngine * | createEngine (IOutputHandler *output=nullptr, QObject *parent=nullptr)=0 |
This interface describes an abstract factory for the QScriptEngine.
Because ScriptUnit should create a new QScriptEngine each time it executes a script (to run it from white board, with clean context), it is needed some kind of the QScriptEngine factory, because just instantiate a new instance of the QScriptEngine is not enough - an engine should be already configured and populated with new functions or types from other components.
Also, during configuration, an IOutputHandler is set in such way, that all output, obtained during execution by the QScriptEngine will be redirected to this handler.
By default, the ScriptingService class implements this interface.
|
inline |
Initializes a new instance of the IScriptEngineFactory class.
|
pure virtual |
Creates a new instance of the QScriptEngine class and populated with new functions or types from other components.
Also, during configuration, an output is set in such way, that all output, obtained during execution by the QScriptEngine will be redirected to this handler.
A parent could be used as a parent for created engine.
Note, that it does not takes ownership for created engine;
Implemented in ScriptingService.