summaryrefslogtreecommitdiffstats
path: root/src/uscxml/plugins/datamodel/null/NULLDataModel.cpp
diff options
context:
space:
mode:
authorStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2013-04-12 11:57:08 (GMT)
committerStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2013-04-12 11:57:08 (GMT)
commitba050afaaad699e60ca657b311d5c34d038bb89c (patch)
treed4c79e30631c63e8557c6ec893a70dda46aa6cd5 /src/uscxml/plugins/datamodel/null/NULLDataModel.cpp
parent45ab2909e17f7e0348ccfe4179f23a897a2fd305 (diff)
downloaduscxml-ba050afaaad699e60ca657b311d5c34d038bb89c.zip
uscxml-ba050afaaad699e60ca657b311d5c34d038bb89c.tar.gz
uscxml-ba050afaaad699e60ca657b311d5c34d038bb89c.tar.bz2
Refactoring for other datamodels
Diffstat (limited to 'src/uscxml/plugins/datamodel/null/NULLDataModel.cpp')
-rw-r--r--src/uscxml/plugins/datamodel/null/NULLDataModel.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/uscxml/plugins/datamodel/null/NULLDataModel.cpp b/src/uscxml/plugins/datamodel/null/NULLDataModel.cpp
index 69970dd..6911480 100644
--- a/src/uscxml/plugins/datamodel/null/NULLDataModel.cpp
+++ b/src/uscxml/plugins/datamodel/null/NULLDataModel.cpp
@@ -52,7 +52,7 @@ bool NULLDataModel::validate(const std::string& location, const std::string& sch
}
uint32_t NULLDataModel::getLength(const std::string& expr) {
- return 0;
+ return 0;
}
void NULLDataModel::eval(const std::string& expr) {
@@ -63,9 +63,9 @@ bool NULLDataModel::isDeclared(const std::string& expr) {
}
/**
- * The boolean expression language consists of the In predicate only. It has the
- * form 'In(id)', where id is the id of a state in the enclosing state machine.
- * The predicate must return 'true' if and only if that state is in the current
+ * The boolean expression language consists of the In predicate only. It has the
+ * form 'In(id)', where id is the id of a state in the enclosing state machine.
+ * The predicate must return 'true' if and only if that state is in the current
* state configuration.
*/
bool NULLDataModel::evalAsBool(const std::string& expr) {
@@ -73,14 +73,14 @@ bool NULLDataModel::evalAsBool(const std::string& expr) {
boost::trim(trimmedExpr);
if (!boost::istarts_with(trimmedExpr, "in"))
return false;
-
+
// find string in between brackets
size_t start = trimmedExpr.find_first_of("(");
size_t end = trimmedExpr.find_last_of(")");
if (start == std::string::npos || end == std::string::npos || start >= end)
return false;
start++;
-
+
// split at comma
std::stringstream ss(trimmedExpr.substr(start, end - start));
std::vector<std::string> stateExprs;
@@ -88,7 +88,7 @@ bool NULLDataModel::evalAsBool(const std::string& expr) {
while(std::getline(ss, item, ',')) {
stateExprs.push_back(item);
}
-
+
for (unsigned int i = 0; i < stateExprs.size(); i++) {
// remove ticks
size_t start = stateExprs[i].find_first_of("'");
@@ -101,7 +101,7 @@ bool NULLDataModel::evalAsBool(const std::string& expr) {
} else {
stateName = stateExprs[i];
}
-
+
if (Interpreter::isMember(_interpreter->getState(stateName), _interpreter->getConfiguration())) {
continue;
}