Move TL object fetch to cpp.

GitOrigin-RevId: 8700426caa00ca34be9716b9875cd4c87f8dc51f
This commit is contained in:
levlam 2018-09-25 05:24:32 +03:00
parent 7b5e6b9362
commit f404f7799b
2 changed files with 9 additions and 8 deletions

View File

@ -516,7 +516,13 @@ std::string TD_TL_writer_cpp::gen_fetch_function_begin(const std::string &parser
assert(arity == 0); assert(arity == 0);
if (parser_type == 0) { if (parser_type == 0) {
return "\n" + class_name + "::" + class_name + "(" + parser_name + return "\n" + fetched_type + class_name + "::fetch(" + parser_name +
" &p) {\n"
" return make_tl_object<" +
class_name +
">(p);\n"
"}\n\n" +
class_name + "::" + class_name + "(" + parser_name +
" &p)\n" " &p)\n"
"#define FAIL(error) p.set_error(error)\n"; "#define FAIL(error) p.set_error(error)\n";
} }

View File

@ -261,13 +261,8 @@ std::string TD_TL_writer_h::gen_fetch_function_begin(const std::string &parser_n
if (parser_type == 0) { if (parser_type == 0) {
return "\n" return "\n"
" static " + " static " +
fetched_type + "fetch(" + parser_name + fetched_type + "fetch(" + parser_name + " &p);\n\n" + " explicit " + class_name + "(" + parser_name +
" &p) {\n" " &p);\n";
" return make_tl_object<" +
class_name +
">(p);\n"
" }\n\n" +
" explicit " + class_name + "(" + parser_name + " &p);\n";
} }
assert(arity == 0); assert(arity == 0);