aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/node/ifnode.h
diff options
context:
space:
mode:
authorRenaud G <renaud@rolisteam.org>2016-11-28 00:36:15 +0100
committerRenaud G <renaud@rolisteam.org>2016-11-28 00:36:15 +0100
commit13e297604b00615d47352538e3c82ea1ac700d4c (patch)
tree567efe03594d261831897f03a7821c4c6eeac59b /node/ifnode.h
parentcdd1716bd1aa8d9bbd0137aa98ff24867b6b3a0e (diff)
downloadOneRoll-13e297604b00615d47352538e3c82ea1ac700d4c.tar.gz
OneRoll-13e297604b00615d47352538e3c82ea1ac700d4c.zip
-Add API for copying a branch of execution node.
-Allow to use if node several times.
Diffstat (limited to 'node/ifnode.h')
-rw-r--r--node/ifnode.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/node/ifnode.h b/node/ifnode.h
index ed9e8de..da8bb0b 100644
--- a/node/ifnode.h
+++ b/node/ifnode.h
@@ -31,13 +31,44 @@
class IfNode : public ExecutionNode
{
public:
+ /**
+ * @brief The ConditionType enum
+ */
+ enum ConditionType {OnEach,OneOfThem,AllOfThem};
+ /**
+ * @brief IfNode
+ */
IfNode();
+ /**
+ * @brief ~IfNode
+ */
virtual ~IfNode();
+ /**
+ * @brief run
+ * @param previous
+ */
virtual void run(ExecutionNode* previous = NULL);
+ /**
+ * @brief setValidator
+ */
virtual void setValidator(Validator* );
+ /**
+ * @brief setInstructionTrue
+ */
virtual void setInstructionTrue(ExecutionNode*);
+ /**
+ * @brief setInstructionFalse
+ */
virtual void setInstructionFalse(ExecutionNode*);
+ /**
+ * @brief toString
+ * @return
+ */
virtual QString toString(bool )const;
+ /**
+ * @brief getPriority
+ * @return
+ */
virtual qint64 getPriority() const;
@@ -46,12 +77,29 @@ public:
*/
virtual void generateDotTree(QString&);
+ /**
+ * @brief getCopy
+ * @return
+ */
+ virtual ExecutionNode *getCopy() const;
+ /**
+ * @brief getConditionType
+ * @return
+ */
+ ConditionType getConditionType() const;
+
+ /**
+ * @brief setConditionType
+ * @param conditionType
+ */
+ void setConditionType(const IfNode::ConditionType &conditionType);
protected:
ExecutionNode *getLeafNode(ExecutionNode *node);
protected:
Validator* m_validator;
+ ConditionType m_conditionType;
ExecutionNode* m_true;
ExecutionNode* m_false;