1#ifndef CODEX_REFLECTION_SOA_DETAIL_HPP
2#define CODEX_REFLECTION_SOA_DETAIL_HPP
20template<
typename S, std::
size_t I,
typename T>
21class field_storage :
public S::for_field<I, T> {
23 static constexpr auto index = I;
26template<
typename S,
typename Is,
typename Ts>
struct storage_impl;
35template<
typename S, std::size_t ...Is,
typename ...Ts>
43 template<std::
size_t I>
50 template<std::
size_t I>
54 template<std::
size_t I>
56 template<std::
size_t I>
74 void for_each_i(std::size_t i,
auto &&
f);
75 void for_each_i(std::size_t i,
auto &&
f)
const;
78template<
typename S, std::size_t ...Is,
typename ...Ts>
80 S, std::index_sequence<Is...>, std::tuple<Ts...>
81>::for_each_i(std::size_t i,
auto &&
f) {
82 return this->for_each([i, &
f]<
typename V>(V &v) {
87template<
typename S, std::size_t ...Is,
typename ...Ts>
89 S, std::index_sequence<Is...>, std::tuple<Ts...>
90>::for_each_i(std::size_t i,
auto &&
f)
const {
91 return this->for_each([i, &
f]<
typename V>(V &v) {
101template<
typename T,
typename S>
103 S, std::make_index_sequence<refl::field_count<T>()>,
108 template<std::
size_t,
typename T>
using for_field = std::vector<T>;
#define f(x)
Definition 5.c:2
Ultimate class for the storage of each field.
Definition soa.hpp:21
static constexpr auto index
Definition soa.hpp:23
void for_each(auto &&f)
Applies f to each field storage.
Definition soa.hpp:65
auto field(void) -> field_storage_type< I > &
Storage for field with index I.
Definition soa.hpp:55
std::tuple_element_t< I, tuple_type > value_type
(Value/decayed) type of field with index I.
Definition soa.hpp:44
auto field(void) const -> const field_storage_type< I > &
Definition soa.hpp:57
void for_each(auto &&f) const
Definition soa.hpp:66
std::tuple< std::decay_t< Ts >... > tuple_type
Tuple with (value/decayed) types of each field.
Definition soa.hpp:41
std::integral_constant< std::size_t, I > index_constant
Alias for an integral_constant of size_t.
Definition utils.hpp:14
decltype(field_tuple(std::declval< T >())) field_tuple_t
Alias of the tuple type returned by field_tuple for type T.
Definition fields.hpp:42
#define CODEX_FWD(x)
Definition utils.hpp:8
Definition reflexpr.cpp:168
Default storage descriptor.
Definition soa.hpp:107
std::vector< T > for_field
Definition soa.hpp:108