From 6fcb5ca46927f7baab744e117af9eb1ce5b74838 Mon Sep 17 00:00:00 2001 From: Renaud Guezennec Date: Sun, 9 Feb 2025 06:05:05 +0100 Subject: [Dice] add functions: floor, ceil, round --- src/libparser/node/roundnode.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/libparser/node/roundnode.h (limited to 'src/libparser/node/roundnode.h') diff --git a/src/libparser/node/roundnode.h b/src/libparser/node/roundnode.h new file mode 100644 index 0000000..0bf49b7 --- /dev/null +++ b/src/libparser/node/roundnode.h @@ -0,0 +1,31 @@ +#ifndef ROUNDNODE_H +#define ROUNDNODE_H + +#include "executionnode.h" +#include "scalarresult.h" + +class RoundNode : public ExecutionNode +{ +public: + enum Mode { + FLOOR, + CEIL, + ROUND + }; + RoundNode(Mode mode); + + // ExecutionNode interface +public: + void run(ExecutionNode *previous); + QString toString(bool withLabel) const; + qint64 getPriority() const; + ExecutionNode *getCopy() const; + void setCommand(ExecutionNode* cmd); + +private: + std::unique_ptr m_scalarResult; + ExecutionNode* m_cmd= nullptr; + Mode m_mode{ROUND}; +}; + +#endif // ROUNDNODE_H -- cgit v1.2.3-70-g09d2