diff options
author | Claudius "keldu" Holeksa <mail@keldu.de> | 2023-11-27 23:03:57 +0100 |
---|---|---|
committer | Claudius "keldu" Holeksa <mail@keldu.de> | 2023-11-27 23:03:57 +0100 |
commit | aa2ecacd2e477eb5748f060d33138e0c12c0634f (patch) | |
tree | d0360b420ecddaf6b9986c004ea3e0b962c9ca1b /c++/tools/c_gen_iface.hpp | |
parent | 0cf04f2d1ba5ed2a18fe9f3501f363cb3ff76c9f (diff) |
codec,core,tools: Adding dangling experimental changes
Diffstat (limited to 'c++/tools/c_gen_iface.hpp')
-rw-r--r-- | c++/tools/c_gen_iface.hpp | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/c++/tools/c_gen_iface.hpp b/c++/tools/c_gen_iface.hpp index 7e2e396..68c8779 100644 --- a/c++/tools/c_gen_iface.hpp +++ b/c++/tools/c_gen_iface.hpp @@ -20,6 +20,7 @@ struct c_types { struct c_member { std::string key; std::string name; + bool is_primitive; }; struct c_param { @@ -184,12 +185,29 @@ struct c_data_translater<schema::Array<T,Dim>> { return make_error<err::critical>(); } + str.translate_to_c_source = "int translate_"; + str.translate_to_c_source += type_str; + str.translate_to_c_source += "(const saw::data<"; + str.translate_to_c_source += str.cpp_schema; + str.translate_to_c_source += ","; + str.translate_to_c_source += c_state.encoding; + str.translate_to_c_source += ">& cpp_data, struct "; + str.translate_to_c_source += type_str; + str.translate_to_c_source += "* c_data"; + + + str.translate_to_c_source += "int translate_"; + str.translate_to_c_source += inner_type_str; + str.translate_to_c_source += "(; + + { c_types::c_member memb; memb.key = inner_type_str; memb.name = "data"; - memb.is_primitive - fn.members.emplace_back(std::move(memb)); + memb.is_primitive = c_is_primitive<T>::value; + // fn.members.emplace_back(std::move(memb)); + str.members.emplace_back(std::move(memb)); } str.def = "struct "; |