taco-db  0.1.0
ProjectionState.h
Go to the documentation of this file.
1 #ifndef EXECUTION_PROJECTIONSTATE_H
2 #define EXECUTION_PROJECTIONSTATE_H
3 
5 #include "plan/Projection.h"
6 
7 namespace taco {
8 
19 public:
20  ~ProjectionState() override;
21 
22  void init() override;
23 
24  bool next_tuple() override;
25 
26  void node_properties_to_string(std::string &buf, int indent) const override;
27 
28  std::vector<NullableDatumRef> get_record() override;
29 
30  void close() override;
31 
32  void rewind() override;
33 
34  Datum save_position() const override;
35 
36  bool rewind(DatumRef saved_position) override;
37 
38  const PlanNode*
39  get_plan() const override {
40  return m_plan;
41  }
42 
43 private:
44  ProjectionState(const Projection* plan, std::unique_ptr<PlanExecState>&& child);
45 
47  std::vector<Datum> m_fields;
48 
49  friend class Projection;
50 };
51 
52 } // namespace taco
53 
54 #endif
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
ProjectionState is the execution state for projections.
Definition: ProjectionState.h:18
std::vector< Datum > m_fields
Definition: ProjectionState.h:47
void node_properties_to_string(std::string &buf, int indent) const override
Definition: ProjectionState.cpp:41
Datum save_position() const override
Returns a saved position where this plan execution state is at.
Definition: ProjectionState.cpp:70
bool next_tuple() override
Moves the iterator of this execution state to the next output record.
Definition: ProjectionState.cpp:28
~ProjectionState() override
Definition: ProjectionState.cpp:14
std::vector< NullableDatumRef > get_record() override
Return the deserialized output record to which this execution state currently points.
Definition: ProjectionState.cpp:46
void close() override
Clear internal states, mark we have finish retrieving output records from this execution state,...
Definition: ProjectionState.cpp:57
const Projection * m_plan
Definition: ProjectionState.h:46
const PlanNode * get_plan() const override
Returns the corresponding plan.
Definition: ProjectionState.h:39
ProjectionState(const Projection *plan, std::unique_ptr< PlanExecState > &&child)
Definition: ProjectionState.cpp:5
void init() override
Initialize this plan execution state, set m_initialized to true and initialize all corresponding stat...
Definition: ProjectionState.cpp:21
void rewind() override
Rewind the execution state as if it has just been initialized.
Definition: ProjectionState.cpp:64
Projection is the physical plan for projections.
Definition: Projection.h:20
Definition: datum.h:28