diff options
author | Claudius "keldu" Holeksa <mail@keldu.de> | 2024-10-14 22:01:17 +0200 |
---|---|---|
committer | Claudius "keldu" Holeksa <mail@keldu.de> | 2024-10-14 22:01:17 +0200 |
commit | 00689114da12f6ecdabcf47f6fe94ee80b7c8d15 (patch) | |
tree | aeacdcaaec7965e5df624f7d378c0a366936d154 /modules/codec/c++ | |
parent | 7c2143a8c44808755bd3302e4bf17cb4b836a31e (diff) |
Get a list of types from Interfaces
Diffstat (limited to 'modules/codec/c++')
-rw-r--r-- | modules/codec/c++/schema.hpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/modules/codec/c++/schema.hpp b/modules/codec/c++/schema.hpp index 40dfe39..e5560fb 100644 --- a/modules/codec/c++/schema.hpp +++ b/modules/codec/c++/schema.hpp @@ -322,4 +322,31 @@ template <typename T, size_t N> struct is_primitive<schema::Primitive<T,N>> { template <typename TI, typename TS> struct is_primitive<schema::MixedPrecision<TI,TS>> { constexpr static bool value = true; }; + +template<typename Iface> +struct schema_iface_type_group { + static_assert(always_false<Iface>, "Expecting an Interface Type"); + + using Type = tmpl_group<>; +}; + +namespace impl { +template<typename... Funcs> +struct schema_func_list_helper { + using Type = tmpl_group<>; +}; + +template<typename F0, typename... Funcs> +struct schema_func_list_helper<F0,Funcs...> { + using Type = typename tmpl_concat< + tmpl_group<typename F0::Request, typename F0::Response>, + typename schema_func_list_helper<Funcs...>::Type + >::type; +}; +} + +template<typename... Funcs> +struct schema_iface_type_group<schema::Interface<Funcs...>> { + using Type = typename tmpl_reduce<typename impl::schema_func_list_helper<Funcs...>::Type>::type; +}; } // namespace saw |