OSSIA
Open Scenario System for Interactive Application
dataspace_list.hpp
1 #pragma once
2 #include <ossia/detail/string_view.hpp>
3 #include <ossia/network/dataspace/dataspace_base_defs_fwd.hpp>
4 
5 #include <boost/mp11/list.hpp>
6 
7 namespace ossia
8 {
9 
10 template <typename T>
11 struct matching_unit_u_list;
12 
13 using angle_u_list = boost::mp11::mp_list<degree_u, radian_u>;
14 
15 using color_u_list = boost::mp11::mp_list<
16  argb_u, rgba_u, rgb_u, bgr_u, argb8_u, rgba8_u, hsv_u, cmy8_u, xyz_u
17  /*, hsl_u, cmyk8_u, yxy_u, hunter_lab_u, cie_lab_u, cie_luv_u*/>;
18 
19 using distance_u_list = boost::mp11::mp_list<
20  meter_u, kilometer_u, decimeter_u, centimeter_u, millimeter_u, micrometer_u,
21  nanometer_u, picometer_u, inch_u, foot_u, mile_u>;
22 
23 using gain_u_list = boost::mp11::mp_list<linear_u, midigain_u, decibel_u, decibel_raw_u>;
24 
25 using orientation_u_list = boost::mp11::mp_list<quaternion_u, euler_u, axis_u>;
26 
27 using position_u_list = boost::mp11::mp_list<
28  cartesian_3d_u, cartesian_2d_u, spherical_u, polar_u, aed_u, ad_u, opengl_u,
29  cylindrical_u, azd_u>;
30 
31 using speed_u_list = boost::mp11::mp_list<
32  meter_per_second_u, miles_per_hour_u, kilometer_per_hour_u, knot_u,
33  foot_per_second_u, foot_per_hour_u>;
34 
35 using timing_u_list = boost::mp11::mp_list<
36  second_u, bark_u, bpm_u, cent_u, frequency_u, mel_u, midi_pitch_u, millisecond_u,
37  playback_speed_u>;
38 
39 using dataspace_variant_u_list = boost::mp11::mp_list<
40  distance_u, position_u, speed_u, orientation_u, angle_u, color_u, gain_u, timing_u>;
41 using dataspace_u_list = boost::mp11::mp_list<
42  distance_u_list, position_u_list, speed_u_list, orientation_u_list, angle_u_list,
43  color_u_list, gain_u_list, timing_u_list>;
44 
45 template <>
46 struct matching_unit_u_list<angle_u>
47 {
48  using type = angle_u_list;
49 };
50 template <>
51 struct matching_unit_u_list<color_u>
52 {
53  using type = color_u_list;
54 };
55 template <>
56 struct matching_unit_u_list<distance_u>
57 {
58  using type = distance_u_list;
59 };
60 template <>
61 struct matching_unit_u_list<position_u>
62 {
63  using type = position_u_list;
64 };
65 template <>
66 struct matching_unit_u_list<orientation_u>
67 {
68  using type = orientation_u_list;
69 };
70 template <>
71 struct matching_unit_u_list<gain_u>
72 {
73  using type = gain_u_list;
74 };
75 template <>
76 struct matching_unit_u_list<speed_u>
77 {
78  using type = speed_u_list;
79 };
80 template <>
81 struct matching_unit_u_list<timing_u>
82 {
83  using type = timing_u_list;
84 };
85 
86 template <>
87 struct matching_unit_u_list<angle_u_list>
88 {
89  using type = angle_u;
90 };
91 template <>
92 struct matching_unit_u_list<color_u_list>
93 {
94  using type = color_u;
95 };
96 template <>
97 struct matching_unit_u_list<distance_u_list>
98 {
99  using type = distance_u;
100 };
101 template <>
102 struct matching_unit_u_list<position_u_list>
103 {
104  using type = position_u;
105 };
106 template <>
107 struct matching_unit_u_list<orientation_u_list>
108 {
109  using type = orientation_u;
110 };
111 template <>
112 struct matching_unit_u_list<gain_u_list>
113 {
114  using type = gain_u;
115 };
116 template <>
117 struct matching_unit_u_list<speed_u_list>
118 {
119  using type = speed_u;
120 };
121 template <>
122 struct matching_unit_u_list<timing_u_list>
123 {
124  using type = timing_u;
125 };
126 
127 template <typename T>
128 struct matching_unit_list;
129 
130 using angle_list = boost::mp11::mp_list<degree, radian>;
131 
132 using color_list = boost::mp11::mp_list<
133  argb, rgba, rgb, bgr, argb8, rgba8, hsv, cmy8, xyz
134  /*, hsl, cmyk8, yxy, hunter_lab, cie_lab, cie_luv_u*/>;
135 
136 using distance_list = boost::mp11::mp_list<
137  meter, kilometer, decimeter, centimeter, millimeter, micrometer, nanometer,
138  picometer, inch, foot, mile>;
139 
140 using gain_list = boost::mp11::mp_list<linear, midigain, decibel, decibel_raw>;
141 
142 using orientation_list = boost::mp11::mp_list<quaternion, euler, axis>;
143 
144 using position_list = boost::mp11::mp_list<
145  cartesian_3d, cartesian_2d, spherical, polar, aed, ad, opengl, cylindrical, azd>;
146 
147 using speed_list = boost::mp11::mp_list<
148  meter_per_second, miles_per_hour, kilometer_per_hour, knot, foot_per_second,
149  foot_per_hour>;
150 
151 using time_list = boost::mp11::mp_list<
152  second, bark, bpm, cent, frequency, mel, midi_pitch, millisecond, playback_speed>;
153 
154 using dataspace_list = boost::mp11::mp_list<
155  distance_list, position_list, speed_list, orientation_list, angle_list, color_list,
156  gain_list, time_list>;
157 
158 using strong_value_variant_list = boost::mp11::mp_list<
159  ossia::value, distance, position, speed, orientation, angle, color, gain,
160  ossia::timing>;
161 
162 template <>
163 struct matching_unit_list<angle>
164 {
165  using type = angle_list;
166 };
167 template <>
168 struct matching_unit_list<color>
169 {
170  using type = color_list;
171 };
172 template <>
173 struct matching_unit_list<distance>
174 {
175  using type = distance_list;
176 };
177 template <>
178 struct matching_unit_list<position>
179 {
180  using type = position_list;
181 };
182 template <>
183 struct matching_unit_list<orientation>
184 {
185  using type = orientation_list;
186 };
187 template <>
188 struct matching_unit_list<gain>
189 {
190  using type = gain_list;
191 };
192 template <>
193 struct matching_unit_list<speed>
194 {
195  using type = speed_list;
196 };
197 template <>
198 struct matching_unit_list<timing>
199 {
200  using type = time_list;
201 };
202 
203 template <>
204 struct matching_unit_list<angle_list>
205 {
206  using type = angle;
207 };
208 template <>
209 struct matching_unit_list<color_list>
210 {
211  using type = color;
212 };
213 template <>
214 struct matching_unit_list<distance_list>
215 {
216  using type = distance;
217 };
218 template <>
219 struct matching_unit_list<position_list>
220 {
221  using type = position;
222 };
223 template <>
224 struct matching_unit_list<orientation_list>
225 {
226  using type = orientation;
227 };
228 template <>
229 struct matching_unit_list<gain_list>
230 {
231  using type = gain;
232 };
233 template <>
234 struct matching_unit_list<speed_list>
235 {
236  using type = speed;
237 };
238 template <>
239 struct matching_unit_list<time_list>
240 {
241  using type = timing;
242 };
243 
244 template <>
245 struct dataspace_traits<angle_u_list>
246 {
247  using neutral_unit = radian_u;
248  static constexpr auto text() { constexpr_return(ossia::make_string_array("angle")); }
249 };
250 
251 template <>
252 struct dataspace_traits<color_u_list>
253 {
254  using neutral_unit = argb_u;
255  static constexpr auto text() { constexpr_return(ossia::make_string_array("color")); }
256 };
257 
258 template <>
259 struct dataspace_traits<distance_u_list>
260 {
261  using neutral_unit = meter_u;
262  static constexpr auto text()
263  {
264  constexpr_return(ossia::make_string_array("distance"));
265  }
266 };
267 
268 template <>
269 struct dataspace_traits<gain_u_list>
270 {
271  using neutral_unit = linear_u;
272  static constexpr auto text() { constexpr_return(ossia::make_string_array("gain")); }
273 };
274 
275 template <>
276 struct dataspace_traits<orientation_u_list>
277 {
278  using neutral_unit = quaternion_u;
279  static constexpr auto text()
280  {
281  constexpr_return(ossia::make_string_array("orientation"));
282  }
283 };
284 template <>
285 struct dataspace_traits<position_u_list>
286 {
287  using neutral_unit = cartesian_3d_u;
288  static constexpr auto text()
289  {
290  constexpr_return(ossia::make_string_array("position"));
291  }
292 };
293 
294 template <>
295 struct dataspace_traits<speed_u_list>
296 {
297  using neutral_unit = meter_per_second_u;
298  static constexpr auto text() { constexpr_return(ossia::make_string_array("speed")); }
299 };
300 
301 template <>
302 struct dataspace_traits<timing_u_list>
303 {
304  using neutral_unit = second_u;
305  static constexpr auto text() { constexpr_return(ossia::make_string_array("time")); }
306 };
307 }
The value class.
Definition: value.hpp:173
Definition: git_info.h:7