summaryrefslogtreecommitdiffstats
path: root/src/uscxml
diff options
context:
space:
mode:
authorStefan Radomski <github@mintwerk.de>2016-05-19 21:22:59 (GMT)
committerStefan Radomski <github@mintwerk.de>2016-05-19 21:22:59 (GMT)
commit8ba26b482ba3f37ce262940af70650be399fd548 (patch)
treeab48de386620e5e888614ed5359a0371c07252f4 /src/uscxml
parent0641c59dd1de9541f9650a58739ff1a7f39fece7 (diff)
downloaduscxml-8ba26b482ba3f37ce262940af70650be399fd548.zip
uscxml-8ba26b482ba3f37ce262940af70650be399fd548.tar.gz
uscxml-8ba26b482ba3f37ce262940af70650be399fd548.tar.bz2
Dire bug in uscxml-browser, smaller fixes and documentation
Diffstat (limited to 'src/uscxml')
-rw-r--r--src/uscxml/Interpreter.cpp4
-rw-r--r--src/uscxml/Interpreter.h2
-rw-r--r--src/uscxml/interpreter/FastMicroStep.cpp2
-rw-r--r--src/uscxml/plugins/DataModelImpl.h29
4 files changed, 28 insertions, 9 deletions
diff --git a/src/uscxml/Interpreter.cpp b/src/uscxml/Interpreter.cpp
index 9f2bfbf..05fb1fc 100644
--- a/src/uscxml/Interpreter.cpp
+++ b/src/uscxml/Interpreter.cpp
@@ -230,6 +230,7 @@ std::list<InterpreterIssue> Interpreter::validate() {
std::recursive_mutex StateTransitionMonitor::_mutex;
+#if 0
static void printNodeSet(const std::list<XERCESC_NS::DOMElement*> nodes) {
std::string seperator;
for (auto nIter = nodes.begin(); nIter != nodes.end(); nIter++) {
@@ -237,7 +238,8 @@ static void printNodeSet(const std::list<XERCESC_NS::DOMElement*> nodes) {
seperator = ", ";
}
}
-
+#endif
+
void StateTransitionMonitor::beforeTakingTransition(const XERCESC_NS::DOMElement* transition) {
std::lock_guard<std::recursive_mutex> lock(_mutex);
std::cerr << "Transition: " << uscxml::DOMUtils::xPathForNode(transition) << std::endl;
diff --git a/src/uscxml/Interpreter.h b/src/uscxml/Interpreter.h
index ae1268f..1596914 100644
--- a/src/uscxml/Interpreter.h
+++ b/src/uscxml/Interpreter.h
@@ -160,7 +160,7 @@ public:
*
* @todo Have Interpreter::step() take a duration to block
*/
- InterpreterState step(bool blocking = false);
+ InterpreterState step(bool blocking = true);
/**
* Unblock and mark for finalize.
diff --git a/src/uscxml/interpreter/FastMicroStep.cpp b/src/uscxml/interpreter/FastMicroStep.cpp
index 99c2d74..fd9f1a9 100644
--- a/src/uscxml/interpreter/FastMicroStep.cpp
+++ b/src/uscxml/interpreter/FastMicroStep.cpp
@@ -325,7 +325,7 @@ void FastMicroStep::init(XERCESC_NS::DOMElement* scxml) {
// establish the transitions' exit set
assert(_transitions[i]->element != NULL);
- std::cout << "i: " << i << std::endl << std::flush;
+// std::cout << "i: " << i << std::endl << std::flush;
std::list<DOMElement*> exitList = getExitSet(_transitions[i]->element, _scxml);
for (j = 0; j < _states.size(); j++) {
if (!exitList.empty() && _states[j]->element == exitList.front()) {
diff --git a/src/uscxml/plugins/DataModelImpl.h b/src/uscxml/plugins/DataModelImpl.h
index e2795c0..c3f5390 100644
--- a/src/uscxml/plugins/DataModelImpl.h
+++ b/src/uscxml/plugins/DataModelImpl.h
@@ -111,16 +111,24 @@ public:
*/
size_t replaceExpressions(std::string& content);
- ///@name Foreach Support
- ///@{
-
- // foreach
+ /**
+ * Evaluate the given expression as something iterable and return its length.
+ * @param expr Anything that possibly evaluates to an enumerable object.
+ * @return The number of items in the enumerable object.
+ */
virtual uint32_t getLength(const std::string& expr) = 0;
+
+ /**
+ * Set a given item to the object at a given index for one iteration.
+ * @param item A variable or location to assign the current object to.
+ * @param array An expression evalating to an enumerable object.
+ * @param index A variable or location to set the current index at.
+ * @param iteration The current iteration index.
+ */
virtual void setForeach(const std::string& item,
const std::string& array,
const std::string& index,
uint32_t iteration) = 0;
- ///@}
/**
* Return a string as an *unevaluated* Data object.
@@ -181,8 +189,17 @@ test277:
*/
virtual void init(const std::string& location, const Data& data) = 0;
-
+ /**
+ * Register an extension to get data into and out of the data-model.
+ * @todo This is currently unsupported
+ */
virtual void addExtension(DataModelExtension* ext);
+
+ /**
+ * Concat the given terms into a conjunctive form.
+ * @todo This is required to automatically transform a state-chart into a
+ * state-machine. Actual transformation is still only available in legacy though.
+ */
virtual std::string andExpressions(std::list<std::string>) {
return "";
}