diff options
| author | 2017-11-30 13:24:17 +0100 | |
|---|---|---|
| committer | 2017-11-30 13:24:17 +0100 | |
| commit | c930587ff1fd23cf14c9c428d1756a02e10728d0 (patch) | |
| tree | c5202451a60ef802de50b8c1c1092acce2675b78 /node | |
| parent | 4efd58fa73100269256feb52679d53c51cf60632 (diff) | |
| download | OneRoll-c930587ff1fd23cf14c9c428d1756a02e10728d0.tar.gz OneRoll-c930587ff1fd23cf14c9c428d1756a02e10728d0.zip | |
-Fix Variable node
Diffstat (limited to 'node')
| -rw-r--r-- | node/variablenode.cpp | 20 | ||||
| -rw-r--r-- | node/variablenode.h | 6 |
2 files changed, 15 insertions, 11 deletions
diff --git a/node/variablenode.cpp b/node/variablenode.cpp index aa42492..f202246 100644 --- a/node/variablenode.cpp +++ b/node/variablenode.cpp @@ -1,5 +1,5 @@ #include "variablenode.h" - +#include "parsingtoolbox.h" VariableNode::VariableNode() { @@ -15,13 +15,17 @@ void VariableNode::run(ExecutionNode *previous) return; } - if(m_data.size()>m_index) + if(m_data->size()>m_index) { - auto value= m_data[m_index]; - m_result = value->getResult(); - if(nullptr!=m_nextNode) + auto value= (*m_data)[m_index]; + value = ParsingToolBox::getLatestNode(value); + if(nullptr != value) { - m_nextNode->run(this); + m_result = value->getResult(); + if(nullptr!=m_nextNode) + { + m_nextNode->run(this); + } } } else @@ -73,12 +77,12 @@ void VariableNode::setIndex(qint64 index) m_index = index; } -std::vector<ExecutionNode *> VariableNode::getData() const +std::vector<ExecutionNode *>* VariableNode::getData() const { return m_data; } -void VariableNode::setData(const std::vector<ExecutionNode *> &data) +void VariableNode::setData(std::vector<ExecutionNode *>* data) { m_data = data; } diff --git a/node/variablenode.h b/node/variablenode.h index 9173ae3..6e9cc78 100644 --- a/node/variablenode.h +++ b/node/variablenode.h @@ -22,12 +22,12 @@ public: qint64 getIndex() const; void setIndex(qint64 index); - std::vector<ExecutionNode *> getData() const; - void setData(const std::vector<ExecutionNode *> &data); + std::vector<ExecutionNode *>* getData() const; + void setData(std::vector<ExecutionNode *>* data); private: qint64 m_index; - std::vector<ExecutionNode*> m_data; + std::vector<ExecutionNode*>* m_data; }; #endif // VARIABLENODE_H |