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