taco-db  0.1.0
CartesianProductState.h
Go to the documentation of this file.
1 #ifndef EXECUTION_CARTESIANPRODUCTSTATE_H
2 #define EXECUTION_CARTESIANPRODUCTSTATE_H
3 
6 
7 namespace taco {
8 
17 public:
18  ~CartesianProductState() override;
19 
20  void node_properties_to_string(std::string &buf, int indent) const override;
21 
22  void init() override;
23 
24  bool next_tuple() override;
25 
26  std::vector<NullableDatumRef> get_record() override;
27 
28  void close() override;
29 
30  void rewind() override;
31 
32  Datum save_position() const override;
33 
34  bool rewind(DatumRef saved_position) override;
35 
36  const PlanNode*
37  get_plan() const override {
38  return m_plan;
39  }
40 
41 private:
43  std::unique_ptr<PlanExecState>&& left,
44  std::unique_ptr<PlanExecState>&& right);
45 
47 
48  // You can add your own states here.
49 
50  friend class CartesianProduct;
51 };
52 
53 } // namespace taco
54 
55 #endif
CartesianProductState is the execution state for cartesian product.
Definition: CartesianProductState.h:16
const CartesianProduct * m_plan
Definition: CartesianProductState.h:46
const PlanNode * get_plan() const override
Returns the corresponding plan.
Definition: CartesianProductState.h:37
void node_properties_to_string(std::string &buf, int indent) const override
Definition: CartesianProductState.cpp:31
void rewind() override
Rewind the execution state as if it has just been initialized.
Definition: CartesianProductState.cpp:47
~CartesianProductState() override
Definition: CartesianProductState.cpp:15
bool next_tuple() override
Moves the iterator of this execution state to the next output record.
Definition: CartesianProductState.cpp:25
void init() override
Initialize this plan execution state, set m_initialized to true and initialize all corresponding stat...
Definition: CartesianProductState.cpp:20
CartesianProductState(const CartesianProduct *plan, std::unique_ptr< PlanExecState > &&left, std::unique_ptr< PlanExecState > &&right)
Definition: CartesianProductState.cpp:6
void close() override
Clear internal states, mark we have finish retrieving output records from this execution state,...
Definition: CartesianProductState.cpp:42
Datum save_position() const override
Returns a saved position where this plan execution state is at.
Definition: CartesianProductState.cpp:52
std::vector< NullableDatumRef > get_record() override
Return the deserialized output record to which this execution state currently points.
Definition: CartesianProductState.cpp:36
CartesianProduct is the physical plan for Cartesian products.
Definition: CartesianProduct.h:15
A DatumRef object is a read-only reference to an C++ object of a supported runtime type.
Definition: datum.h:823
A Datum stores and possibly manage the memory resource of a read-only value of a plain fixed-length C...
Definition: datum.h:250
PlanExecState is an abstract interface for execution state of various query plan.
Definition: PlanExecState.h:19
PlanNode is an abstract interface representing physical query plan that does not bound with any parti...
Definition: PlanNode.h:26
Definition: datum.h:28