taco-db  0.1.0
ExprNode.h
Go to the documentation of this file.
1 #ifndef EXPR_EXPRNODE_H
2 #define EXPR_EXPRNODE_H
3 
4 #include "tdb.h"
5 #include "storage/Record.h"
6 
7 #include "utils/tree/TreeNode.h"
8 #include "utils/tree/NodeTag.h"
10 
11 namespace taco {
12 
29 class ExprNode: public TreeNode {
30 public:
42  template<class ...UniquePtrs>
43  ExprNode(NodeTag tag, UniquePtrs&& ...input):
44  TreeNode(tag, std::forward<UniquePtrs>(input)...) {}
45 
47  virtual ~ExprNode() {}
48 
50  virtual Datum Eval(const std::vector<NullableDatumRef>& record) const = 0;
51 
53  virtual Datum Eval(const char* record) const = 0;
54 
56  std::shared_ptr<const SysTable_Type> ReturnType() const {
57  return m_type;
58  }
59 
60 protected:
61  std::shared_ptr<const SysTable_Type> m_type;
62 };
63 
64 }
65 
66 #endif // QUERY_EXPR_EXPRNODE_H
This file is automatically generated, DO NOT modify.
A Datum stores and possibly manage the memory resource of a read-only value of a plain fixed-length C...
Definition: datum.h:250
ExprNode is an abstract class of all expressions.
Definition: ExprNode.h:29
std::shared_ptr< const SysTable_Type > ReturnType() const
Derive the return type of this expression.
Definition: ExprNode.h:56
virtual Datum Eval(const std::vector< NullableDatumRef > &record) const =0
Evaluate function upon a deserialized record.
virtual Datum Eval(const char *record) const =0
Evaluate function on top of a serialized record.
std::shared_ptr< const SysTable_Type > m_type
Definition: ExprNode.h:61
virtual ~ExprNode()
Deconstructor.
Definition: ExprNode.h:47
ExprNode(NodeTag tag, UniquePtrs &&...input)
Base constructor for all expression nodes.
Definition: ExprNode.h:43
TreeNode is the base class of all tree structures in TDB (e.g., parsing tree, logical plan,...
Definition: TreeNode.h:40
Definition: Record.h:148
Definition: datum.h:28
NodeTag
Definition: NodeTag.h:12