taco-db  0.1.0
IndexScanState.h
Go to the documentation of this file.
1 #ifndef EXECUTION_INDEXSCANSTATE_H
2 #define EXECUTION_INDEXSCANSTATE_H
3 
5 
7 #include "plan/IndexScan.h"
8 #include "index/Index.h"
9 
10 namespace taco {
11 
24 public:
25  ~IndexScanState() override;
26 
27  void node_properties_to_string(std::string& buf, int indent) const override;
28 
29  void init() override;
30 
31  bool next_tuple() override;
32 
33  std::vector<NullableDatumRef> get_record() override;
34 
35  void close() override;
36 
37  void rewind() override;
38 
39  Datum save_position() const override;
40 
41  bool rewind(DatumRef saved_position) override;
42 
43  const PlanNode*
44  get_plan() const override {
45  return m_plan;
46  }
47 
48 private:
49  IndexScanState(const IndexScan* plan,
50  std::unique_ptr<Index> idx);
51 
52  const IndexScan* m_plan;
53 
54  // You can add your own states here.
55 
56  friend class IndexScan;
57 };
58 
59 } // namespace taco
60 
61 #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
IndexScanState is the execution state for index based table scan.
Definition: IndexScanState.h:23
void node_properties_to_string(std::string &buf, int indent) const override
Definition: IndexScanState.cpp:19
IndexScanState(const IndexScan *plan, std::unique_ptr< Index > idx)
Definition: IndexScanState.cpp:6
bool next_tuple() override
Moves the iterator of this execution state to the next output record.
Definition: IndexScanState.cpp:29
void init() override
Initialize this plan execution state, set m_initialized to true and initialize all corresponding stat...
Definition: IndexScanState.cpp:24
void rewind() override
Rewind the execution state as if it has just been initialized.
Definition: IndexScanState.cpp:46
~IndexScanState() override
Definition: IndexScanState.cpp:14
const IndexScan * m_plan
Definition: IndexScanState.h:52
std::vector< NullableDatumRef > get_record() override
Return the deserialized output record to which this execution state currently points.
Definition: IndexScanState.cpp:35
Datum save_position() const override
Returns a saved position where this plan execution state is at.
Definition: IndexScanState.cpp:51
void close() override
Clear internal states, mark we have finish retrieving output records from this execution state,...
Definition: IndexScanState.cpp:41
const PlanNode * get_plan() const override
Returns the corresponding plan.
Definition: IndexScanState.h:44
IndexScan is the physical plan for index based table scanning.
Definition: IndexScan.h:24
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