GemaLib
The GeMA library
Loading...
Searching...
No Matches
gmSimulationRunner.h
Go to the documentation of this file.
1/************************************************************************
2**
3** Copyright (C) 2014 by Carlos Augusto Teixera Mendes
4** All rights reserved.
5**
6** This file is part of the "GeMA" software. It's use should respect
7** the terms in the license agreement that can be found together
8** with this source code.
9** It is provided AS IS, with NO WARRANTY OF ANY KIND,
10** INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR
11** A PARTICULAR PURPOSE.
12**
13************************************************************************/
14
24#ifndef _GEMA_SIMULATION_RUNNER_H_
25#define _GEMA_SIMULATION_RUNNER_H_
26
27#include "gmSimulation.h"
28
30class GmPluginLoader;
31class GmLogCategory;
32
33struct lua_State;
34struct lua_Debug;
35class LuaEnv;
36
37class GmProcess;
38class GmCommServer;
39
40#include <QObject>
41
43class GM_API_EXPORT GmSimulationRunner: public QObject
44{
45 Q_OBJECT
46
47public:
48 GmSimulationRunner(GmSimulationData* data, GmPluginLoader* loader, GmCommServer* server,
49 bool enableMonitorRuleTesting, LuaEnv* env, const QList<LuaEnv*>& workerEnv);
51
53
54private slots:
55
56private:
57 void prepareEnvironment();
58 void setupMonitorHook();
59
60 static int loadProcessMM(lua_State* L);
61 static void lineHook(lua_State* L, lua_Debug* ar);
62
63#ifdef ENABLE_PYTHON
64 static bool registerScriptInPythonSysPath(const char *scriptPath);
65 GmLogCategory _pyLogger;
66#endif
67
70 GmCommServer* _server;
76};
77
78#endif
79
Class responsible for executing a simulation.
Definition gmSimulationRunner.h:44
bool _monitorRuleTesting
Should we enable monitor rule testing?
Definition gmSimulationRunner.h:71
LuaEnv * _env
The environment where the simulation will be runned.
Definition gmSimulationRunner.h:74
QList< GmProcess * > _procList
List of process objects instanced during the script execution.
Definition gmSimulationRunner.h:73
GmPluginLoader * _pluginLoader
Plugin loader (needed since required processes are found while running the process script)
Definition gmSimulationRunner.h:69
GmCommServer * _server
The monitor server if this option was enabled.
Definition gmSimulationRunner.h:70
GmLogCategory _logger
Basic logger object for the library.
Definition gmSimulationRunner.h:72
const QList< LuaEnv * > & _workerEnvList
A list with worker thread environments.
Definition gmSimulationRunner.h:75
GmSimulationData * _simulationData
Object storing the complete Simulation information.
Definition gmSimulationRunner.h:68
Declaration of the GmSimulation class.
GmSimulationResult
Enumeration describing the result of a simulation.
Definition gmSimulation.h:48