aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/node/jumpbackwardnode.cpp
blob: c311ed2813dee8f568fba9e342626a4954868949 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include "jumpbackwardnode.h"

JumpBackwardNode::JumpBackwardNode()
{
}



qint64 JumpBackwardNode::getPriority() const
{
	return 1;
}
QString JumpBackwardNode::toString() const
{
	return QString();
}
void JumpBackwardNode::run(ExecutionNode* previous)
{
		ExecutionNode* parent = previous;
		bool found=false;
		int i = 1;
		Result* result=NULL;
		while((NULL!=parent)&&(found))
		{
			result = parent->getResult();
			if(NULL!=result)
			{
				--i;
				if(i==0)
				{
					found =true;
				}
			}
			parent = parent->getPreviousNode();

		}
		m_result = result;
}