2 #include "fisch/vx/traits.h"
3 #include "fisch/vx/word_access_type.h"
5 #include "hate/type_list.h"
6 #include "hate/visibility.h"
8 #include <boost/utility/enable_if.hpp>
9 #include <boost/variant.hpp>
24 #define PLAYBACK_CONTAINER(Name, Type) Name,
25 #define LAST_PLAYBACK_CONTAINER(Name, Type) Name
26 #include "fisch/vx/container.def"
29 typedef hate::type_list<
30 #define PLAYBACK_CONTAINER(Name, Type) fisch::vx::word_access_type::Name,
31 #define LAST_PLAYBACK_CONTAINER(Name, Type) fisch::vx::word_access_type::Name
32 #include "fisch/vx/container.def"
38 template <
typename BackendContainer>
42 hate::index_type_list_by_type<BackendContainer, BackendContainerList>::value);
53 template <
typename T,
size_t N>
54 constexpr
bool is_in_array(std::array<T, N>
const& arr, T
const& test)
74 typename DefaultBackendContainer,
75 typename... AdditionalBackendContainer>
78 typedef hate::type_list<DefaultBackendContainer, AdditionalBackendContainer...>
container_list;
81 constexpr
static Backend default_backend =
84 constexpr
static std::array<
Backend,
sizeof...(AdditionalBackendContainer) + 1> valid_backends{
88 template <
typename TL>
91 template <
typename... Ts>
96 template <
size_t I,
size_t... Is>
99 if constexpr (hate::is_in_type_list<
100 typename hate::index_type_list_by_integer<
103 table[I] =
static_cast<Backend>(
104 hate::index_type_list_by_type<
105 typename hate::index_type_list_by_integer<I, BackendContainerList>::type,
108 table[I] =
static_cast<Backend>(0);
110 if constexpr (
sizeof...(Is) != 0) {
111 return gen(table, std::index_sequence<Is...>());
117 constexpr
static auto backend_index_lookup_table =
118 gen(
table_type(), std::make_index_sequence<
sizeof...(Ts)>());
121 constexpr
static auto backend_index_lookup_table =
127 template <
typename ContainerT>
134 template <
typename T,
typename =
void>
138 template <
typename T>
139 struct HasLocalData<T, typename boost::enable_if_has_type<typename T::has_local_data>::type>
140 :
public T::has_local_data
143 template <
typename T>
144 struct HasLocalData<T, typename boost::enable_if_has_type<typename T::is_leaf_node>::type>
145 :
public T::is_leaf_node
Trait signalling derived-from container type support differential write operation.
#define GENPYBIND_TAG_HALDLS_VX
constexpr bool is_in_array(std::array< T, N > const &arr, T const &test)
Backend
Possible backends to target with PlaybackProgramBuilder::read/write.
hate::type_list<#define PLAYBACK_CONTAINER(Name, Type) #define LAST_PLAYBACK_CONTAINER(Name, Type) > BackendContainerList
std::array< Backend, sizeof...(Ts)> table_type
constexpr static table_type gen(table_type table, std::index_sequence< I, Is... >)
Backend container trait base.
hate::type_list< DefaultBackendContainer, AdditionalBackendContainer... > container_list
DefaultBackendContainer default_container
constexpr static bool valid(Backend backend)
hate::index_type_list_by_integer< static_cast< size_t >B), BackendContainerList >::type container_type