From e4ea59e05e6ca870a05f731d42efdcdc3f595055 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Tue, 16 Jan 2024 12:59:10 +0100 Subject: tools: Dangling changes --- modules/tools/c_gen_iface.hpp | 61 ++++++++----------------------------------- 1 file changed, 11 insertions(+), 50 deletions(-) (limited to 'modules') diff --git a/modules/tools/c_gen_iface.hpp b/modules/tools/c_gen_iface.hpp index 4fa6ca7..1416062 100644 --- a/modules/tools/c_gen_iface.hpp +++ b/modules/tools/c_gen_iface.hpp @@ -250,22 +250,21 @@ struct c_data_translater> { } { c_types::c_member memb; - memb.key } - str.def = "struct "; - str.def += type_str; + str.type = "struct "; + str.type += type_str; - str.def += " {\n"; + str.type += " {\n"; - str.def += "\t" + inner_type_str + "* data;\n"; - str.def += "\tsize_t size;\n"; + str.type += "\t" + inner_type_str + "* data;\n"; + str.type += "\tsize_t size;\n"; if( Dim > 1 ){ - str.def += "\tsize_t dims["+std::to_string(Dim)+"];\n"; + str.type += "\tsize_t dims["+std::to_string(Dim)+"];\n"; } - str.def += "};\n"; + str.type += "};\n"; c_state.struct_map.emplace(std::make_pair(type_str, std::move(str))); return void_t{}; @@ -337,48 +336,12 @@ struct c_iface_translater 0 ){ - fn.def += ", "; - auto eov = generate_parameter<0>(fn.def, request_type_arr); - if(eov.is_error()){ - return eov; - } - } - fn.def += ")"; - - fn.source = "{\n"; - // Check necessary pointers - fn.source += "\tassert(ctx);\n"; - fn.source += "\tif(!ctx){return -1;}\n\n"; - fn.source += "\tauto rmt = reinterpret_cast 0){ - // I need a recursive search for the types - } - - // Call the remote interface - fn.source += "\tauto eov = rmt->template call<\"" + fn.cpp_name + "\">(std::move(input));"; - fn.source += ");\n"; - // translate the output data - fn.source += ""; - - // Close the brace - - fn.source += "}\n"; - c_state.func_map.emplace(std::make_pair(c_func_name, std::move(fn))); + c_state.func_map.emplace(std::make_pair(fn.cpp_name, std::move(fn))); return void_t{}; } @@ -469,7 +432,7 @@ error_or generate_iface_example(){ for(auto& iter : type_map){ std::cout<<"\nType: \""< generate_iface_example(){ for(auto& iter : func_map){ std::cout<<"\nSymbol: \""< generate_array_example(){ for(auto& iter : c_state.struct_map){ std::cout<<"\nType: \""<