From 90cec3957ff5e61981f9068a1fac3cb44a3e7d41 Mon Sep 17 00:00:00 2001 From: Renaud G Date: Wed, 8 May 2019 17:11:29 +0200 Subject: Add test node. --- node/testnode.cpp | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 node/testnode.cpp (limited to 'node/testnode.cpp') diff --git a/node/testnode.cpp b/node/testnode.cpp new file mode 100644 index 0000000..263286b --- /dev/null +++ b/node/testnode.cpp @@ -0,0 +1,48 @@ +#include "testnode.h" +#include "die.h" + +TestNode::TestNode() {} + +TestNode::~TestNode() +{ + m_nextNode= nullptr; + m_result= nullptr; +} +void TestNode::run(ExecutionNode* previous) +{ + if(nullptr != m_nextNode) + { + m_nextNode->run(this); + } +} + +QString TestNode::toString(bool wl) const +{ + if(wl) + { + return QStringLiteral("%1 [label=\"TestNode \"]").arg(m_id); + } + else + { + return m_id; + } +} +qint64 TestNode::getPriority() const +{ + qint64 priority= 4; + return priority; +} +ExecutionNode* TestNode::getCopy() const +{ + TestNode* node= new TestNode(); + if(nullptr != m_nextNode) + { + node->setNextNode(m_nextNode->getCopy()); + } + return node; +} + +void TestNode::setResult(Result* result) +{ + m_result= result; +} -- cgit v1.2.3-70-g09d2