From 07c5f6ec23fcf9237a24e71adcfacabce677f818 Mon Sep 17 00:00:00 2001 From: Renaud G Date: Fri, 29 Apr 2022 10:48:09 +0200 Subject: Change file organization. --- node/executionnode.cpp | 101 ------------------------------------------------- 1 file changed, 101 deletions(-) delete mode 100644 node/executionnode.cpp (limited to 'node/executionnode.cpp') diff --git a/node/executionnode.cpp b/node/executionnode.cpp deleted file mode 100644 index 4545934..0000000 --- a/node/executionnode.cpp +++ /dev/null @@ -1,101 +0,0 @@ -#include "executionnode.h" - -#include - -ExecutionNode::ExecutionNode() - : m_previousNode(nullptr) - , m_result(nullptr) - , m_nextNode(nullptr) - , m_errors(QMap()) - , m_id(QString("\"%1\"").arg(QUuid::createUuid().toString())) -{ -} -ExecutionNode::~ExecutionNode() -{ - if(nullptr != m_result) - { - delete m_result; - m_result= nullptr; - } - if(nullptr != m_nextNode) - { - delete m_nextNode; - m_nextNode= nullptr; - } -} - -Result* ExecutionNode::getResult() -{ - return m_result; -} -void ExecutionNode::setNextNode(ExecutionNode* node) -{ - m_nextNode= node; -} -void ExecutionNode::setPreviousNode(ExecutionNode* node) -{ - m_previousNode= node; -} -ExecutionNode* ExecutionNode::getNextNode() -{ - return m_nextNode; -} -QMap ExecutionNode::getExecutionErrorMap() -{ - if(nullptr != m_nextNode) - { - auto const& keys= m_nextNode->getExecutionErrorMap().keys(); - for(auto& key : keys) - { - m_errors.insert(key, m_nextNode->getExecutionErrorMap().value(key)); - } - } - return m_errors; -} -QString ExecutionNode::getHelp() -{ - return QString(); -} -ExecutionNode* ExecutionNode::getPreviousNode() const -{ - return m_previousNode; -} -void ExecutionNode::generateDotTree(QString& s) -{ - auto str= toString(true); - if(s.contains(str)) - return; - s.append(toString(true)); - s.append(";\n"); - - if(nullptr != m_nextNode) - { - s.append(toString(false)); - s.append(" -> "); - s.append(m_nextNode->toString(false)); - s.append("[label=\"next\"];\n"); - // s.append(" [label=\"nextNode\"];\n"); - m_nextNode->generateDotTree(s); - } - else - { - s.append(toString(false)); - s.append(" -> "); - s.append("nullptr;\n"); - } - if(nullptr != m_result) - { - s.append(toString(false)); - s.append(" ->"); - s.append(m_result->toString(false)); - s.append(" [label=\"Result\", style=\"dashed\"];\n"); - if(nullptr == m_nextNode) - m_result->generateDotTree(s); - } -} -qint64 ExecutionNode::getScalarResult() -{ - if(m_result == nullptr) - return 0; - return m_result->getResult(Dice::RESULT_TYPE::SCALAR).toInt(); -} -- cgit v1.2.3-70-g09d2