#include <ScriptHost.h>
Public Member Functions | |
AddScriptResponse | addScript (string sourceCode) |
void | deleteScript (string scriptName) |
vector< DiagnosticStatusPtr > | getDiagnosticStatusesAndClear () |
set< PythonScriptPtr > | getScripts () |
ScriptHost () | |
void | start () |
void | stop () |
virtual | ~ScriptHost () |
Private Member Functions | |
void | addDiagnosticStatus (PythonScriptPtr script) |
PythonScriptPtr | getScript (string scriptName) |
bool | hasAllTopicValues (PythonScriptPtr script) |
bool | isExecutionTime (PythonScriptPtr script) |
bool | prepareScript (PythonScript &script) |
void | run () |
bool | scriptExists (string scriptName) |
Private Attributes | |
vector< DiagnosticStatusPtr > | _diagnosticStatuses |
ScriptExecuter | _executer |
double | _executionInterval |
set< PythonScriptPtr > | _scripts |
boost::recursive_mutex | _scriptsMutex |
boost::recursive_mutex | _statusesMutex |
boost::shared_ptr< boost::thread > | _workThread |
Definition at line 34 of file ScriptHost.h.
Definition at line 10 of file ScriptHost.cpp.
ScriptHost::~ScriptHost | ( | ) | [virtual] |
Definition at line 16 of file ScriptHost.cpp.
void ScriptHost::addDiagnosticStatus | ( | PythonScriptPtr | script | ) | [private] |
Definition at line 162 of file ScriptHost.cpp.
AddScriptResponse ScriptHost::addScript | ( | string | sourceCode | ) |
Create predicate script from the source code
Convert to python script, simulate execution to extract used topic names
Add used topics to listener
Definition at line 22 of file ScriptHost.cpp.
void ScriptHost::deleteScript | ( | string | scriptName | ) |
Definition at line 150 of file ScriptHost.cpp.
vector< DiagnosticStatusPtr > ScriptHost::getDiagnosticStatusesAndClear | ( | ) |
Definition at line 182 of file ScriptHost.cpp.
PythonScriptPtr ScriptHost::getScript | ( | string | scriptName | ) | [private] |
Definition at line 197 of file ScriptHost.cpp.
Definition at line 191 of file ScriptHost.cpp.
bool ScriptHost::hasAllTopicValues | ( | PythonScriptPtr | script | ) | [private] |
Definition at line 209 of file ScriptHost.cpp.
bool ScriptHost::isExecutionTime | ( | PythonScriptPtr | script | ) | [private] |
Definition at line 141 of file ScriptHost.cpp.
bool ScriptHost::prepareScript | ( | PythonScript & | script | ) | [private] |
Extracts used topics, validations, internal function etc...
Definition at line 79 of file ScriptHost.cpp.
void ScriptHost::run | ( | ) | [private] |
Definition at line 96 of file ScriptHost.cpp.
bool ScriptHost::scriptExists | ( | string | scriptName | ) | [private] |
Definition at line 219 of file ScriptHost.cpp.
void ScriptHost::start | ( | ) |
Definition at line 125 of file ScriptHost.cpp.
void ScriptHost::stop | ( | ) |
Definition at line 134 of file ScriptHost.cpp.
vector<DiagnosticStatusPtr> ScriptHost::_diagnosticStatuses [private] |
Definition at line 60 of file ScriptHost.h.
ScriptExecuter ScriptHost::_executer [private] |
Definition at line 56 of file ScriptHost.h.
double ScriptHost::_executionInterval [private] |
Scripts execution check interval in seconds
Definition at line 53 of file ScriptHost.h.
set<PythonScriptPtr> ScriptHost::_scripts [private] |
Definition at line 55 of file ScriptHost.h.
boost::recursive_mutex ScriptHost::_scriptsMutex [private] |
Definition at line 58 of file ScriptHost.h.
boost::recursive_mutex ScriptHost::_statusesMutex [private] |
Definition at line 59 of file ScriptHost.h.
boost::shared_ptr<boost::thread> ScriptHost::_workThread [private] |
Definition at line 54 of file ScriptHost.h.