Use LCP to generate LogicalOperator boost serialization

Summary:
Since we are moving from boost to Capnp for serialization, it makes
sense to keep all of the LogicalOperator classes in LCP format. This
will make it easier to generate Capnp code.

Depends on D1361

Reviewers: buda, mferencevic, msantl, dgleich, ipaljak, mculinovic, mtomic

Reviewed By: mtomic

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1362
This commit is contained in:
Teon Banek 2018-04-23 16:23:42 +02:00
parent 632663dca5
commit 30506f44f5
6 changed files with 2164 additions and 2739 deletions

3
.gitignore vendored
View File

@ -37,3 +37,6 @@ TAGS
# Cap'n Proto generated files # Cap'n Proto generated files
*.capnp.c++ *.capnp.c++
*.capnp.h *.capnp.h
# LCP generated C++ files
src/query/plan/operator.hpp

View File

@ -94,6 +94,8 @@ function(add_lcp lcp_file)
set(generated_lcp_files ${generated_lcp_files} ${h_file} PARENT_SCOPE) set(generated_lcp_files ${generated_lcp_files} ${h_file} PARENT_SCOPE)
endfunction(add_lcp) endfunction(add_lcp)
add_lcp(query/plan/operator.lcp)
add_custom_target(generate_lcp DEPENDS ${generated_lcp_files}) add_custom_target(generate_lcp DEPENDS ${generated_lcp_files})
# Use this function to add each capnp file to generation. This way each file is # Use this function to add each capnp file to generation. This way each file is

View File

@ -243,17 +243,18 @@
(defun boost-serialization (cpp-class) (defun boost-serialization (cpp-class)
"Add boost serialization code to `CPP-CLASS'." "Add boost serialization code to `CPP-CLASS'."
(labels ((get-serialize-code (member-name serialize-fun) (labels ((get-serialize-code (member-name serialize-fun)
(make-raw-cpp
:string
(if serialize-fun (if serialize-fun
(etypecase serialize-fun ;; Invoke or use serialize-fun
(string serialize-fun) (ctypecase serialize-fun
(raw-cpp (raw-cpp-string serialize-fun)) ((or string raw-cpp) serialize-fun)
(function (function
(let ((res (funcall serialize-fun "ar" member-name))) (let ((res (funcall serialize-fun "ar" member-name)))
(check-type res (or raw-cpp string)) (check-type res (or raw-cpp string))
res))) res)))
(format nil "ar & ~A;" member-name)))) ;; Else use the default serialization
#>cpp
ar & ${member-name};
cpp<#))
(save-member (member) (save-member (member)
(get-serialize-code (get-serialize-code
(cpp-member-name member :struct (cpp-class-structp cpp-class)) (cpp-member-name member :struct (cpp-class-structp cpp-class))

View File

@ -1604,10 +1604,6 @@ std::vector<Symbol> Produce::ModifiedSymbols(const SymbolTable &table) const {
return OutputSymbols(table); return OutputSymbols(table);
} }
const std::vector<NamedExpression *> &Produce::named_expressions() {
return named_expressions_;
}
Produce::ProduceCursor::ProduceCursor(const Produce &self, Produce::ProduceCursor::ProduceCursor(const Produce &self,
database::GraphDbAccessor &db) database::GraphDbAccessor &db)
: self_(self), db_(db), input_cursor_(self_.input_->MakeCursor(db)) {} : self_(self), db_(db), input_cursor_(self_.input_->MakeCursor(db)) {}

File diff suppressed because it is too large Load Diff

2147
src/query/plan/operator.lcp Normal file

File diff suppressed because it is too large Load Diff