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 
20 class ExprNode: public TreeNode {
21 public:
33  template<class ...UniquePtrs>
34  ExprNode(NodeTag tag, UniquePtrs&& ...input):
35  TreeNode(tag, std::forward<UniquePtrs>(input)...) {}
36 
38  virtual ~ExprNode() {}
39 
41  virtual Datum Eval(const std::vector<NullableDatumRef>& record) const = 0;
42 
44  virtual Datum Eval(const char* record) const = 0;
45 
47  std::shared_ptr<const SysTable_Type> ReturnType() const {
48  return m_type;
49  }
50 
51 protected:
52  std::shared_ptr<const SysTable_Type> m_type;
53 };
54 
55 }
56 
57 #endif // QUERY_EXPR_EXPRNODE_H
taco::TreeNode
TreeNode is the base class of all tree structures in TDB (e.g., parsing tree, logical plan,...
Definition: TreeNode.h:45
taco::ExprNode::Eval
virtual Datum Eval(const std::vector< NullableDatumRef > &record) const =0
Evaluate function upon a deserialized record.
NodeTag.h
taco
Definition: datum.h:28
TreeNode.h
taco::ExprNode::ReturnType
std::shared_ptr< const SysTable_Type > ReturnType() const
Derive the return type of this expression.
Definition: ExprNode.h:47
Type.h
tdb.h
taco::ExprNode::~ExprNode
virtual ~ExprNode()
Deconstructor.
Definition: ExprNode.h:38
taco::ExprNode
ExprNode is an abstract class of all expressions.
Definition: ExprNode.h:20
std
Definition: Record.h:148
taco::Datum
A Datum stores and possibly manage the memory resource of a read-only value of a plain fixed-length C...
Definition: datum.h:250
taco::ExprNode::m_type
std::shared_ptr< const SysTable_Type > m_type
Definition: ExprNode.h:52
taco::ExprNode::ExprNode
ExprNode(NodeTag tag, UniquePtrs &&...input)
Base constructor for all expression nodes.
Definition: ExprNode.h:34
taco::NodeTag
NodeTag
Definition: NodeTag.h:12
Record.h