Skip to content
This repository was archived by the owner on Sep 27, 2019. It is now read-only.

Commit 3838caa

Browse files
committed
Cleanup common
1 parent e5379f2 commit 3838caa

File tree

1 file changed

+26
-19
lines changed

1 file changed

+26
-19
lines changed

src/include/common/statement.h

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//
77
// Identification: src/include/common/statement.h
88
//
9-
// Copyright (c) 2015-16, Carnegie Mellon University Database Group
9+
// Copyright (c) 2015-2018, Carnegie Mellon University Database Group
1010
//
1111
//===----------------------------------------------------------------------===//
1212

@@ -22,9 +22,10 @@
2222
#include "parser/sql_statement.h"
2323

2424
namespace peloton {
25+
2526
namespace planner {
2627
class AbstractPlan;
27-
}
28+
} // namespace planner
2829

2930
// Contains the value of a column in a tuple of the result set.
3031
// std::string since the result is sent to the client over the network.
@@ -38,55 +39,60 @@ typedef std::tuple<std::string, oid_t, size_t> FieldInfo;
3839
class Statement : public Printable {
3940
public:
4041
Statement() = delete;
41-
Statement(const Statement&) = delete;
42-
Statement& operator=(const Statement&) = delete;
43-
Statement(Statement&&) = delete;
44-
Statement& operator=(Statement&&) = delete;
42+
Statement(const Statement &) = delete;
43+
Statement &operator=(const Statement &) = delete;
44+
Statement(Statement &&) = delete;
45+
Statement &operator=(Statement &&) = delete;
4546

46-
Statement(const std::string& statement_name, const std::string& query_string);
47-
Statement(const std::string& statement_name, QueryType query_type,
48-
std::string query_string, std::unique_ptr<parser::SQLStatementList> sql_stmt_list);
47+
Statement(const std::string &statement_name, const std::string &query_string);
48+
Statement(const std::string &statement_name, QueryType query_type,
49+
std::string query_string,
50+
std::unique_ptr<parser::SQLStatementList> sql_stmt_list);
4951

5052
~Statement();
5153

5254
std::vector<FieldInfo> GetTupleDescriptor() const;
5355

54-
void SetStatementName(const std::string& statement_name);
56+
void SetStatementName(const std::string &statement_name);
5557

5658
std::string GetStatementName() const;
5759

58-
void SetQueryString(const std::string& query_string);
60+
void SetQueryString(const std::string &query_string);
5961

6062
std::string GetQueryString() const;
6163

6264
std::string GetQueryTypeString() const;
6365

6466
QueryType GetQueryType() const;
6567

66-
void SetParamTypes(const std::vector<int32_t>& param_types);
68+
void SetParamTypes(const std::vector<int32_t> &param_types);
6769

6870
std::vector<int32_t> GetParamTypes() const;
6971

70-
void SetTupleDescriptor(const std::vector<FieldInfo>& tuple_descriptor);
72+
void SetTupleDescriptor(const std::vector<FieldInfo> &tuple_descriptor);
7173

7274
void SetReferencedTables(const std::set<oid_t> table_ids);
7375

7476
const std::set<oid_t> GetReferencedTables() const;
7577

7678
void SetPlanTree(std::shared_ptr<planner::AbstractPlan> plan_tree);
7779

78-
const std::shared_ptr<planner::AbstractPlan>& GetPlanTree() const;
80+
const std::shared_ptr<planner::AbstractPlan> &GetPlanTree() const;
7981

80-
std::unique_ptr<parser::SQLStatementList>const& GetStmtParseTreeList() {return sql_stmt_list_;}
82+
std::unique_ptr<parser::SQLStatementList> const &GetStmtParseTreeList() {
83+
return sql_stmt_list_;
84+
}
8185

82-
std::unique_ptr<parser::SQLStatementList> PassStmtParseTreeList() {return std::move(sql_stmt_list_);}
86+
std::unique_ptr<parser::SQLStatementList> PassStmtParseTreeList() {
87+
return std::move(sql_stmt_list_);
88+
}
8389

8490
inline bool GetNeedsReplan() const { return (needs_replan_); }
8591

8692
inline void SetNeedsReplan(bool replan) { needs_replan_ = replan; }
8793

8894
// Get a string representation for debugging
89-
const std::string GetInfo() const;
95+
const std::string GetInfo() const override;
9096

9197
private:
9298
// logical name of statement
@@ -102,8 +108,8 @@ class Statement : public Printable {
102108
std::unique_ptr<parser::SQLStatementList> sql_stmt_list_;
103109

104110
// first token in query
105-
// Keep the string token of the query_type because it is returned
106-
// as responses after executing commands.
111+
// Keep the string token of the query_type because it is returned as responses
112+
// after executing commands.
107113
std::string query_type_string_;
108114

109115
// format codes of the parameters
@@ -122,4 +128,5 @@ class Statement : public Printable {
122128
// If this flag is true, then somebody wants us to replan this query
123129
bool needs_replan_ = false;
124130
};
131+
125132
} // namespace peloton

0 commit comments

Comments
 (0)