From 6d3f9ab695235cebb33f31cf91bb0043f289ff08 Mon Sep 17 00:00:00 2001 From: jeremy Date: Mon, 5 Dec 2022 14:07:53 +0100 Subject: [PATCH] Removing template from class Frame --- src/expr/interpret/eval.hpp | 6 +++--- src/expr/interpret/frame.hpp | 8 +++----- src/query/v2/bindings/frame.hpp | 4 ++-- src/query/v2/interpreter.cpp | 12 ++++++------ src/storage/v3/bindings/frame.hpp | 2 +- 5 files changed, 15 insertions(+), 17 deletions(-) diff --git a/src/expr/interpret/eval.hpp b/src/expr/interpret/eval.hpp index 8fb300a83..b97ecc9d1 100644 --- a/src/expr/interpret/eval.hpp +++ b/src/expr/interpret/eval.hpp @@ -36,8 +36,8 @@ template class ExpressionEvaluator : public ExpressionVisitor { public: - ExpressionEvaluator(Frame *frame, const SymbolTable &symbol_table, const EvaluationContext &ctx, - DbAccessor *dba, StorageView view) + ExpressionEvaluator(Frame *frame, const SymbolTable &symbol_table, const EvaluationContext &ctx, DbAccessor *dba, + StorageView view) : frame_(frame), symbol_table_(&symbol_table), ctx_(&ctx), dba_(dba), view_(view) {} using ExpressionVisitor::Visit; @@ -782,7 +782,7 @@ class ExpressionEvaluator : public ExpressionVisitor { LabelId GetLabel(LabelIx label) { return ctx_->labels[label.ix]; } - Frame *frame_; + Frame *frame_; const SymbolTable *symbol_table_; const EvaluationContext *ctx_; DbAccessor *dba_; diff --git a/src/expr/interpret/frame.hpp b/src/expr/interpret/frame.hpp index 1bc5bba83..1cd6a99ce 100644 --- a/src/expr/interpret/frame.hpp +++ b/src/expr/interpret/frame.hpp @@ -20,7 +20,6 @@ namespace memgraph::expr { -template class Frame { public: /// Create a Frame of given size backed by a utils::NewDeleteResource() @@ -42,12 +41,11 @@ class Frame { utils::pmr::vector elems_; }; -template -class FrameWithValidity final : public Frame { +class FrameWithValidity final : public Frame { public: - explicit FrameWithValidity(int64_t size) : Frame(size), is_valid_(false) {} + explicit FrameWithValidity(int64_t size) : Frame(size), is_valid_(false) {} - FrameWithValidity(int64_t size, utils::MemoryResource *memory) : Frame(size, memory), is_valid_(false) {} + FrameWithValidity(int64_t size, utils::MemoryResource *memory) : Frame(size, memory), is_valid_(false) {} bool IsValid() const noexcept { return is_valid_; } void MakeValid() noexcept { is_valid_ = true; } diff --git a/src/query/v2/bindings/frame.hpp b/src/query/v2/bindings/frame.hpp index 688f14121..898b03512 100644 --- a/src/query/v2/bindings/frame.hpp +++ b/src/query/v2/bindings/frame.hpp @@ -17,6 +17,6 @@ #include "query/v2/bindings/typed_value.hpp" namespace memgraph::query::v2 { -using Frame = memgraph::expr::Frame; -using FrameWithValidity = memgraph::expr::FrameWithValidity; +using Frame = memgraph::expr::Frame; +using FrameWithValidity = memgraph::expr::FrameWithValidity; } // namespace memgraph::query::v2 diff --git a/src/query/v2/interpreter.cpp b/src/query/v2/interpreter.cpp index b5f916e9f..fde11ac00 100644 --- a/src/query/v2/interpreter.cpp +++ b/src/query/v2/interpreter.cpp @@ -148,7 +148,7 @@ Callback HandleAuthQuery(AuthQuery *auth_query, AuthQueryHandler *auth, const Pa // Empty frame for evaluation of password expression. This is OK since // password should be either null or string literal and it's evaluation // should not depend on frame. - expr::Frame frame(0); + expr::Frame frame(0); SymbolTable symbol_table; EvaluationContext evaluation_context; // TODO: MemoryResource for EvaluationContext, it should probably be passed as @@ -315,7 +315,7 @@ Callback HandleAuthQuery(AuthQuery *auth_query, AuthQueryHandler *auth, const Pa Callback HandleReplicationQuery(ReplicationQuery *repl_query, const Parameters ¶meters, InterpreterContext *interpreter_context, RequestRouterInterface *request_router, std::vector *notifications) { - expr::Frame frame(0); + expr::Frame frame(0); SymbolTable symbol_table; EvaluationContext evaluation_context; // TODO: MemoryResource for EvaluationContext, it should probably be passed as @@ -450,7 +450,7 @@ Callback HandleReplicationQuery(ReplicationQuery *repl_query, const Parameters & Callback HandleSettingQuery(SettingQuery *setting_query, const Parameters ¶meters, RequestRouterInterface *request_router) { - expr::Frame frame(0); + expr::Frame frame(0); SymbolTable symbol_table; EvaluationContext evaluation_context; // TODO: MemoryResource for EvaluationContext, it should probably be passed as @@ -663,7 +663,7 @@ struct PullPlan { private: std::shared_ptr plan_ = nullptr; plan::UniqueCursorPtr cursor_ = nullptr; - expr::FrameWithValidity frame_; + expr::FrameWithValidity frame_; MultiFrame multi_frame_; ExecutionContext ctx_; std::optional memory_limit_; @@ -998,7 +998,7 @@ PreparedQuery PrepareCypherQuery(ParsedQuery parsed_query, std::map(parsed_query.query); - expr::Frame frame(0); + expr::Frame frame(0); SymbolTable symbol_table; EvaluationContext evaluation_context; evaluation_context.timestamp = QueryTimestamp(); @@ -1140,7 +1140,7 @@ PreparedQuery PrepareProfileQuery(ParsedQuery parsed_query, bool in_explicit_tra auto *cypher_query = utils::Downcast(parsed_inner_query.query); MG_ASSERT(cypher_query, "Cypher grammar should not allow other queries in PROFILE"); - expr::Frame frame(0); + expr::Frame frame(0); SymbolTable symbol_table; EvaluationContext evaluation_context; evaluation_context.timestamp = QueryTimestamp(); diff --git a/src/storage/v3/bindings/frame.hpp b/src/storage/v3/bindings/frame.hpp index 6e695816c..04a944ca4 100644 --- a/src/storage/v3/bindings/frame.hpp +++ b/src/storage/v3/bindings/frame.hpp @@ -17,5 +17,5 @@ #include "storage/v3/bindings/typed_value.hpp" namespace memgraph::storage::v3 { -using Frame = memgraph::expr::Frame; +using Frame = memgraph::expr::Frame; } // namespace memgraph::storage::v3