aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/libparser/node/executionnode.h
diff options
context:
space:
mode:
authorRenaud G <renaud@rolisteam.org>2022-04-29 10:48:09 +0200
committerRenaud G <renaud@rolisteam.org>2022-04-29 10:48:09 +0200
commit07c5f6ec23fcf9237a24e71adcfacabce677f818 (patch)
tree588e8c5f82b9163181fad3581f610e6f1d88cba4 /src/libparser/node/executionnode.h
parenta9153f1615a842cfb9e9bcda4d9071e202618569 (diff)
downloadOneRoll-07c5f6ec23fcf9237a24e71adcfacabce677f818.tar.gz
OneRoll-07c5f6ec23fcf9237a24e71adcfacabce677f818.zip
Change file organization.
Diffstat (limited to 'src/libparser/node/executionnode.h')
-rw-r--r--src/libparser/node/executionnode.h102
1 files changed, 102 insertions, 0 deletions
diff --git a/src/libparser/node/executionnode.h b/src/libparser/node/executionnode.h
new file mode 100644
index 0000000..d1bdf66
--- /dev/null
+++ b/src/libparser/node/executionnode.h
@@ -0,0 +1,102 @@
+#ifndef EXECUTIONNODE_H
+#define EXECUTIONNODE_H
+
+#include "result/result.h"
+#include <diceparser/diceparserhelper.h>
+
+/**
+ * @brief The ExecutionNode class
+ */
+class ExecutionNode
+{
+public:
+ /**
+ * @brief ExecutionNode
+ */
+ ExecutionNode();
+ /**
+ * @brief ~ExecutionNode
+ */
+ virtual ~ExecutionNode();
+ /**
+ * @brief run
+ * @param previous
+ */
+ virtual void run(ExecutionNode* previous= nullptr)= 0;
+ /**
+ * @brief getResult
+ * @return
+ */
+ virtual Result* getResult();
+ /**
+ * @brief setNextNode
+ */
+ void setNextNode(ExecutionNode*);
+ /**
+ * @brief getNextNode
+ * @return
+ */
+ ExecutionNode* getNextNode();
+ /**
+ * @brief getPreviousNode
+ * @return
+ */
+ virtual ExecutionNode* getPreviousNode() const;
+ void setPreviousNode(ExecutionNode* node);
+ /**
+ * @brief toString
+ * @return
+ */
+ virtual QString toString(bool withLabel) const= 0;
+ /**
+ * @brief getPriority
+ * @return
+ */
+ virtual qint64 getPriority() const= 0;
+ /**
+ * @brief getErrorList
+ * @return
+ */
+ virtual QMap<Dice::ERROR_CODE, QString> getExecutionErrorMap();
+
+ /**
+ * @brief generateDotTree
+ */
+ virtual void generateDotTree(QString&);
+
+ /**
+ * @brief getHelp
+ * @return
+ */
+ virtual QString getHelp();
+
+ /**
+ * @brief getCopy
+ * @return should return a copy of that node.
+ */
+ virtual ExecutionNode* getCopy() const= 0;
+
+ virtual qint64 getScalarResult();
+
+protected:
+ /**
+ * @brief m_nextNode
+ */
+ ExecutionNode* m_previousNode= nullptr;
+ /**
+ * @brief m_result
+ */
+ Result* m_result= nullptr;
+ /**
+ * @brief m_nextNode
+ */
+ ExecutionNode* m_nextNode= nullptr;
+ /**
+ * @brief m_errors
+ */
+ QMap<Dice::ERROR_CODE, QString> m_errors;
+
+ QString m_id;
+};
+
+#endif // EXECUTIONNODE_H