taco-db  0.1.0
Cast.h
Go to the documentation of this file.
1 #ifndef EXPR_CAST_H
2 #define EXPR_CAST_H
3 
4 #include "expr/ExprNode.h"
5 
6 namespace taco {
7 
8 class Cast: public ExprNode {
9 public:
10  static std::unique_ptr<Cast>
11  Create(Oid typ_oid, std::unique_ptr<ExprNode>&& child, bool implicit);
12 
13  ~Cast() override;
14 
15  Datum Eval(const std::vector<NullableDatumRef>& record) const override;
16 
17  Datum Eval(const char* record) const override;
18 
19  void node_properties_to_string(std::string& buf, int indent) const override;
20 
21 private:
22  Cast(Oid typ_oid, std::unique_ptr<ExprNode>&& child, bool implicit);
23 
25 
26 };
27 
28 }
29 
30 #endif
Definition: Cast.h:8
Cast(Oid typ_oid, std::unique_ptr< ExprNode > &&child, bool implicit)
Definition: Cast.cpp:7
Datum Eval(const std::vector< NullableDatumRef > &record) const override
Evaluate function upon a deserialized record.
Definition: Cast.cpp:27
FunctionInfo m_func
Definition: Cast.h:24
static std::unique_ptr< Cast > Create(Oid typ_oid, std::unique_ptr< ExprNode > &&child, bool implicit)
Definition: Cast.cpp:19
~Cast() override
Definition: Cast.cpp:24
void node_properties_to_string(std::string &buf, int indent) const override
Definition: Cast.cpp:38
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
Definition: datum.h:28
uint32_t Oid
Definition: tdb_base.h:210
std::function< Datum(FunctionCallInfo &)> FunctionInfo
An FMGR managed function should be declared as.
Definition: fmgr.h:50