taco-db  0.1.0
Limit.h
Go to the documentation of this file.
1 #ifndef PLAN_LIMIT_H
2 #define PLAN_LIMIT_H
3 
4 #include "tdb.h"
5 #include "plan/PlanNode.h"
6 
7 namespace taco {
8 
9 class LimitState;
10 
16 class Limit: public PlanNode {
17 public:
18  static std::unique_ptr<Limit>
19  Create(std::unique_ptr<PlanNode>&& child, size_t count);
20 
21  ~Limit() override;
22 
23  void node_properties_to_string(std::string& buf, int indent) const override;
24 
25  std::unique_ptr<PlanExecState> create_exec_state() const override;
26 
27  const Schema* get_output_schema() const override;
28 
29 private:
30  Limit(std::unique_ptr<PlanNode>&& child, size_t count);
31 
32  size_t m_cnt;
33 
34  friend class LimitState;
35 };
36 
37 } // namespace taco
38 
39 #endif
LimitState is the exeuction state for limitation.
Definition: LimitState.h:20
Limit is the physical plan for limitation.
Definition: Limit.h:16
Limit(std::unique_ptr< PlanNode > &&child, size_t count)
Definition: Limit.cpp:9
std::unique_ptr< PlanExecState > create_exec_state() const override
Create the corresponding execution state for the physical plan so that it can be used as physical sca...
Definition: Limit.cpp:27
static std::unique_ptr< Limit > Create(std::unique_ptr< PlanNode > &&child, size_t count)
Definition: Limit.cpp:14
~Limit() override
Definition: Limit.cpp:18
void node_properties_to_string(std::string &buf, int indent) const override
Definition: Limit.cpp:22
const Schema * get_output_schema() const override
Each physical plan should link a schema for its output relation, incidating what fields are included ...
Definition: Limit.cpp:32
size_t m_cnt
Definition: Limit.h:32
PlanNode is an abstract interface representing physical query plan that does not bound with any parti...
Definition: PlanNode.h:26
A Schema object stores the information for accessing an ordered set of typed fields either from a dis...
Definition: Schema.h:39
Definition: datum.h:28