diff options
author | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2013-04-14 08:43:05 (GMT) |
---|---|---|
committer | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2013-04-14 08:43:05 (GMT) |
commit | 01e7e16d34b23b1198455809860abe4e43d9606a (patch) | |
tree | 8b184a60e812a2cd835d15cb304d6a46792ca9e3 /src/uscxml/plugins | |
parent | a22c9ab9c1a72bee6802dc8ada771930253f140b (diff) | |
download | uscxml-01e7e16d34b23b1198455809860abe4e43d9606a.zip uscxml-01e7e16d34b23b1198455809860abe4e43d9606a.tar.gz uscxml-01e7e16d34b23b1198455809860abe4e43d9606a.tar.bz2 |
Apps working again
Diffstat (limited to 'src/uscxml/plugins')
-rw-r--r-- | src/uscxml/plugins/element/postpone/PostponeElement.cpp | 2 | ||||
-rw-r--r-- | src/uscxml/plugins/element/respond/RespondElement.cpp (renamed from src/uscxml/plugins/element/response/ResponseElement.cpp) | 34 | ||||
-rw-r--r-- | src/uscxml/plugins/element/respond/RespondElement.h (renamed from src/uscxml/plugins/element/response/ResponseElement.h) | 16 |
3 files changed, 26 insertions, 26 deletions
diff --git a/src/uscxml/plugins/element/postpone/PostponeElement.cpp b/src/uscxml/plugins/element/postpone/PostponeElement.cpp index 54f2499..3c1d1b8 100644 --- a/src/uscxml/plugins/element/postpone/PostponeElement.cpp +++ b/src/uscxml/plugins/element/postpone/PostponeElement.cpp @@ -112,7 +112,7 @@ void PostponeElement::Resubmitter::onStableConfiguration(Interpreter interpreter // LOG(INFO) << " -> is TRUE"; eventIter->event.name += ".postponed"; interpreter.receive(eventIter->event, true); - _postponedEvents.erase(eventIter); + _postponedEvents.erase(eventIter++); dispatched = true; } // LOG(INFO) << " -> is FALSE"; diff --git a/src/uscxml/plugins/element/response/ResponseElement.cpp b/src/uscxml/plugins/element/respond/RespondElement.cpp index 675bc1e..3c47b83 100644 --- a/src/uscxml/plugins/element/response/ResponseElement.cpp +++ b/src/uscxml/plugins/element/respond/RespondElement.cpp @@ -1,4 +1,4 @@ -#include "ResponseElement.h" +#include "RespondElement.h" #include "uscxml/plugins/invoker/http/HTTPServletInvoker.h" #include <glog/logging.h> @@ -11,35 +11,35 @@ namespace uscxml { #ifdef BUILD_AS_PLUGINS PLUMA_CONNECTOR bool connect(pluma::Host& host) { - host.add( new ResponseElementProvider() ); + host.add( new RespondElementProvider() ); return true; } #endif -boost::shared_ptr<ExecutableContentImpl> ResponseElement::create(InterpreterImpl* interpreter) { - boost::shared_ptr<ResponseElement> invoker = boost::shared_ptr<ResponseElement>(new ResponseElement()); +boost::shared_ptr<ExecutableContentImpl> RespondElement::create(InterpreterImpl* interpreter) { + boost::shared_ptr<RespondElement> invoker = boost::shared_ptr<RespondElement>(new RespondElement()); invoker->_interpreter = interpreter; return invoker; } -void ResponseElement::enterElement(const Arabica::DOM::Node<std::string>& node) { +void RespondElement::enterElement(const Arabica::DOM::Node<std::string>& node) { // try to get the request id - if (!HAS_ATTR(node, "request") && !HAS_ATTR(node, "requestexpr")) { - LOG(ERROR) << "Response element requires request or requestexpr"; + if (!HAS_ATTR(node, "to")) { + LOG(ERROR) << "Respond element requires to attribute"; return; } - if (HAS_ATTR(node, "requestexpr") && !_interpreter->getDataModel()) { - LOG(ERROR) << "Response element with requestexpr requires datamodel"; + if (HAS_ATTR(node, "to") && !_interpreter->getDataModel()) { + LOG(ERROR) << "Respond element with to requires datamodel"; return; } - std::string requestId = (HAS_ATTR(node, "request") ? ATTR(node, "request") : _interpreter->getDataModel().evalAsString(ATTR(node, "requestexpr"))); + std::string requestId = _interpreter->getDataModel().evalAsString(ATTR(node, "to")); // try to get the request object InterpreterServlet* servlet = _interpreter->getHTTPServlet(); tthread::lock_guard<tthread::recursive_mutex> lock(servlet->getMutex()); if (servlet->getRequests().find(requestId) == servlet->getRequests().end()) { - LOG(ERROR) << "No matching HTTP request for response element"; + LOG(ERROR) << "No matching HTTP request for respond element"; return; } @@ -52,7 +52,7 @@ void ResponseElement::enterElement(const Arabica::DOM::Node<std::string>& node) // get the status or default to 200 std::string statusStr = (HAS_ATTR(node, "status") ? ATTR(node, "status") : "200"); if (!isNumeric(statusStr.c_str(), 10)) { - LOG(ERROR) << "Response element with non-numeric status " << statusStr; + LOG(ERROR) << "Respond element with non-numeric status " << statusStr; return; } httpReply.status = strTo<int>(statusStr);; @@ -66,7 +66,7 @@ void ResponseElement::enterElement(const Arabica::DOM::Node<std::string>& node) std::string contentValue = _interpreter->getDataModel().evalAsString(ATTR(contents[0], "expr")); httpReply.content = contentValue; } catch (Event e) { - LOG(ERROR) << "Syntax error with expr in content child of response element:" << std::endl << e << std::endl; + LOG(ERROR) << "Syntax error with expr in content child of Respond element:" << std::endl << e << std::endl; return; } } else { @@ -80,7 +80,7 @@ void ResponseElement::enterElement(const Arabica::DOM::Node<std::string>& node) try { file = "file://" + _interpreter->getDataModel().evalAsString(ATTR(contents[0], "fileexpr")); } catch (Event e) { - LOG(ERROR) << "Syntax error with fileexpr in content child of response element:" << std::endl << e << std::endl; + LOG(ERROR) << "Syntax error with fileexpr in content child of Respond element:" << std::endl << e << std::endl; return; } } @@ -117,7 +117,7 @@ void ResponseElement::enterElement(const Arabica::DOM::Node<std::string>& node) try { name = _interpreter->getDataModel().evalAsString(ATTR(headers[i], "nameexpr")); } catch (Event e) { - LOG(ERROR) << "Syntax error with nameexpr in header child of response element:" << std::endl << e << std::endl; + LOG(ERROR) << "Syntax error with nameexpr in header child of Respond element:" << std::endl << e << std::endl; return; } } else { @@ -137,7 +137,7 @@ void ResponseElement::enterElement(const Arabica::DOM::Node<std::string>& node) try { value = _interpreter->getDataModel().evalAsString(ATTR(headers[i], "expr")); } catch (Event e) { - LOG(ERROR) << "Syntax error with expr in header child of response element:" << std::endl << e << std::endl; + LOG(ERROR) << "Syntax error with expr in header child of Respond element:" << std::endl << e << std::endl; return; } } else { @@ -157,7 +157,7 @@ void ResponseElement::enterElement(const Arabica::DOM::Node<std::string>& node) servlet->getRequests().erase(requestId); } -void ResponseElement::exitElement(const Arabica::DOM::Node<std::string>& node) { +void RespondElement::exitElement(const Arabica::DOM::Node<std::string>& node) { } diff --git a/src/uscxml/plugins/element/response/ResponseElement.h b/src/uscxml/plugins/element/respond/RespondElement.h index 333dd98..c53d60a 100644 --- a/src/uscxml/plugins/element/response/ResponseElement.h +++ b/src/uscxml/plugins/element/respond/RespondElement.h @@ -1,5 +1,5 @@ -#ifndef RESPONSEELEMENT_H_I11KQ39Q -#define RESPONSEELEMENT_H_I11KQ39Q +#ifndef RESPONDELEMENT_H_I11KQ39Q +#define RESPONDELEMENT_H_I11KQ39Q #include <uscxml/Interpreter.h> @@ -9,14 +9,14 @@ namespace uscxml { -class ResponseElement : public ExecutableContentImpl { +class RespondElement : public ExecutableContentImpl { public: - ResponseElement() {} - virtual ~ResponseElement() {} + RespondElement() {} + virtual ~RespondElement() {} boost::shared_ptr<ExecutableContentImpl> create(InterpreterImpl* interpreter); std::string getLocalName() { - return "response"; + return "respond"; } std::string getNamespace() { @@ -33,10 +33,10 @@ public: }; #ifdef BUILD_AS_PLUGINS -PLUMA_INHERIT_PROVIDER(ResponseElement, ExecutableContentImpl); +PLUMA_INHERIT_PROVIDER(RespondElement, ExecutableContentImpl); #endif } -#endif /* end of include guard: RESPONSEELEMENT_H_I11KQ39Q */ +#endif /* end of include guard: RESPONDELEMENT_H_I11KQ39Q */ |