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/scalaroperatornode.h | 64 +++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 59 insertions(+), 5 deletions(-) (limited to 'node/scalaroperatornode.h') diff --git a/node/scalaroperatornode.h b/node/scalaroperatornode.h index 7fa9b6b..4b21b8c 100644 --- a/node/scalaroperatornode.h +++ b/node/scalaroperatornode.h @@ -35,30 +35,84 @@ class ScalarOperatorNode : public ExecutionNode { public: + /** + * @brief The ArithmeticOperator enum + */ enum ArithmeticOperator {PLUS,MINUS,DIVIDE,MULTIPLICATION}; + /** + * @brief ScalarOperatorNode + */ ScalarOperatorNode(); - virtual ~ScalarOperatorNode(); + /** + * @brief ~ScalarOperatorNode + */ + virtual ~ScalarOperatorNode(); + /** + * @brief run + */ virtual void run(ExecutionNode*); - + /** + * @brief setInternalNode + * @param node + */ void setInternalNode(ExecutionNode* node); - + /** + * @brief toString + * @param wl + * @return + */ virtual QString toString(bool wl)const; + /** + * @brief getPriority + * @return + */ virtual qint64 getPriority() const; - + /** + * @brief generateDotTree + * @param s + */ void generateDotTree(QString& s); /** * @brief getErrorList * @return */ virtual QMap getExecutionErrorMap(); - + /** + * @brief getArithmeticOperator + * @return + */ ScalarOperatorNode::ArithmeticOperator getArithmeticOperator() const; + /** + * @brief setArithmeticOperator + * @param arithmeticOperator + */ void setArithmeticOperator(const ScalarOperatorNode::ArithmeticOperator &arithmeticOperator); + /** + * @brief getCopy + * @return + */ + virtual ExecutionNode *getCopy() const; private: + /** + * @brief add + * @return + */ static qint64 add(qint64,qint64); + /** + * @brief substract + * @return + */ static qint64 substract(qint64,qint64); + /** + * @brief divide not static because of error management + * @return + */ qreal divide(qint64,qint64); + /** + * @brief multiple + * @return + */ static qint64 multiple(qint64,qint64); private: -- cgit v1.2.3-70-g09d2