summaryrefslogtreecommitdiffstats
path: root/src/uscxml
diff options
context:
space:
mode:
authorStefan Radomski <github@mintwerk.de>2016-03-22 14:09:43 (GMT)
committerStefan Radomski <github@mintwerk.de>2016-03-22 14:09:43 (GMT)
commitce285a4048f7f9560da153c89443878e1f24dc27 (patch)
tree0ad37306e64a2f5457a3dfaa7e0447468b271345 /src/uscxml
parent0e9e267de9ba03dc19b6393dbb679a1bdae3ca54 (diff)
parent1cec449a5449e7d3c5c0bca34d83f85ab4a4c2e1 (diff)
downloaduscxml-ce285a4048f7f9560da153c89443878e1f24dc27.zip
uscxml-ce285a4048f7f9560da153c89443878e1f24dc27.tar.gz
uscxml-ce285a4048f7f9560da153c89443878e1f24dc27.tar.bz2
Merge pull request #60 from c64zottel/master
renaming getValidEvents() to: getEventDescriptors()
Diffstat (limited to 'src/uscxml')
-rw-r--r--src/uscxml/Interpreter.h43
-rw-r--r--src/uscxml/plugins/invoker/im/IMInvoker.cpp3
2 files changed, 45 insertions, 1 deletions
diff --git a/src/uscxml/Interpreter.h b/src/uscxml/Interpreter.h
index c65c8f7..303e126 100644
--- a/src/uscxml/Interpreter.h
+++ b/src/uscxml/Interpreter.h
@@ -46,6 +46,8 @@
#include "uscxml/plugins/Invoker.h"
#include "uscxml/plugins/ExecutableContent.h"
+#include "dom/DOMUtils.h"
+
#ifndef TIME_BLOCK
# ifdef BUILD_PROFILING
# include "uscxml/concurrency/Timer.h"
@@ -402,6 +404,38 @@ public:
virtual void handleDOMEvent(Arabica::DOM::Events::Event<std::string>& event);
+ std::vector<std::string> getReachableTargets() {
+
+ std::vector<std::string> e;
+ tthread::lock_guard<tthread::recursive_mutex> lock(_mutex);
+ Arabica::XPath::NodeSet<std::string> possibleTransitions = DOMUtils::filterChildElements( "transition", _configuration, false);
+
+ for( size_t i = 0; i < possibleTransitions.size(); i++ ) {
+ Arabica::DOM::Node<std::string> transitions = possibleTransitions[ i ];
+ Arabica::DOM::NamedNodeMap<std::string> attributes = transitions.getAttributes();
+ Arabica::DOM::Node<std::string> events = attributes.getNamedItem("target");
+ e.push_back( std::string( events.getNodeValue() ) );
+ }
+ return e;
+
+ }
+
+ std::vector<std::string> getEventDescriptors() {
+
+ std::vector<std::string> e;
+ tthread::lock_guard<tthread::recursive_mutex> lock(_mutex);
+ Arabica::XPath::NodeSet<std::string> possibleTransitions = DOMUtils::filterChildElements( "transition", _configuration, false);
+
+ for( size_t i = 0; i < possibleTransitions.size(); i++ ) {
+ Arabica::DOM::Node<std::string> transitions = possibleTransitions[ i ];
+ Arabica::DOM::NamedNodeMap<std::string> attributes = transitions.getAttributes();
+ Arabica::DOM::Node<std::string> events = attributes.getNamedItem("event");
+ e.push_back( std::string( events.getNodeValue() ) );
+ }
+ return e;
+
+ }
+
protected:
static void run(void*); // static method for thread to run
@@ -589,6 +623,14 @@ public:
return _impl->reset();
}
+ std::vector<std::string> getReachableTargets() {
+ return _impl->getReachableTargets();
+ }
+
+ std::vector<std::string> getEventDescriptors() {
+ return _impl->getEventDescriptors();
+ }
+
void start() {
return _impl->start();
}
@@ -807,6 +849,7 @@ public:
Timer timer;
#endif
+
protected:
void setInvokeRequest(const InvokeRequest& req) {
diff --git a/src/uscxml/plugins/invoker/im/IMInvoker.cpp b/src/uscxml/plugins/invoker/im/IMInvoker.cpp
index 91a22e1..f111743 100644
--- a/src/uscxml/plugins/invoker/im/IMInvoker.cpp
+++ b/src/uscxml/plugins/invoker/im/IMInvoker.cpp
@@ -21,6 +21,7 @@
#include <glog/logging.h>
#include "uscxml/UUID.h"
#include "uscxml/dom/DOMUtils.h"
+#include "uscxml/dom/NameSpacingParser.h"
#include <boost/algorithm/string.hpp>
#include "uscxml/concurrency/DelayedEventQueue.h"
@@ -1405,4 +1406,4 @@ gboolean IMInvoker::purpleDebugIsEnabled(PurpleDebugLevel level, const char *cat
}
-} \ No newline at end of file
+}