OSSIA
Open Scenario System for Interactive Application
domain_variant_impl.hpp
1 struct domain_base_variant
2 {
3 public:
4  struct dummy_t
5  {
6  };
7  union Impl
8  {
9  ossia::domain_base<ossia::impulse> m_value0;
10 
11  ossia::domain_base<bool> m_value1;
12 
13  ossia::domain_base<int32_t> m_value2;
14 
15  ossia::domain_base<float> m_value3;
16 
17  ossia::domain_base<std::string> m_value5;
18 
19  ossia::vector_domain m_value6;
20 
21  ossia::vecf_domain<2> m_value7;
22 
23  ossia::vecf_domain<3> m_value8;
24 
25  ossia::vecf_domain<4> m_value9;
26 
27  ossia::domain_base<ossia::value> m_value10;
28 
29  dummy_t m_dummy;
30  Impl()
31  : m_dummy{}
32  {
33  }
34  ~Impl() { }
35  };
36 
37  enum Type : int8_t
38  {
39  Type0,
40  Type1,
41  Type2,
42  Type3,
43  Type4,
44  Type5,
45  Type6,
46  Type7,
47  Type8,
48  Type9,
49  Type10,
50  Npos
51  };
52 
53  void destruct_impl()
54  {
55  switch(m_type)
56  {
57  case Type::Type0:
58  m_impl.m_value0.~domain_base();
59  break;
60  case Type::Type1:
61  m_impl.m_value1.~domain_base();
62  break;
63  case Type::Type2:
64  m_impl.m_value2.~domain_base();
65  break;
66  case Type::Type3:
67  m_impl.m_value3.~domain_base();
68  break;
69  case Type::Type5:
70  m_impl.m_value5.~domain_base();
71  break;
72  case Type::Type6:
73  m_impl.m_value6.~vector_domain();
74  break;
75  case Type::Type7:
76  m_impl.m_value7.~vecf_domain();
77  break;
78  case Type::Type8:
79  m_impl.m_value8.~vecf_domain();
80  break;
81  case Type::Type9:
82  m_impl.m_value9.~vecf_domain();
83  break;
84  case Type::Type10:
85  m_impl.m_value10.~domain_base();
86  break;
87  default:
88  break;
89  }
90  }
91  Impl m_impl;
92  Type m_type;
93 
94 public:
95  static const constexpr auto npos = Npos;
96  int which() const { return m_type; }
97 
98  operator bool() const { return m_type != npos; }
99  template <typename T>
100  const T* target() const;
101  template <typename T>
102  T* target();
103  template <typename T>
104  const T& get() const;
105  template <typename T>
106  T& get();
107 
108  template <typename T>
109  static Type matching_type();
110  domain_base_variant()
111  : m_type{Npos}
112  {
113  }
114  ~domain_base_variant() { destruct_impl(); }
115  domain_base_variant(const ossia::domain_base<ossia::impulse>& v)
116  : m_type{Type0}
117  {
118  new(&m_impl.m_value0) ossia::domain_base<ossia::impulse>{v};
119  }
120  domain_base_variant(ossia::domain_base<ossia::impulse>&& v)
121  : m_type{Type0}
122  {
123  new(&m_impl.m_value0) ossia::domain_base<ossia::impulse>{std::move(v)};
124  }
125  domain_base_variant(const ossia::domain_base<bool>& v)
126  : m_type{Type1}
127  {
128  new(&m_impl.m_value1) ossia::domain_base<bool>{v};
129  }
130  domain_base_variant(ossia::domain_base<bool>&& v)
131  : m_type{Type1}
132  {
133  new(&m_impl.m_value1) ossia::domain_base<bool>{std::move(v)};
134  }
135  domain_base_variant(const ossia::domain_base<int32_t>& v)
136  : m_type{Type2}
137  {
138  new(&m_impl.m_value2) ossia::domain_base<int32_t>{v};
139  }
140  domain_base_variant(ossia::domain_base<int32_t>&& v)
141  : m_type{Type2}
142  {
143  new(&m_impl.m_value2) ossia::domain_base<int32_t>{std::move(v)};
144  }
145  domain_base_variant(const ossia::domain_base<float>& v)
146  : m_type{Type3}
147  {
148  new(&m_impl.m_value3) ossia::domain_base<float>{v};
149  }
150  domain_base_variant(ossia::domain_base<float>&& v)
151  : m_type{Type3}
152  {
153  new(&m_impl.m_value3) ossia::domain_base<float>{std::move(v)};
154  }
155  domain_base_variant(const ossia::domain_base<std::string>& v)
156  : m_type{Type5}
157  {
158  new(&m_impl.m_value5) ossia::domain_base<std::string>{v};
159  }
160  domain_base_variant(ossia::domain_base<std::string>&& v)
161  : m_type{Type5}
162  {
163  new(&m_impl.m_value5) ossia::domain_base<std::string>{std::move(v)};
164  }
165  domain_base_variant(const ossia::vector_domain& v)
166  : m_type{Type6}
167  {
168  new(&m_impl.m_value6) ossia::vector_domain{v};
169  }
170  domain_base_variant(ossia::vector_domain&& v)
171  : m_type{Type6}
172  {
173  new(&m_impl.m_value6) ossia::vector_domain{std::move(v)};
174  }
175  domain_base_variant(const ossia::vecf_domain<2>& v)
176  : m_type{Type7}
177  {
178  new(&m_impl.m_value7) ossia::vecf_domain<2>{v};
179  }
180  domain_base_variant(ossia::vecf_domain<2>&& v)
181  : m_type{Type7}
182  {
183  new(&m_impl.m_value7) ossia::vecf_domain<2>{std::move(v)};
184  }
185  domain_base_variant(const ossia::vecf_domain<3>& v)
186  : m_type{Type8}
187  {
188  new(&m_impl.m_value8) ossia::vecf_domain<3>{v};
189  }
190  domain_base_variant(ossia::vecf_domain<3>&& v)
191  : m_type{Type8}
192  {
193  new(&m_impl.m_value8) ossia::vecf_domain<3>{std::move(v)};
194  }
195  domain_base_variant(const ossia::vecf_domain<4>& v)
196  : m_type{Type9}
197  {
198  new(&m_impl.m_value9) ossia::vecf_domain<4>{v};
199  }
200  domain_base_variant(ossia::vecf_domain<4>&& v)
201  : m_type{Type9}
202  {
203  new(&m_impl.m_value9) ossia::vecf_domain<4>{std::move(v)};
204  }
205  domain_base_variant(const ossia::domain_base<ossia::value>& v)
206  : m_type{Type10}
207  {
208  new(&m_impl.m_value10) ossia::domain_base<ossia::value>{v};
209  }
210  domain_base_variant(ossia::domain_base<ossia::value>&& v)
211  : m_type{Type10}
212  {
213  new(&m_impl.m_value10) ossia::domain_base<ossia::value>{std::move(v)};
214  }
215  domain_base_variant(const domain_base_variant& other)
216  : m_type{other.m_type}
217  {
218  switch(m_type)
219  {
220  case Type::Type0:
221  new(&m_impl.m_value0) ossia::domain_base<ossia::impulse>{other.m_impl.m_value0};
222  break;
223  case Type::Type1:
224  new(&m_impl.m_value1) ossia::domain_base<bool>{other.m_impl.m_value1};
225  break;
226  case Type::Type2:
227  new(&m_impl.m_value2) ossia::domain_base<int32_t>{other.m_impl.m_value2};
228  break;
229  case Type::Type3:
230  new(&m_impl.m_value3) ossia::domain_base<float>{other.m_impl.m_value3};
231  break;
232  case Type::Type5:
233  new(&m_impl.m_value5) ossia::domain_base<std::string>{other.m_impl.m_value5};
234  break;
235  case Type::Type6:
236  new(&m_impl.m_value6) ossia::vector_domain{other.m_impl.m_value6};
237  break;
238  case Type::Type7:
239  new(&m_impl.m_value7) ossia::vecf_domain<2>{other.m_impl.m_value7};
240  break;
241  case Type::Type8:
242  new(&m_impl.m_value8) ossia::vecf_domain<3>{other.m_impl.m_value8};
243  break;
244  case Type::Type9:
245  new(&m_impl.m_value9) ossia::vecf_domain<4>{other.m_impl.m_value9};
246  break;
247  case Type::Type10:
248  new(&m_impl.m_value10) ossia::domain_base<ossia::value>{other.m_impl.m_value10};
249  break;
250  default:
251  break;
252  }
253  }
254  domain_base_variant(domain_base_variant&& other)
255  : m_type{other.m_type}
256  {
257  switch(m_type)
258  {
259  case Type::Type0:
260  new(&m_impl.m_value0)
261  ossia::domain_base<ossia::impulse>{std::move(other.m_impl.m_value0)};
262  break;
263  case Type::Type1:
264  new(&m_impl.m_value1) ossia::domain_base<bool>{std::move(other.m_impl.m_value1)};
265  break;
266  case Type::Type2:
267  new(&m_impl.m_value2)
268  ossia::domain_base<int32_t>{std::move(other.m_impl.m_value2)};
269  break;
270  case Type::Type3:
271  new(&m_impl.m_value3)
272  ossia::domain_base<float>{std::move(other.m_impl.m_value3)};
273  break;
274  case Type::Type5:
275  new(&m_impl.m_value5)
276  ossia::domain_base<std::string>{std::move(other.m_impl.m_value5)};
277  break;
278  case Type::Type6:
279  new(&m_impl.m_value6) ossia::vector_domain{std::move(other.m_impl.m_value6)};
280  break;
281  case Type::Type7:
282  new(&m_impl.m_value7) ossia::vecf_domain<2>{std::move(other.m_impl.m_value7)};
283  break;
284  case Type::Type8:
285  new(&m_impl.m_value8) ossia::vecf_domain<3>{std::move(other.m_impl.m_value8)};
286  break;
287  case Type::Type9:
288  new(&m_impl.m_value9) ossia::vecf_domain<4>{std::move(other.m_impl.m_value9)};
289  break;
290  case Type::Type10:
291  new(&m_impl.m_value10)
292  ossia::domain_base<ossia::value>{std::move(other.m_impl.m_value10)};
293  break;
294  default:
295  break;
296  }
297  }
298  domain_base_variant& operator=(const domain_base_variant& other)
299  {
300  destruct_impl();
301  m_type = other.m_type;
302  switch(m_type)
303  {
304  case Type::Type0:
305  new(&m_impl.m_value0) ossia::domain_base<ossia::impulse>{other.m_impl.m_value0};
306  break;
307  case Type::Type1:
308  new(&m_impl.m_value1) ossia::domain_base<bool>{other.m_impl.m_value1};
309  break;
310  case Type::Type2:
311  new(&m_impl.m_value2) ossia::domain_base<int32_t>{other.m_impl.m_value2};
312  break;
313  case Type::Type3:
314  new(&m_impl.m_value3) ossia::domain_base<float>{other.m_impl.m_value3};
315  break;
316  case Type::Type5:
317  new(&m_impl.m_value5) ossia::domain_base<std::string>{other.m_impl.m_value5};
318  break;
319  case Type::Type6:
320  new(&m_impl.m_value6) ossia::vector_domain{other.m_impl.m_value6};
321  break;
322  case Type::Type7:
323  new(&m_impl.m_value7) ossia::vecf_domain<2>{other.m_impl.m_value7};
324  break;
325  case Type::Type8:
326  new(&m_impl.m_value8) ossia::vecf_domain<3>{other.m_impl.m_value8};
327  break;
328  case Type::Type9:
329  new(&m_impl.m_value9) ossia::vecf_domain<4>{other.m_impl.m_value9};
330  break;
331  case Type::Type10:
332  new(&m_impl.m_value10) ossia::domain_base<ossia::value>{other.m_impl.m_value10};
333  break;
334  default:
335  break;
336  }
337  return *this;
338  }
339  domain_base_variant& operator=(domain_base_variant&& other)
340  {
341  destruct_impl();
342  m_type = other.m_type;
343  switch(m_type)
344  {
345  case Type::Type0:
346  new(&m_impl.m_value0)
347  ossia::domain_base<ossia::impulse>{std::move(other.m_impl.m_value0)};
348  break;
349  case Type::Type1:
350  new(&m_impl.m_value1) ossia::domain_base<bool>{std::move(other.m_impl.m_value1)};
351  break;
352  case Type::Type2:
353  new(&m_impl.m_value2)
354  ossia::domain_base<int32_t>{std::move(other.m_impl.m_value2)};
355  break;
356  case Type::Type3:
357  new(&m_impl.m_value3)
358  ossia::domain_base<float>{std::move(other.m_impl.m_value3)};
359  break;
360  case Type::Type5:
361  new(&m_impl.m_value5)
362  ossia::domain_base<std::string>{std::move(other.m_impl.m_value5)};
363  break;
364  case Type::Type6:
365  new(&m_impl.m_value6) ossia::vector_domain{std::move(other.m_impl.m_value6)};
366  break;
367  case Type::Type7:
368  new(&m_impl.m_value7) ossia::vecf_domain<2>{std::move(other.m_impl.m_value7)};
369  break;
370  case Type::Type8:
371  new(&m_impl.m_value8) ossia::vecf_domain<3>{std::move(other.m_impl.m_value8)};
372  break;
373  case Type::Type9:
374  new(&m_impl.m_value9) ossia::vecf_domain<4>{std::move(other.m_impl.m_value9)};
375  break;
376  case Type::Type10:
377  new(&m_impl.m_value10)
378  ossia::domain_base<ossia::value>{std::move(other.m_impl.m_value10)};
379  break;
380  default:
381  break;
382  }
383  return *this;
384  }
385 };
386 template <>
387 inline const ossia::domain_base<ossia::impulse>* domain_base_variant::target() const
388 {
389  if(m_type == Type0)
390  return &m_impl.m_value0;
391  return nullptr;
392 }
393 template <>
394 inline const ossia::domain_base<bool>* domain_base_variant::target() const
395 {
396  if(m_type == Type1)
397  return &m_impl.m_value1;
398  return nullptr;
399 }
400 template <>
401 inline const ossia::domain_base<int32_t>* domain_base_variant::target() const
402 {
403  if(m_type == Type2)
404  return &m_impl.m_value2;
405  return nullptr;
406 }
407 template <>
408 inline const ossia::domain_base<float>* domain_base_variant::target() const
409 {
410  if(m_type == Type3)
411  return &m_impl.m_value3;
412  return nullptr;
413 }
414 template <>
415 inline const ossia::domain_base<std::string>* domain_base_variant::target() const
416 {
417  if(m_type == Type5)
418  return &m_impl.m_value5;
419  return nullptr;
420 }
421 template <>
422 inline const ossia::vector_domain* domain_base_variant::target() const
423 {
424  if(m_type == Type6)
425  return &m_impl.m_value6;
426  return nullptr;
427 }
428 template <>
429 inline const ossia::vecf_domain<2>* domain_base_variant::target() const
430 {
431  if(m_type == Type7)
432  return &m_impl.m_value7;
433  return nullptr;
434 }
435 template <>
436 inline const ossia::vecf_domain<3>* domain_base_variant::target() const
437 {
438  if(m_type == Type8)
439  return &m_impl.m_value8;
440  return nullptr;
441 }
442 template <>
443 inline const ossia::vecf_domain<4>* domain_base_variant::target() const
444 {
445  if(m_type == Type9)
446  return &m_impl.m_value9;
447  return nullptr;
448 }
449 template <>
450 inline const ossia::domain_base<ossia::value>* domain_base_variant::target() const
451 {
452  if(m_type == Type10)
453  return &m_impl.m_value10;
454  return nullptr;
455 }
456 template <>
457 inline ossia::domain_base<ossia::impulse>* domain_base_variant::target()
458 {
459  if(m_type == Type0)
460  return &m_impl.m_value0;
461  return nullptr;
462 }
463 template <>
464 inline ossia::domain_base<bool>* domain_base_variant::target()
465 {
466  if(m_type == Type1)
467  return &m_impl.m_value1;
468  return nullptr;
469 }
470 template <>
471 inline ossia::domain_base<int32_t>* domain_base_variant::target()
472 {
473  if(m_type == Type2)
474  return &m_impl.m_value2;
475  return nullptr;
476 }
477 template <>
478 inline ossia::domain_base<float>* domain_base_variant::target()
479 {
480  if(m_type == Type3)
481  return &m_impl.m_value3;
482  return nullptr;
483 }
484 template <>
485 inline ossia::domain_base<std::string>* domain_base_variant::target()
486 {
487  if(m_type == Type5)
488  return &m_impl.m_value5;
489  return nullptr;
490 }
491 template <>
492 inline ossia::vector_domain* domain_base_variant::target()
493 {
494  if(m_type == Type6)
495  return &m_impl.m_value6;
496  return nullptr;
497 }
498 template <>
499 inline ossia::vecf_domain<2>* domain_base_variant::target()
500 {
501  if(m_type == Type7)
502  return &m_impl.m_value7;
503  return nullptr;
504 }
505 template <>
506 inline ossia::vecf_domain<3>* domain_base_variant::target()
507 {
508  if(m_type == Type8)
509  return &m_impl.m_value8;
510  return nullptr;
511 }
512 template <>
513 inline ossia::vecf_domain<4>* domain_base_variant::target()
514 {
515  if(m_type == Type9)
516  return &m_impl.m_value9;
517  return nullptr;
518 }
519 template <>
520 inline ossia::domain_base<ossia::value>* domain_base_variant::target()
521 {
522  if(m_type == Type10)
523  return &m_impl.m_value10;
524  return nullptr;
525 }
526 template <>
527 inline const ossia::domain_base<ossia::impulse>& domain_base_variant::get() const
528 {
529  if(m_type == Type0)
530  return m_impl.m_value0;
531  ossia_do_throw(std::runtime_error, "domain_variant_impl: bad type");
532 }
533 template <>
534 inline const ossia::domain_base<bool>& domain_base_variant::get() const
535 {
536  if(m_type == Type1)
537  return m_impl.m_value1;
538  ossia_do_throw(std::runtime_error, "domain_variant_impl: bad type");
539 }
540 template <>
541 inline const ossia::domain_base<int32_t>& domain_base_variant::get() const
542 {
543  if(m_type == Type2)
544  return m_impl.m_value2;
545  ossia_do_throw(std::runtime_error, "domain_variant_impl: bad type");
546 }
547 template <>
548 inline const ossia::domain_base<float>& domain_base_variant::get() const
549 {
550  if(m_type == Type3)
551  return m_impl.m_value3;
552  ossia_do_throw(std::runtime_error, "domain_variant_impl: bad type");
553 }
554 template <>
555 inline const ossia::domain_base<std::string>& domain_base_variant::get() const
556 {
557  if(m_type == Type5)
558  return m_impl.m_value5;
559  ossia_do_throw(std::runtime_error, "domain_variant_impl: bad type");
560 }
561 template <>
562 inline const ossia::vector_domain& domain_base_variant::get() const
563 {
564  if(m_type == Type6)
565  return m_impl.m_value6;
566  ossia_do_throw(std::runtime_error, "domain_variant_impl: bad type");
567 }
568 template <>
569 inline const ossia::vecf_domain<2>& domain_base_variant::get() const
570 {
571  if(m_type == Type7)
572  return m_impl.m_value7;
573  ossia_do_throw(std::runtime_error, "domain_variant_impl: bad type");
574 }
575 template <>
576 inline const ossia::vecf_domain<3>& domain_base_variant::get() const
577 {
578  if(m_type == Type8)
579  return m_impl.m_value8;
580  ossia_do_throw(std::runtime_error, "domain_variant_impl: bad type");
581 }
582 template <>
583 inline const ossia::vecf_domain<4>& domain_base_variant::get() const
584 {
585  if(m_type == Type9)
586  return m_impl.m_value9;
587  ossia_do_throw(std::runtime_error, "domain_variant_impl: bad type");
588 }
589 template <>
590 inline const ossia::domain_base<ossia::value>& domain_base_variant::get() const
591 {
592  if(m_type == Type10)
593  return m_impl.m_value10;
594  ossia_do_throw(std::runtime_error, "domain_variant_impl: bad type");
595 }
596 template <>
597 inline ossia::domain_base<ossia::impulse>& domain_base_variant::get()
598 {
599  if(m_type == Type0)
600  return m_impl.m_value0;
601  ossia_do_throw(std::runtime_error, "domain_variant_impl: bad type");
602 }
603 template <>
604 inline ossia::domain_base<bool>& domain_base_variant::get()
605 {
606  if(m_type == Type1)
607  return m_impl.m_value1;
608  ossia_do_throw(std::runtime_error, "domain_variant_impl: bad type");
609 }
610 template <>
611 inline ossia::domain_base<int32_t>& domain_base_variant::get()
612 {
613  if(m_type == Type2)
614  return m_impl.m_value2;
615  ossia_do_throw(std::runtime_error, "domain_variant_impl: bad type");
616 }
617 template <>
618 inline ossia::domain_base<float>& domain_base_variant::get()
619 {
620  if(m_type == Type3)
621  return m_impl.m_value3;
622  ossia_do_throw(std::runtime_error, "domain_variant_impl: bad type");
623 }
624 template <>
625 inline ossia::domain_base<std::string>& domain_base_variant::get()
626 {
627  if(m_type == Type5)
628  return m_impl.m_value5;
629  ossia_do_throw(std::runtime_error, "domain_variant_impl: bad type");
630 }
631 template <>
632 inline ossia::vector_domain& domain_base_variant::get()
633 {
634  if(m_type == Type6)
635  return m_impl.m_value6;
636  ossia_do_throw(std::runtime_error, "domain_variant_impl: bad type");
637 }
638 template <>
639 inline ossia::vecf_domain<2>& domain_base_variant::get()
640 {
641  if(m_type == Type7)
642  return m_impl.m_value7;
643  ossia_do_throw(std::runtime_error, "domain_variant_impl: bad type");
644 }
645 template <>
646 inline ossia::vecf_domain<3>& domain_base_variant::get()
647 {
648  if(m_type == Type8)
649  return m_impl.m_value8;
650  ossia_do_throw(std::runtime_error, "domain_variant_impl: bad type");
651 }
652 template <>
653 inline ossia::vecf_domain<4>& domain_base_variant::get()
654 {
655  if(m_type == Type9)
656  return m_impl.m_value9;
657  ossia_do_throw(std::runtime_error, "domain_variant_impl: bad type");
658 }
659 template <>
660 inline ossia::domain_base<ossia::value>& domain_base_variant::get()
661 {
662  if(m_type == Type10)
663  return m_impl.m_value10;
664  ossia_do_throw(std::runtime_error, "domain_variant_impl: bad type");
665 }
666 template <typename Visitor>
667 auto apply_nonnull(Visitor&& functor, const domain_base_variant& var)
668 {
669  switch(var.m_type)
670  {
671  case domain_base_variant::Type::Type0:
672  return functor(var.m_impl.m_value0);
673  case domain_base_variant::Type::Type1:
674  return functor(var.m_impl.m_value1);
675  case domain_base_variant::Type::Type2:
676  return functor(var.m_impl.m_value2);
677  case domain_base_variant::Type::Type3:
678  return functor(var.m_impl.m_value3);
679  case domain_base_variant::Type::Type5:
680  return functor(var.m_impl.m_value5);
681  case domain_base_variant::Type::Type6:
682  return functor(var.m_impl.m_value6);
683  case domain_base_variant::Type::Type7:
684  return functor(var.m_impl.m_value7);
685  case domain_base_variant::Type::Type8:
686  return functor(var.m_impl.m_value8);
687  case domain_base_variant::Type::Type9:
688  return functor(var.m_impl.m_value9);
689  case domain_base_variant::Type::Type10:
690  return functor(var.m_impl.m_value10);
691  default:
692  ossia_do_throw(std::runtime_error, "domain_variant_impl: bad type");
693  }
694 }
695 template <typename Visitor>
696 auto apply_nonnull(Visitor&& functor, domain_base_variant& var)
697 {
698  switch(var.m_type)
699  {
700  case domain_base_variant::Type::Type0:
701  return functor(var.m_impl.m_value0);
702  case domain_base_variant::Type::Type1:
703  return functor(var.m_impl.m_value1);
704  case domain_base_variant::Type::Type2:
705  return functor(var.m_impl.m_value2);
706  case domain_base_variant::Type::Type3:
707  return functor(var.m_impl.m_value3);
708  case domain_base_variant::Type::Type5:
709  return functor(var.m_impl.m_value5);
710  case domain_base_variant::Type::Type6:
711  return functor(var.m_impl.m_value6);
712  case domain_base_variant::Type::Type7:
713  return functor(var.m_impl.m_value7);
714  case domain_base_variant::Type::Type8:
715  return functor(var.m_impl.m_value8);
716  case domain_base_variant::Type::Type9:
717  return functor(var.m_impl.m_value9);
718  case domain_base_variant::Type::Type10:
719  return functor(var.m_impl.m_value10);
720  default:
721  ossia_do_throw(std::runtime_error, "domain_variant_impl: bad type");
722  }
723 }
724 template <typename Visitor>
725 auto apply_nonnull(Visitor&& functor, domain_base_variant&& var)
726 {
727  switch(var.m_type)
728  {
729  case domain_base_variant::Type::Type0:
730  return functor(std::move(var.m_impl.m_value0));
731  case domain_base_variant::Type::Type1:
732  return functor(std::move(var.m_impl.m_value1));
733  case domain_base_variant::Type::Type2:
734  return functor(std::move(var.m_impl.m_value2));
735  case domain_base_variant::Type::Type3:
736  return functor(std::move(var.m_impl.m_value3));
737  case domain_base_variant::Type::Type5:
738  return functor(std::move(var.m_impl.m_value5));
739  case domain_base_variant::Type::Type6:
740  return functor(std::move(var.m_impl.m_value6));
741  case domain_base_variant::Type::Type7:
742  return functor(std::move(var.m_impl.m_value7));
743  case domain_base_variant::Type::Type8:
744  return functor(std::move(var.m_impl.m_value8));
745  case domain_base_variant::Type::Type9:
746  return functor(std::move(var.m_impl.m_value9));
747  case domain_base_variant::Type::Type10:
748  return functor(std::move(var.m_impl.m_value10));
749  default:
750  ossia_do_throw(std::runtime_error, "domain_variant_impl: bad type");
751  }
752 }
753 template <typename Visitor>
754 auto apply(Visitor&& functor, const domain_base_variant& var)
755 {
756  switch(var.m_type)
757  {
758  case domain_base_variant::Type::Type0:
759  return functor(var.m_impl.m_value0);
760  case domain_base_variant::Type::Type1:
761  return functor(var.m_impl.m_value1);
762  case domain_base_variant::Type::Type2:
763  return functor(var.m_impl.m_value2);
764  case domain_base_variant::Type::Type3:
765  return functor(var.m_impl.m_value3);
766  case domain_base_variant::Type::Type5:
767  return functor(var.m_impl.m_value5);
768  case domain_base_variant::Type::Type6:
769  return functor(var.m_impl.m_value6);
770  case domain_base_variant::Type::Type7:
771  return functor(var.m_impl.m_value7);
772  case domain_base_variant::Type::Type8:
773  return functor(var.m_impl.m_value8);
774  case domain_base_variant::Type::Type9:
775  return functor(var.m_impl.m_value9);
776  case domain_base_variant::Type::Type10:
777  return functor(var.m_impl.m_value10);
778  default:
779  return functor();
780  }
781 }
782 template <typename Visitor>
783 auto apply(Visitor&& functor, domain_base_variant& var)
784 {
785  switch(var.m_type)
786  {
787  case domain_base_variant::Type::Type0:
788  return functor(var.m_impl.m_value0);
789  case domain_base_variant::Type::Type1:
790  return functor(var.m_impl.m_value1);
791  case domain_base_variant::Type::Type2:
792  return functor(var.m_impl.m_value2);
793  case domain_base_variant::Type::Type3:
794  return functor(var.m_impl.m_value3);
795  case domain_base_variant::Type::Type5:
796  return functor(var.m_impl.m_value5);
797  case domain_base_variant::Type::Type6:
798  return functor(var.m_impl.m_value6);
799  case domain_base_variant::Type::Type7:
800  return functor(var.m_impl.m_value7);
801  case domain_base_variant::Type::Type8:
802  return functor(var.m_impl.m_value8);
803  case domain_base_variant::Type::Type9:
804  return functor(var.m_impl.m_value9);
805  case domain_base_variant::Type::Type10:
806  return functor(var.m_impl.m_value10);
807  default:
808  return functor();
809  }
810 }
811 template <typename Visitor>
812 auto apply(Visitor&& functor, domain_base_variant&& var)
813 {
814  switch(var.m_type)
815  {
816  case domain_base_variant::Type::Type0:
817  return functor(std::move(var.m_impl.m_value0));
818  case domain_base_variant::Type::Type1:
819  return functor(std::move(var.m_impl.m_value1));
820  case domain_base_variant::Type::Type2:
821  return functor(std::move(var.m_impl.m_value2));
822  case domain_base_variant::Type::Type3:
823  return functor(std::move(var.m_impl.m_value3));
824  case domain_base_variant::Type::Type5:
825  return functor(std::move(var.m_impl.m_value5));
826  case domain_base_variant::Type::Type6:
827  return functor(std::move(var.m_impl.m_value6));
828  case domain_base_variant::Type::Type7:
829  return functor(std::move(var.m_impl.m_value7));
830  case domain_base_variant::Type::Type8:
831  return functor(std::move(var.m_impl.m_value8));
832  case domain_base_variant::Type::Type9:
833  return functor(std::move(var.m_impl.m_value9));
834  case domain_base_variant::Type::Type10:
835  return functor(std::move(var.m_impl.m_value10));
836  default:
837  return functor();
838  }
839 }
840 inline bool operator==(const domain_base_variant& lhs, const domain_base_variant& rhs)
841 {
842  if(lhs.m_type == rhs.m_type)
843  {
844  switch(lhs.m_type)
845  {
846  case domain_base_variant::Type::Type0:
847  return lhs.m_impl.m_value0 == rhs.m_impl.m_value0;
848  case domain_base_variant::Type::Type1:
849  return lhs.m_impl.m_value1 == rhs.m_impl.m_value1;
850  case domain_base_variant::Type::Type2:
851  return lhs.m_impl.m_value2 == rhs.m_impl.m_value2;
852  case domain_base_variant::Type::Type3:
853  return lhs.m_impl.m_value3 == rhs.m_impl.m_value3;
854  case domain_base_variant::Type::Type5:
855  return lhs.m_impl.m_value5 == rhs.m_impl.m_value5;
856  case domain_base_variant::Type::Type6:
857  return lhs.m_impl.m_value6 == rhs.m_impl.m_value6;
858  case domain_base_variant::Type::Type7:
859  return lhs.m_impl.m_value7 == rhs.m_impl.m_value7;
860  case domain_base_variant::Type::Type8:
861  return lhs.m_impl.m_value8 == rhs.m_impl.m_value8;
862  case domain_base_variant::Type::Type9:
863  return lhs.m_impl.m_value9 == rhs.m_impl.m_value9;
864  case domain_base_variant::Type::Type10:
865  return lhs.m_impl.m_value10 == rhs.m_impl.m_value10;
866  default:
867  return true;
868  }
869  }
870  return false;
871 }
872 inline bool operator!=(const domain_base_variant& lhs, const domain_base_variant& rhs)
873 {
874  if(lhs.m_type != rhs.m_type)
875  return true;
876  switch(lhs.m_type)
877  {
878  case domain_base_variant::Type::Type0:
879  return lhs.m_impl.m_value0 != rhs.m_impl.m_value0;
880  case domain_base_variant::Type::Type1:
881  return lhs.m_impl.m_value1 != rhs.m_impl.m_value1;
882  case domain_base_variant::Type::Type2:
883  return lhs.m_impl.m_value2 != rhs.m_impl.m_value2;
884  case domain_base_variant::Type::Type3:
885  return lhs.m_impl.m_value3 != rhs.m_impl.m_value3;
886  case domain_base_variant::Type::Type5:
887  return lhs.m_impl.m_value5 != rhs.m_impl.m_value5;
888  case domain_base_variant::Type::Type6:
889  return lhs.m_impl.m_value6 != rhs.m_impl.m_value6;
890  case domain_base_variant::Type::Type7:
891  return lhs.m_impl.m_value7 != rhs.m_impl.m_value7;
892  case domain_base_variant::Type::Type8:
893  return lhs.m_impl.m_value8 != rhs.m_impl.m_value8;
894  case domain_base_variant::Type::Type9:
895  return lhs.m_impl.m_value9 != rhs.m_impl.m_value9;
896  case domain_base_variant::Type::Type10:
897  return lhs.m_impl.m_value10 != rhs.m_impl.m_value10;
898  default:
899  return false;
900  }
901  return true;
902 }
903 inline bool
904 operator==(const domain_base_variant& lhs, const ossia::domain_base<ossia::impulse>& rhs)
905 {
906  return (lhs.m_type == domain_base_variant::Type::Type0)
907  && (lhs.m_impl.m_value0 == rhs);
908 }
909 inline bool
910 operator==(const ossia::domain_base<ossia::impulse>& lhs, const domain_base_variant& rhs)
911 {
912  return (rhs.m_type == domain_base_variant::Type::Type0)
913  && (rhs.m_impl.m_value0 == lhs);
914 }
915 inline bool
916 operator!=(const domain_base_variant& lhs, const ossia::domain_base<ossia::impulse>& rhs)
917 {
918  return (lhs.m_type != domain_base_variant::Type::Type0)
919  || (lhs.m_impl.m_value0 != rhs);
920 }
921 inline bool
922 operator!=(const ossia::domain_base<ossia::impulse>& lhs, const domain_base_variant& rhs)
923 {
924  return (rhs.m_type != domain_base_variant::Type::Type0)
925  || (rhs.m_impl.m_value0 != lhs);
926 }
927 inline bool
928 operator==(const domain_base_variant& lhs, const ossia::domain_base<bool>& rhs)
929 {
930  return (lhs.m_type == domain_base_variant::Type::Type1)
931  && (lhs.m_impl.m_value1 == rhs);
932 }
933 inline bool
934 operator==(const ossia::domain_base<bool>& lhs, const domain_base_variant& rhs)
935 {
936  return (rhs.m_type == domain_base_variant::Type::Type1)
937  && (rhs.m_impl.m_value1 == lhs);
938 }
939 inline bool
940 operator!=(const domain_base_variant& lhs, const ossia::domain_base<bool>& rhs)
941 {
942  return (lhs.m_type != domain_base_variant::Type::Type1)
943  || (lhs.m_impl.m_value1 != rhs);
944 }
945 inline bool
946 operator!=(const ossia::domain_base<bool>& lhs, const domain_base_variant& rhs)
947 {
948  return (rhs.m_type != domain_base_variant::Type::Type1)
949  || (rhs.m_impl.m_value1 != lhs);
950 }
951 inline bool
952 operator==(const domain_base_variant& lhs, const ossia::domain_base<int32_t>& rhs)
953 {
954  return (lhs.m_type == domain_base_variant::Type::Type2)
955  && (lhs.m_impl.m_value2 == rhs);
956 }
957 inline bool
958 operator==(const ossia::domain_base<int32_t>& lhs, const domain_base_variant& rhs)
959 {
960  return (rhs.m_type == domain_base_variant::Type::Type2)
961  && (rhs.m_impl.m_value2 == lhs);
962 }
963 inline bool
964 operator!=(const domain_base_variant& lhs, const ossia::domain_base<int32_t>& rhs)
965 {
966  return (lhs.m_type != domain_base_variant::Type::Type2)
967  || (lhs.m_impl.m_value2 != rhs);
968 }
969 inline bool
970 operator!=(const ossia::domain_base<int32_t>& lhs, const domain_base_variant& rhs)
971 {
972  return (rhs.m_type != domain_base_variant::Type::Type2)
973  || (rhs.m_impl.m_value2 != lhs);
974 }
975 inline bool
976 operator==(const domain_base_variant& lhs, const ossia::domain_base<float>& rhs)
977 {
978  return (lhs.m_type == domain_base_variant::Type::Type3)
979  && (lhs.m_impl.m_value3 == rhs);
980 }
981 inline bool
982 operator==(const ossia::domain_base<float>& lhs, const domain_base_variant& rhs)
983 {
984  return (rhs.m_type == domain_base_variant::Type::Type3)
985  && (rhs.m_impl.m_value3 == lhs);
986 }
987 inline bool
988 operator!=(const domain_base_variant& lhs, const ossia::domain_base<float>& rhs)
989 {
990  return (lhs.m_type != domain_base_variant::Type::Type3)
991  || (lhs.m_impl.m_value3 != rhs);
992 }
993 inline bool
994 operator!=(const ossia::domain_base<float>& lhs, const domain_base_variant& rhs)
995 {
996  return (rhs.m_type != domain_base_variant::Type::Type3)
997  || (rhs.m_impl.m_value3 != lhs);
998 }
999 inline bool
1000 operator==(const domain_base_variant& lhs, const ossia::domain_base<std::string>& rhs)
1001 {
1002  return (lhs.m_type == domain_base_variant::Type::Type5)
1003  && (lhs.m_impl.m_value5 == rhs);
1004 }
1005 inline bool
1006 operator==(const ossia::domain_base<std::string>& lhs, const domain_base_variant& rhs)
1007 {
1008  return (rhs.m_type == domain_base_variant::Type::Type5)
1009  && (rhs.m_impl.m_value5 == lhs);
1010 }
1011 inline bool
1012 operator!=(const domain_base_variant& lhs, const ossia::domain_base<std::string>& rhs)
1013 {
1014  return (lhs.m_type != domain_base_variant::Type::Type5)
1015  || (lhs.m_impl.m_value5 != rhs);
1016 }
1017 inline bool
1018 operator!=(const ossia::domain_base<std::string>& lhs, const domain_base_variant& rhs)
1019 {
1020  return (rhs.m_type != domain_base_variant::Type::Type5)
1021  || (rhs.m_impl.m_value5 != lhs);
1022 }
1023 inline bool operator==(const domain_base_variant& lhs, const ossia::vector_domain& rhs)
1024 {
1025  return (lhs.m_type == domain_base_variant::Type::Type6)
1026  && (lhs.m_impl.m_value6 == rhs);
1027 }
1028 inline bool operator==(const ossia::vector_domain& lhs, const domain_base_variant& rhs)
1029 {
1030  return (rhs.m_type == domain_base_variant::Type::Type6)
1031  && (rhs.m_impl.m_value6 == lhs);
1032 }
1033 inline bool operator!=(const domain_base_variant& lhs, const ossia::vector_domain& rhs)
1034 {
1035  return (lhs.m_type != domain_base_variant::Type::Type6)
1036  || (lhs.m_impl.m_value6 != rhs);
1037 }
1038 inline bool operator!=(const ossia::vector_domain& lhs, const domain_base_variant& rhs)
1039 {
1040  return (rhs.m_type != domain_base_variant::Type::Type6)
1041  || (rhs.m_impl.m_value6 != lhs);
1042 }
1043 inline bool operator==(const domain_base_variant& lhs, const ossia::vecf_domain<2>& rhs)
1044 {
1045  return (lhs.m_type == domain_base_variant::Type::Type7)
1046  && (lhs.m_impl.m_value7 == rhs);
1047 }
1048 inline bool operator==(const ossia::vecf_domain<2>& lhs, const domain_base_variant& rhs)
1049 {
1050  return (rhs.m_type == domain_base_variant::Type::Type7)
1051  && (rhs.m_impl.m_value7 == lhs);
1052 }
1053 inline bool operator!=(const domain_base_variant& lhs, const ossia::vecf_domain<2>& rhs)
1054 {
1055  return (lhs.m_type != domain_base_variant::Type::Type7)
1056  || (lhs.m_impl.m_value7 != rhs);
1057 }
1058 inline bool operator!=(const ossia::vecf_domain<2>& lhs, const domain_base_variant& rhs)
1059 {
1060  return (rhs.m_type != domain_base_variant::Type::Type7)
1061  || (rhs.m_impl.m_value7 != lhs);
1062 }
1063 inline bool operator==(const domain_base_variant& lhs, const ossia::vecf_domain<3>& rhs)
1064 {
1065  return (lhs.m_type == domain_base_variant::Type::Type8)
1066  && (lhs.m_impl.m_value8 == rhs);
1067 }
1068 inline bool operator==(const ossia::vecf_domain<3>& lhs, const domain_base_variant& rhs)
1069 {
1070  return (rhs.m_type == domain_base_variant::Type::Type8)
1071  && (rhs.m_impl.m_value8 == lhs);
1072 }
1073 inline bool operator!=(const domain_base_variant& lhs, const ossia::vecf_domain<3>& rhs)
1074 {
1075  return (lhs.m_type != domain_base_variant::Type::Type8)
1076  || (lhs.m_impl.m_value8 != rhs);
1077 }
1078 inline bool operator!=(const ossia::vecf_domain<3>& lhs, const domain_base_variant& rhs)
1079 {
1080  return (rhs.m_type != domain_base_variant::Type::Type8)
1081  || (rhs.m_impl.m_value8 != lhs);
1082 }
1083 inline bool operator==(const domain_base_variant& lhs, const ossia::vecf_domain<4>& rhs)
1084 {
1085  return (lhs.m_type == domain_base_variant::Type::Type9)
1086  && (lhs.m_impl.m_value9 == rhs);
1087 }
1088 inline bool operator==(const ossia::vecf_domain<4>& lhs, const domain_base_variant& rhs)
1089 {
1090  return (rhs.m_type == domain_base_variant::Type::Type9)
1091  && (rhs.m_impl.m_value9 == lhs);
1092 }
1093 inline bool operator!=(const domain_base_variant& lhs, const ossia::vecf_domain<4>& rhs)
1094 {
1095  return (lhs.m_type != domain_base_variant::Type::Type9)
1096  || (lhs.m_impl.m_value9 != rhs);
1097 }
1098 inline bool operator!=(const ossia::vecf_domain<4>& lhs, const domain_base_variant& rhs)
1099 {
1100  return (rhs.m_type != domain_base_variant::Type::Type9)
1101  || (rhs.m_impl.m_value9 != lhs);
1102 }
1103 inline bool
1104 operator==(const domain_base_variant& lhs, const ossia::domain_base<ossia::value>& rhs)
1105 {
1106  return (lhs.m_type == domain_base_variant::Type::Type10)
1107  && (lhs.m_impl.m_value10 == rhs);
1108 }
1109 inline bool
1110 operator==(const ossia::domain_base<ossia::value>& lhs, const domain_base_variant& rhs)
1111 {
1112  return (rhs.m_type == domain_base_variant::Type::Type10)
1113  && (rhs.m_impl.m_value10 == lhs);
1114 }
1115 inline bool
1116 operator!=(const domain_base_variant& lhs, const ossia::domain_base<ossia::value>& rhs)
1117 {
1118  return (lhs.m_type != domain_base_variant::Type::Type10)
1119  || (lhs.m_impl.m_value10 != rhs);
1120 }
1121 inline bool
1122 operator!=(const ossia::domain_base<ossia::value>& lhs, const domain_base_variant& rhs)
1123 {
1124  return (rhs.m_type != domain_base_variant::Type::Type10)
1125  || (rhs.m_impl.m_value10 != lhs);
1126 }
1127 template <typename Functor>
1128 auto apply(Functor&& functor, domain_base_variant& arg0, const value_variant_type& arg1)
1129 {
1130  switch(arg0.m_type)
1131  {
1132  case domain_base_variant::Type::Type0: {
1133  switch(arg1.m_type)
1134  {
1135  case value_variant_type::Type::Type0: {
1136  return functor(arg0.m_impl.m_value0, arg1.m_impl.m_value0);
1137  }
1138  case value_variant_type::Type::Type1: {
1139  return functor(arg0.m_impl.m_value0, arg1.m_impl.m_value1);
1140  }
1141  case value_variant_type::Type::Type2: {
1142  return functor(arg0.m_impl.m_value0, arg1.m_impl.m_value2);
1143  }
1144  case value_variant_type::Type::Type3: {
1145  return functor(arg0.m_impl.m_value0, arg1.m_impl.m_value3);
1146  }
1147  case value_variant_type::Type::Type4: {
1148  return functor(arg0.m_impl.m_value0, arg1.m_impl.m_value4);
1149  }
1150  case value_variant_type::Type::Type5: {
1151  return functor(arg0.m_impl.m_value0, arg1.m_impl.m_value5);
1152  }
1153  case value_variant_type::Type::Type6: {
1154  return functor(arg0.m_impl.m_value0, arg1.m_impl.m_value6);
1155  }
1156  case value_variant_type::Type::Type7: {
1157  return functor(arg0.m_impl.m_value0, arg1.m_impl.m_value7);
1158  }
1159  case value_variant_type::Type::Type8: {
1160  return functor(arg0.m_impl.m_value0, arg1.m_impl.m_value8);
1161  }
1162  case value_variant_type::Type::Type9: {
1163  return functor(arg0.m_impl.m_value0, arg1.m_impl.m_value9);
1164  }
1165  default:
1166  ossia_do_throw(std::runtime_error, "domain_variant_impl: bad type");
1167  }
1168  }
1169  case domain_base_variant::Type::Type1: {
1170  switch(arg1.m_type)
1171  {
1172  case value_variant_type::Type::Type0: {
1173  return functor(arg0.m_impl.m_value1, arg1.m_impl.m_value0);
1174  }
1175  case value_variant_type::Type::Type1: {
1176  return functor(arg0.m_impl.m_value1, arg1.m_impl.m_value1);
1177  }
1178  case value_variant_type::Type::Type2: {
1179  return functor(arg0.m_impl.m_value1, arg1.m_impl.m_value2);
1180  }
1181  case value_variant_type::Type::Type3: {
1182  return functor(arg0.m_impl.m_value1, arg1.m_impl.m_value3);
1183  }
1184  case value_variant_type::Type::Type4: {
1185  return functor(arg0.m_impl.m_value1, arg1.m_impl.m_value4);
1186  }
1187  case value_variant_type::Type::Type5: {
1188  return functor(arg0.m_impl.m_value1, arg1.m_impl.m_value5);
1189  }
1190  case value_variant_type::Type::Type6: {
1191  return functor(arg0.m_impl.m_value1, arg1.m_impl.m_value6);
1192  }
1193  case value_variant_type::Type::Type7: {
1194  return functor(arg0.m_impl.m_value1, arg1.m_impl.m_value7);
1195  }
1196  case value_variant_type::Type::Type8: {
1197  return functor(arg0.m_impl.m_value1, arg1.m_impl.m_value8);
1198  }
1199  case value_variant_type::Type::Type9: {
1200  return functor(arg0.m_impl.m_value1, arg1.m_impl.m_value9);
1201  }
1202  default:
1203  ossia_do_throw(std::runtime_error, "domain_variant_impl: bad type");
1204  }
1205  }
1206  case domain_base_variant::Type::Type2: {
1207  switch(arg1.m_type)
1208  {
1209  case value_variant_type::Type::Type0: {
1210  return functor(arg0.m_impl.m_value2, arg1.m_impl.m_value0);
1211  }
1212  case value_variant_type::Type::Type1: {
1213  return functor(arg0.m_impl.m_value2, arg1.m_impl.m_value1);
1214  }
1215  case value_variant_type::Type::Type2: {
1216  return functor(arg0.m_impl.m_value2, arg1.m_impl.m_value2);
1217  }
1218  case value_variant_type::Type::Type3: {
1219  return functor(arg0.m_impl.m_value2, arg1.m_impl.m_value3);
1220  }
1221  case value_variant_type::Type::Type4: {
1222  return functor(arg0.m_impl.m_value2, arg1.m_impl.m_value4);
1223  }
1224  case value_variant_type::Type::Type5: {
1225  return functor(arg0.m_impl.m_value2, arg1.m_impl.m_value5);
1226  }
1227  case value_variant_type::Type::Type6: {
1228  return functor(arg0.m_impl.m_value2, arg1.m_impl.m_value6);
1229  }
1230  case value_variant_type::Type::Type7: {
1231  return functor(arg0.m_impl.m_value2, arg1.m_impl.m_value7);
1232  }
1233  case value_variant_type::Type::Type8: {
1234  return functor(arg0.m_impl.m_value2, arg1.m_impl.m_value8);
1235  }
1236  case value_variant_type::Type::Type9: {
1237  return functor(arg0.m_impl.m_value2, arg1.m_impl.m_value9);
1238  }
1239  default:
1240  ossia_do_throw(std::runtime_error, "domain_variant_impl: bad type");
1241  }
1242  }
1243  case domain_base_variant::Type::Type3: {
1244  switch(arg1.m_type)
1245  {
1246  case value_variant_type::Type::Type0: {
1247  return functor(arg0.m_impl.m_value3, arg1.m_impl.m_value0);
1248  }
1249  case value_variant_type::Type::Type1: {
1250  return functor(arg0.m_impl.m_value3, arg1.m_impl.m_value1);
1251  }
1252  case value_variant_type::Type::Type2: {
1253  return functor(arg0.m_impl.m_value3, arg1.m_impl.m_value2);
1254  }
1255  case value_variant_type::Type::Type3: {
1256  return functor(arg0.m_impl.m_value3, arg1.m_impl.m_value3);
1257  }
1258  case value_variant_type::Type::Type4: {
1259  return functor(arg0.m_impl.m_value3, arg1.m_impl.m_value4);
1260  }
1261  case value_variant_type::Type::Type5: {
1262  return functor(arg0.m_impl.m_value3, arg1.m_impl.m_value5);
1263  }
1264  case value_variant_type::Type::Type6: {
1265  return functor(arg0.m_impl.m_value3, arg1.m_impl.m_value6);
1266  }
1267  case value_variant_type::Type::Type7: {
1268  return functor(arg0.m_impl.m_value3, arg1.m_impl.m_value7);
1269  }
1270  case value_variant_type::Type::Type8: {
1271  return functor(arg0.m_impl.m_value3, arg1.m_impl.m_value8);
1272  }
1273  case value_variant_type::Type::Type9: {
1274  return functor(arg0.m_impl.m_value3, arg1.m_impl.m_value9);
1275  }
1276  default:
1277  ossia_do_throw(std::runtime_error, "domain_variant_impl: bad type");
1278  }
1279  }
1280  case domain_base_variant::Type::Type5: {
1281  switch(arg1.m_type)
1282  {
1283  case value_variant_type::Type::Type0: {
1284  return functor(arg0.m_impl.m_value5, arg1.m_impl.m_value0);
1285  }
1286  case value_variant_type::Type::Type1: {
1287  return functor(arg0.m_impl.m_value5, arg1.m_impl.m_value1);
1288  }
1289  case value_variant_type::Type::Type2: {
1290  return functor(arg0.m_impl.m_value5, arg1.m_impl.m_value2);
1291  }
1292  case value_variant_type::Type::Type3: {
1293  return functor(arg0.m_impl.m_value5, arg1.m_impl.m_value3);
1294  }
1295  case value_variant_type::Type::Type4: {
1296  return functor(arg0.m_impl.m_value5, arg1.m_impl.m_value4);
1297  }
1298  case value_variant_type::Type::Type5: {
1299  return functor(arg0.m_impl.m_value5, arg1.m_impl.m_value5);
1300  }
1301  case value_variant_type::Type::Type6: {
1302  return functor(arg0.m_impl.m_value5, arg1.m_impl.m_value6);
1303  }
1304  case value_variant_type::Type::Type7: {
1305  return functor(arg0.m_impl.m_value5, arg1.m_impl.m_value7);
1306  }
1307  case value_variant_type::Type::Type8: {
1308  return functor(arg0.m_impl.m_value5, arg1.m_impl.m_value8);
1309  }
1310  case value_variant_type::Type::Type9: {
1311  return functor(arg0.m_impl.m_value5, arg1.m_impl.m_value9);
1312  }
1313  default:
1314  ossia_do_throw(std::runtime_error, "domain_variant_impl: bad type");
1315  }
1316  }
1317  case domain_base_variant::Type::Type6: {
1318  switch(arg1.m_type)
1319  {
1320  case value_variant_type::Type::Type0: {
1321  return functor(arg0.m_impl.m_value6, arg1.m_impl.m_value0);
1322  }
1323  case value_variant_type::Type::Type1: {
1324  return functor(arg0.m_impl.m_value6, arg1.m_impl.m_value1);
1325  }
1326  case value_variant_type::Type::Type2: {
1327  return functor(arg0.m_impl.m_value6, arg1.m_impl.m_value2);
1328  }
1329  case value_variant_type::Type::Type3: {
1330  return functor(arg0.m_impl.m_value6, arg1.m_impl.m_value3);
1331  }
1332  case value_variant_type::Type::Type4: {
1333  return functor(arg0.m_impl.m_value6, arg1.m_impl.m_value4);
1334  }
1335  case value_variant_type::Type::Type5: {
1336  return functor(arg0.m_impl.m_value6, arg1.m_impl.m_value5);
1337  }
1338  case value_variant_type::Type::Type6: {
1339  return functor(arg0.m_impl.m_value6, arg1.m_impl.m_value6);
1340  }
1341  case value_variant_type::Type::Type7: {
1342  return functor(arg0.m_impl.m_value6, arg1.m_impl.m_value7);
1343  }
1344  case value_variant_type::Type::Type8: {
1345  return functor(arg0.m_impl.m_value6, arg1.m_impl.m_value8);
1346  }
1347  case value_variant_type::Type::Type9: {
1348  return functor(arg0.m_impl.m_value6, arg1.m_impl.m_value9);
1349  }
1350  default:
1351  ossia_do_throw(std::runtime_error, "domain_variant_impl: bad type");
1352  }
1353  }
1354  case domain_base_variant::Type::Type7: {
1355  switch(arg1.m_type)
1356  {
1357  case value_variant_type::Type::Type0: {
1358  return functor(arg0.m_impl.m_value7, arg1.m_impl.m_value0);
1359  }
1360  case value_variant_type::Type::Type1: {
1361  return functor(arg0.m_impl.m_value7, arg1.m_impl.m_value1);
1362  }
1363  case value_variant_type::Type::Type2: {
1364  return functor(arg0.m_impl.m_value7, arg1.m_impl.m_value2);
1365  }
1366  case value_variant_type::Type::Type3: {
1367  return functor(arg0.m_impl.m_value7, arg1.m_impl.m_value3);
1368  }
1369  case value_variant_type::Type::Type4: {
1370  return functor(arg0.m_impl.m_value7, arg1.m_impl.m_value4);
1371  }
1372  case value_variant_type::Type::Type5: {
1373  return functor(arg0.m_impl.m_value7, arg1.m_impl.m_value5);
1374  }
1375  case value_variant_type::Type::Type6: {
1376  return functor(arg0.m_impl.m_value7, arg1.m_impl.m_value6);
1377  }
1378  case value_variant_type::Type::Type7: {
1379  return functor(arg0.m_impl.m_value7, arg1.m_impl.m_value7);
1380  }
1381  case value_variant_type::Type::Type8: {
1382  return functor(arg0.m_impl.m_value7, arg1.m_impl.m_value8);
1383  }
1384  case value_variant_type::Type::Type9: {
1385  return functor(arg0.m_impl.m_value7, arg1.m_impl.m_value9);
1386  }
1387  default:
1388  ossia_do_throw(std::runtime_error, "domain_variant_impl: bad type");
1389  }
1390  }
1391  case domain_base_variant::Type::Type8: {
1392  switch(arg1.m_type)
1393  {
1394  case value_variant_type::Type::Type0: {
1395  return functor(arg0.m_impl.m_value8, arg1.m_impl.m_value0);
1396  }
1397  case value_variant_type::Type::Type1: {
1398  return functor(arg0.m_impl.m_value8, arg1.m_impl.m_value1);
1399  }
1400  case value_variant_type::Type::Type2: {
1401  return functor(arg0.m_impl.m_value8, arg1.m_impl.m_value2);
1402  }
1403  case value_variant_type::Type::Type3: {
1404  return functor(arg0.m_impl.m_value8, arg1.m_impl.m_value3);
1405  }
1406  case value_variant_type::Type::Type4: {
1407  return functor(arg0.m_impl.m_value8, arg1.m_impl.m_value4);
1408  }
1409  case value_variant_type::Type::Type5: {
1410  return functor(arg0.m_impl.m_value8, arg1.m_impl.m_value5);
1411  }
1412  case value_variant_type::Type::Type6: {
1413  return functor(arg0.m_impl.m_value8, arg1.m_impl.m_value6);
1414  }
1415  case value_variant_type::Type::Type7: {
1416  return functor(arg0.m_impl.m_value8, arg1.m_impl.m_value7);
1417  }
1418  case value_variant_type::Type::Type8: {
1419  return functor(arg0.m_impl.m_value8, arg1.m_impl.m_value8);
1420  }
1421  case value_variant_type::Type::Type9: {
1422  return functor(arg0.m_impl.m_value8, arg1.m_impl.m_value9);
1423  }
1424  default:
1425  ossia_do_throw(std::runtime_error, "domain_variant_impl: bad type");
1426  }
1427  }
1428  case domain_base_variant::Type::Type9: {
1429  switch(arg1.m_type)
1430  {
1431  case value_variant_type::Type::Type0: {
1432  return functor(arg0.m_impl.m_value9, arg1.m_impl.m_value0);
1433  }
1434  case value_variant_type::Type::Type1: {
1435  return functor(arg0.m_impl.m_value9, arg1.m_impl.m_value1);
1436  }
1437  case value_variant_type::Type::Type2: {
1438  return functor(arg0.m_impl.m_value9, arg1.m_impl.m_value2);
1439  }
1440  case value_variant_type::Type::Type3: {
1441  return functor(arg0.m_impl.m_value9, arg1.m_impl.m_value3);
1442  }
1443  case value_variant_type::Type::Type4: {
1444  return functor(arg0.m_impl.m_value9, arg1.m_impl.m_value4);
1445  }
1446  case value_variant_type::Type::Type5: {
1447  return functor(arg0.m_impl.m_value9, arg1.m_impl.m_value5);
1448  }
1449  case value_variant_type::Type::Type6: {
1450  return functor(arg0.m_impl.m_value9, arg1.m_impl.m_value6);
1451  }
1452  case value_variant_type::Type::Type7: {
1453  return functor(arg0.m_impl.m_value9, arg1.m_impl.m_value7);
1454  }
1455  case value_variant_type::Type::Type8: {
1456  return functor(arg0.m_impl.m_value9, arg1.m_impl.m_value8);
1457  }
1458  case value_variant_type::Type::Type9: {
1459  return functor(arg0.m_impl.m_value9, arg1.m_impl.m_value9);
1460  }
1461  default:
1462  ossia_do_throw(std::runtime_error, "domain_variant_impl: bad type");
1463  }
1464  }
1465  case domain_base_variant::Type::Type10: {
1466  switch(arg1.m_type)
1467  {
1468  case value_variant_type::Type::Type0: {
1469  return functor(arg0.m_impl.m_value10, arg1.m_impl.m_value0);
1470  }
1471  case value_variant_type::Type::Type1: {
1472  return functor(arg0.m_impl.m_value10, arg1.m_impl.m_value1);
1473  }
1474  case value_variant_type::Type::Type2: {
1475  return functor(arg0.m_impl.m_value10, arg1.m_impl.m_value2);
1476  }
1477  case value_variant_type::Type::Type3: {
1478  return functor(arg0.m_impl.m_value10, arg1.m_impl.m_value3);
1479  }
1480  case value_variant_type::Type::Type4: {
1481  return functor(arg0.m_impl.m_value10, arg1.m_impl.m_value4);
1482  }
1483  case value_variant_type::Type::Type5: {
1484  return functor(arg0.m_impl.m_value10, arg1.m_impl.m_value5);
1485  }
1486  case value_variant_type::Type::Type6: {
1487  return functor(arg0.m_impl.m_value10, arg1.m_impl.m_value6);
1488  }
1489  case value_variant_type::Type::Type7: {
1490  return functor(arg0.m_impl.m_value10, arg1.m_impl.m_value7);
1491  }
1492  case value_variant_type::Type::Type8: {
1493  return functor(arg0.m_impl.m_value10, arg1.m_impl.m_value8);
1494  }
1495  case value_variant_type::Type::Type9: {
1496  return functor(arg0.m_impl.m_value10, arg1.m_impl.m_value9);
1497  }
1498  default:
1499  ossia_do_throw(std::runtime_error, "domain_variant_impl: bad type");
1500  }
1501  }
1502  default:
1503  ossia_do_throw(std::runtime_error, "domain_variant_impl: bad type");
1504  }
1505 }
1506 template <typename Functor>
1507 auto apply(
1508  Functor&& functor, const value_variant_type& arg0, const domain_base_variant& arg1)
1509 {
1510  switch(arg0.m_type)
1511  {
1512  case value_variant_type::Type::Type0: {
1513  switch(arg1.m_type)
1514  {
1515  case domain_base_variant::Type::Type0: {
1516  return functor(arg0.m_impl.m_value0, arg1.m_impl.m_value0);
1517  }
1518  case domain_base_variant::Type::Type1: {
1519  return functor(arg0.m_impl.m_value0, arg1.m_impl.m_value1);
1520  }
1521  case domain_base_variant::Type::Type2: {
1522  return functor(arg0.m_impl.m_value0, arg1.m_impl.m_value2);
1523  }
1524  case domain_base_variant::Type::Type3: {
1525  return functor(arg0.m_impl.m_value0, arg1.m_impl.m_value3);
1526  }
1527  case domain_base_variant::Type::Type5: {
1528  return functor(arg0.m_impl.m_value0, arg1.m_impl.m_value5);
1529  }
1530  case domain_base_variant::Type::Type6: {
1531  return functor(arg0.m_impl.m_value0, arg1.m_impl.m_value6);
1532  }
1533  case domain_base_variant::Type::Type7: {
1534  return functor(arg0.m_impl.m_value0, arg1.m_impl.m_value7);
1535  }
1536  case domain_base_variant::Type::Type8: {
1537  return functor(arg0.m_impl.m_value0, arg1.m_impl.m_value8);
1538  }
1539  case domain_base_variant::Type::Type9: {
1540  return functor(arg0.m_impl.m_value0, arg1.m_impl.m_value9);
1541  }
1542  case domain_base_variant::Type::Type10: {
1543  return functor(arg0.m_impl.m_value0, arg1.m_impl.m_value10);
1544  }
1545  default:
1546  ossia_do_throw(std::runtime_error, "domain_variant_impl: bad type");
1547  }
1548  }
1549  case value_variant_type::Type::Type1: {
1550  switch(arg1.m_type)
1551  {
1552  case domain_base_variant::Type::Type0: {
1553  return functor(arg0.m_impl.m_value1, arg1.m_impl.m_value0);
1554  }
1555  case domain_base_variant::Type::Type1: {
1556  return functor(arg0.m_impl.m_value1, arg1.m_impl.m_value1);
1557  }
1558  case domain_base_variant::Type::Type2: {
1559  return functor(arg0.m_impl.m_value1, arg1.m_impl.m_value2);
1560  }
1561  case domain_base_variant::Type::Type3: {
1562  return functor(arg0.m_impl.m_value1, arg1.m_impl.m_value3);
1563  }
1564  case domain_base_variant::Type::Type5: {
1565  return functor(arg0.m_impl.m_value1, arg1.m_impl.m_value5);
1566  }
1567  case domain_base_variant::Type::Type6: {
1568  return functor(arg0.m_impl.m_value1, arg1.m_impl.m_value6);
1569  }
1570  case domain_base_variant::Type::Type7: {
1571  return functor(arg0.m_impl.m_value1, arg1.m_impl.m_value7);
1572  }
1573  case domain_base_variant::Type::Type8: {
1574  return functor(arg0.m_impl.m_value1, arg1.m_impl.m_value8);
1575  }
1576  case domain_base_variant::Type::Type9: {
1577  return functor(arg0.m_impl.m_value1, arg1.m_impl.m_value9);
1578  }
1579  case domain_base_variant::Type::Type10: {
1580  return functor(arg0.m_impl.m_value1, arg1.m_impl.m_value10);
1581  }
1582  default:
1583  ossia_do_throw(std::runtime_error, "domain_variant_impl: bad type");
1584  }
1585  }
1586  case value_variant_type::Type::Type2: {
1587  switch(arg1.m_type)
1588  {
1589  case domain_base_variant::Type::Type0: {
1590  return functor(arg0.m_impl.m_value2, arg1.m_impl.m_value0);
1591  }
1592  case domain_base_variant::Type::Type1: {
1593  return functor(arg0.m_impl.m_value2, arg1.m_impl.m_value1);
1594  }
1595  case domain_base_variant::Type::Type2: {
1596  return functor(arg0.m_impl.m_value2, arg1.m_impl.m_value2);
1597  }
1598  case domain_base_variant::Type::Type3: {
1599  return functor(arg0.m_impl.m_value2, arg1.m_impl.m_value3);
1600  }
1601  case domain_base_variant::Type::Type5: {
1602  return functor(arg0.m_impl.m_value2, arg1.m_impl.m_value5);
1603  }
1604  case domain_base_variant::Type::Type6: {
1605  return functor(arg0.m_impl.m_value2, arg1.m_impl.m_value6);
1606  }
1607  case domain_base_variant::Type::Type7: {
1608  return functor(arg0.m_impl.m_value2, arg1.m_impl.m_value7);
1609  }
1610  case domain_base_variant::Type::Type8: {
1611  return functor(arg0.m_impl.m_value2, arg1.m_impl.m_value8);
1612  }
1613  case domain_base_variant::Type::Type9: {
1614  return functor(arg0.m_impl.m_value2, arg1.m_impl.m_value9);
1615  }
1616  case domain_base_variant::Type::Type10: {
1617  return functor(arg0.m_impl.m_value2, arg1.m_impl.m_value10);
1618  }
1619  default:
1620  ossia_do_throw(std::runtime_error, "domain_variant_impl: bad type");
1621  }
1622  }
1623  case value_variant_type::Type::Type3: {
1624  switch(arg1.m_type)
1625  {
1626  case domain_base_variant::Type::Type0: {
1627  return functor(arg0.m_impl.m_value3, arg1.m_impl.m_value0);
1628  }
1629  case domain_base_variant::Type::Type1: {
1630  return functor(arg0.m_impl.m_value3, arg1.m_impl.m_value1);
1631  }
1632  case domain_base_variant::Type::Type2: {
1633  return functor(arg0.m_impl.m_value3, arg1.m_impl.m_value2);
1634  }
1635  case domain_base_variant::Type::Type3: {
1636  return functor(arg0.m_impl.m_value3, arg1.m_impl.m_value3);
1637  }
1638  case domain_base_variant::Type::Type5: {
1639  return functor(arg0.m_impl.m_value3, arg1.m_impl.m_value5);
1640  }
1641  case domain_base_variant::Type::Type6: {
1642  return functor(arg0.m_impl.m_value3, arg1.m_impl.m_value6);
1643  }
1644  case domain_base_variant::Type::Type7: {
1645  return functor(arg0.m_impl.m_value3, arg1.m_impl.m_value7);
1646  }
1647  case domain_base_variant::Type::Type8: {
1648  return functor(arg0.m_impl.m_value3, arg1.m_impl.m_value8);
1649  }
1650  case domain_base_variant::Type::Type9: {
1651  return functor(arg0.m_impl.m_value3, arg1.m_impl.m_value9);
1652  }
1653  case domain_base_variant::Type::Type10: {
1654  return functor(arg0.m_impl.m_value3, arg1.m_impl.m_value10);
1655  }
1656  default:
1657  ossia_do_throw(std::runtime_error, "domain_variant_impl: bad type");
1658  }
1659  }
1660  case value_variant_type::Type::Type4: {
1661  switch(arg1.m_type)
1662  {
1663  case domain_base_variant::Type::Type0: {
1664  return functor(arg0.m_impl.m_value4, arg1.m_impl.m_value0);
1665  }
1666  case domain_base_variant::Type::Type1: {
1667  return functor(arg0.m_impl.m_value4, arg1.m_impl.m_value1);
1668  }
1669  case domain_base_variant::Type::Type2: {
1670  return functor(arg0.m_impl.m_value4, arg1.m_impl.m_value2);
1671  }
1672  case domain_base_variant::Type::Type3: {
1673  return functor(arg0.m_impl.m_value4, arg1.m_impl.m_value3);
1674  }
1675  case domain_base_variant::Type::Type5: {
1676  return functor(arg0.m_impl.m_value4, arg1.m_impl.m_value5);
1677  }
1678  case domain_base_variant::Type::Type6: {
1679  return functor(arg0.m_impl.m_value4, arg1.m_impl.m_value6);
1680  }
1681  case domain_base_variant::Type::Type7: {
1682  return functor(arg0.m_impl.m_value4, arg1.m_impl.m_value7);
1683  }
1684  case domain_base_variant::Type::Type8: {
1685  return functor(arg0.m_impl.m_value4, arg1.m_impl.m_value8);
1686  }
1687  case domain_base_variant::Type::Type9: {
1688  return functor(arg0.m_impl.m_value4, arg1.m_impl.m_value9);
1689  }
1690  case domain_base_variant::Type::Type10: {
1691  return functor(arg0.m_impl.m_value4, arg1.m_impl.m_value10);
1692  }
1693  default:
1694  ossia_do_throw(std::runtime_error, "domain_variant_impl: bad type");
1695  }
1696  }
1697  case value_variant_type::Type::Type5: {
1698  switch(arg1.m_type)
1699  {
1700  case domain_base_variant::Type::Type0: {
1701  return functor(arg0.m_impl.m_value5, arg1.m_impl.m_value0);
1702  }
1703  case domain_base_variant::Type::Type1: {
1704  return functor(arg0.m_impl.m_value5, arg1.m_impl.m_value1);
1705  }
1706  case domain_base_variant::Type::Type2: {
1707  return functor(arg0.m_impl.m_value5, arg1.m_impl.m_value2);
1708  }
1709  case domain_base_variant::Type::Type3: {
1710  return functor(arg0.m_impl.m_value5, arg1.m_impl.m_value3);
1711  }
1712  case domain_base_variant::Type::Type5: {
1713  return functor(arg0.m_impl.m_value5, arg1.m_impl.m_value5);
1714  }
1715  case domain_base_variant::Type::Type6: {
1716  return functor(arg0.m_impl.m_value5, arg1.m_impl.m_value6);
1717  }
1718  case domain_base_variant::Type::Type7: {
1719  return functor(arg0.m_impl.m_value5, arg1.m_impl.m_value7);
1720  }
1721  case domain_base_variant::Type::Type8: {
1722  return functor(arg0.m_impl.m_value5, arg1.m_impl.m_value8);
1723  }
1724  case domain_base_variant::Type::Type9: {
1725  return functor(arg0.m_impl.m_value5, arg1.m_impl.m_value9);
1726  }
1727  case domain_base_variant::Type::Type10: {
1728  return functor(arg0.m_impl.m_value5, arg1.m_impl.m_value10);
1729  }
1730  default:
1731  ossia_do_throw(std::runtime_error, "domain_variant_impl: bad type");
1732  }
1733  }
1734  case value_variant_type::Type::Type6: {
1735  switch(arg1.m_type)
1736  {
1737  case domain_base_variant::Type::Type0: {
1738  return functor(arg0.m_impl.m_value6, arg1.m_impl.m_value0);
1739  }
1740  case domain_base_variant::Type::Type1: {
1741  return functor(arg0.m_impl.m_value6, arg1.m_impl.m_value1);
1742  }
1743  case domain_base_variant::Type::Type2: {
1744  return functor(arg0.m_impl.m_value6, arg1.m_impl.m_value2);
1745  }
1746  case domain_base_variant::Type::Type3: {
1747  return functor(arg0.m_impl.m_value6, arg1.m_impl.m_value3);
1748  }
1749  case domain_base_variant::Type::Type5: {
1750  return functor(arg0.m_impl.m_value6, arg1.m_impl.m_value5);
1751  }
1752  case domain_base_variant::Type::Type6: {
1753  return functor(arg0.m_impl.m_value6, arg1.m_impl.m_value6);
1754  }
1755  case domain_base_variant::Type::Type7: {
1756  return functor(arg0.m_impl.m_value6, arg1.m_impl.m_value7);
1757  }
1758  case domain_base_variant::Type::Type8: {
1759  return functor(arg0.m_impl.m_value6, arg1.m_impl.m_value8);
1760  }
1761  case domain_base_variant::Type::Type9: {
1762  return functor(arg0.m_impl.m_value6, arg1.m_impl.m_value9);
1763  }
1764  case domain_base_variant::Type::Type10: {
1765  return functor(arg0.m_impl.m_value6, arg1.m_impl.m_value10);
1766  }
1767  default:
1768  ossia_do_throw(std::runtime_error, "domain_variant_impl: bad type");
1769  }
1770  }
1771  case value_variant_type::Type::Type7: {
1772  switch(arg1.m_type)
1773  {
1774  case domain_base_variant::Type::Type0: {
1775  return functor(arg0.m_impl.m_value7, arg1.m_impl.m_value0);
1776  }
1777  case domain_base_variant::Type::Type1: {
1778  return functor(arg0.m_impl.m_value7, arg1.m_impl.m_value1);
1779  }
1780  case domain_base_variant::Type::Type2: {
1781  return functor(arg0.m_impl.m_value7, arg1.m_impl.m_value2);
1782  }
1783  case domain_base_variant::Type::Type3: {
1784  return functor(arg0.m_impl.m_value7, arg1.m_impl.m_value3);
1785  }
1786  case domain_base_variant::Type::Type5: {
1787  return functor(arg0.m_impl.m_value7, arg1.m_impl.m_value5);
1788  }
1789  case domain_base_variant::Type::Type6: {
1790  return functor(arg0.m_impl.m_value7, arg1.m_impl.m_value6);
1791  }
1792  case domain_base_variant::Type::Type7: {
1793  return functor(arg0.m_impl.m_value7, arg1.m_impl.m_value7);
1794  }
1795  case domain_base_variant::Type::Type8: {
1796  return functor(arg0.m_impl.m_value7, arg1.m_impl.m_value8);
1797  }
1798  case domain_base_variant::Type::Type9: {
1799  return functor(arg0.m_impl.m_value7, arg1.m_impl.m_value9);
1800  }
1801  case domain_base_variant::Type::Type10: {
1802  return functor(arg0.m_impl.m_value7, arg1.m_impl.m_value10);
1803  }
1804  default:
1805  ossia_do_throw(std::runtime_error, "domain_variant_impl: bad type");
1806  }
1807  }
1808  case value_variant_type::Type::Type8: {
1809  switch(arg1.m_type)
1810  {
1811  case domain_base_variant::Type::Type0: {
1812  return functor(arg0.m_impl.m_value8, arg1.m_impl.m_value0);
1813  }
1814  case domain_base_variant::Type::Type1: {
1815  return functor(arg0.m_impl.m_value8, arg1.m_impl.m_value1);
1816  }
1817  case domain_base_variant::Type::Type2: {
1818  return functor(arg0.m_impl.m_value8, arg1.m_impl.m_value2);
1819  }
1820  case domain_base_variant::Type::Type3: {
1821  return functor(arg0.m_impl.m_value8, arg1.m_impl.m_value3);
1822  }
1823  case domain_base_variant::Type::Type5: {
1824  return functor(arg0.m_impl.m_value8, arg1.m_impl.m_value5);
1825  }
1826  case domain_base_variant::Type::Type6: {
1827  return functor(arg0.m_impl.m_value8, arg1.m_impl.m_value6);
1828  }
1829  case domain_base_variant::Type::Type7: {
1830  return functor(arg0.m_impl.m_value8, arg1.m_impl.m_value7);
1831  }
1832  case domain_base_variant::Type::Type8: {
1833  return functor(arg0.m_impl.m_value8, arg1.m_impl.m_value8);
1834  }
1835  case domain_base_variant::Type::Type9: {
1836  return functor(arg0.m_impl.m_value8, arg1.m_impl.m_value9);
1837  }
1838  case domain_base_variant::Type::Type10: {
1839  return functor(arg0.m_impl.m_value8, arg1.m_impl.m_value10);
1840  }
1841  default:
1842  ossia_do_throw(std::runtime_error, "domain_variant_impl: bad type");
1843  }
1844  }
1845  case value_variant_type::Type::Type9: {
1846  switch(arg1.m_type)
1847  {
1848  case domain_base_variant::Type::Type0: {
1849  return functor(arg0.m_impl.m_value9, arg1.m_impl.m_value0);
1850  }
1851  case domain_base_variant::Type::Type1: {
1852  return functor(arg0.m_impl.m_value9, arg1.m_impl.m_value1);
1853  }
1854  case domain_base_variant::Type::Type2: {
1855  return functor(arg0.m_impl.m_value9, arg1.m_impl.m_value2);
1856  }
1857  case domain_base_variant::Type::Type3: {
1858  return functor(arg0.m_impl.m_value9, arg1.m_impl.m_value3);
1859  }
1860  case domain_base_variant::Type::Type5: {
1861  return functor(arg0.m_impl.m_value9, arg1.m_impl.m_value5);
1862  }
1863  case domain_base_variant::Type::Type6: {
1864  return functor(arg0.m_impl.m_value9, arg1.m_impl.m_value6);
1865  }
1866  case domain_base_variant::Type::Type7: {
1867  return functor(arg0.m_impl.m_value9, arg1.m_impl.m_value7);
1868  }
1869  case domain_base_variant::Type::Type8: {
1870  return functor(arg0.m_impl.m_value9, arg1.m_impl.m_value8);
1871  }
1872  case domain_base_variant::Type::Type9: {
1873  return functor(arg0.m_impl.m_value9, arg1.m_impl.m_value9);
1874  }
1875  case domain_base_variant::Type::Type10: {
1876  return functor(arg0.m_impl.m_value9, arg1.m_impl.m_value10);
1877  }
1878  default:
1879  ossia_do_throw(std::runtime_error, "domain_variant_impl: bad type");
1880  }
1881  }
1882  default:
1883  ossia_do_throw(std::runtime_error, "domain_variant_impl: bad type");
1884  }
1885 }
val_type matching_type(const unit_t &u)
underlying_type Get the implementation type of an unit
Definition: dataspace_visitors.cpp:198