From 13e297604b00615d47352538e3c82ea1ac700d4c Mon Sep 17 00:00:00 2001 From: Renaud G Date: Mon, 28 Nov 2016 00:36:15 +0100 Subject: -Add API for copying a branch of execution node. -Allow to use if node several times. --- node/ifnode.h | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'node/ifnode.h') 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; -- cgit v1.2.3-70-g09d2