Bug fix: check if vm exists
[avr-sim.git] / ScriptEngine.h
blob100d2a57215a51ff06f76fc9251c916e7f2eed53
1 #ifndef AVR_SCRIPTENGINE_H
2 #define AVR_SCRIPTENGINE_H
4 #include "Exception.h"
5 #include "script/VM.h"
7 namespace avr {
9 class Program;
11 //! Thrown if the application or script performs invalid script operation.
12 class ScriptException : public util::Exception {
13 public:
14 ScriptException() : Exception(msg) {}
15 ScriptException(const std::string & msg) : Exception(msg) {}
16 ScriptException(const char *msg) : Exception(msg) {}
19 class ScriptEngine : public script::VM {
20 public:
21 ScriptEngine();
22 ~ScriptEngine();
24 public:
25 void setProgram(const Program & program);
26 void loadConfig(const char *filename);
31 #endif /*SCRIPTENGINE_H_*/