diff options
Diffstat (limited to 'src/libparser/node/executionnode.h')
| -rw-r--r-- | src/libparser/node/executionnode.h | 102 |
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 |