summaryrefslogtreecommitdiffstats
path: root/src/uscxml/Interpreter.cpp
diff options
context:
space:
mode:
authorStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2013-07-04 19:46:07 (GMT)
committerStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2013-07-04 19:46:07 (GMT)
commit7bd0256239f247ed01ee6c673e31283c794bb3d0 (patch)
treea8c9b03374d995c6fd4b23cac2f5be282344bba3 /src/uscxml/Interpreter.cpp
parent096f7df1137dd62871cacd371bf023e39d6b30e5 (diff)
downloaduscxml-7bd0256239f247ed01ee6c673e31283c794bb3d0.zip
uscxml-7bd0256239f247ed01ee6c673e31283c794bb3d0.tar.gz
uscxml-7bd0256239f247ed01ee6c673e31283c794bb3d0.tar.bz2
Reactiveated umundo invoker
Diffstat (limited to 'src/uscxml/Interpreter.cpp')
-rw-r--r--src/uscxml/Interpreter.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/uscxml/Interpreter.cpp b/src/uscxml/Interpreter.cpp
index bdda8c8..158ea96 100644
--- a/src/uscxml/Interpreter.cpp
+++ b/src/uscxml/Interpreter.cpp
@@ -634,13 +634,12 @@ void InterpreterImpl::send(const Arabica::DOM::Node<std::string>& element) {
}
if (delay.size() > 0) {
boost::trim(delay);
- std::stringstream delayTime;
- if (delay.size() > 2 && boost::iequals("ms", delay.substr(delay.length() - 2, 2))) {
- delayTime << delay.substr(0, delay.size() - 2);
- delayTime >> sendReq.delayMs;
- } else if (delay.size() > 1 && boost::iequals("s", delay.substr(delay.length() - 1, 1))) {
- delayTime << delay.substr(0, delay.size() - 1);
- delayTime >> sendReq.delayMs;
+
+ NumAttr delayAttr(delay);
+ if (boost::iequals(delayAttr.unit, "ms")) {
+ sendReq.delayMs = strTo<uint32_t>(delayAttr.value);
+ } else if (boost::iequals(delayAttr.unit, "s")) {
+ sendReq.delayMs = strTo<uint32_t>(delayAttr.value);
sendReq.delayMs *= 1000;
} else {
LOG(ERROR) << "Cannot make sense of delay value " << delay << ": does not end in 's' or 'ms'";