diff options
author | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2014-05-14 16:51:56 (GMT) |
---|---|---|
committer | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2014-05-14 16:51:56 (GMT) |
commit | 49127140ed2ad91bfcf532b3d2265582cb80b0db (patch) | |
tree | b31c1537973792f4ac9216de82c0f041e9e8aeae /src/bindings/swig/java/JavaDataModel.h | |
parent | 6920a312918f989cd2970277a853fbed52cf0c38 (diff) | |
download | uscxml-49127140ed2ad91bfcf532b3d2265582cb80b0db.zip uscxml-49127140ed2ad91bfcf532b3d2265582cb80b0db.tar.gz uscxml-49127140ed2ad91bfcf532b3d2265582cb80b0db.tar.bz2 |
Retain interpreter instance for DataModels in Java (Rhino)
Diffstat (limited to 'src/bindings/swig/java/JavaDataModel.h')
-rw-r--r-- | src/bindings/swig/java/JavaDataModel.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/bindings/swig/java/JavaDataModel.h b/src/bindings/swig/java/JavaDataModel.h index fcfb665..4fe6cbe 100644 --- a/src/bindings/swig/java/JavaDataModel.h +++ b/src/bindings/swig/java/JavaDataModel.h @@ -12,12 +12,13 @@ public: JavaDataModel(); virtual ~JavaDataModel(); - virtual JavaDataModel* create(Interpreter interpreter) { + virtual JavaDataModel* create(const Interpreter& interpreter) { return new JavaDataModel(); } virtual boost::shared_ptr<DataModelImpl> create(InterpreterImpl* interpreter) { - return boost::shared_ptr<DataModelImpl>(create(interpreter->shared_from_this())); + _interpreter = interpreter->shared_from_this(); + return boost::shared_ptr<DataModelImpl>(create(_interpreter)); } virtual std::set<std::string> getNames() { return std::set<std::string>(); @@ -131,6 +132,8 @@ public: virtual void assign(const std::string& assignElem, const std::string& location, const std::string& content) {} virtual void eval(const std::string& scriptElem, const std::string& expr) {} +private: + Interpreter _interpreter; }; } |