aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/node/scalaroperatornode.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/scalaroperatornode.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/scalaroperatornode.h')
-rw-r--r--node/scalaroperatornode.h64
1 files changed, 59 insertions, 5 deletions
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<ExecutionNode::DICE_ERROR_CODE,QString> 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: