aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/node
diff options
context:
space:
mode:
authorRenaud G <renaud@rolisteam.org>2018-03-18 17:46:44 +0100
committerRenaud G <renaud@rolisteam.org>2018-03-18 17:46:44 +0100
commit8e2f96053a4fb57f82a59fffbfa4178168455e9f (patch)
tree9e0ba273f240ead1212a7efb6a194e79ae3448b2 /node
parentf47c0c0a6f151d7f74d41e551fccadd8b12b003c (diff)
downloadOneRoll-8e2f96053a4fb57f82a59fffbfa4178168455e9f.tar.gz
OneRoll-8e2f96053a4fb57f82a59fffbfa4178168455e9f.zip
-get scalar result.
Diffstat (limited to 'node')
-rw-r--r--node/executionnode.cpp6
-rw-r--r--node/executionnode.h6
2 files changed, 10 insertions, 2 deletions
diff --git a/node/executionnode.cpp b/node/executionnode.cpp
index fadc9fb..588f4f5 100644
--- a/node/executionnode.cpp
+++ b/node/executionnode.cpp
@@ -89,3 +89,9 @@ void ExecutionNode::generateDotTree(QString& s)
}
}
+qint64 ExecutionNode::getScalarResult()
+{
+ if(m_result == nullptr)
+ return 0;
+ return m_result->getResult(Result::SCALAR).toInt();
+}
diff --git a/node/executionnode.h b/node/executionnode.h
index 6fe8c62..a84bef0 100644
--- a/node/executionnode.h
+++ b/node/executionnode.h
@@ -80,11 +80,13 @@ public:
*/
virtual ExecutionNode* getCopy() const = 0;
+ virtual qint64 getScalarResult();
+
protected:
/**
* @brief m_nextNode
*/
- ExecutionNode* m_previousNode;
+ ExecutionNode* m_previousNode= nullptr;
/**
* @brief m_result
*/
@@ -92,7 +94,7 @@ protected:
/**
* @brief m_nextNode
*/
- ExecutionNode* m_nextNode;
+ ExecutionNode* m_nextNode = nullptr;
/**
* @brief m_errors
*/