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);
42 
43  const PlanNode*
44  get_plan() const {
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
taco::IndexScanState::IndexScanState
IndexScanState(const IndexScan *plan, std::unique_ptr< Index > idx)
Definition: IndexScanState.cpp:6
Index.h
taco::DatumRef
A DatumRef object is a read-only reference to an C++ object of a supported runtime type.
Definition: datum.h:823
taco::IndexScanState::close
void close() override
Clear internal states, mark we have finish retrieving output records from this execution state,...
Definition: IndexScanState.cpp:41
taco
Definition: datum.h:28
IndexScan.h
taco::IndexScanState::~IndexScanState
~IndexScanState() override
Definition: IndexScanState.cpp:14
taco::IndexScanState::get_plan
const PlanNode * get_plan() const
Returns the corresponding plan.
Definition: IndexScanState.h:44
taco::IndexScan
IndexScan is the physical plan for index based table scanning.
Definition: IndexScan.h:24
taco::IndexScanState::save_position
Datum save_position() const override
Returns a saved position where this plan execution state is at.
Definition: IndexScanState.cpp:51
taco::IndexScanState
IndexScanState is the execution state for index based table scan.
Definition: IndexScanState.h:23
taco::PlanExecState
PlanExecState is an abstract interface for execution state of various query plan.
Definition: PlanExecState.h:19
taco::IndexScanState::m_plan
const IndexScan * m_plan
Definition: IndexScanState.h:52
taco::IndexScanState::next_tuple
bool next_tuple() override
Moves the iterator of this execution state to the next output record.
Definition: IndexScanState.cpp:29
taco::IndexScanState::init
void init() override
Initialize this plan execution state, set m_initialized to true and initialize all corresponding stat...
Definition: IndexScanState.cpp:24
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
PlanExecState.h
taco::IndexScanState::node_properties_to_string
void node_properties_to_string(std::string &buf, int indent) const override
Definition: IndexScanState.cpp:19
taco::IndexScanState::rewind
void rewind() override
Rewind the execution state as if it has just been initialized.
Definition: IndexScanState.cpp:46
BufferManager.h
taco::IndexScanState::get_record
std::vector< NullableDatumRef > get_record() override
Return the deserialized output record to which this execution state currently points.
Definition: IndexScanState.cpp:35
taco::PlanNode
PlanNode is an abstract interface representing physical query plan that does not bound with any parti...
Definition: PlanNode.h:26