aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/libparser/node/roundnode.h
blob: 0bf49b73665e973ac9f6d639647190421bbe1cb5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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<ScalarResult> m_scalarResult;
    ExecutionNode* m_cmd= nullptr;
    Mode m_mode{ROUND};
};

#endif // ROUNDNODE_H