From 0f02e83609309972f01fb72392fb7f96d98b9e01 Mon Sep 17 00:00:00 2001 From: Stefan Radomski Date: Tue, 15 Jul 2014 22:17:24 +0200 Subject: More fixes for language bindings --- .travis.yml | 1 + embedding/java/src/org/uscxml/tests/TestData.java | 1 - src/bindings/swig/csharp/uscxml.i | 4 ++++ src/bindings/swig/java/uscxml.i | 9 +++++++++ src/bindings/swig/uscxml_ignores.i | 2 +- src/bindings/swig/wrapped/WrappedInvoker.h | 8 ++++++-- src/uscxml/server/HTTPServer.h | 4 +++- 7 files changed, 24 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 95e2e7d..1e811e9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,5 +11,6 @@ before_install: - sudo apt-get install -qq expect-dev - sudo apt-get install -qq libprotobuf-dev libprotoc-dev - sudo apt-get install -qq swi-prolog + - wget http://uscxml.tk.informatik.tu-darmstadt.de script: mkdir build && cd build && cmake .. && make diff --git a/embedding/java/src/org/uscxml/tests/TestData.java b/embedding/java/src/org/uscxml/tests/TestData.java index d225dec..0a95328 100644 --- a/embedding/java/src/org/uscxml/tests/TestData.java +++ b/embedding/java/src/org/uscxml/tests/TestData.java @@ -1,7 +1,6 @@ package org.uscxml.tests; import org.uscxml.Blob; -import org.uscxml.BlobImpl; import org.uscxml.Data; public class TestData { diff --git a/src/bindings/swig/csharp/uscxml.i b/src/bindings/swig/csharp/uscxml.i index 7625c8d..359f640 100644 --- a/src/bindings/swig/csharp/uscxml.i +++ b/src/bindings/swig/csharp/uscxml.i @@ -56,6 +56,8 @@ typedef uscxml::ExecutableContentImpl ExecutableContentImpl; #include "../../../uscxml/Factory.h" #include "../../../uscxml/Interpreter.h" #include "../../../uscxml/concurrency/BlockingQueue.h" +#include "../../../uscxml/server/HTTPServer.h" +#include "../../../uscxml/debug/DebuggerServlet.h" #include "../wrapped/WrappedInvoker.h" #include "../wrapped/WrappedDataModel.h" @@ -379,6 +381,8 @@ using System.Runtime.InteropServices; %include "../../../uscxml/Message.h" %include "../../../uscxml/Interpreter.h" %include "../../../uscxml/concurrency/BlockingQueue.h" +%include "../../../uscxml/server/HTTPServer.h" +%include "../../../uscxml/debug/DebuggerServlet.h" %include "../../../uscxml/messages/Blob.h" %include "../../../uscxml/messages/Data.h" diff --git a/src/bindings/swig/java/uscxml.i b/src/bindings/swig/java/uscxml.i index 654ea91..688ca6e 100644 --- a/src/bindings/swig/java/uscxml.i +++ b/src/bindings/swig/java/uscxml.i @@ -55,6 +55,8 @@ typedef uscxml::ExecutableContentImpl ExecutableContentImpl; #include "../../../uscxml/Factory.h" #include "../../../uscxml/Interpreter.h" #include "../../../uscxml/concurrency/BlockingQueue.h" +#include "../../../uscxml/server/HTTPServer.h" +#include "../../../uscxml/debug/DebuggerServlet.h" #include "../wrapped/WrappedInvoker.h" #include "../wrapped/WrappedDataModel.h" @@ -210,9 +212,14 @@ import java.util.Map; import java.util.HashMap; import java.util.List; import java.util.LinkedList; +import java.net.URL; %} %typemap(javacode) uscxml::Interpreter %{ + public static Interpreter fromURI(URL uri) throws org.uscxml.InterpreterException { + return Interpreter.fromURI(uri.toString()); + } + public Map getIOProcessors() { Map ioProcs = new HashMap(); StringVector keys = getIOProcessorKeys(); @@ -384,6 +391,8 @@ import java.util.LinkedList; %include "../../../uscxml/Message.h" %include "../../../uscxml/Interpreter.h" %include "../../../uscxml/concurrency/BlockingQueue.h" +%include "../../../uscxml/server/HTTPServer.h" +%include "../../../uscxml/debug/DebuggerServlet.h" %include "../../../uscxml/messages/Blob.h" %include "../../../uscxml/messages/Data.h" diff --git a/src/bindings/swig/uscxml_ignores.i b/src/bindings/swig/uscxml_ignores.i index 24a6ffa..c9df57f 100644 --- a/src/bindings/swig/uscxml_ignores.i +++ b/src/bindings/swig/uscxml_ignores.i @@ -38,7 +38,7 @@ %ignore uscxml::Interpreter::Interpreter(const boost::shared_ptr); %ignore uscxml::Interpreter::Interpreter(const Interpreter&); %ignore uscxml::Interpreter::getDelayQueue(); -%ignore uscxml::Interpreter::fromURI(const URI&); +%ignore uscxml::Interpreter::fromURI(const URL&); %ignore uscxml::Interpreter::fromDOM; %ignore uscxml::Interpreter::fromClone; %ignore uscxml::Interpreter::start(); diff --git a/src/bindings/swig/wrapped/WrappedInvoker.h b/src/bindings/swig/wrapped/WrappedInvoker.h index 6251c6e..5e0f39e 100644 --- a/src/bindings/swig/wrapped/WrappedInvoker.h +++ b/src/bindings/swig/wrapped/WrappedInvoker.h @@ -52,14 +52,18 @@ public: virtual void invoke(const InvokeRequest& req) {} virtual void uninvoke() {} - virtual WrappedInvoker* create(Interpreter interpreter) { + virtual WrappedInvoker* create(const Interpreter& interpreter) { return new WrappedInvoker(); } virtual boost::shared_ptr create(InterpreterImpl* interpreter) { - return boost::shared_ptr(create(interpreter->shared_from_this())); + _interpreter = interpreter->shared_from_this(); + return boost::shared_ptr(create(_interpreter)); } +private: + Interpreter _interpreter; + }; } diff --git a/src/uscxml/server/HTTPServer.h b/src/uscxml/server/HTTPServer.h index 398bb12..b1816bc 100644 --- a/src/uscxml/server/HTTPServer.h +++ b/src/uscxml/server/HTTPServer.h @@ -134,7 +134,7 @@ private: }; HTTPServer(unsigned short port, unsigned short wsPort, SSLConfig* sslConf = NULL); - ~HTTPServer(); + virtual ~HTTPServer(); void start(); void stop(); @@ -191,6 +191,7 @@ private: class USCXML_API HTTPServlet { public: + virtual ~HTTPServlet() {} virtual bool httpRecvRequest(const HTTPServer::Request& request) = 0; virtual void setURL(const std::string& url) = 0; /// Called by the server with the actual URL virtual bool canAdaptPath() { @@ -200,6 +201,7 @@ public: class USCXML_API WebSocketServlet { public: + virtual ~WebSocketServlet() {} virtual bool wsRecvRequest(struct evws_connection *conn, const HTTPServer::WSFrame& frame) = 0; virtual void setURL(const std::string& url) = 0; /// Called by the server with the actual URL virtual bool canAdaptPath() { -- cgit v0.12