diff options
Diffstat (limited to 'c++/tools/c_gen_iface.hpp')
-rw-r--r-- | c++/tools/c_gen_iface.hpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/c++/tools/c_gen_iface.hpp b/c++/tools/c_gen_iface.hpp index 42f694f..469c5c0 100644 --- a/c++/tools/c_gen_iface.hpp +++ b/c++/tools/c_gen_iface.hpp @@ -57,7 +57,33 @@ struct c_types { namespace schema { using namespace saw::schema; +/** +Pseudo flattened +using Foo = Struct< + Member<Array<Int32>, "a"> + Member<Array<Float32>, "b"> +>; + +Needs to be flattened to + +template<typename InnerSchema> +using FlattenedSchemaElement = Struct< + Member<Array<String>, "path">, + Member<InnerSchema, "inner_schema"> +>; + +// Illegal, but doable with more lines of code +// Just use typename... T and +// "T..." for +// "Member<FlattenedSchemaElement<Ele>,Names>..." +// and specialize somewhere else +template<typename... Ele, string_literal... Names> +using FlattenedSchema = Struct< + Member<String, "top_schema"> + Member<FlattenedSchemaElement<Ele>, Names>... +>; + */ using StructBindingSchema = Struct< Member<String, "kind">, Member<String, "key">, |