Flecs: include/flecs/addons/cpp/entity_component_tuple.hpp Source File
Description: A fast entity component system (ECS) for C & C++

| Flecs v4.1 A fast entity component system (ECS) for C & C++

Loading...
Searching...
No Matches
entity_component_tuple.hpp
Go to the documentation of this file.
1
5
6#pragma once
7
12
13namespace flecs
14{
15
21 template<std::size_t size, typename... Args>
22 struct tuple_builder {};
23
25 template<typename T, typename U>
26 struct tuple_2 {
27 T val1;
28 U val2;
29 };
30
32 template<typename... Args>
33 struct tuple_builder<2, Args...> {
34 using type = tuple_2<Args&...>;
35 using type_ptr = tuple_2<Args*...>;
36 using type_const = tuple_2<const Args&...>;
37 using type_const_ptr = tuple_2<const Args*...>;
38 };
39
41 template<typename T, typename U, typename V>
42 struct tuple_3 {
43 T val1;
44 U val2;
45 V val3;
46 };
47
49 template<typename... Args>
50 struct tuple_builder<3, Args...> {
51 using type = tuple_3<Args&...>;
52 using type_ptr = tuple_3<Args*...>;
53 using type_const = tuple_3<const Args&...>;
54 using type_const_ptr = tuple_3<const Args*...>;
55 };
56
58 template<typename T, typename U, typename V, typename W>
59 struct tuple_4 {
60 T val1;
61 U val2;
62 V val3;
63 W val4;
64 };
65
67 template<typename... Args>
68 struct tuple_builder<4, Args...> {
69 using type = tuple_4<Args&...>;
70 using type_ptr = tuple_4<Args*...>;
71 using type_const = tuple_4<const Args&...>;
72 using type_const_ptr = tuple_4<const Args*...>;
73 };
74
76 template<typename T, typename U, typename V, typename W, typename X>
77 struct tuple_5 {
78 T val1;
79 U val2;
80 V val3;
81 W val4;
82 X val5;
83 };
84
86 template<typename... Args>
87 struct tuple_builder<5, Args...> {
88 using type = tuple_5<Args&...>;
89 using type_ptr = tuple_5<Args*...>;
90 using type_const = tuple_5<const Args&...>;
91 using type_const_ptr = tuple_5<const Args*...>;
92 };
93
95 template<typename T, typename U, typename V, typename W, typename X, typename Y>
96 struct tuple_6 {
97 T val1;
98 U val2;
99 V val3;
100 W val4;
101 X val5;
102 Y val6;
103 };
104
106 template<typename... Args>
107 struct tuple_builder<6, Args...> {
108 using type = tuple_6<Args&...>;
109 using type_ptr = tuple_6<Args*...>;
110 using type_const = tuple_6<const Args&...>;
111 using type_const_ptr = tuple_6<const Args*...>;
112 };
113
115 template<typename T, typename U, typename V, typename W, typename X, typename Y, typename Z>
116 struct tuple_7 {
117 T val1;
118 U val2;
119 V val3;
120 W val4;
121 X val5;
122 Y val6;
123 Z val7;
124 };
125
127 template<typename... Args>
128 struct tuple_builder<7, Args...> {
129 using type = tuple_7<Args&...>;
130 using type_ptr = tuple_7<Args*...>;
131 using type_const = tuple_7<const Args&...>;
132 using type_const_ptr = tuple_7<const Args*...>;
133 };
134
136 template<typename T, typename U, typename V, typename W, typename X, typename Y, typename Z, typename A>
137 struct tuple_8 {
138 T val1;
139 U val2;
140 V val3;
141 W val4;
142 X val5;
143 Y val6;
144 Z val7;
145 A val8;
146 };
147
149 template<typename... Args>
150 struct tuple_builder<8, Args...> {
151 using type = tuple_8<Args&...>;
152 using type_ptr = tuple_8<Args*...>;
153 using type_const = tuple_8<const Args&...>;
154 using type_const_ptr = tuple_8<const Args*...>;
155 };
156
157}
158
flecs::tuple_2
Tuple of 2 elements.
Definition entity_component_tuple.hpp:26
flecs::tuple_2< Args &... >::val2
U val2
Definition entity_component_tuple.hpp:28
flecs::tuple_2< Args &... >::val1
Args &... val1
Definition entity_component_tuple.hpp:27
flecs::tuple_3
Tuple of 3 elements.
Definition entity_component_tuple.hpp:42
flecs::tuple_3< Args &... >::val1
Args &... val1
Definition entity_component_tuple.hpp:43
flecs::tuple_3< Args &... >::val3
V val3
Definition entity_component_tuple.hpp:45
flecs::tuple_3< Args &... >::val2
U val2
Definition entity_component_tuple.hpp:44
flecs::tuple_4
Tuple of 4 elements.
Definition entity_component_tuple.hpp:59
flecs::tuple_4< Args &... >::val4
W val4
Definition entity_component_tuple.hpp:63
flecs::tuple_4< Args &... >::val3
V val3
Definition entity_component_tuple.hpp:62
flecs::tuple_4< Args &... >::val1
Args &... val1
Definition entity_component_tuple.hpp:60
flecs::tuple_4< Args &... >::val2
U val2
Definition entity_component_tuple.hpp:61
flecs::tuple_5
Tuple of 5 elements.
Definition entity_component_tuple.hpp:77
flecs::tuple_5< Args &... >::val2
U val2
Definition entity_component_tuple.hpp:79
flecs::tuple_5< Args &... >::val1
Args &... val1
Definition entity_component_tuple.hpp:78
flecs::tuple_5< Args &... >::val4
W val4
Definition entity_component_tuple.hpp:81
flecs::tuple_5< Args &... >::val3
V val3
Definition entity_component_tuple.hpp:80
flecs::tuple_5< Args &... >::val5
X val5
Definition entity_component_tuple.hpp:82
flecs::tuple_6
Tuple of 6 elements.
Definition entity_component_tuple.hpp:96
flecs::tuple_6< Args &... >::val5
X val5
Definition entity_component_tuple.hpp:101
flecs::tuple_6< Args &... >::val3
V val3
Definition entity_component_tuple.hpp:99
flecs::tuple_6< Args &... >::val4
W val4
Definition entity_component_tuple.hpp:100
flecs::tuple_6< Args &... >::val1
Args &... val1
Definition entity_component_tuple.hpp:97
flecs::tuple_6< Args &... >::val6
Y val6
Definition entity_component_tuple.hpp:102
flecs::tuple_6< Args &... >::val2
U val2
Definition entity_component_tuple.hpp:98
flecs::tuple_7
Tuple of 7 elements.
Definition entity_component_tuple.hpp:116
flecs::tuple_7< Args &... >::val3
V val3
Definition entity_component_tuple.hpp:119
flecs::tuple_7< Args &... >::val2
U val2
Definition entity_component_tuple.hpp:118
flecs::tuple_7< Args &... >::val7
Z val7
Definition entity_component_tuple.hpp:123
flecs::tuple_7< Args &... >::val5
X val5
Definition entity_component_tuple.hpp:121
flecs::tuple_7< Args &... >::val4
W val4
Definition entity_component_tuple.hpp:120
flecs::tuple_7< Args &... >::val6
Y val6
Definition entity_component_tuple.hpp:122
flecs::tuple_7< Args &... >::val1
Args &... val1
Definition entity_component_tuple.hpp:117
flecs::tuple_8
Tuple of 8 elements.
Definition entity_component_tuple.hpp:137
flecs::tuple_8< Args &... >::val4
W val4
Definition entity_component_tuple.hpp:141
flecs::tuple_8< Args &... >::val6
Y val6
Definition entity_component_tuple.hpp:143
flecs::tuple_8< Args &... >::val5
X val5
Definition entity_component_tuple.hpp:142
flecs::tuple_8< Args &... >::val8
A val8
Definition entity_component_tuple.hpp:145
flecs::tuple_8< Args &... >::val7
Z val7
Definition entity_component_tuple.hpp:144
flecs::tuple_8< Args &... >::val1
Args &... val1
Definition entity_component_tuple.hpp:138
flecs::tuple_8< Args &... >::val3
V val3
Definition entity_component_tuple.hpp:140
flecs::tuple_8< Args &... >::val2
U val2
Definition entity_component_tuple.hpp:139
flecs::tuple_builder< 2, Args... >::type_ptr
tuple_2< Args *... > type_ptr
Pointer tuple type.
Definition entity_component_tuple.hpp:35
flecs::tuple_builder< 2, Args... >::type
tuple_2< Args &... > type
Reference tuple type.
Definition entity_component_tuple.hpp:34
flecs::tuple_builder< 2, Args... >::type_const_ptr
tuple_2< const Args *... > type_const_ptr
Const pointer tuple type.
Definition entity_component_tuple.hpp:37
flecs::tuple_builder< 2, Args... >::type_const
tuple_2< const Args &... > type_const
Const reference tuple type.
Definition entity_component_tuple.hpp:36
flecs::tuple_builder< 3, Args... >::type
tuple_3< Args &... > type
Reference tuple type.
Definition entity_component_tuple.hpp:51
flecs::tuple_builder< 3, Args... >::type_ptr
tuple_3< Args *... > type_ptr
Pointer tuple type.
Definition entity_component_tuple.hpp:52
flecs::tuple_builder< 3, Args... >::type_const_ptr
tuple_3< const Args *... > type_const_ptr
Const pointer tuple type.
Definition entity_component_tuple.hpp:54
flecs::tuple_builder< 3, Args... >::type_const
tuple_3< const Args &... > type_const
Const reference tuple type.
Definition entity_component_tuple.hpp:53
flecs::tuple_builder< 4, Args... >::type_const
tuple_4< const Args &... > type_const
Const reference tuple type.
Definition entity_component_tuple.hpp:71
flecs::tuple_builder< 4, Args... >::type_ptr
tuple_4< Args *... > type_ptr
Pointer tuple type.
Definition entity_component_tuple.hpp:70
flecs::tuple_builder< 4, Args... >::type
tuple_4< Args &... > type
Reference tuple type.
Definition entity_component_tuple.hpp:69
flecs::tuple_builder< 4, Args... >::type_const_ptr
tuple_4< const Args *... > type_const_ptr
Const pointer tuple type.
Definition entity_component_tuple.hpp:72
flecs::tuple_builder< 5, Args... >::type_const
tuple_5< const Args &... > type_const
Const reference tuple type.
Definition entity_component_tuple.hpp:90
flecs::tuple_builder< 5, Args... >::type
tuple_5< Args &... > type
Reference tuple type.
Definition entity_component_tuple.hpp:88
flecs::tuple_builder< 5, Args... >::type_const_ptr
tuple_5< const Args *... > type_const_ptr
Const pointer tuple type.
Definition entity_component_tuple.hpp:91
flecs::tuple_builder< 5, Args... >::type_ptr
tuple_5< Args *... > type_ptr
Pointer tuple type.
Definition entity_component_tuple.hpp:89
flecs::tuple_builder< 6, Args... >::type
tuple_6< Args &... > type
Reference tuple type.
Definition entity_component_tuple.hpp:108
flecs::tuple_builder< 6, Args... >::type_ptr
tuple_6< Args *... > type_ptr
Pointer tuple type.
Definition entity_component_tuple.hpp:109
flecs::tuple_builder< 6, Args... >::type_const
tuple_6< const Args &... > type_const
Const reference tuple type.
Definition entity_component_tuple.hpp:110
flecs::tuple_builder< 6, Args... >::type_const_ptr
tuple_6< const Args *... > type_const_ptr
Const pointer tuple type.
Definition entity_component_tuple.hpp:111
flecs::tuple_builder< 7, Args... >::type_const
tuple_7< const Args &... > type_const
Const reference tuple type.
Definition entity_component_tuple.hpp:131
flecs::tuple_builder< 7, Args... >::type_ptr
tuple_7< Args *... > type_ptr
Pointer tuple type.
Definition entity_component_tuple.hpp:130
flecs::tuple_builder< 7, Args... >::type
tuple_7< Args &... > type
Reference tuple type.
Definition entity_component_tuple.hpp:129
flecs::tuple_builder< 7, Args... >::type_const_ptr
tuple_7< const Args *... > type_const_ptr
Const pointer tuple type.
Definition entity_component_tuple.hpp:132
flecs::tuple_builder< 8, Args... >::type
tuple_8< Args &... > type
Reference tuple type.
Definition entity_component_tuple.hpp:151
flecs::tuple_builder< 8, Args... >::type_const_ptr
tuple_8< const Args *... > type_const_ptr
Const pointer tuple type.
Definition entity_component_tuple.hpp:154
flecs::tuple_builder< 8, Args... >::type_ptr
tuple_8< Args *... > type_ptr
Pointer tuple type.
Definition entity_component_tuple.hpp:152
flecs::tuple_builder< 8, Args... >::type_const
tuple_8< const Args &... > type_const
Const reference tuple type.
Definition entity_component_tuple.hpp:153
flecs::tuple_builder
Builds tuple types for a given number of component types.
Definition entity_component_tuple.hpp:22