summaryrefslogtreecommitdiffstats
path: root/src/uscxml/interpreter
diff options
context:
space:
mode:
Diffstat (limited to 'src/uscxml/interpreter')
-rw-r--r--src/uscxml/interpreter/BasicContentExecutor.cpp38
-rw-r--r--src/uscxml/interpreter/BasicContentExecutor.h2
-rw-r--r--src/uscxml/interpreter/ContentExecutor.cpp4
-rw-r--r--src/uscxml/interpreter/ContentExecutor.h2
-rw-r--r--src/uscxml/interpreter/ContentExecutorImpl.h2
-rw-r--r--src/uscxml/interpreter/InterpreterImpl.cpp10
-rw-r--r--src/uscxml/interpreter/InterpreterImpl.h8
7 files changed, 33 insertions, 33 deletions
diff --git a/src/uscxml/interpreter/BasicContentExecutor.cpp b/src/uscxml/interpreter/BasicContentExecutor.cpp
index a801f35..17dd611 100644
--- a/src/uscxml/interpreter/BasicContentExecutor.cpp
+++ b/src/uscxml/interpreter/BasicContentExecutor.cpp
@@ -235,7 +235,7 @@ void BasicContentExecutor::processIf(XERCESC_NS::DOMElement* content) {
// current block is true
if (blockIsTrue) {
// we do now that the prefix of content is correct
- process(childElem, XML_PREFIX(content));
+ process(childElem);
}
}
}
@@ -266,7 +266,7 @@ void BasicContentExecutor::processForeach(XERCESC_NS::DOMElement* content) {
_callbacks->setForeach(item, array, index, iteration);
for (auto childElem = content->getFirstElementChild(); childElem; childElem = childElem->getNextElementSibling()) {
- process(childElem, XML_PREFIX(content));
+ process(childElem);
}
}
}
@@ -289,18 +289,18 @@ void BasicContentExecutor::processScript(XERCESC_NS::DOMElement* content) {
}
-void BasicContentExecutor::process(XERCESC_NS::DOMElement* block, const X& xmlPrefix) {
+void BasicContentExecutor::process(XERCESC_NS::DOMElement* block) {
std::string tagName = TAGNAME(block);
+ std::string xmlPrefix = XML_PREFIX(block);
-
- if (iequals(tagName, xmlPrefix.str() + "onentry") ||
- iequals(tagName, xmlPrefix.str() + "onexit") ||
- iequals(tagName, xmlPrefix.str() + "transition")) {
+ if (iequals(tagName, xmlPrefix + "onentry") ||
+ iequals(tagName, xmlPrefix + "onexit") ||
+ iequals(tagName, xmlPrefix + "transition")) {
try {
for (auto childElem = block->getFirstElementChild(); childElem; childElem = childElem->getNextElementSibling()) {
// process any child eleents
- process(childElem, xmlPrefix);
+ process(childElem);
}
} catch (Event e) {
// there has been an error in an executable content block
@@ -310,18 +310,18 @@ void BasicContentExecutor::process(XERCESC_NS::DOMElement* block, const X& xmlPr
return;
}
- if (iequals(tagName, xmlPrefix.str() + "finalize")) {
+ if (iequals(tagName, xmlPrefix + "finalize")) {
std::list<DOMNode*> childElems = DOMUtils::filterChildType(DOMNode::ELEMENT_NODE, block, false);
if(childElems.size() > 0) {
for(auto elemIter = childElems.begin(); elemIter != childElems.end(); elemIter++) {
- process(static_cast<DOMElement*>(*elemIter), xmlPrefix);
+ process(static_cast<DOMElement*>(*elemIter));
}
} else {
// issue 67 - empty finalize element
DOMNode* parent = block->getParentNode();
if (parent && parent->getNodeType() == DOMNode::ELEMENT_NODE) {
DOMElement* invokeElem = static_cast<DOMElement*>(parent);
- if (iequals(X(invokeElem->getTagName()).str(), xmlPrefix.str() + "invoke")) {
+ if (iequals(X(invokeElem->getTagName()).str(), xmlPrefix + "invoke")) {
// we are the empth finalize element of an invoke
// Specification 6.5.2: http://www.w3.org/TR/scxml/#N110EF
@@ -347,21 +347,21 @@ void BasicContentExecutor::process(XERCESC_NS::DOMElement* block, const X& xmlPr
USCXML_MONITOR_CALLBACK1(_callbacks->getMonitors(), beforeExecutingContent, block);
if (false) {
- } else if (iequals(tagName, xmlPrefix.str() + "raise")) {
+ } else if (iequals(tagName, xmlPrefix + "raise")) {
processRaise(block);
- } else if (iequals(tagName, xmlPrefix.str() + "send")) {
+ } else if (iequals(tagName, xmlPrefix + "send")) {
processSend(block);
- } else if (iequals(tagName, xmlPrefix.str() + "cancel")) {
+ } else if (iequals(tagName, xmlPrefix + "cancel")) {
processCancel(block);
- } else if (iequals(tagName, xmlPrefix.str() + "if")) {
+ } else if (iequals(tagName, xmlPrefix + "if")) {
processIf(block);
- } else if (iequals(tagName, xmlPrefix.str() + "assign")) {
+ } else if (iequals(tagName, xmlPrefix + "assign")) {
processAssign(block);
- } else if (iequals(tagName, xmlPrefix.str() + "foreach")) {
+ } else if (iequals(tagName, xmlPrefix + "foreach")) {
processForeach(block);
- } else if (iequals(tagName, xmlPrefix.str() + "log")) {
+ } else if (iequals(tagName, xmlPrefix + "log")) {
processLog(block);
- } else if (iequals(tagName, xmlPrefix.str() + "script")) {
+ } else if (iequals(tagName, xmlPrefix + "script")) {
processScript(block);
} else {
LOG(_callbacks->getLogger(), USCXML_ERROR) << tagName;
diff --git a/src/uscxml/interpreter/BasicContentExecutor.h b/src/uscxml/interpreter/BasicContentExecutor.h
index 032da6f..9019b23 100644
--- a/src/uscxml/interpreter/BasicContentExecutor.h
+++ b/src/uscxml/interpreter/BasicContentExecutor.h
@@ -46,7 +46,7 @@ public:
void processLog(XERCESC_NS::DOMElement* content);
void processScript(XERCESC_NS::DOMElement* content);
- virtual void process(XERCESC_NS::DOMElement* block, const X& xmlPrefix);
+ virtual void process(XERCESC_NS::DOMElement* block);
virtual void invoke(XERCESC_NS::DOMElement* invoke);
virtual void uninvoke(XERCESC_NS::DOMElement* invoke);
diff --git a/src/uscxml/interpreter/ContentExecutor.cpp b/src/uscxml/interpreter/ContentExecutor.cpp
index de142a1..4aa6eb4 100644
--- a/src/uscxml/interpreter/ContentExecutor.cpp
+++ b/src/uscxml/interpreter/ContentExecutor.cpp
@@ -23,8 +23,8 @@
namespace uscxml {
-void ContentExecutor::process(XERCESC_NS::DOMElement* block, const X& xmlPrefix) {
- _impl->process(block, xmlPrefix);
+void ContentExecutor::process(XERCESC_NS::DOMElement* block) {
+ _impl->process(block);
}
void ContentExecutor::invoke(XERCESC_NS::DOMElement* invoke) {
diff --git a/src/uscxml/interpreter/ContentExecutor.h b/src/uscxml/interpreter/ContentExecutor.h
index 7a0b125..78fdf94 100644
--- a/src/uscxml/interpreter/ContentExecutor.h
+++ b/src/uscxml/interpreter/ContentExecutor.h
@@ -43,7 +43,7 @@ class USCXML_API ContentExecutor {
public:
PIMPL_OPERATORS(ContentExecutor);
- virtual void process(XERCESC_NS::DOMElement* block, const X& xmlPrefix);
+ virtual void process(XERCESC_NS::DOMElement* block);
virtual void invoke(XERCESC_NS::DOMElement* invoke);
virtual void uninvoke(XERCESC_NS::DOMElement* invoke);
virtual Data elementAsData(XERCESC_NS::DOMElement* element, bool asExpression = false);
diff --git a/src/uscxml/interpreter/ContentExecutorImpl.h b/src/uscxml/interpreter/ContentExecutorImpl.h
index e8c89f9..5f0acfe 100644
--- a/src/uscxml/interpreter/ContentExecutorImpl.h
+++ b/src/uscxml/interpreter/ContentExecutorImpl.h
@@ -89,7 +89,7 @@ public:
virtual std::shared_ptr<ContentExecutorImpl> create(ContentExecutorCallbacks* callbacks) = 0;
- virtual void process(XERCESC_NS::DOMElement* block, const X& xmlPrefix) = 0;
+ virtual void process(XERCESC_NS::DOMElement* block) = 0;
virtual void invoke(XERCESC_NS::DOMElement* invoke) = 0;
virtual void uninvoke(XERCESC_NS::DOMElement* invoke) = 0;
diff --git a/src/uscxml/interpreter/InterpreterImpl.cpp b/src/uscxml/interpreter/InterpreterImpl.cpp
index 1693462..ac6aa41 100644
--- a/src/uscxml/interpreter/InterpreterImpl.cpp
+++ b/src/uscxml/interpreter/InterpreterImpl.cpp
@@ -87,7 +87,7 @@ InterpreterImpl::~InterpreterImpl() {
// make sure we deallocate all user-data in the DOM,
// this is neccesary if we were aborted early
- std::list<DOMElement*> invokes = DOMUtils::filterChildElements(_xmlPrefix.str() + "invoke", _scxml, true);
+ std::list<DOMElement*> invokes = DOMUtils::filterChildElements(_xmlPrefix + "invoke", _scxml, true);
for (auto invoke : invokes) {
char* invokeId = (char*)invoke->getUserData(X("invokeid"));
if (invokeId != NULL) {
@@ -284,9 +284,9 @@ SCXML_STOP_SEARCH:
_scxml = dynamic_cast<XERCESC_NS::DOMElement*>(scxmls->item(0));
- _xmlPrefix = _scxml->getPrefix();
- _xmlNS = _scxml->getNamespaceURI();
- if (_xmlPrefix) {
+ _xmlPrefix = X(_scxml->getPrefix()).str();
+ _xmlNS = X(_scxml->getNamespaceURI()).str();
+ if (_xmlPrefix.size() > 0) {
_xmlPrefix = std::string(_xmlPrefix) + ":";
}
if (HAS_ATTR(_scxml, kXMLCharName)) {
@@ -467,7 +467,7 @@ Event InterpreterImpl::dequeueExternal(size_t blockMs) {
if (_currEvent.invokeid.size() > 0 &&
_invokers.find(_currEvent.invokeid) != _invokers.end() &&
_invokers[_currEvent.invokeid].getFinalize() != NULL) {
- _execContent.process(_invokers[_currEvent.invokeid].getFinalize(), _xmlPrefix);
+ _execContent.process(_invokers[_currEvent.invokeid].getFinalize());
}
for (auto invIter = _invokers.begin(); invIter != _invokers.end(); invIter++) {
diff --git a/src/uscxml/interpreter/InterpreterImpl.h b/src/uscxml/interpreter/InterpreterImpl.h
index 5b73939..8e8b810 100644
--- a/src/uscxml/interpreter/InterpreterImpl.h
+++ b/src/uscxml/interpreter/InterpreterImpl.h
@@ -37,7 +37,7 @@
#include "uscxml/interpreter/ContentExecutorImpl.h"
#include "uscxml/interpreter/EventQueue.h"
#include "uscxml/interpreter/EventQueueImpl.h"
-#include "uscxml/util/DOM.h"
+//#include "uscxml/util/DOM.h"
namespace uscxml {
@@ -109,7 +109,7 @@ public:
}
virtual void process(XERCESC_NS::DOMElement* block) {
- _execContent.process(block, _xmlPrefix);
+ _execContent.process(block);
}
virtual bool isMatched(const Event& event, const std::string& eventDesc);
@@ -290,8 +290,8 @@ protected:
friend class DebugSession;
friend class Debugger;
- X _xmlPrefix;
- X _xmlNS;
+ std::string _xmlPrefix;
+ std::string _xmlNS;
Factory* _factory;
URL _baseURL;