9 ossia::degree_u m_value0;
11 ossia::radian_u m_value1;
32 static const constexpr
auto npos = Npos;
33 int which()
const {
return m_type; }
35 operator bool()
const {
return m_type != npos; }
37 const T* target()
const;
52 angle_u(ossia::degree_u v)
55 new(&m_impl.m_value0) ossia::degree_u{v};
57 angle_u(ossia::radian_u v)
60 new(&m_impl.m_value1) ossia::radian_u{v};
62 angle_u(
const angle_u& other)
63 : m_type{other.m_type}
68 new(&m_impl.m_value0) ossia::degree_u{other.m_impl.m_value0};
71 new(&m_impl.m_value1) ossia::radian_u{other.m_impl.m_value1};
77 angle_u(angle_u&& other) noexcept
78 : m_type{other.m_type}
83 new(&m_impl.m_value0) ossia::degree_u{std::move(other.m_impl.m_value0)};
86 new(&m_impl.m_value1) ossia::radian_u{std::move(other.m_impl.m_value1)};
92 angle_u& operator=(
const angle_u& other)
94 m_type = other.m_type;
98 new(&m_impl.m_value0) ossia::degree_u{other.m_impl.m_value0};
101 new(&m_impl.m_value1) ossia::radian_u{other.m_impl.m_value1};
108 angle_u& operator=(angle_u&& other) noexcept
110 m_type = other.m_type;
114 new(&m_impl.m_value0) ossia::degree_u{std::move(other.m_impl.m_value0)};
117 new(&m_impl.m_value1) ossia::radian_u{std::move(other.m_impl.m_value1)};
126 inline const ossia::degree_u* angle_u::target()
const
129 return &m_impl.m_value0;
133 inline const ossia::radian_u* angle_u::target()
const
136 return &m_impl.m_value1;
140 inline ossia::degree_u* angle_u::target()
143 return &m_impl.m_value0;
147 inline ossia::radian_u* angle_u::target()
150 return &m_impl.m_value1;
154 inline const ossia::degree_u& angle_u::get()
const
157 return m_impl.m_value0;
158 ossia_do_throw(std::runtime_error,
"angle_u: bad type");
161 inline const ossia::radian_u& angle_u::get()
const
164 return m_impl.m_value1;
165 ossia_do_throw(std::runtime_error,
"angle_u: bad type");
168 inline ossia::degree_u& angle_u::get()
171 return m_impl.m_value0;
172 ossia_do_throw(std::runtime_error,
"angle_u: bad type");
175 inline ossia::radian_u& angle_u::get()
178 return m_impl.m_value1;
179 ossia_do_throw(std::runtime_error,
"angle_u: bad type");
181 template <
typename Visitor>
182 auto apply_nonnull(Visitor&& functor,
const angle_u& var)
186 case angle_u::Type::Type0:
187 return functor(var.m_impl.m_value0);
188 case angle_u::Type::Type1:
189 return functor(var.m_impl.m_value1);
191 ossia_do_throw(std::runtime_error,
"angle_u: bad type");
194 template <
typename Visitor>
195 auto apply_nonnull(Visitor&& functor, angle_u& var)
199 case angle_u::Type::Type0:
200 return functor(var.m_impl.m_value0);
201 case angle_u::Type::Type1:
202 return functor(var.m_impl.m_value1);
204 ossia_do_throw(std::runtime_error,
"angle_u: bad type");
207 template <
typename Visitor>
208 auto apply_nonnull(Visitor&& functor, angle_u&& var)
212 case angle_u::Type::Type0:
213 return functor(std::move(var.m_impl.m_value0));
214 case angle_u::Type::Type1:
215 return functor(std::move(var.m_impl.m_value1));
217 ossia_do_throw(std::runtime_error,
"angle_u: bad type");
220 template <
typename Visitor>
221 auto apply(Visitor&& functor,
const angle_u& var)
225 case angle_u::Type::Type0:
226 return functor(var.m_impl.m_value0);
227 case angle_u::Type::Type1:
228 return functor(var.m_impl.m_value1);
233 template <
typename Visitor>
234 auto apply(Visitor&& functor, angle_u& var)
238 case angle_u::Type::Type0:
239 return functor(var.m_impl.m_value0);
240 case angle_u::Type::Type1:
241 return functor(var.m_impl.m_value1);
246 template <
typename Visitor>
247 auto apply(Visitor&& functor, angle_u&& var)
251 case angle_u::Type::Type0:
252 return functor(std::move(var.m_impl.m_value0));
253 case angle_u::Type::Type1:
254 return functor(std::move(var.m_impl.m_value1));
259 inline bool operator==(
const angle_u& lhs,
const angle_u& rhs)
261 return (lhs.m_type == rhs.m_type);
263 inline bool operator!=(
const angle_u& lhs,
const angle_u& rhs)
265 return (lhs.m_type != rhs.m_type);
267 inline bool operator==(
const angle_u& lhs,
const ossia::degree_u& rhs)
269 return (lhs.m_type == angle_u::Type::Type0);
271 inline bool operator==(
const ossia::degree_u& lhs,
const angle_u& rhs)
273 return (rhs.m_type == angle_u::Type::Type0);
275 inline bool operator!=(
const angle_u& lhs,
const ossia::degree_u& rhs)
277 return (lhs.m_type != angle_u::Type::Type0);
279 inline bool operator!=(
const ossia::degree_u& lhs,
const angle_u& rhs)
281 return (rhs.m_type != angle_u::Type::Type0);
283 inline bool operator==(
const angle_u& lhs,
const ossia::radian_u& rhs)
285 return (lhs.m_type == angle_u::Type::Type1);
287 inline bool operator==(
const ossia::radian_u& lhs,
const angle_u& rhs)
289 return (rhs.m_type == angle_u::Type::Type1);
291 inline bool operator!=(
const angle_u& lhs,
const ossia::radian_u& rhs)
293 return (lhs.m_type != angle_u::Type::Type1);
295 inline bool operator!=(
const ossia::radian_u& lhs,
const angle_u& rhs)
297 return (rhs.m_type != angle_u::Type::Type1);
307 ossia::argb_u m_value0;
309 ossia::rgba_u m_value1;
311 ossia::rgb_u m_value2;
313 ossia::bgr_u m_value3;
315 ossia::argb8_u m_value4;
317 ossia::rgba8_u m_value5;
319 ossia::hsv_u m_value6;
321 ossia::cmy8_u m_value7;
323 ossia::xyz_u m_value8;
351 static const constexpr
auto npos = Npos;
352 int which()
const {
return m_type; }
354 operator bool()
const {
return m_type != npos; }
355 template <
typename T>
356 const T* target()
const;
357 template <
typename T>
359 template <
typename T>
360 const T& get()
const;
361 template <
typename T>
364 template <
typename T>
370 ~color_u() =
default;
371 color_u(ossia::argb_u v)
374 new(&m_impl.m_value0) ossia::argb_u{v};
376 color_u(ossia::rgba_u v)
379 new(&m_impl.m_value1) ossia::rgba_u{v};
381 color_u(ossia::rgb_u v)
384 new(&m_impl.m_value2) ossia::rgb_u{v};
386 color_u(ossia::bgr_u v)
389 new(&m_impl.m_value3) ossia::bgr_u{v};
391 color_u(ossia::argb8_u v)
394 new(&m_impl.m_value4) ossia::argb8_u{v};
396 color_u(ossia::rgba8_u v)
399 new(&m_impl.m_value5) ossia::rgba8_u{v};
401 color_u(ossia::hsv_u v)
404 new(&m_impl.m_value6) ossia::hsv_u{v};
406 color_u(ossia::cmy8_u v)
409 new(&m_impl.m_value7) ossia::cmy8_u{v};
411 color_u(ossia::xyz_u v)
414 new(&m_impl.m_value8) ossia::xyz_u{v};
416 color_u(
const color_u& other)
417 : m_type{other.m_type}
422 new(&m_impl.m_value0) ossia::argb_u{other.m_impl.m_value0};
425 new(&m_impl.m_value1) ossia::rgba_u{other.m_impl.m_value1};
428 new(&m_impl.m_value2) ossia::rgb_u{other.m_impl.m_value2};
431 new(&m_impl.m_value3) ossia::bgr_u{other.m_impl.m_value3};
434 new(&m_impl.m_value4) ossia::argb8_u{other.m_impl.m_value4};
437 new(&m_impl.m_value5) ossia::rgba8_u{other.m_impl.m_value5};
440 new(&m_impl.m_value6) ossia::hsv_u{other.m_impl.m_value6};
443 new(&m_impl.m_value7) ossia::cmy8_u{other.m_impl.m_value7};
446 new(&m_impl.m_value8) ossia::xyz_u{other.m_impl.m_value8};
452 color_u(color_u&& other) noexcept
453 : m_type{other.m_type}
458 new(&m_impl.m_value0) ossia::argb_u{std::move(other.m_impl.m_value0)};
461 new(&m_impl.m_value1) ossia::rgba_u{std::move(other.m_impl.m_value1)};
464 new(&m_impl.m_value2) ossia::rgb_u{std::move(other.m_impl.m_value2)};
467 new(&m_impl.m_value3) ossia::bgr_u{std::move(other.m_impl.m_value3)};
470 new(&m_impl.m_value4) ossia::argb8_u{std::move(other.m_impl.m_value4)};
473 new(&m_impl.m_value5) ossia::rgba8_u{std::move(other.m_impl.m_value5)};
476 new(&m_impl.m_value6) ossia::hsv_u{std::move(other.m_impl.m_value6)};
479 new(&m_impl.m_value7) ossia::cmy8_u{std::move(other.m_impl.m_value7)};
482 new(&m_impl.m_value8) ossia::xyz_u{std::move(other.m_impl.m_value8)};
488 color_u& operator=(
const color_u& other)
491 m_type = other.m_type;
495 new(&m_impl.m_value0) ossia::argb_u{other.m_impl.m_value0};
498 new(&m_impl.m_value1) ossia::rgba_u{other.m_impl.m_value1};
501 new(&m_impl.m_value2) ossia::rgb_u{other.m_impl.m_value2};
504 new(&m_impl.m_value3) ossia::bgr_u{other.m_impl.m_value3};
507 new(&m_impl.m_value4) ossia::argb8_u{other.m_impl.m_value4};
510 new(&m_impl.m_value5) ossia::rgba8_u{other.m_impl.m_value5};
513 new(&m_impl.m_value6) ossia::hsv_u{other.m_impl.m_value6};
516 new(&m_impl.m_value7) ossia::cmy8_u{other.m_impl.m_value7};
519 new(&m_impl.m_value8) ossia::xyz_u{other.m_impl.m_value8};
526 color_u& operator=(color_u&& other) noexcept
529 m_type = other.m_type;
533 new(&m_impl.m_value0) ossia::argb_u{std::move(other.m_impl.m_value0)};
536 new(&m_impl.m_value1) ossia::rgba_u{std::move(other.m_impl.m_value1)};
539 new(&m_impl.m_value2) ossia::rgb_u{std::move(other.m_impl.m_value2)};
542 new(&m_impl.m_value3) ossia::bgr_u{std::move(other.m_impl.m_value3)};
545 new(&m_impl.m_value4) ossia::argb8_u{std::move(other.m_impl.m_value4)};
548 new(&m_impl.m_value5) ossia::rgba8_u{std::move(other.m_impl.m_value5)};
551 new(&m_impl.m_value6) ossia::hsv_u{std::move(other.m_impl.m_value6)};
554 new(&m_impl.m_value7) ossia::cmy8_u{std::move(other.m_impl.m_value7)};
557 new(&m_impl.m_value8) ossia::xyz_u{std::move(other.m_impl.m_value8)};
566 inline const ossia::argb_u* color_u::target()
const
569 return &m_impl.m_value0;
573 inline const ossia::rgba_u* color_u::target()
const
576 return &m_impl.m_value1;
580 inline const ossia::rgb_u* color_u::target()
const
583 return &m_impl.m_value2;
587 inline const ossia::bgr_u* color_u::target()
const
590 return &m_impl.m_value3;
594 inline const ossia::argb8_u* color_u::target()
const
597 return &m_impl.m_value4;
601 inline const ossia::rgba8_u* color_u::target()
const
604 return &m_impl.m_value5;
608 inline const ossia::hsv_u* color_u::target()
const
611 return &m_impl.m_value6;
615 inline const ossia::cmy8_u* color_u::target()
const
618 return &m_impl.m_value7;
622 inline const ossia::xyz_u* color_u::target()
const
625 return &m_impl.m_value8;
629 inline ossia::argb_u* color_u::target()
632 return &m_impl.m_value0;
636 inline ossia::rgba_u* color_u::target()
639 return &m_impl.m_value1;
643 inline ossia::rgb_u* color_u::target()
646 return &m_impl.m_value2;
650 inline ossia::bgr_u* color_u::target()
653 return &m_impl.m_value3;
657 inline ossia::argb8_u* color_u::target()
660 return &m_impl.m_value4;
664 inline ossia::rgba8_u* color_u::target()
667 return &m_impl.m_value5;
671 inline ossia::hsv_u* color_u::target()
674 return &m_impl.m_value6;
678 inline ossia::cmy8_u* color_u::target()
681 return &m_impl.m_value7;
685 inline ossia::xyz_u* color_u::target()
688 return &m_impl.m_value8;
692 inline const ossia::argb_u& color_u::get()
const
695 return m_impl.m_value0;
696 ossia_do_throw(std::runtime_error,
"color_u: bad type");
699 inline const ossia::rgba_u& color_u::get()
const
702 return m_impl.m_value1;
703 ossia_do_throw(std::runtime_error,
"color_u: bad type");
706 inline const ossia::rgb_u& color_u::get()
const
709 return m_impl.m_value2;
710 ossia_do_throw(std::runtime_error,
"color_u: bad type");
713 inline const ossia::bgr_u& color_u::get()
const
716 return m_impl.m_value3;
717 ossia_do_throw(std::runtime_error,
"color_u: bad type");
720 inline const ossia::argb8_u& color_u::get()
const
723 return m_impl.m_value4;
724 ossia_do_throw(std::runtime_error,
"color_u: bad type");
727 inline const ossia::rgba8_u& color_u::get()
const
730 return m_impl.m_value5;
731 ossia_do_throw(std::runtime_error,
"color_u: bad type");
734 inline const ossia::hsv_u& color_u::get()
const
737 return m_impl.m_value6;
738 ossia_do_throw(std::runtime_error,
"color_u: bad type");
741 inline const ossia::cmy8_u& color_u::get()
const
744 return m_impl.m_value7;
745 ossia_do_throw(std::runtime_error,
"color_u: bad type");
748 inline const ossia::xyz_u& color_u::get()
const
751 return m_impl.m_value8;
752 ossia_do_throw(std::runtime_error,
"color_u: bad type");
755 inline ossia::argb_u& color_u::get()
758 return m_impl.m_value0;
759 ossia_do_throw(std::runtime_error,
"color_u: bad type");
762 inline ossia::rgba_u& color_u::get()
765 return m_impl.m_value1;
766 ossia_do_throw(std::runtime_error,
"color_u: bad type");
769 inline ossia::rgb_u& color_u::get()
772 return m_impl.m_value2;
773 ossia_do_throw(std::runtime_error,
"color_u: bad type");
776 inline ossia::bgr_u& color_u::get()
779 return m_impl.m_value3;
780 ossia_do_throw(std::runtime_error,
"color_u: bad type");
783 inline ossia::argb8_u& color_u::get()
786 return m_impl.m_value4;
787 ossia_do_throw(std::runtime_error,
"color_u: bad type");
790 inline ossia::rgba8_u& color_u::get()
793 return m_impl.m_value5;
794 ossia_do_throw(std::runtime_error,
"color_u: bad type");
797 inline ossia::hsv_u& color_u::get()
800 return m_impl.m_value6;
801 ossia_do_throw(std::runtime_error,
"color_u: bad type");
804 inline ossia::cmy8_u& color_u::get()
807 return m_impl.m_value7;
808 ossia_do_throw(std::runtime_error,
"color_u: bad type");
811 inline ossia::xyz_u& color_u::get()
814 return m_impl.m_value8;
815 ossia_do_throw(std::runtime_error,
"color_u: bad type");
817 template <
typename Visitor>
818 auto apply_nonnull(Visitor&& functor,
const color_u& var)
822 case color_u::Type::Type0:
823 return functor(var.m_impl.m_value0);
824 case color_u::Type::Type1:
825 return functor(var.m_impl.m_value1);
826 case color_u::Type::Type2:
827 return functor(var.m_impl.m_value2);
828 case color_u::Type::Type3:
829 return functor(var.m_impl.m_value3);
830 case color_u::Type::Type4:
831 return functor(var.m_impl.m_value4);
832 case color_u::Type::Type5:
833 return functor(var.m_impl.m_value5);
834 case color_u::Type::Type6:
835 return functor(var.m_impl.m_value6);
836 case color_u::Type::Type7:
837 return functor(var.m_impl.m_value7);
838 case color_u::Type::Type8:
839 return functor(var.m_impl.m_value8);
841 ossia_do_throw(std::runtime_error,
"color_u: bad type");
844 template <
typename Visitor>
845 auto apply_nonnull(Visitor&& functor, color_u& var)
849 case color_u::Type::Type0:
850 return functor(var.m_impl.m_value0);
851 case color_u::Type::Type1:
852 return functor(var.m_impl.m_value1);
853 case color_u::Type::Type2:
854 return functor(var.m_impl.m_value2);
855 case color_u::Type::Type3:
856 return functor(var.m_impl.m_value3);
857 case color_u::Type::Type4:
858 return functor(var.m_impl.m_value4);
859 case color_u::Type::Type5:
860 return functor(var.m_impl.m_value5);
861 case color_u::Type::Type6:
862 return functor(var.m_impl.m_value6);
863 case color_u::Type::Type7:
864 return functor(var.m_impl.m_value7);
865 case color_u::Type::Type8:
866 return functor(var.m_impl.m_value8);
868 ossia_do_throw(std::runtime_error,
"color_u: bad type");
871 template <
typename Visitor>
872 auto apply_nonnull(Visitor&& functor, color_u&& var)
876 case color_u::Type::Type0:
877 return functor(std::move(var.m_impl.m_value0));
878 case color_u::Type::Type1:
879 return functor(std::move(var.m_impl.m_value1));
880 case color_u::Type::Type2:
881 return functor(std::move(var.m_impl.m_value2));
882 case color_u::Type::Type3:
883 return functor(std::move(var.m_impl.m_value3));
884 case color_u::Type::Type4:
885 return functor(std::move(var.m_impl.m_value4));
886 case color_u::Type::Type5:
887 return functor(std::move(var.m_impl.m_value5));
888 case color_u::Type::Type6:
889 return functor(std::move(var.m_impl.m_value6));
890 case color_u::Type::Type7:
891 return functor(std::move(var.m_impl.m_value7));
892 case color_u::Type::Type8:
893 return functor(std::move(var.m_impl.m_value8));
895 ossia_do_throw(std::runtime_error,
"color_u: bad type");
898 template <
typename Visitor>
899 auto apply(Visitor&& functor,
const color_u& var)
903 case color_u::Type::Type0:
904 return functor(var.m_impl.m_value0);
905 case color_u::Type::Type1:
906 return functor(var.m_impl.m_value1);
907 case color_u::Type::Type2:
908 return functor(var.m_impl.m_value2);
909 case color_u::Type::Type3:
910 return functor(var.m_impl.m_value3);
911 case color_u::Type::Type4:
912 return functor(var.m_impl.m_value4);
913 case color_u::Type::Type5:
914 return functor(var.m_impl.m_value5);
915 case color_u::Type::Type6:
916 return functor(var.m_impl.m_value6);
917 case color_u::Type::Type7:
918 return functor(var.m_impl.m_value7);
919 case color_u::Type::Type8:
920 return functor(var.m_impl.m_value8);
925 template <
typename Visitor>
926 auto apply(Visitor&& functor, color_u& var)
930 case color_u::Type::Type0:
931 return functor(var.m_impl.m_value0);
932 case color_u::Type::Type1:
933 return functor(var.m_impl.m_value1);
934 case color_u::Type::Type2:
935 return functor(var.m_impl.m_value2);
936 case color_u::Type::Type3:
937 return functor(var.m_impl.m_value3);
938 case color_u::Type::Type4:
939 return functor(var.m_impl.m_value4);
940 case color_u::Type::Type5:
941 return functor(var.m_impl.m_value5);
942 case color_u::Type::Type6:
943 return functor(var.m_impl.m_value6);
944 case color_u::Type::Type7:
945 return functor(var.m_impl.m_value7);
946 case color_u::Type::Type8:
947 return functor(var.m_impl.m_value8);
952 template <
typename Visitor>
953 auto apply(Visitor&& functor, color_u&& var)
957 case color_u::Type::Type0:
958 return functor(std::move(var.m_impl.m_value0));
959 case color_u::Type::Type1:
960 return functor(std::move(var.m_impl.m_value1));
961 case color_u::Type::Type2:
962 return functor(std::move(var.m_impl.m_value2));
963 case color_u::Type::Type3:
964 return functor(std::move(var.m_impl.m_value3));
965 case color_u::Type::Type4:
966 return functor(std::move(var.m_impl.m_value4));
967 case color_u::Type::Type5:
968 return functor(std::move(var.m_impl.m_value5));
969 case color_u::Type::Type6:
970 return functor(std::move(var.m_impl.m_value6));
971 case color_u::Type::Type7:
972 return functor(std::move(var.m_impl.m_value7));
973 case color_u::Type::Type8:
974 return functor(std::move(var.m_impl.m_value8));
979 inline bool operator==(
const color_u& lhs,
const color_u& rhs)
981 return (lhs.m_type == rhs.m_type);
983 inline bool operator!=(
const color_u& lhs,
const color_u& rhs)
985 return (lhs.m_type != rhs.m_type);
987 inline bool operator==(
const color_u& lhs,
const ossia::argb_u& rhs)
989 return (lhs.m_type == color_u::Type::Type0);
991 inline bool operator==(
const ossia::argb_u& lhs,
const color_u& rhs)
993 return (rhs.m_type == color_u::Type::Type0);
995 inline bool operator!=(
const color_u& lhs,
const ossia::argb_u& rhs)
997 return (lhs.m_type != color_u::Type::Type0);
999 inline bool operator!=(
const ossia::argb_u& lhs,
const color_u& rhs)
1001 return (rhs.m_type != color_u::Type::Type0);
1003 inline bool operator==(
const color_u& lhs,
const ossia::rgba_u& rhs)
1005 return (lhs.m_type == color_u::Type::Type1);
1007 inline bool operator==(
const ossia::rgba_u& lhs,
const color_u& rhs)
1009 return (rhs.m_type == color_u::Type::Type1);
1011 inline bool operator!=(
const color_u& lhs,
const ossia::rgba_u& rhs)
1013 return (lhs.m_type != color_u::Type::Type1);
1015 inline bool operator!=(
const ossia::rgba_u& lhs,
const color_u& rhs)
1017 return (rhs.m_type != color_u::Type::Type1);
1019 inline bool operator==(
const color_u& lhs,
const ossia::rgb_u& rhs)
1021 return (lhs.m_type == color_u::Type::Type2);
1023 inline bool operator==(
const ossia::rgb_u& lhs,
const color_u& rhs)
1025 return (rhs.m_type == color_u::Type::Type2);
1027 inline bool operator!=(
const color_u& lhs,
const ossia::rgb_u& rhs)
1029 return (lhs.m_type != color_u::Type::Type2);
1031 inline bool operator!=(
const ossia::rgb_u& lhs,
const color_u& rhs)
1033 return (rhs.m_type != color_u::Type::Type2);
1035 inline bool operator==(
const color_u& lhs,
const ossia::bgr_u& rhs)
1037 return (lhs.m_type == color_u::Type::Type3);
1039 inline bool operator==(
const ossia::bgr_u& lhs,
const color_u& rhs)
1041 return (rhs.m_type == color_u::Type::Type3);
1043 inline bool operator!=(
const color_u& lhs,
const ossia::bgr_u& rhs)
1045 return (lhs.m_type != color_u::Type::Type3);
1047 inline bool operator!=(
const ossia::bgr_u& lhs,
const color_u& rhs)
1049 return (rhs.m_type != color_u::Type::Type3);
1051 inline bool operator==(
const color_u& lhs,
const ossia::argb8_u& rhs)
1053 return (lhs.m_type == color_u::Type::Type4);
1055 inline bool operator==(
const ossia::argb8_u& lhs,
const color_u& rhs)
1057 return (rhs.m_type == color_u::Type::Type4);
1059 inline bool operator!=(
const color_u& lhs,
const ossia::argb8_u& rhs)
1061 return (lhs.m_type != color_u::Type::Type4);
1063 inline bool operator!=(
const ossia::argb8_u& lhs,
const color_u& rhs)
1065 return (rhs.m_type != color_u::Type::Type4);
1067 inline bool operator==(
const color_u& lhs,
const ossia::rgba8_u& rhs)
1069 return (lhs.m_type == color_u::Type::Type5);
1071 inline bool operator==(
const ossia::rgba8_u& lhs,
const color_u& rhs)
1073 return (rhs.m_type == color_u::Type::Type5);
1075 inline bool operator!=(
const color_u& lhs,
const ossia::rgba8_u& rhs)
1077 return (lhs.m_type != color_u::Type::Type5);
1079 inline bool operator!=(
const ossia::rgba8_u& lhs,
const color_u& rhs)
1081 return (rhs.m_type != color_u::Type::Type5);
1083 inline bool operator==(
const color_u& lhs,
const ossia::hsv_u& rhs)
1085 return (lhs.m_type == color_u::Type::Type6);
1087 inline bool operator==(
const ossia::hsv_u& lhs,
const color_u& rhs)
1089 return (rhs.m_type == color_u::Type::Type6);
1091 inline bool operator!=(
const color_u& lhs,
const ossia::hsv_u& rhs)
1093 return (lhs.m_type != color_u::Type::Type6);
1095 inline bool operator!=(
const ossia::hsv_u& lhs,
const color_u& rhs)
1097 return (rhs.m_type != color_u::Type::Type6);
1099 inline bool operator==(
const color_u& lhs,
const ossia::cmy8_u& rhs)
1101 return (lhs.m_type == color_u::Type::Type7);
1103 inline bool operator==(
const ossia::cmy8_u& lhs,
const color_u& rhs)
1105 return (rhs.m_type == color_u::Type::Type7);
1107 inline bool operator!=(
const color_u& lhs,
const ossia::cmy8_u& rhs)
1109 return (lhs.m_type != color_u::Type::Type7);
1111 inline bool operator!=(
const ossia::cmy8_u& lhs,
const color_u& rhs)
1113 return (rhs.m_type != color_u::Type::Type7);
1115 inline bool operator==(
const color_u& lhs,
const ossia::xyz_u& rhs)
1117 return (lhs.m_type == color_u::Type::Type8);
1119 inline bool operator==(
const ossia::xyz_u& lhs,
const color_u& rhs)
1121 return (rhs.m_type == color_u::Type::Type8);
1123 inline bool operator!=(
const color_u& lhs,
const ossia::xyz_u& rhs)
1125 return (lhs.m_type != color_u::Type::Type8);
1127 inline bool operator!=(
const ossia::xyz_u& lhs,
const color_u& rhs)
1129 return (rhs.m_type != color_u::Type::Type8);
1139 ossia::meter_u m_value0;
1141 ossia::kilometer_u m_value1;
1143 ossia::decimeter_u m_value2;
1145 ossia::centimeter_u m_value3;
1147 ossia::millimeter_u m_value4;
1149 ossia::micrometer_u m_value5;
1151 ossia::nanometer_u m_value6;
1153 ossia::picometer_u m_value7;
1155 ossia::inch_u m_value8;
1157 ossia::foot_u m_value9;
1159 ossia::mile_u m_value10;
1189 static const constexpr
auto npos = Npos;
1190 int which()
const {
return m_type; }
1192 operator bool()
const {
return m_type != npos; }
1193 template <
typename T>
1194 const T* target()
const;
1195 template <
typename T>
1197 template <
typename T>
1198 const T& get()
const;
1199 template <
typename T>
1202 template <
typename T>
1208 ~distance_u() =
default;
1209 distance_u(ossia::meter_u v)
1212 new(&m_impl.m_value0) ossia::meter_u{v};
1214 distance_u(ossia::kilometer_u v)
1217 new(&m_impl.m_value1) ossia::kilometer_u{v};
1219 distance_u(ossia::decimeter_u v)
1222 new(&m_impl.m_value2) ossia::decimeter_u{v};
1224 distance_u(ossia::centimeter_u v)
1227 new(&m_impl.m_value3) ossia::centimeter_u{v};
1229 distance_u(ossia::millimeter_u v)
1232 new(&m_impl.m_value4) ossia::millimeter_u{v};
1234 distance_u(ossia::micrometer_u v)
1237 new(&m_impl.m_value5) ossia::micrometer_u{v};
1239 distance_u(ossia::nanometer_u v)
1242 new(&m_impl.m_value6) ossia::nanometer_u{v};
1244 distance_u(ossia::picometer_u v)
1247 new(&m_impl.m_value7) ossia::picometer_u{v};
1249 distance_u(ossia::inch_u v)
1252 new(&m_impl.m_value8) ossia::inch_u{v};
1254 distance_u(ossia::foot_u v)
1257 new(&m_impl.m_value9) ossia::foot_u{v};
1259 distance_u(ossia::mile_u v)
1262 new(&m_impl.m_value10) ossia::mile_u{v};
1264 distance_u(
const distance_u& other)
1265 : m_type{other.m_type}
1270 new(&m_impl.m_value0) ossia::meter_u{other.m_impl.m_value0};
1273 new(&m_impl.m_value1) ossia::kilometer_u{other.m_impl.m_value1};
1276 new(&m_impl.m_value2) ossia::decimeter_u{other.m_impl.m_value2};
1279 new(&m_impl.m_value3) ossia::centimeter_u{other.m_impl.m_value3};
1282 new(&m_impl.m_value4) ossia::millimeter_u{other.m_impl.m_value4};
1285 new(&m_impl.m_value5) ossia::micrometer_u{other.m_impl.m_value5};
1288 new(&m_impl.m_value6) ossia::nanometer_u{other.m_impl.m_value6};
1291 new(&m_impl.m_value7) ossia::picometer_u{other.m_impl.m_value7};
1294 new(&m_impl.m_value8) ossia::inch_u{other.m_impl.m_value8};
1297 new(&m_impl.m_value9) ossia::foot_u{other.m_impl.m_value9};
1300 new(&m_impl.m_value10) ossia::mile_u{other.m_impl.m_value10};
1306 distance_u(distance_u&& other) noexcept
1307 : m_type{other.m_type}
1312 new(&m_impl.m_value0) ossia::meter_u{std::move(other.m_impl.m_value0)};
1315 new(&m_impl.m_value1) ossia::kilometer_u{std::move(other.m_impl.m_value1)};
1318 new(&m_impl.m_value2) ossia::decimeter_u{std::move(other.m_impl.m_value2)};
1321 new(&m_impl.m_value3) ossia::centimeter_u{std::move(other.m_impl.m_value3)};
1324 new(&m_impl.m_value4) ossia::millimeter_u{std::move(other.m_impl.m_value4)};
1327 new(&m_impl.m_value5) ossia::micrometer_u{std::move(other.m_impl.m_value5)};
1330 new(&m_impl.m_value6) ossia::nanometer_u{std::move(other.m_impl.m_value6)};
1333 new(&m_impl.m_value7) ossia::picometer_u{std::move(other.m_impl.m_value7)};
1336 new(&m_impl.m_value8) ossia::inch_u{std::move(other.m_impl.m_value8)};
1339 new(&m_impl.m_value9) ossia::foot_u{std::move(other.m_impl.m_value9)};
1342 new(&m_impl.m_value10) ossia::mile_u{std::move(other.m_impl.m_value10)};
1348 distance_u& operator=(
const distance_u& other)
1351 m_type = other.m_type;
1355 new(&m_impl.m_value0) ossia::meter_u{other.m_impl.m_value0};
1358 new(&m_impl.m_value1) ossia::kilometer_u{other.m_impl.m_value1};
1361 new(&m_impl.m_value2) ossia::decimeter_u{other.m_impl.m_value2};
1364 new(&m_impl.m_value3) ossia::centimeter_u{other.m_impl.m_value3};
1367 new(&m_impl.m_value4) ossia::millimeter_u{other.m_impl.m_value4};
1370 new(&m_impl.m_value5) ossia::micrometer_u{other.m_impl.m_value5};
1373 new(&m_impl.m_value6) ossia::nanometer_u{other.m_impl.m_value6};
1376 new(&m_impl.m_value7) ossia::picometer_u{other.m_impl.m_value7};
1379 new(&m_impl.m_value8) ossia::inch_u{other.m_impl.m_value8};
1382 new(&m_impl.m_value9) ossia::foot_u{other.m_impl.m_value9};
1385 new(&m_impl.m_value10) ossia::mile_u{other.m_impl.m_value10};
1392 distance_u& operator=(distance_u&& other) noexcept
1395 m_type = other.m_type;
1399 new(&m_impl.m_value0) ossia::meter_u{std::move(other.m_impl.m_value0)};
1402 new(&m_impl.m_value1) ossia::kilometer_u{std::move(other.m_impl.m_value1)};
1405 new(&m_impl.m_value2) ossia::decimeter_u{std::move(other.m_impl.m_value2)};
1408 new(&m_impl.m_value3) ossia::centimeter_u{std::move(other.m_impl.m_value3)};
1411 new(&m_impl.m_value4) ossia::millimeter_u{std::move(other.m_impl.m_value4)};
1414 new(&m_impl.m_value5) ossia::micrometer_u{std::move(other.m_impl.m_value5)};
1417 new(&m_impl.m_value6) ossia::nanometer_u{std::move(other.m_impl.m_value6)};
1420 new(&m_impl.m_value7) ossia::picometer_u{std::move(other.m_impl.m_value7)};
1423 new(&m_impl.m_value8) ossia::inch_u{std::move(other.m_impl.m_value8)};
1426 new(&m_impl.m_value9) ossia::foot_u{std::move(other.m_impl.m_value9)};
1429 new(&m_impl.m_value10) ossia::mile_u{std::move(other.m_impl.m_value10)};
1438 inline const ossia::meter_u* distance_u::target()
const
1441 return &m_impl.m_value0;
1445 inline const ossia::kilometer_u* distance_u::target()
const
1448 return &m_impl.m_value1;
1452 inline const ossia::decimeter_u* distance_u::target()
const
1455 return &m_impl.m_value2;
1459 inline const ossia::centimeter_u* distance_u::target()
const
1462 return &m_impl.m_value3;
1466 inline const ossia::millimeter_u* distance_u::target()
const
1469 return &m_impl.m_value4;
1473 inline const ossia::micrometer_u* distance_u::target()
const
1476 return &m_impl.m_value5;
1480 inline const ossia::nanometer_u* distance_u::target()
const
1483 return &m_impl.m_value6;
1487 inline const ossia::picometer_u* distance_u::target()
const
1490 return &m_impl.m_value7;
1494 inline const ossia::inch_u* distance_u::target()
const
1497 return &m_impl.m_value8;
1501 inline const ossia::foot_u* distance_u::target()
const
1504 return &m_impl.m_value9;
1508 inline const ossia::mile_u* distance_u::target()
const
1510 if(m_type == Type10)
1511 return &m_impl.m_value10;
1515 inline ossia::meter_u* distance_u::target()
1518 return &m_impl.m_value0;
1522 inline ossia::kilometer_u* distance_u::target()
1525 return &m_impl.m_value1;
1529 inline ossia::decimeter_u* distance_u::target()
1532 return &m_impl.m_value2;
1536 inline ossia::centimeter_u* distance_u::target()
1539 return &m_impl.m_value3;
1543 inline ossia::millimeter_u* distance_u::target()
1546 return &m_impl.m_value4;
1550 inline ossia::micrometer_u* distance_u::target()
1553 return &m_impl.m_value5;
1557 inline ossia::nanometer_u* distance_u::target()
1560 return &m_impl.m_value6;
1564 inline ossia::picometer_u* distance_u::target()
1567 return &m_impl.m_value7;
1571 inline ossia::inch_u* distance_u::target()
1574 return &m_impl.m_value8;
1578 inline ossia::foot_u* distance_u::target()
1581 return &m_impl.m_value9;
1585 inline ossia::mile_u* distance_u::target()
1587 if(m_type == Type10)
1588 return &m_impl.m_value10;
1592 inline const ossia::meter_u& distance_u::get()
const
1595 return m_impl.m_value0;
1596 ossia_do_throw(std::runtime_error,
"distance_u: bad type");
1599 inline const ossia::kilometer_u& distance_u::get()
const
1602 return m_impl.m_value1;
1603 ossia_do_throw(std::runtime_error,
"distance_u: bad type");
1606 inline const ossia::decimeter_u& distance_u::get()
const
1609 return m_impl.m_value2;
1610 ossia_do_throw(std::runtime_error,
"distance_u: bad type");
1613 inline const ossia::centimeter_u& distance_u::get()
const
1616 return m_impl.m_value3;
1617 ossia_do_throw(std::runtime_error,
"distance_u: bad type");
1620 inline const ossia::millimeter_u& distance_u::get()
const
1623 return m_impl.m_value4;
1624 ossia_do_throw(std::runtime_error,
"distance_u: bad type");
1627 inline const ossia::micrometer_u& distance_u::get()
const
1630 return m_impl.m_value5;
1631 ossia_do_throw(std::runtime_error,
"distance_u: bad type");
1634 inline const ossia::nanometer_u& distance_u::get()
const
1637 return m_impl.m_value6;
1638 ossia_do_throw(std::runtime_error,
"distance_u: bad type");
1641 inline const ossia::picometer_u& distance_u::get()
const
1644 return m_impl.m_value7;
1645 ossia_do_throw(std::runtime_error,
"distance_u: bad type");
1648 inline const ossia::inch_u& distance_u::get()
const
1651 return m_impl.m_value8;
1652 ossia_do_throw(std::runtime_error,
"distance_u: bad type");
1655 inline const ossia::foot_u& distance_u::get()
const
1658 return m_impl.m_value9;
1659 ossia_do_throw(std::runtime_error,
"distance_u: bad type");
1662 inline const ossia::mile_u& distance_u::get()
const
1664 if(m_type == Type10)
1665 return m_impl.m_value10;
1666 ossia_do_throw(std::runtime_error,
"distance_u: bad type");
1669 inline ossia::meter_u& distance_u::get()
1672 return m_impl.m_value0;
1673 ossia_do_throw(std::runtime_error,
"distance_u: bad type");
1676 inline ossia::kilometer_u& distance_u::get()
1679 return m_impl.m_value1;
1680 ossia_do_throw(std::runtime_error,
"distance_u: bad type");
1683 inline ossia::decimeter_u& distance_u::get()
1686 return m_impl.m_value2;
1687 ossia_do_throw(std::runtime_error,
"distance_u: bad type");
1690 inline ossia::centimeter_u& distance_u::get()
1693 return m_impl.m_value3;
1694 ossia_do_throw(std::runtime_error,
"distance_u: bad type");
1697 inline ossia::millimeter_u& distance_u::get()
1700 return m_impl.m_value4;
1701 ossia_do_throw(std::runtime_error,
"distance_u: bad type");
1704 inline ossia::micrometer_u& distance_u::get()
1707 return m_impl.m_value5;
1708 ossia_do_throw(std::runtime_error,
"distance_u: bad type");
1711 inline ossia::nanometer_u& distance_u::get()
1714 return m_impl.m_value6;
1715 ossia_do_throw(std::runtime_error,
"distance_u: bad type");
1718 inline ossia::picometer_u& distance_u::get()
1721 return m_impl.m_value7;
1722 ossia_do_throw(std::runtime_error,
"distance_u: bad type");
1725 inline ossia::inch_u& distance_u::get()
1728 return m_impl.m_value8;
1729 ossia_do_throw(std::runtime_error,
"distance_u: bad type");
1732 inline ossia::foot_u& distance_u::get()
1735 return m_impl.m_value9;
1736 ossia_do_throw(std::runtime_error,
"distance_u: bad type");
1739 inline ossia::mile_u& distance_u::get()
1741 if(m_type == Type10)
1742 return m_impl.m_value10;
1743 ossia_do_throw(std::runtime_error,
"distance_u: bad type");
1745 template <
typename Visitor>
1746 auto apply_nonnull(Visitor&& functor,
const distance_u& var)
1750 case distance_u::Type::Type0:
1751 return functor(var.m_impl.m_value0);
1752 case distance_u::Type::Type1:
1753 return functor(var.m_impl.m_value1);
1754 case distance_u::Type::Type2:
1755 return functor(var.m_impl.m_value2);
1756 case distance_u::Type::Type3:
1757 return functor(var.m_impl.m_value3);
1758 case distance_u::Type::Type4:
1759 return functor(var.m_impl.m_value4);
1760 case distance_u::Type::Type5:
1761 return functor(var.m_impl.m_value5);
1762 case distance_u::Type::Type6:
1763 return functor(var.m_impl.m_value6);
1764 case distance_u::Type::Type7:
1765 return functor(var.m_impl.m_value7);
1766 case distance_u::Type::Type8:
1767 return functor(var.m_impl.m_value8);
1768 case distance_u::Type::Type9:
1769 return functor(var.m_impl.m_value9);
1770 case distance_u::Type::Type10:
1771 return functor(var.m_impl.m_value10);
1773 ossia_do_throw(std::runtime_error,
"distance_u: bad type");
1776 template <
typename Visitor>
1777 auto apply_nonnull(Visitor&& functor, distance_u& var)
1781 case distance_u::Type::Type0:
1782 return functor(var.m_impl.m_value0);
1783 case distance_u::Type::Type1:
1784 return functor(var.m_impl.m_value1);
1785 case distance_u::Type::Type2:
1786 return functor(var.m_impl.m_value2);
1787 case distance_u::Type::Type3:
1788 return functor(var.m_impl.m_value3);
1789 case distance_u::Type::Type4:
1790 return functor(var.m_impl.m_value4);
1791 case distance_u::Type::Type5:
1792 return functor(var.m_impl.m_value5);
1793 case distance_u::Type::Type6:
1794 return functor(var.m_impl.m_value6);
1795 case distance_u::Type::Type7:
1796 return functor(var.m_impl.m_value7);
1797 case distance_u::Type::Type8:
1798 return functor(var.m_impl.m_value8);
1799 case distance_u::Type::Type9:
1800 return functor(var.m_impl.m_value9);
1801 case distance_u::Type::Type10:
1802 return functor(var.m_impl.m_value10);
1804 ossia_do_throw(std::runtime_error,
"distance_u: bad type");
1807 template <
typename Visitor>
1808 auto apply_nonnull(Visitor&& functor, distance_u&& var)
1812 case distance_u::Type::Type0:
1813 return functor(std::move(var.m_impl.m_value0));
1814 case distance_u::Type::Type1:
1815 return functor(std::move(var.m_impl.m_value1));
1816 case distance_u::Type::Type2:
1817 return functor(std::move(var.m_impl.m_value2));
1818 case distance_u::Type::Type3:
1819 return functor(std::move(var.m_impl.m_value3));
1820 case distance_u::Type::Type4:
1821 return functor(std::move(var.m_impl.m_value4));
1822 case distance_u::Type::Type5:
1823 return functor(std::move(var.m_impl.m_value5));
1824 case distance_u::Type::Type6:
1825 return functor(std::move(var.m_impl.m_value6));
1826 case distance_u::Type::Type7:
1827 return functor(std::move(var.m_impl.m_value7));
1828 case distance_u::Type::Type8:
1829 return functor(std::move(var.m_impl.m_value8));
1830 case distance_u::Type::Type9:
1831 return functor(std::move(var.m_impl.m_value9));
1832 case distance_u::Type::Type10:
1833 return functor(std::move(var.m_impl.m_value10));
1835 ossia_do_throw(std::runtime_error,
"distance_u: bad type");
1838 template <
typename Visitor>
1839 auto apply(Visitor&& functor,
const distance_u& var)
1843 case distance_u::Type::Type0:
1844 return functor(var.m_impl.m_value0);
1845 case distance_u::Type::Type1:
1846 return functor(var.m_impl.m_value1);
1847 case distance_u::Type::Type2:
1848 return functor(var.m_impl.m_value2);
1849 case distance_u::Type::Type3:
1850 return functor(var.m_impl.m_value3);
1851 case distance_u::Type::Type4:
1852 return functor(var.m_impl.m_value4);
1853 case distance_u::Type::Type5:
1854 return functor(var.m_impl.m_value5);
1855 case distance_u::Type::Type6:
1856 return functor(var.m_impl.m_value6);
1857 case distance_u::Type::Type7:
1858 return functor(var.m_impl.m_value7);
1859 case distance_u::Type::Type8:
1860 return functor(var.m_impl.m_value8);
1861 case distance_u::Type::Type9:
1862 return functor(var.m_impl.m_value9);
1863 case distance_u::Type::Type10:
1864 return functor(var.m_impl.m_value10);
1869 template <
typename Visitor>
1870 auto apply(Visitor&& functor, distance_u& var)
1874 case distance_u::Type::Type0:
1875 return functor(var.m_impl.m_value0);
1876 case distance_u::Type::Type1:
1877 return functor(var.m_impl.m_value1);
1878 case distance_u::Type::Type2:
1879 return functor(var.m_impl.m_value2);
1880 case distance_u::Type::Type3:
1881 return functor(var.m_impl.m_value3);
1882 case distance_u::Type::Type4:
1883 return functor(var.m_impl.m_value4);
1884 case distance_u::Type::Type5:
1885 return functor(var.m_impl.m_value5);
1886 case distance_u::Type::Type6:
1887 return functor(var.m_impl.m_value6);
1888 case distance_u::Type::Type7:
1889 return functor(var.m_impl.m_value7);
1890 case distance_u::Type::Type8:
1891 return functor(var.m_impl.m_value8);
1892 case distance_u::Type::Type9:
1893 return functor(var.m_impl.m_value9);
1894 case distance_u::Type::Type10:
1895 return functor(var.m_impl.m_value10);
1900 template <
typename Visitor>
1901 auto apply(Visitor&& functor, distance_u&& var)
1905 case distance_u::Type::Type0:
1906 return functor(std::move(var.m_impl.m_value0));
1907 case distance_u::Type::Type1:
1908 return functor(std::move(var.m_impl.m_value1));
1909 case distance_u::Type::Type2:
1910 return functor(std::move(var.m_impl.m_value2));
1911 case distance_u::Type::Type3:
1912 return functor(std::move(var.m_impl.m_value3));
1913 case distance_u::Type::Type4:
1914 return functor(std::move(var.m_impl.m_value4));
1915 case distance_u::Type::Type5:
1916 return functor(std::move(var.m_impl.m_value5));
1917 case distance_u::Type::Type6:
1918 return functor(std::move(var.m_impl.m_value6));
1919 case distance_u::Type::Type7:
1920 return functor(std::move(var.m_impl.m_value7));
1921 case distance_u::Type::Type8:
1922 return functor(std::move(var.m_impl.m_value8));
1923 case distance_u::Type::Type9:
1924 return functor(std::move(var.m_impl.m_value9));
1925 case distance_u::Type::Type10:
1926 return functor(std::move(var.m_impl.m_value10));
1931 inline bool operator==(
const distance_u& lhs,
const distance_u& rhs)
1933 return (lhs.m_type == rhs.m_type);
1935 inline bool operator!=(
const distance_u& lhs,
const distance_u& rhs)
1937 return (lhs.m_type != rhs.m_type);
1939 inline bool operator==(
const distance_u& lhs,
const ossia::meter_u& rhs)
1941 return (lhs.m_type == distance_u::Type::Type0);
1943 inline bool operator==(
const ossia::meter_u& lhs,
const distance_u& rhs)
1945 return (rhs.m_type == distance_u::Type::Type0);
1947 inline bool operator!=(
const distance_u& lhs,
const ossia::meter_u& rhs)
1949 return (lhs.m_type != distance_u::Type::Type0);
1951 inline bool operator!=(
const ossia::meter_u& lhs,
const distance_u& rhs)
1953 return (rhs.m_type != distance_u::Type::Type0);
1955 inline bool operator==(
const distance_u& lhs,
const ossia::kilometer_u& rhs)
1957 return (lhs.m_type == distance_u::Type::Type1);
1959 inline bool operator==(
const ossia::kilometer_u& lhs,
const distance_u& rhs)
1961 return (rhs.m_type == distance_u::Type::Type1);
1963 inline bool operator!=(
const distance_u& lhs,
const ossia::kilometer_u& rhs)
1965 return (lhs.m_type != distance_u::Type::Type1);
1967 inline bool operator!=(
const ossia::kilometer_u& lhs,
const distance_u& rhs)
1969 return (rhs.m_type != distance_u::Type::Type1);
1971 inline bool operator==(
const distance_u& lhs,
const ossia::decimeter_u& rhs)
1973 return (lhs.m_type == distance_u::Type::Type2);
1975 inline bool operator==(
const ossia::decimeter_u& lhs,
const distance_u& rhs)
1977 return (rhs.m_type == distance_u::Type::Type2);
1979 inline bool operator!=(
const distance_u& lhs,
const ossia::decimeter_u& rhs)
1981 return (lhs.m_type != distance_u::Type::Type2);
1983 inline bool operator!=(
const ossia::decimeter_u& lhs,
const distance_u& rhs)
1985 return (rhs.m_type != distance_u::Type::Type2);
1987 inline bool operator==(
const distance_u& lhs,
const ossia::centimeter_u& rhs)
1989 return (lhs.m_type == distance_u::Type::Type3);
1991 inline bool operator==(
const ossia::centimeter_u& lhs,
const distance_u& rhs)
1993 return (rhs.m_type == distance_u::Type::Type3);
1995 inline bool operator!=(
const distance_u& lhs,
const ossia::centimeter_u& rhs)
1997 return (lhs.m_type != distance_u::Type::Type3);
1999 inline bool operator!=(
const ossia::centimeter_u& lhs,
const distance_u& rhs)
2001 return (rhs.m_type != distance_u::Type::Type3);
2003 inline bool operator==(
const distance_u& lhs,
const ossia::millimeter_u& rhs)
2005 return (lhs.m_type == distance_u::Type::Type4);
2007 inline bool operator==(
const ossia::millimeter_u& lhs,
const distance_u& rhs)
2009 return (rhs.m_type == distance_u::Type::Type4);
2011 inline bool operator!=(
const distance_u& lhs,
const ossia::millimeter_u& rhs)
2013 return (lhs.m_type != distance_u::Type::Type4);
2015 inline bool operator!=(
const ossia::millimeter_u& lhs,
const distance_u& rhs)
2017 return (rhs.m_type != distance_u::Type::Type4);
2019 inline bool operator==(
const distance_u& lhs,
const ossia::micrometer_u& rhs)
2021 return (lhs.m_type == distance_u::Type::Type5);
2023 inline bool operator==(
const ossia::micrometer_u& lhs,
const distance_u& rhs)
2025 return (rhs.m_type == distance_u::Type::Type5);
2027 inline bool operator!=(
const distance_u& lhs,
const ossia::micrometer_u& rhs)
2029 return (lhs.m_type != distance_u::Type::Type5);
2031 inline bool operator!=(
const ossia::micrometer_u& lhs,
const distance_u& rhs)
2033 return (rhs.m_type != distance_u::Type::Type5);
2035 inline bool operator==(
const distance_u& lhs,
const ossia::nanometer_u& rhs)
2037 return (lhs.m_type == distance_u::Type::Type6);
2039 inline bool operator==(
const ossia::nanometer_u& lhs,
const distance_u& rhs)
2041 return (rhs.m_type == distance_u::Type::Type6);
2043 inline bool operator!=(
const distance_u& lhs,
const ossia::nanometer_u& rhs)
2045 return (lhs.m_type != distance_u::Type::Type6);
2047 inline bool operator!=(
const ossia::nanometer_u& lhs,
const distance_u& rhs)
2049 return (rhs.m_type != distance_u::Type::Type6);
2051 inline bool operator==(
const distance_u& lhs,
const ossia::picometer_u& rhs)
2053 return (lhs.m_type == distance_u::Type::Type7);
2055 inline bool operator==(
const ossia::picometer_u& lhs,
const distance_u& rhs)
2057 return (rhs.m_type == distance_u::Type::Type7);
2059 inline bool operator!=(
const distance_u& lhs,
const ossia::picometer_u& rhs)
2061 return (lhs.m_type != distance_u::Type::Type7);
2063 inline bool operator!=(
const ossia::picometer_u& lhs,
const distance_u& rhs)
2065 return (rhs.m_type != distance_u::Type::Type7);
2067 inline bool operator==(
const distance_u& lhs,
const ossia::inch_u& rhs)
2069 return (lhs.m_type == distance_u::Type::Type8);
2071 inline bool operator==(
const ossia::inch_u& lhs,
const distance_u& rhs)
2073 return (rhs.m_type == distance_u::Type::Type8);
2075 inline bool operator!=(
const distance_u& lhs,
const ossia::inch_u& rhs)
2077 return (lhs.m_type != distance_u::Type::Type8);
2079 inline bool operator!=(
const ossia::inch_u& lhs,
const distance_u& rhs)
2081 return (rhs.m_type != distance_u::Type::Type8);
2083 inline bool operator==(
const distance_u& lhs,
const ossia::foot_u& rhs)
2085 return (lhs.m_type == distance_u::Type::Type9);
2087 inline bool operator==(
const ossia::foot_u& lhs,
const distance_u& rhs)
2089 return (rhs.m_type == distance_u::Type::Type9);
2091 inline bool operator!=(
const distance_u& lhs,
const ossia::foot_u& rhs)
2093 return (lhs.m_type != distance_u::Type::Type9);
2095 inline bool operator!=(
const ossia::foot_u& lhs,
const distance_u& rhs)
2097 return (rhs.m_type != distance_u::Type::Type9);
2099 inline bool operator==(
const distance_u& lhs,
const ossia::mile_u& rhs)
2101 return (lhs.m_type == distance_u::Type::Type10);
2103 inline bool operator==(
const ossia::mile_u& lhs,
const distance_u& rhs)
2105 return (rhs.m_type == distance_u::Type::Type10);
2107 inline bool operator!=(
const distance_u& lhs,
const ossia::mile_u& rhs)
2109 return (lhs.m_type != distance_u::Type::Type10);
2111 inline bool operator!=(
const ossia::mile_u& lhs,
const distance_u& rhs)
2113 return (rhs.m_type != distance_u::Type::Type10);
2123 ossia::linear_u m_value0;
2125 ossia::midigain_u m_value1;
2127 ossia::decibel_u m_value2;
2129 ossia::decibel_raw_u m_value3;
2152 static const constexpr
auto npos = Npos;
2153 int which()
const {
return m_type; }
2155 operator bool()
const {
return m_type != npos; }
2156 template <
typename T>
2157 const T* target()
const;
2158 template <
typename T>
2160 template <
typename T>
2161 const T& get()
const;
2162 template <
typename T>
2165 template <
typename T>
2171 ~gain_u() =
default;
2172 gain_u(ossia::linear_u v)
2175 new(&m_impl.m_value0) ossia::linear_u{v};
2177 gain_u(ossia::midigain_u v)
2180 new(&m_impl.m_value1) ossia::midigain_u{v};
2182 gain_u(ossia::decibel_u v)
2185 new(&m_impl.m_value2) ossia::decibel_u{v};
2187 gain_u(ossia::decibel_raw_u v)
2190 new(&m_impl.m_value3) ossia::decibel_raw_u{v};
2192 gain_u(
const gain_u& other)
2193 : m_type{other.m_type}
2198 new(&m_impl.m_value0) ossia::linear_u{other.m_impl.m_value0};
2201 new(&m_impl.m_value1) ossia::midigain_u{other.m_impl.m_value1};
2204 new(&m_impl.m_value2) ossia::decibel_u{other.m_impl.m_value2};
2207 new(&m_impl.m_value3) ossia::decibel_raw_u{other.m_impl.m_value3};
2213 gain_u(gain_u&& other) noexcept
2214 : m_type{other.m_type}
2219 new(&m_impl.m_value0) ossia::linear_u{std::move(other.m_impl.m_value0)};
2222 new(&m_impl.m_value1) ossia::midigain_u{std::move(other.m_impl.m_value1)};
2225 new(&m_impl.m_value2) ossia::decibel_u{std::move(other.m_impl.m_value2)};
2228 new(&m_impl.m_value3) ossia::decibel_raw_u{std::move(other.m_impl.m_value3)};
2234 gain_u& operator=(
const gain_u& other)
2237 m_type = other.m_type;
2241 new(&m_impl.m_value0) ossia::linear_u{other.m_impl.m_value0};
2244 new(&m_impl.m_value1) ossia::midigain_u{other.m_impl.m_value1};
2247 new(&m_impl.m_value2) ossia::decibel_u{other.m_impl.m_value2};
2250 new(&m_impl.m_value3) ossia::decibel_raw_u{other.m_impl.m_value3};
2257 gain_u& operator=(gain_u&& other) noexcept
2260 m_type = other.m_type;
2264 new(&m_impl.m_value0) ossia::linear_u{std::move(other.m_impl.m_value0)};
2267 new(&m_impl.m_value1) ossia::midigain_u{std::move(other.m_impl.m_value1)};
2270 new(&m_impl.m_value2) ossia::decibel_u{std::move(other.m_impl.m_value2)};
2273 new(&m_impl.m_value3) ossia::decibel_raw_u{std::move(other.m_impl.m_value3)};
2282 inline const ossia::linear_u* gain_u::target()
const
2285 return &m_impl.m_value0;
2289 inline const ossia::midigain_u* gain_u::target()
const
2292 return &m_impl.m_value1;
2296 inline const ossia::decibel_u* gain_u::target()
const
2299 return &m_impl.m_value2;
2303 inline const ossia::decibel_raw_u* gain_u::target()
const
2306 return &m_impl.m_value3;
2310 inline ossia::linear_u* gain_u::target()
2313 return &m_impl.m_value0;
2317 inline ossia::midigain_u* gain_u::target()
2320 return &m_impl.m_value1;
2324 inline ossia::decibel_u* gain_u::target()
2327 return &m_impl.m_value2;
2331 inline ossia::decibel_raw_u* gain_u::target()
2334 return &m_impl.m_value3;
2338 inline const ossia::linear_u& gain_u::get()
const
2341 return m_impl.m_value0;
2342 ossia_do_throw(std::runtime_error,
"gain_u: bad type");
2345 inline const ossia::midigain_u& gain_u::get()
const
2348 return m_impl.m_value1;
2349 ossia_do_throw(std::runtime_error,
"gain_u: bad type");
2352 inline const ossia::decibel_u& gain_u::get()
const
2355 return m_impl.m_value2;
2356 ossia_do_throw(std::runtime_error,
"gain_u: bad type");
2359 inline const ossia::decibel_raw_u& gain_u::get()
const
2362 return m_impl.m_value3;
2363 ossia_do_throw(std::runtime_error,
"gain_u: bad type");
2366 inline ossia::linear_u& gain_u::get()
2369 return m_impl.m_value0;
2370 ossia_do_throw(std::runtime_error,
"gain_u: bad type");
2373 inline ossia::midigain_u& gain_u::get()
2376 return m_impl.m_value1;
2377 ossia_do_throw(std::runtime_error,
"gain_u: bad type");
2380 inline ossia::decibel_u& gain_u::get()
2383 return m_impl.m_value2;
2384 ossia_do_throw(std::runtime_error,
"gain_u: bad type");
2387 inline ossia::decibel_raw_u& gain_u::get()
2390 return m_impl.m_value3;
2391 ossia_do_throw(std::runtime_error,
"gain_u: bad type");
2393 template <
typename Visitor>
2394 auto apply_nonnull(Visitor&& functor,
const gain_u& var)
2398 case gain_u::Type::Type0:
2399 return functor(var.m_impl.m_value0);
2400 case gain_u::Type::Type1:
2401 return functor(var.m_impl.m_value1);
2402 case gain_u::Type::Type2:
2403 return functor(var.m_impl.m_value2);
2404 case gain_u::Type::Type3:
2405 return functor(var.m_impl.m_value3);
2407 ossia_do_throw(std::runtime_error,
"gain_u: bad type");
2410 template <
typename Visitor>
2411 auto apply_nonnull(Visitor&& functor, gain_u& var)
2415 case gain_u::Type::Type0:
2416 return functor(var.m_impl.m_value0);
2417 case gain_u::Type::Type1:
2418 return functor(var.m_impl.m_value1);
2419 case gain_u::Type::Type2:
2420 return functor(var.m_impl.m_value2);
2421 case gain_u::Type::Type3:
2422 return functor(var.m_impl.m_value3);
2424 ossia_do_throw(std::runtime_error,
"gain_u: bad type");
2427 template <
typename Visitor>
2428 auto apply_nonnull(Visitor&& functor, gain_u&& var)
2432 case gain_u::Type::Type0:
2433 return functor(std::move(var.m_impl.m_value0));
2434 case gain_u::Type::Type1:
2435 return functor(std::move(var.m_impl.m_value1));
2436 case gain_u::Type::Type2:
2437 return functor(std::move(var.m_impl.m_value2));
2438 case gain_u::Type::Type3:
2439 return functor(std::move(var.m_impl.m_value3));
2441 ossia_do_throw(std::runtime_error,
"gain_u: bad type");
2444 template <
typename Visitor>
2445 auto apply(Visitor&& functor,
const gain_u& var)
2449 case gain_u::Type::Type0:
2450 return functor(var.m_impl.m_value0);
2451 case gain_u::Type::Type1:
2452 return functor(var.m_impl.m_value1);
2453 case gain_u::Type::Type2:
2454 return functor(var.m_impl.m_value2);
2455 case gain_u::Type::Type3:
2456 return functor(var.m_impl.m_value3);
2461 template <
typename Visitor>
2462 auto apply(Visitor&& functor, gain_u& var)
2466 case gain_u::Type::Type0:
2467 return functor(var.m_impl.m_value0);
2468 case gain_u::Type::Type1:
2469 return functor(var.m_impl.m_value1);
2470 case gain_u::Type::Type2:
2471 return functor(var.m_impl.m_value2);
2472 case gain_u::Type::Type3:
2473 return functor(var.m_impl.m_value3);
2478 template <
typename Visitor>
2479 auto apply(Visitor&& functor, gain_u&& var)
2483 case gain_u::Type::Type0:
2484 return functor(std::move(var.m_impl.m_value0));
2485 case gain_u::Type::Type1:
2486 return functor(std::move(var.m_impl.m_value1));
2487 case gain_u::Type::Type2:
2488 return functor(std::move(var.m_impl.m_value2));
2489 case gain_u::Type::Type3:
2490 return functor(std::move(var.m_impl.m_value3));
2495 inline bool operator==(
const gain_u& lhs,
const gain_u& rhs)
2497 return (lhs.m_type == rhs.m_type);
2499 inline bool operator!=(
const gain_u& lhs,
const gain_u& rhs)
2501 return (lhs.m_type != rhs.m_type);
2503 inline bool operator==(
const gain_u& lhs,
const ossia::linear_u& rhs)
2505 return (lhs.m_type == gain_u::Type::Type0);
2507 inline bool operator==(
const ossia::linear_u& lhs,
const gain_u& rhs)
2509 return (rhs.m_type == gain_u::Type::Type0);
2511 inline bool operator!=(
const gain_u& lhs,
const ossia::linear_u& rhs)
2513 return (lhs.m_type != gain_u::Type::Type0);
2515 inline bool operator!=(
const ossia::linear_u& lhs,
const gain_u& rhs)
2517 return (rhs.m_type != gain_u::Type::Type0);
2519 inline bool operator==(
const gain_u& lhs,
const ossia::midigain_u& rhs)
2521 return (lhs.m_type == gain_u::Type::Type1);
2523 inline bool operator==(
const ossia::midigain_u& lhs,
const gain_u& rhs)
2525 return (rhs.m_type == gain_u::Type::Type1);
2527 inline bool operator!=(
const gain_u& lhs,
const ossia::midigain_u& rhs)
2529 return (lhs.m_type != gain_u::Type::Type1);
2531 inline bool operator!=(
const ossia::midigain_u& lhs,
const gain_u& rhs)
2533 return (rhs.m_type != gain_u::Type::Type1);
2535 inline bool operator==(
const gain_u& lhs,
const ossia::decibel_u& rhs)
2537 return (lhs.m_type == gain_u::Type::Type2);
2539 inline bool operator==(
const ossia::decibel_u& lhs,
const gain_u& rhs)
2541 return (rhs.m_type == gain_u::Type::Type2);
2543 inline bool operator!=(
const gain_u& lhs,
const ossia::decibel_u& rhs)
2545 return (lhs.m_type != gain_u::Type::Type2);
2547 inline bool operator!=(
const ossia::decibel_u& lhs,
const gain_u& rhs)
2549 return (rhs.m_type != gain_u::Type::Type2);
2551 inline bool operator==(
const gain_u& lhs,
const ossia::decibel_raw_u& rhs)
2553 return (lhs.m_type == gain_u::Type::Type3);
2555 inline bool operator==(
const ossia::decibel_raw_u& lhs,
const gain_u& rhs)
2557 return (rhs.m_type == gain_u::Type::Type3);
2559 inline bool operator!=(
const gain_u& lhs,
const ossia::decibel_raw_u& rhs)
2561 return (lhs.m_type != gain_u::Type::Type3);
2563 inline bool operator!=(
const ossia::decibel_raw_u& lhs,
const gain_u& rhs)
2565 return (rhs.m_type != gain_u::Type::Type3);
2567 struct orientation_u
2575 ossia::quaternion_u m_value0;
2577 ossia::euler_u m_value1;
2579 ossia::axis_u m_value2;
2601 static const constexpr
auto npos = Npos;
2602 int which()
const {
return m_type; }
2604 operator bool()
const {
return m_type != npos; }
2605 template <
typename T>
2606 const T* target()
const;
2607 template <
typename T>
2609 template <
typename T>
2610 const T& get()
const;
2611 template <
typename T>
2614 template <
typename T>
2620 ~orientation_u() =
default;
2621 orientation_u(ossia::quaternion_u v)
2624 new(&m_impl.m_value0) ossia::quaternion_u{v};
2626 orientation_u(ossia::euler_u v)
2629 new(&m_impl.m_value1) ossia::euler_u{v};
2631 orientation_u(ossia::axis_u v)
2634 new(&m_impl.m_value2) ossia::axis_u{v};
2636 orientation_u(
const orientation_u& other)
2637 : m_type{other.m_type}
2642 new(&m_impl.m_value0) ossia::quaternion_u{other.m_impl.m_value0};
2645 new(&m_impl.m_value1) ossia::euler_u{other.m_impl.m_value1};
2648 new(&m_impl.m_value2) ossia::axis_u{other.m_impl.m_value2};
2654 orientation_u(orientation_u&& other) noexcept
2655 : m_type{other.m_type}
2660 new(&m_impl.m_value0) ossia::quaternion_u{std::move(other.m_impl.m_value0)};
2663 new(&m_impl.m_value1) ossia::euler_u{std::move(other.m_impl.m_value1)};
2666 new(&m_impl.m_value2) ossia::axis_u{std::move(other.m_impl.m_value2)};
2672 orientation_u& operator=(
const orientation_u& other)
2675 m_type = other.m_type;
2679 new(&m_impl.m_value0) ossia::quaternion_u{other.m_impl.m_value0};
2682 new(&m_impl.m_value1) ossia::euler_u{other.m_impl.m_value1};
2685 new(&m_impl.m_value2) ossia::axis_u{other.m_impl.m_value2};
2692 orientation_u& operator=(orientation_u&& other) noexcept
2695 m_type = other.m_type;
2699 new(&m_impl.m_value0) ossia::quaternion_u{std::move(other.m_impl.m_value0)};
2702 new(&m_impl.m_value1) ossia::euler_u{std::move(other.m_impl.m_value1)};
2705 new(&m_impl.m_value2) ossia::axis_u{std::move(other.m_impl.m_value2)};
2714 inline const ossia::quaternion_u* orientation_u::target()
const
2717 return &m_impl.m_value0;
2721 inline const ossia::euler_u* orientation_u::target()
const
2724 return &m_impl.m_value1;
2728 inline const ossia::axis_u* orientation_u::target()
const
2731 return &m_impl.m_value2;
2735 inline ossia::quaternion_u* orientation_u::target()
2738 return &m_impl.m_value0;
2742 inline ossia::euler_u* orientation_u::target()
2745 return &m_impl.m_value1;
2749 inline ossia::axis_u* orientation_u::target()
2752 return &m_impl.m_value2;
2756 inline const ossia::quaternion_u& orientation_u::get()
const
2759 return m_impl.m_value0;
2760 ossia_do_throw(std::runtime_error,
"orientation_u: bad type");
2763 inline const ossia::euler_u& orientation_u::get()
const
2766 return m_impl.m_value1;
2767 ossia_do_throw(std::runtime_error,
"orientation_u: bad type");
2770 inline const ossia::axis_u& orientation_u::get()
const
2773 return m_impl.m_value2;
2774 ossia_do_throw(std::runtime_error,
"orientation_u: bad type");
2777 inline ossia::quaternion_u& orientation_u::get()
2780 return m_impl.m_value0;
2781 ossia_do_throw(std::runtime_error,
"orientation_u: bad type");
2784 inline ossia::euler_u& orientation_u::get()
2787 return m_impl.m_value1;
2788 ossia_do_throw(std::runtime_error,
"orientation_u: bad type");
2791 inline ossia::axis_u& orientation_u::get()
2794 return m_impl.m_value2;
2795 ossia_do_throw(std::runtime_error,
"orientation_u: bad type");
2797 template <
typename Visitor>
2798 auto apply_nonnull(Visitor&& functor,
const orientation_u& var)
2802 case orientation_u::Type::Type0:
2803 return functor(var.m_impl.m_value0);
2804 case orientation_u::Type::Type1:
2805 return functor(var.m_impl.m_value1);
2806 case orientation_u::Type::Type2:
2807 return functor(var.m_impl.m_value2);
2809 ossia_do_throw(std::runtime_error,
"orientation_u: bad type");
2812 template <
typename Visitor>
2813 auto apply_nonnull(Visitor&& functor, orientation_u& var)
2817 case orientation_u::Type::Type0:
2818 return functor(var.m_impl.m_value0);
2819 case orientation_u::Type::Type1:
2820 return functor(var.m_impl.m_value1);
2821 case orientation_u::Type::Type2:
2822 return functor(var.m_impl.m_value2);
2824 ossia_do_throw(std::runtime_error,
"orientation_u: bad type");
2827 template <
typename Visitor>
2828 auto apply_nonnull(Visitor&& functor, orientation_u&& var)
2832 case orientation_u::Type::Type0:
2833 return functor(std::move(var.m_impl.m_value0));
2834 case orientation_u::Type::Type1:
2835 return functor(std::move(var.m_impl.m_value1));
2836 case orientation_u::Type::Type2:
2837 return functor(std::move(var.m_impl.m_value2));
2839 ossia_do_throw(std::runtime_error,
"orientation_u: bad type");
2842 template <
typename Visitor>
2843 auto apply(Visitor&& functor,
const orientation_u& var)
2847 case orientation_u::Type::Type0:
2848 return functor(var.m_impl.m_value0);
2849 case orientation_u::Type::Type1:
2850 return functor(var.m_impl.m_value1);
2851 case orientation_u::Type::Type2:
2852 return functor(var.m_impl.m_value2);
2857 template <
typename Visitor>
2858 auto apply(Visitor&& functor, orientation_u& var)
2862 case orientation_u::Type::Type0:
2863 return functor(var.m_impl.m_value0);
2864 case orientation_u::Type::Type1:
2865 return functor(var.m_impl.m_value1);
2866 case orientation_u::Type::Type2:
2867 return functor(var.m_impl.m_value2);
2872 template <
typename Visitor>
2873 auto apply(Visitor&& functor, orientation_u&& var)
2877 case orientation_u::Type::Type0:
2878 return functor(std::move(var.m_impl.m_value0));
2879 case orientation_u::Type::Type1:
2880 return functor(std::move(var.m_impl.m_value1));
2881 case orientation_u::Type::Type2:
2882 return functor(std::move(var.m_impl.m_value2));
2887 inline bool operator==(
const orientation_u& lhs,
const orientation_u& rhs)
2889 return (lhs.m_type == rhs.m_type);
2891 inline bool operator!=(
const orientation_u& lhs,
const orientation_u& rhs)
2893 return (lhs.m_type != rhs.m_type);
2895 inline bool operator==(
const orientation_u& lhs,
const ossia::quaternion_u& rhs)
2897 return (lhs.m_type == orientation_u::Type::Type0);
2899 inline bool operator==(
const ossia::quaternion_u& lhs,
const orientation_u& rhs)
2901 return (rhs.m_type == orientation_u::Type::Type0);
2903 inline bool operator!=(
const orientation_u& lhs,
const ossia::quaternion_u& rhs)
2905 return (lhs.m_type != orientation_u::Type::Type0);
2907 inline bool operator!=(
const ossia::quaternion_u& lhs,
const orientation_u& rhs)
2909 return (rhs.m_type != orientation_u::Type::Type0);
2911 inline bool operator==(
const orientation_u& lhs,
const ossia::euler_u& rhs)
2913 return (lhs.m_type == orientation_u::Type::Type1);
2915 inline bool operator==(
const ossia::euler_u& lhs,
const orientation_u& rhs)
2917 return (rhs.m_type == orientation_u::Type::Type1);
2919 inline bool operator!=(
const orientation_u& lhs,
const ossia::euler_u& rhs)
2921 return (lhs.m_type != orientation_u::Type::Type1);
2923 inline bool operator!=(
const ossia::euler_u& lhs,
const orientation_u& rhs)
2925 return (rhs.m_type != orientation_u::Type::Type1);
2927 inline bool operator==(
const orientation_u& lhs,
const ossia::axis_u& rhs)
2929 return (lhs.m_type == orientation_u::Type::Type2);
2931 inline bool operator==(
const ossia::axis_u& lhs,
const orientation_u& rhs)
2933 return (rhs.m_type == orientation_u::Type::Type2);
2935 inline bool operator!=(
const orientation_u& lhs,
const ossia::axis_u& rhs)
2937 return (lhs.m_type != orientation_u::Type::Type2);
2939 inline bool operator!=(
const ossia::axis_u& lhs,
const orientation_u& rhs)
2941 return (rhs.m_type != orientation_u::Type::Type2);
2951 ossia::cartesian_3d_u m_value0;
2953 ossia::cartesian_2d_u m_value1;
2955 ossia::spherical_u m_value2;
2957 ossia::polar_u m_value3;
2959 ossia::aed_u m_value4;
2961 ossia::ad_u m_value5;
2963 ossia::opengl_u m_value6;
2965 ossia::cylindrical_u m_value7;
2967 ossia::azd_u m_value8;
2995 static const constexpr
auto npos = Npos;
2996 int which()
const {
return m_type; }
2998 operator bool()
const {
return m_type != npos; }
2999 template <
typename T>
3000 const T* target()
const;
3001 template <
typename T>
3003 template <
typename T>
3004 const T& get()
const;
3005 template <
typename T>
3008 template <
typename T>
3014 ~position_u() =
default;
3015 position_u(ossia::cartesian_3d_u v)
3018 new(&m_impl.m_value0) ossia::cartesian_3d_u{v};
3020 position_u(ossia::cartesian_2d_u v)
3023 new(&m_impl.m_value1) ossia::cartesian_2d_u{v};
3025 position_u(ossia::spherical_u v)
3028 new(&m_impl.m_value2) ossia::spherical_u{v};
3030 position_u(ossia::polar_u v)
3033 new(&m_impl.m_value3) ossia::polar_u{v};
3035 position_u(ossia::aed_u v)
3038 new(&m_impl.m_value4) ossia::aed_u{v};
3040 position_u(ossia::ad_u v)
3043 new(&m_impl.m_value5) ossia::ad_u{v};
3045 position_u(ossia::opengl_u v)
3048 new(&m_impl.m_value6) ossia::opengl_u{v};
3050 position_u(ossia::cylindrical_u v)
3053 new(&m_impl.m_value7) ossia::cylindrical_u{v};
3055 position_u(ossia::azd_u v)
3058 new(&m_impl.m_value8) ossia::azd_u{v};
3060 position_u(
const position_u& other)
3061 : m_type{other.m_type}
3066 new(&m_impl.m_value0) ossia::cartesian_3d_u{other.m_impl.m_value0};
3069 new(&m_impl.m_value1) ossia::cartesian_2d_u{other.m_impl.m_value1};
3072 new(&m_impl.m_value2) ossia::spherical_u{other.m_impl.m_value2};
3075 new(&m_impl.m_value3) ossia::polar_u{other.m_impl.m_value3};
3078 new(&m_impl.m_value4) ossia::aed_u{other.m_impl.m_value4};
3081 new(&m_impl.m_value5) ossia::ad_u{other.m_impl.m_value5};
3084 new(&m_impl.m_value6) ossia::opengl_u{other.m_impl.m_value6};
3087 new(&m_impl.m_value7) ossia::cylindrical_u{other.m_impl.m_value7};
3090 new(&m_impl.m_value8) ossia::azd_u{other.m_impl.m_value8};
3096 position_u(position_u&& other) noexcept
3097 : m_type{other.m_type}
3102 new(&m_impl.m_value0) ossia::cartesian_3d_u{std::move(other.m_impl.m_value0)};
3105 new(&m_impl.m_value1) ossia::cartesian_2d_u{std::move(other.m_impl.m_value1)};
3108 new(&m_impl.m_value2) ossia::spherical_u{std::move(other.m_impl.m_value2)};
3111 new(&m_impl.m_value3) ossia::polar_u{std::move(other.m_impl.m_value3)};
3114 new(&m_impl.m_value4) ossia::aed_u{std::move(other.m_impl.m_value4)};
3117 new(&m_impl.m_value5) ossia::ad_u{std::move(other.m_impl.m_value5)};
3120 new(&m_impl.m_value6) ossia::opengl_u{std::move(other.m_impl.m_value6)};
3123 new(&m_impl.m_value7) ossia::cylindrical_u{std::move(other.m_impl.m_value7)};
3126 new(&m_impl.m_value8) ossia::azd_u{std::move(other.m_impl.m_value8)};
3132 position_u& operator=(
const position_u& other)
3135 m_type = other.m_type;
3139 new(&m_impl.m_value0) ossia::cartesian_3d_u{other.m_impl.m_value0};
3142 new(&m_impl.m_value1) ossia::cartesian_2d_u{other.m_impl.m_value1};
3145 new(&m_impl.m_value2) ossia::spherical_u{other.m_impl.m_value2};
3148 new(&m_impl.m_value3) ossia::polar_u{other.m_impl.m_value3};
3151 new(&m_impl.m_value4) ossia::aed_u{other.m_impl.m_value4};
3154 new(&m_impl.m_value5) ossia::ad_u{other.m_impl.m_value5};
3157 new(&m_impl.m_value6) ossia::opengl_u{other.m_impl.m_value6};
3160 new(&m_impl.m_value7) ossia::cylindrical_u{other.m_impl.m_value7};
3163 new(&m_impl.m_value8) ossia::azd_u{other.m_impl.m_value8};
3170 position_u& operator=(position_u&& other) noexcept
3173 m_type = other.m_type;
3177 new(&m_impl.m_value0) ossia::cartesian_3d_u{std::move(other.m_impl.m_value0)};
3180 new(&m_impl.m_value1) ossia::cartesian_2d_u{std::move(other.m_impl.m_value1)};
3183 new(&m_impl.m_value2) ossia::spherical_u{std::move(other.m_impl.m_value2)};
3186 new(&m_impl.m_value3) ossia::polar_u{std::move(other.m_impl.m_value3)};
3189 new(&m_impl.m_value4) ossia::aed_u{std::move(other.m_impl.m_value4)};
3192 new(&m_impl.m_value5) ossia::ad_u{std::move(other.m_impl.m_value5)};
3195 new(&m_impl.m_value6) ossia::opengl_u{std::move(other.m_impl.m_value6)};
3198 new(&m_impl.m_value7) ossia::cylindrical_u{std::move(other.m_impl.m_value7)};
3201 new(&m_impl.m_value8) ossia::azd_u{std::move(other.m_impl.m_value8)};
3210 inline const ossia::cartesian_3d_u* position_u::target()
const
3213 return &m_impl.m_value0;
3217 inline const ossia::cartesian_2d_u* position_u::target()
const
3220 return &m_impl.m_value1;
3224 inline const ossia::spherical_u* position_u::target()
const
3227 return &m_impl.m_value2;
3231 inline const ossia::polar_u* position_u::target()
const
3234 return &m_impl.m_value3;
3238 inline const ossia::aed_u* position_u::target()
const
3241 return &m_impl.m_value4;
3245 inline const ossia::ad_u* position_u::target()
const
3248 return &m_impl.m_value5;
3252 inline const ossia::opengl_u* position_u::target()
const
3255 return &m_impl.m_value6;
3259 inline const ossia::cylindrical_u* position_u::target()
const
3262 return &m_impl.m_value7;
3266 inline const ossia::azd_u* position_u::target()
const
3269 return &m_impl.m_value8;
3273 inline ossia::cartesian_3d_u* position_u::target()
3276 return &m_impl.m_value0;
3280 inline ossia::cartesian_2d_u* position_u::target()
3283 return &m_impl.m_value1;
3287 inline ossia::spherical_u* position_u::target()
3290 return &m_impl.m_value2;
3294 inline ossia::polar_u* position_u::target()
3297 return &m_impl.m_value3;
3301 inline ossia::aed_u* position_u::target()
3304 return &m_impl.m_value4;
3308 inline ossia::ad_u* position_u::target()
3311 return &m_impl.m_value5;
3315 inline ossia::opengl_u* position_u::target()
3318 return &m_impl.m_value6;
3322 inline ossia::cylindrical_u* position_u::target()
3325 return &m_impl.m_value7;
3329 inline ossia::azd_u* position_u::target()
3332 return &m_impl.m_value8;
3336 inline const ossia::cartesian_3d_u& position_u::get()
const
3339 return m_impl.m_value0;
3340 ossia_do_throw(std::runtime_error,
"position_u: bad type");
3343 inline const ossia::cartesian_2d_u& position_u::get()
const
3346 return m_impl.m_value1;
3347 ossia_do_throw(std::runtime_error,
"position_u: bad type");
3350 inline const ossia::spherical_u& position_u::get()
const
3353 return m_impl.m_value2;
3354 ossia_do_throw(std::runtime_error,
"position_u: bad type");
3357 inline const ossia::polar_u& position_u::get()
const
3360 return m_impl.m_value3;
3361 ossia_do_throw(std::runtime_error,
"position_u: bad type");
3364 inline const ossia::aed_u& position_u::get()
const
3367 return m_impl.m_value4;
3368 ossia_do_throw(std::runtime_error,
"position_u: bad type");
3371 inline const ossia::ad_u& position_u::get()
const
3374 return m_impl.m_value5;
3375 ossia_do_throw(std::runtime_error,
"position_u: bad type");
3378 inline const ossia::opengl_u& position_u::get()
const
3381 return m_impl.m_value6;
3382 ossia_do_throw(std::runtime_error,
"position_u: bad type");
3385 inline const ossia::cylindrical_u& position_u::get()
const
3388 return m_impl.m_value7;
3389 ossia_do_throw(std::runtime_error,
"position_u: bad type");
3392 inline const ossia::azd_u& position_u::get()
const
3395 return m_impl.m_value8;
3396 ossia_do_throw(std::runtime_error,
"position_u: bad type");
3399 inline ossia::cartesian_3d_u& position_u::get()
3402 return m_impl.m_value0;
3403 ossia_do_throw(std::runtime_error,
"position_u: bad type");
3406 inline ossia::cartesian_2d_u& position_u::get()
3409 return m_impl.m_value1;
3410 ossia_do_throw(std::runtime_error,
"position_u: bad type");
3413 inline ossia::spherical_u& position_u::get()
3416 return m_impl.m_value2;
3417 ossia_do_throw(std::runtime_error,
"position_u: bad type");
3420 inline ossia::polar_u& position_u::get()
3423 return m_impl.m_value3;
3424 ossia_do_throw(std::runtime_error,
"position_u: bad type");
3427 inline ossia::aed_u& position_u::get()
3430 return m_impl.m_value4;
3431 ossia_do_throw(std::runtime_error,
"position_u: bad type");
3434 inline ossia::ad_u& position_u::get()
3437 return m_impl.m_value5;
3438 ossia_do_throw(std::runtime_error,
"position_u: bad type");
3441 inline ossia::opengl_u& position_u::get()
3444 return m_impl.m_value6;
3445 ossia_do_throw(std::runtime_error,
"position_u: bad type");
3448 inline ossia::cylindrical_u& position_u::get()
3451 return m_impl.m_value7;
3452 ossia_do_throw(std::runtime_error,
"position_u: bad type");
3455 inline ossia::azd_u& position_u::get()
3458 return m_impl.m_value8;
3459 ossia_do_throw(std::runtime_error,
"position_u: bad type");
3461 template <
typename Visitor>
3462 auto apply_nonnull(Visitor&& functor,
const position_u& var)
3466 case position_u::Type::Type0:
3467 return functor(var.m_impl.m_value0);
3468 case position_u::Type::Type1:
3469 return functor(var.m_impl.m_value1);
3470 case position_u::Type::Type2:
3471 return functor(var.m_impl.m_value2);
3472 case position_u::Type::Type3:
3473 return functor(var.m_impl.m_value3);
3474 case position_u::Type::Type4:
3475 return functor(var.m_impl.m_value4);
3476 case position_u::Type::Type5:
3477 return functor(var.m_impl.m_value5);
3478 case position_u::Type::Type6:
3479 return functor(var.m_impl.m_value6);
3480 case position_u::Type::Type7:
3481 return functor(var.m_impl.m_value7);
3482 case position_u::Type::Type8:
3483 return functor(var.m_impl.m_value8);
3485 ossia_do_throw(std::runtime_error,
"position_u: bad type");
3488 template <
typename Visitor>
3489 auto apply_nonnull(Visitor&& functor, position_u& var)
3493 case position_u::Type::Type0:
3494 return functor(var.m_impl.m_value0);
3495 case position_u::Type::Type1:
3496 return functor(var.m_impl.m_value1);
3497 case position_u::Type::Type2:
3498 return functor(var.m_impl.m_value2);
3499 case position_u::Type::Type3:
3500 return functor(var.m_impl.m_value3);
3501 case position_u::Type::Type4:
3502 return functor(var.m_impl.m_value4);
3503 case position_u::Type::Type5:
3504 return functor(var.m_impl.m_value5);
3505 case position_u::Type::Type6:
3506 return functor(var.m_impl.m_value6);
3507 case position_u::Type::Type7:
3508 return functor(var.m_impl.m_value7);
3509 case position_u::Type::Type8:
3510 return functor(var.m_impl.m_value8);
3512 ossia_do_throw(std::runtime_error,
"position_u: bad type");
3515 template <
typename Visitor>
3516 auto apply_nonnull(Visitor&& functor, position_u&& var)
3520 case position_u::Type::Type0:
3521 return functor(std::move(var.m_impl.m_value0));
3522 case position_u::Type::Type1:
3523 return functor(std::move(var.m_impl.m_value1));
3524 case position_u::Type::Type2:
3525 return functor(std::move(var.m_impl.m_value2));
3526 case position_u::Type::Type3:
3527 return functor(std::move(var.m_impl.m_value3));
3528 case position_u::Type::Type4:
3529 return functor(std::move(var.m_impl.m_value4));
3530 case position_u::Type::Type5:
3531 return functor(std::move(var.m_impl.m_value5));
3532 case position_u::Type::Type6:
3533 return functor(std::move(var.m_impl.m_value6));
3534 case position_u::Type::Type7:
3535 return functor(std::move(var.m_impl.m_value7));
3536 case position_u::Type::Type8:
3537 return functor(std::move(var.m_impl.m_value8));
3539 ossia_do_throw(std::runtime_error,
"position_u: bad type");
3542 template <
typename Visitor>
3543 auto apply(Visitor&& functor,
const position_u& var)
3547 case position_u::Type::Type0:
3548 return functor(var.m_impl.m_value0);
3549 case position_u::Type::Type1:
3550 return functor(var.m_impl.m_value1);
3551 case position_u::Type::Type2:
3552 return functor(var.m_impl.m_value2);
3553 case position_u::Type::Type3:
3554 return functor(var.m_impl.m_value3);
3555 case position_u::Type::Type4:
3556 return functor(var.m_impl.m_value4);
3557 case position_u::Type::Type5:
3558 return functor(var.m_impl.m_value5);
3559 case position_u::Type::Type6:
3560 return functor(var.m_impl.m_value6);
3561 case position_u::Type::Type7:
3562 return functor(var.m_impl.m_value7);
3563 case position_u::Type::Type8:
3564 return functor(var.m_impl.m_value8);
3569 template <
typename Visitor>
3570 auto apply(Visitor&& functor, position_u& var)
3574 case position_u::Type::Type0:
3575 return functor(var.m_impl.m_value0);
3576 case position_u::Type::Type1:
3577 return functor(var.m_impl.m_value1);
3578 case position_u::Type::Type2:
3579 return functor(var.m_impl.m_value2);
3580 case position_u::Type::Type3:
3581 return functor(var.m_impl.m_value3);
3582 case position_u::Type::Type4:
3583 return functor(var.m_impl.m_value4);
3584 case position_u::Type::Type5:
3585 return functor(var.m_impl.m_value5);
3586 case position_u::Type::Type6:
3587 return functor(var.m_impl.m_value6);
3588 case position_u::Type::Type7:
3589 return functor(var.m_impl.m_value7);
3590 case position_u::Type::Type8:
3591 return functor(var.m_impl.m_value8);
3596 template <
typename Visitor>
3597 auto apply(Visitor&& functor, position_u&& var)
3601 case position_u::Type::Type0:
3602 return functor(std::move(var.m_impl.m_value0));
3603 case position_u::Type::Type1:
3604 return functor(std::move(var.m_impl.m_value1));
3605 case position_u::Type::Type2:
3606 return functor(std::move(var.m_impl.m_value2));
3607 case position_u::Type::Type3:
3608 return functor(std::move(var.m_impl.m_value3));
3609 case position_u::Type::Type4:
3610 return functor(std::move(var.m_impl.m_value4));
3611 case position_u::Type::Type5:
3612 return functor(std::move(var.m_impl.m_value5));
3613 case position_u::Type::Type6:
3614 return functor(std::move(var.m_impl.m_value6));
3615 case position_u::Type::Type7:
3616 return functor(std::move(var.m_impl.m_value7));
3617 case position_u::Type::Type8:
3618 return functor(std::move(var.m_impl.m_value8));
3623 inline bool operator==(
const position_u& lhs,
const position_u& rhs)
3625 return (lhs.m_type == rhs.m_type);
3627 inline bool operator!=(
const position_u& lhs,
const position_u& rhs)
3629 return (lhs.m_type != rhs.m_type);
3631 inline bool operator==(
const position_u& lhs,
const ossia::cartesian_3d_u& rhs)
3633 return (lhs.m_type == position_u::Type::Type0);
3635 inline bool operator==(
const ossia::cartesian_3d_u& lhs,
const position_u& rhs)
3637 return (rhs.m_type == position_u::Type::Type0);
3639 inline bool operator!=(
const position_u& lhs,
const ossia::cartesian_3d_u& rhs)
3641 return (lhs.m_type != position_u::Type::Type0);
3643 inline bool operator!=(
const ossia::cartesian_3d_u& lhs,
const position_u& rhs)
3645 return (rhs.m_type != position_u::Type::Type0);
3647 inline bool operator==(
const position_u& lhs,
const ossia::cartesian_2d_u& rhs)
3649 return (lhs.m_type == position_u::Type::Type1);
3651 inline bool operator==(
const ossia::cartesian_2d_u& lhs,
const position_u& rhs)
3653 return (rhs.m_type == position_u::Type::Type1);
3655 inline bool operator!=(
const position_u& lhs,
const ossia::cartesian_2d_u& rhs)
3657 return (lhs.m_type != position_u::Type::Type1);
3659 inline bool operator!=(
const ossia::cartesian_2d_u& lhs,
const position_u& rhs)
3661 return (rhs.m_type != position_u::Type::Type1);
3663 inline bool operator==(
const position_u& lhs,
const ossia::spherical_u& rhs)
3665 return (lhs.m_type == position_u::Type::Type2);
3667 inline bool operator==(
const ossia::spherical_u& lhs,
const position_u& rhs)
3669 return (rhs.m_type == position_u::Type::Type2);
3671 inline bool operator!=(
const position_u& lhs,
const ossia::spherical_u& rhs)
3673 return (lhs.m_type != position_u::Type::Type2);
3675 inline bool operator!=(
const ossia::spherical_u& lhs,
const position_u& rhs)
3677 return (rhs.m_type != position_u::Type::Type2);
3679 inline bool operator==(
const position_u& lhs,
const ossia::polar_u& rhs)
3681 return (lhs.m_type == position_u::Type::Type3);
3683 inline bool operator==(
const ossia::polar_u& lhs,
const position_u& rhs)
3685 return (rhs.m_type == position_u::Type::Type3);
3687 inline bool operator!=(
const position_u& lhs,
const ossia::polar_u& rhs)
3689 return (lhs.m_type != position_u::Type::Type3);
3691 inline bool operator!=(
const ossia::polar_u& lhs,
const position_u& rhs)
3693 return (rhs.m_type != position_u::Type::Type3);
3695 inline bool operator==(
const position_u& lhs,
const ossia::aed_u& rhs)
3697 return (lhs.m_type == position_u::Type::Type4);
3699 inline bool operator==(
const ossia::aed_u& lhs,
const position_u& rhs)
3701 return (rhs.m_type == position_u::Type::Type4);
3703 inline bool operator!=(
const position_u& lhs,
const ossia::aed_u& rhs)
3705 return (lhs.m_type != position_u::Type::Type4);
3707 inline bool operator!=(
const ossia::aed_u& lhs,
const position_u& rhs)
3709 return (rhs.m_type != position_u::Type::Type4);
3711 inline bool operator==(
const position_u& lhs,
const ossia::ad_u& rhs)
3713 return (lhs.m_type == position_u::Type::Type5);
3715 inline bool operator==(
const ossia::ad_u& lhs,
const position_u& rhs)
3717 return (rhs.m_type == position_u::Type::Type5);
3719 inline bool operator!=(
const position_u& lhs,
const ossia::ad_u& rhs)
3721 return (lhs.m_type != position_u::Type::Type5);
3723 inline bool operator!=(
const ossia::ad_u& lhs,
const position_u& rhs)
3725 return (rhs.m_type != position_u::Type::Type5);
3727 inline bool operator==(
const position_u& lhs,
const ossia::opengl_u& rhs)
3729 return (lhs.m_type == position_u::Type::Type6);
3731 inline bool operator==(
const ossia::opengl_u& lhs,
const position_u& rhs)
3733 return (rhs.m_type == position_u::Type::Type6);
3735 inline bool operator!=(
const position_u& lhs,
const ossia::opengl_u& rhs)
3737 return (lhs.m_type != position_u::Type::Type6);
3739 inline bool operator!=(
const ossia::opengl_u& lhs,
const position_u& rhs)
3741 return (rhs.m_type != position_u::Type::Type6);
3743 inline bool operator==(
const position_u& lhs,
const ossia::cylindrical_u& rhs)
3745 return (lhs.m_type == position_u::Type::Type7);
3747 inline bool operator==(
const ossia::cylindrical_u& lhs,
const position_u& rhs)
3749 return (rhs.m_type == position_u::Type::Type7);
3751 inline bool operator!=(
const position_u& lhs,
const ossia::cylindrical_u& rhs)
3753 return (lhs.m_type != position_u::Type::Type7);
3755 inline bool operator!=(
const ossia::cylindrical_u& lhs,
const position_u& rhs)
3757 return (rhs.m_type != position_u::Type::Type7);
3759 inline bool operator==(
const position_u& lhs,
const ossia::azd_u& rhs)
3761 return (lhs.m_type == position_u::Type::Type8);
3763 inline bool operator==(
const ossia::azd_u& lhs,
const position_u& rhs)
3765 return (rhs.m_type == position_u::Type::Type8);
3767 inline bool operator!=(
const position_u& lhs,
const ossia::azd_u& rhs)
3769 return (lhs.m_type != position_u::Type::Type8);
3771 inline bool operator!=(
const ossia::azd_u& lhs,
const position_u& rhs)
3773 return (rhs.m_type != position_u::Type::Type8);
3783 ossia::meter_per_second_u m_value0;
3785 ossia::miles_per_hour_u m_value1;
3787 ossia::kilometer_per_hour_u m_value2;
3789 ossia::knot_u m_value3;
3791 ossia::foot_per_second_u m_value4;
3793 ossia::foot_per_hour_u m_value5;
3818 static const constexpr
auto npos = Npos;
3819 int which()
const {
return m_type; }
3821 operator bool()
const {
return m_type != npos; }
3822 template <
typename T>
3823 const T* target()
const;
3824 template <
typename T>
3826 template <
typename T>
3827 const T& get()
const;
3828 template <
typename T>
3831 template <
typename T>
3837 ~speed_u() =
default;
3838 speed_u(ossia::meter_per_second_u v)
3841 new(&m_impl.m_value0) ossia::meter_per_second_u{v};
3843 speed_u(ossia::miles_per_hour_u v)
3846 new(&m_impl.m_value1) ossia::miles_per_hour_u{v};
3848 speed_u(ossia::kilometer_per_hour_u v)
3851 new(&m_impl.m_value2) ossia::kilometer_per_hour_u{v};
3853 speed_u(ossia::knot_u v)
3856 new(&m_impl.m_value3) ossia::knot_u{v};
3858 speed_u(ossia::foot_per_second_u v)
3861 new(&m_impl.m_value4) ossia::foot_per_second_u{v};
3863 speed_u(ossia::foot_per_hour_u v)
3866 new(&m_impl.m_value5) ossia::foot_per_hour_u{v};
3868 speed_u(
const speed_u& other)
3869 : m_type{other.m_type}
3874 new(&m_impl.m_value0) ossia::meter_per_second_u{other.m_impl.m_value0};
3877 new(&m_impl.m_value1) ossia::miles_per_hour_u{other.m_impl.m_value1};
3880 new(&m_impl.m_value2) ossia::kilometer_per_hour_u{other.m_impl.m_value2};
3883 new(&m_impl.m_value3) ossia::knot_u{other.m_impl.m_value3};
3886 new(&m_impl.m_value4) ossia::foot_per_second_u{other.m_impl.m_value4};
3889 new(&m_impl.m_value5) ossia::foot_per_hour_u{other.m_impl.m_value5};
3895 speed_u(speed_u&& other) noexcept
3896 : m_type{other.m_type}
3901 new(&m_impl.m_value0)
3902 ossia::meter_per_second_u{std::move(other.m_impl.m_value0)};
3905 new(&m_impl.m_value1) ossia::miles_per_hour_u{std::move(other.m_impl.m_value1)};
3908 new(&m_impl.m_value2)
3909 ossia::kilometer_per_hour_u{std::move(other.m_impl.m_value2)};
3912 new(&m_impl.m_value3) ossia::knot_u{std::move(other.m_impl.m_value3)};
3915 new(&m_impl.m_value4) ossia::foot_per_second_u{std::move(other.m_impl.m_value4)};
3918 new(&m_impl.m_value5) ossia::foot_per_hour_u{std::move(other.m_impl.m_value5)};
3924 speed_u& operator=(
const speed_u& other)
3927 m_type = other.m_type;
3931 new(&m_impl.m_value0) ossia::meter_per_second_u{other.m_impl.m_value0};
3934 new(&m_impl.m_value1) ossia::miles_per_hour_u{other.m_impl.m_value1};
3937 new(&m_impl.m_value2) ossia::kilometer_per_hour_u{other.m_impl.m_value2};
3940 new(&m_impl.m_value3) ossia::knot_u{other.m_impl.m_value3};
3943 new(&m_impl.m_value4) ossia::foot_per_second_u{other.m_impl.m_value4};
3946 new(&m_impl.m_value5) ossia::foot_per_hour_u{other.m_impl.m_value5};
3953 speed_u& operator=(speed_u&& other) noexcept
3956 m_type = other.m_type;
3960 new(&m_impl.m_value0)
3961 ossia::meter_per_second_u{std::move(other.m_impl.m_value0)};
3964 new(&m_impl.m_value1) ossia::miles_per_hour_u{std::move(other.m_impl.m_value1)};
3967 new(&m_impl.m_value2)
3968 ossia::kilometer_per_hour_u{std::move(other.m_impl.m_value2)};
3971 new(&m_impl.m_value3) ossia::knot_u{std::move(other.m_impl.m_value3)};
3974 new(&m_impl.m_value4) ossia::foot_per_second_u{std::move(other.m_impl.m_value4)};
3977 new(&m_impl.m_value5) ossia::foot_per_hour_u{std::move(other.m_impl.m_value5)};
3986 inline const ossia::meter_per_second_u* speed_u::target()
const
3989 return &m_impl.m_value0;
3993 inline const ossia::miles_per_hour_u* speed_u::target()
const
3996 return &m_impl.m_value1;
4000 inline const ossia::kilometer_per_hour_u* speed_u::target()
const
4003 return &m_impl.m_value2;
4007 inline const ossia::knot_u* speed_u::target()
const
4010 return &m_impl.m_value3;
4014 inline const ossia::foot_per_second_u* speed_u::target()
const
4017 return &m_impl.m_value4;
4021 inline const ossia::foot_per_hour_u* speed_u::target()
const
4024 return &m_impl.m_value5;
4028 inline ossia::meter_per_second_u* speed_u::target()
4031 return &m_impl.m_value0;
4035 inline ossia::miles_per_hour_u* speed_u::target()
4038 return &m_impl.m_value1;
4042 inline ossia::kilometer_per_hour_u* speed_u::target()
4045 return &m_impl.m_value2;
4049 inline ossia::knot_u* speed_u::target()
4052 return &m_impl.m_value3;
4056 inline ossia::foot_per_second_u* speed_u::target()
4059 return &m_impl.m_value4;
4063 inline ossia::foot_per_hour_u* speed_u::target()
4066 return &m_impl.m_value5;
4070 inline const ossia::meter_per_second_u& speed_u::get()
const
4073 return m_impl.m_value0;
4074 ossia_do_throw(std::runtime_error,
"speed_u: bad type");
4077 inline const ossia::miles_per_hour_u& speed_u::get()
const
4080 return m_impl.m_value1;
4081 ossia_do_throw(std::runtime_error,
"speed_u: bad type");
4084 inline const ossia::kilometer_per_hour_u& speed_u::get()
const
4087 return m_impl.m_value2;
4088 ossia_do_throw(std::runtime_error,
"speed_u: bad type");
4091 inline const ossia::knot_u& speed_u::get()
const
4094 return m_impl.m_value3;
4095 ossia_do_throw(std::runtime_error,
"speed_u: bad type");
4098 inline const ossia::foot_per_second_u& speed_u::get()
const
4101 return m_impl.m_value4;
4102 ossia_do_throw(std::runtime_error,
"speed_u: bad type");
4105 inline const ossia::foot_per_hour_u& speed_u::get()
const
4108 return m_impl.m_value5;
4109 ossia_do_throw(std::runtime_error,
"speed_u: bad type");
4112 inline ossia::meter_per_second_u& speed_u::get()
4115 return m_impl.m_value0;
4116 ossia_do_throw(std::runtime_error,
"speed_u: bad type");
4119 inline ossia::miles_per_hour_u& speed_u::get()
4122 return m_impl.m_value1;
4123 ossia_do_throw(std::runtime_error,
"speed_u: bad type");
4126 inline ossia::kilometer_per_hour_u& speed_u::get()
4129 return m_impl.m_value2;
4130 ossia_do_throw(std::runtime_error,
"speed_u: bad type");
4133 inline ossia::knot_u& speed_u::get()
4136 return m_impl.m_value3;
4137 ossia_do_throw(std::runtime_error,
"speed_u: bad type");
4140 inline ossia::foot_per_second_u& speed_u::get()
4143 return m_impl.m_value4;
4144 ossia_do_throw(std::runtime_error,
"speed_u: bad type");
4147 inline ossia::foot_per_hour_u& speed_u::get()
4150 return m_impl.m_value5;
4151 ossia_do_throw(std::runtime_error,
"speed_u: bad type");
4153 template <
typename Visitor>
4154 auto apply_nonnull(Visitor&& functor,
const speed_u& var)
4158 case speed_u::Type::Type0:
4159 return functor(var.m_impl.m_value0);
4160 case speed_u::Type::Type1:
4161 return functor(var.m_impl.m_value1);
4162 case speed_u::Type::Type2:
4163 return functor(var.m_impl.m_value2);
4164 case speed_u::Type::Type3:
4165 return functor(var.m_impl.m_value3);
4166 case speed_u::Type::Type4:
4167 return functor(var.m_impl.m_value4);
4168 case speed_u::Type::Type5:
4169 return functor(var.m_impl.m_value5);
4171 ossia_do_throw(std::runtime_error,
"speed_u: bad type");
4174 template <
typename Visitor>
4175 auto apply_nonnull(Visitor&& functor, speed_u& var)
4179 case speed_u::Type::Type0:
4180 return functor(var.m_impl.m_value0);
4181 case speed_u::Type::Type1:
4182 return functor(var.m_impl.m_value1);
4183 case speed_u::Type::Type2:
4184 return functor(var.m_impl.m_value2);
4185 case speed_u::Type::Type3:
4186 return functor(var.m_impl.m_value3);
4187 case speed_u::Type::Type4:
4188 return functor(var.m_impl.m_value4);
4189 case speed_u::Type::Type5:
4190 return functor(var.m_impl.m_value5);
4192 ossia_do_throw(std::runtime_error,
"speed_u: bad type");
4195 template <
typename Visitor>
4196 auto apply_nonnull(Visitor&& functor, speed_u&& var)
4200 case speed_u::Type::Type0:
4201 return functor(std::move(var.m_impl.m_value0));
4202 case speed_u::Type::Type1:
4203 return functor(std::move(var.m_impl.m_value1));
4204 case speed_u::Type::Type2:
4205 return functor(std::move(var.m_impl.m_value2));
4206 case speed_u::Type::Type3:
4207 return functor(std::move(var.m_impl.m_value3));
4208 case speed_u::Type::Type4:
4209 return functor(std::move(var.m_impl.m_value4));
4210 case speed_u::Type::Type5:
4211 return functor(std::move(var.m_impl.m_value5));
4213 ossia_do_throw(std::runtime_error,
"speed_u: bad type");
4216 template <
typename Visitor>
4217 auto apply(Visitor&& functor,
const speed_u& var)
4221 case speed_u::Type::Type0:
4222 return functor(var.m_impl.m_value0);
4223 case speed_u::Type::Type1:
4224 return functor(var.m_impl.m_value1);
4225 case speed_u::Type::Type2:
4226 return functor(var.m_impl.m_value2);
4227 case speed_u::Type::Type3:
4228 return functor(var.m_impl.m_value3);
4229 case speed_u::Type::Type4:
4230 return functor(var.m_impl.m_value4);
4231 case speed_u::Type::Type5:
4232 return functor(var.m_impl.m_value5);
4237 template <
typename Visitor>
4238 auto apply(Visitor&& functor, speed_u& var)
4242 case speed_u::Type::Type0:
4243 return functor(var.m_impl.m_value0);
4244 case speed_u::Type::Type1:
4245 return functor(var.m_impl.m_value1);
4246 case speed_u::Type::Type2:
4247 return functor(var.m_impl.m_value2);
4248 case speed_u::Type::Type3:
4249 return functor(var.m_impl.m_value3);
4250 case speed_u::Type::Type4:
4251 return functor(var.m_impl.m_value4);
4252 case speed_u::Type::Type5:
4253 return functor(var.m_impl.m_value5);
4258 template <
typename Visitor>
4259 auto apply(Visitor&& functor, speed_u&& var)
4263 case speed_u::Type::Type0:
4264 return functor(std::move(var.m_impl.m_value0));
4265 case speed_u::Type::Type1:
4266 return functor(std::move(var.m_impl.m_value1));
4267 case speed_u::Type::Type2:
4268 return functor(std::move(var.m_impl.m_value2));
4269 case speed_u::Type::Type3:
4270 return functor(std::move(var.m_impl.m_value3));
4271 case speed_u::Type::Type4:
4272 return functor(std::move(var.m_impl.m_value4));
4273 case speed_u::Type::Type5:
4274 return functor(std::move(var.m_impl.m_value5));
4279 inline bool operator==(
const speed_u& lhs,
const speed_u& rhs)
4281 return (lhs.m_type == rhs.m_type);
4283 inline bool operator!=(
const speed_u& lhs,
const speed_u& rhs)
4285 return (lhs.m_type != rhs.m_type);
4287 inline bool operator==(
const speed_u& lhs,
const ossia::meter_per_second_u& rhs)
4289 return (lhs.m_type == speed_u::Type::Type0);
4291 inline bool operator==(
const ossia::meter_per_second_u& lhs,
const speed_u& rhs)
4293 return (rhs.m_type == speed_u::Type::Type0);
4295 inline bool operator!=(
const speed_u& lhs,
const ossia::meter_per_second_u& rhs)
4297 return (lhs.m_type != speed_u::Type::Type0);
4299 inline bool operator!=(
const ossia::meter_per_second_u& lhs,
const speed_u& rhs)
4301 return (rhs.m_type != speed_u::Type::Type0);
4303 inline bool operator==(
const speed_u& lhs,
const ossia::miles_per_hour_u& rhs)
4305 return (lhs.m_type == speed_u::Type::Type1);
4307 inline bool operator==(
const ossia::miles_per_hour_u& lhs,
const speed_u& rhs)
4309 return (rhs.m_type == speed_u::Type::Type1);
4311 inline bool operator!=(
const speed_u& lhs,
const ossia::miles_per_hour_u& rhs)
4313 return (lhs.m_type != speed_u::Type::Type1);
4315 inline bool operator!=(
const ossia::miles_per_hour_u& lhs,
const speed_u& rhs)
4317 return (rhs.m_type != speed_u::Type::Type1);
4319 inline bool operator==(
const speed_u& lhs,
const ossia::kilometer_per_hour_u& rhs)
4321 return (lhs.m_type == speed_u::Type::Type2);
4323 inline bool operator==(
const ossia::kilometer_per_hour_u& lhs,
const speed_u& rhs)
4325 return (rhs.m_type == speed_u::Type::Type2);
4327 inline bool operator!=(
const speed_u& lhs,
const ossia::kilometer_per_hour_u& rhs)
4329 return (lhs.m_type != speed_u::Type::Type2);
4331 inline bool operator!=(
const ossia::kilometer_per_hour_u& lhs,
const speed_u& rhs)
4333 return (rhs.m_type != speed_u::Type::Type2);
4335 inline bool operator==(
const speed_u& lhs,
const ossia::knot_u& rhs)
4337 return (lhs.m_type == speed_u::Type::Type3);
4339 inline bool operator==(
const ossia::knot_u& lhs,
const speed_u& rhs)
4341 return (rhs.m_type == speed_u::Type::Type3);
4343 inline bool operator!=(
const speed_u& lhs,
const ossia::knot_u& rhs)
4345 return (lhs.m_type != speed_u::Type::Type3);
4347 inline bool operator!=(
const ossia::knot_u& lhs,
const speed_u& rhs)
4349 return (rhs.m_type != speed_u::Type::Type3);
4351 inline bool operator==(
const speed_u& lhs,
const ossia::foot_per_second_u& rhs)
4353 return (lhs.m_type == speed_u::Type::Type4);
4355 inline bool operator==(
const ossia::foot_per_second_u& lhs,
const speed_u& rhs)
4357 return (rhs.m_type == speed_u::Type::Type4);
4359 inline bool operator!=(
const speed_u& lhs,
const ossia::foot_per_second_u& rhs)
4361 return (lhs.m_type != speed_u::Type::Type4);
4363 inline bool operator!=(
const ossia::foot_per_second_u& lhs,
const speed_u& rhs)
4365 return (rhs.m_type != speed_u::Type::Type4);
4367 inline bool operator==(
const speed_u& lhs,
const ossia::foot_per_hour_u& rhs)
4369 return (lhs.m_type == speed_u::Type::Type5);
4371 inline bool operator==(
const ossia::foot_per_hour_u& lhs,
const speed_u& rhs)
4373 return (rhs.m_type == speed_u::Type::Type5);
4375 inline bool operator!=(
const speed_u& lhs,
const ossia::foot_per_hour_u& rhs)
4377 return (lhs.m_type != speed_u::Type::Type5);
4379 inline bool operator!=(
const ossia::foot_per_hour_u& lhs,
const speed_u& rhs)
4381 return (rhs.m_type != speed_u::Type::Type5);
4391 ossia::second_u m_value0;
4393 ossia::bark_u m_value1;
4395 ossia::bpm_u m_value2;
4397 ossia::cent_u m_value3;
4399 ossia::frequency_u m_value4;
4401 ossia::mel_u m_value5;
4403 ossia::midi_pitch_u m_value6;
4405 ossia::millisecond_u m_value7;
4407 ossia::playback_speed_u m_value8;
4435 static const constexpr
auto npos = Npos;
4436 int which()
const {
return m_type; }
4438 operator bool()
const {
return m_type != npos; }
4439 template <
typename T>
4440 const T* target()
const;
4441 template <
typename T>
4443 template <
typename T>
4444 const T& get()
const;
4445 template <
typename T>
4448 template <
typename T>
4454 ~timing_u() =
default;
4455 timing_u(ossia::second_u v)
4458 new(&m_impl.m_value0) ossia::second_u{v};
4460 timing_u(ossia::bark_u v)
4463 new(&m_impl.m_value1) ossia::bark_u{v};
4465 timing_u(ossia::bpm_u v)
4468 new(&m_impl.m_value2) ossia::bpm_u{v};
4470 timing_u(ossia::cent_u v)
4473 new(&m_impl.m_value3) ossia::cent_u{v};
4475 timing_u(ossia::frequency_u v)
4478 new(&m_impl.m_value4) ossia::frequency_u{v};
4480 timing_u(ossia::mel_u v)
4483 new(&m_impl.m_value5) ossia::mel_u{v};
4485 timing_u(ossia::midi_pitch_u v)
4488 new(&m_impl.m_value6) ossia::midi_pitch_u{v};
4490 timing_u(ossia::millisecond_u v)
4493 new(&m_impl.m_value7) ossia::millisecond_u{v};
4495 timing_u(ossia::playback_speed_u v)
4498 new(&m_impl.m_value8) ossia::playback_speed_u{v};
4500 timing_u(
const timing_u& other)
4501 : m_type{other.m_type}
4506 new(&m_impl.m_value0) ossia::second_u{other.m_impl.m_value0};
4509 new(&m_impl.m_value1) ossia::bark_u{other.m_impl.m_value1};
4512 new(&m_impl.m_value2) ossia::bpm_u{other.m_impl.m_value2};
4515 new(&m_impl.m_value3) ossia::cent_u{other.m_impl.m_value3};
4518 new(&m_impl.m_value4) ossia::frequency_u{other.m_impl.m_value4};
4521 new(&m_impl.m_value5) ossia::mel_u{other.m_impl.m_value5};
4524 new(&m_impl.m_value6) ossia::midi_pitch_u{other.m_impl.m_value6};
4527 new(&m_impl.m_value7) ossia::millisecond_u{other.m_impl.m_value7};
4530 new(&m_impl.m_value8) ossia::playback_speed_u{other.m_impl.m_value8};
4536 timing_u(timing_u&& other) noexcept
4537 : m_type{other.m_type}
4542 new(&m_impl.m_value0) ossia::second_u{std::move(other.m_impl.m_value0)};
4545 new(&m_impl.m_value1) ossia::bark_u{std::move(other.m_impl.m_value1)};
4548 new(&m_impl.m_value2) ossia::bpm_u{std::move(other.m_impl.m_value2)};
4551 new(&m_impl.m_value3) ossia::cent_u{std::move(other.m_impl.m_value3)};
4554 new(&m_impl.m_value4) ossia::frequency_u{std::move(other.m_impl.m_value4)};
4557 new(&m_impl.m_value5) ossia::mel_u{std::move(other.m_impl.m_value5)};
4560 new(&m_impl.m_value6) ossia::midi_pitch_u{std::move(other.m_impl.m_value6)};
4563 new(&m_impl.m_value7) ossia::millisecond_u{std::move(other.m_impl.m_value7)};
4566 new(&m_impl.m_value8) ossia::playback_speed_u{std::move(other.m_impl.m_value8)};
4572 timing_u& operator=(
const timing_u& other)
4575 m_type = other.m_type;
4579 new(&m_impl.m_value0) ossia::second_u{other.m_impl.m_value0};
4582 new(&m_impl.m_value1) ossia::bark_u{other.m_impl.m_value1};
4585 new(&m_impl.m_value2) ossia::bpm_u{other.m_impl.m_value2};
4588 new(&m_impl.m_value3) ossia::cent_u{other.m_impl.m_value3};
4591 new(&m_impl.m_value4) ossia::frequency_u{other.m_impl.m_value4};
4594 new(&m_impl.m_value5) ossia::mel_u{other.m_impl.m_value5};
4597 new(&m_impl.m_value6) ossia::midi_pitch_u{other.m_impl.m_value6};
4600 new(&m_impl.m_value7) ossia::millisecond_u{other.m_impl.m_value7};
4603 new(&m_impl.m_value8) ossia::playback_speed_u{other.m_impl.m_value8};
4610 timing_u& operator=(timing_u&& other) noexcept
4613 m_type = other.m_type;
4617 new(&m_impl.m_value0) ossia::second_u{std::move(other.m_impl.m_value0)};
4620 new(&m_impl.m_value1) ossia::bark_u{std::move(other.m_impl.m_value1)};
4623 new(&m_impl.m_value2) ossia::bpm_u{std::move(other.m_impl.m_value2)};
4626 new(&m_impl.m_value3) ossia::cent_u{std::move(other.m_impl.m_value3)};
4629 new(&m_impl.m_value4) ossia::frequency_u{std::move(other.m_impl.m_value4)};
4632 new(&m_impl.m_value5) ossia::mel_u{std::move(other.m_impl.m_value5)};
4635 new(&m_impl.m_value6) ossia::midi_pitch_u{std::move(other.m_impl.m_value6)};
4638 new(&m_impl.m_value7) ossia::millisecond_u{std::move(other.m_impl.m_value7)};
4641 new(&m_impl.m_value8) ossia::playback_speed_u{std::move(other.m_impl.m_value8)};
4650 inline const ossia::second_u* timing_u::target()
const
4653 return &m_impl.m_value0;
4657 inline const ossia::bark_u* timing_u::target()
const
4660 return &m_impl.m_value1;
4664 inline const ossia::bpm_u* timing_u::target()
const
4667 return &m_impl.m_value2;
4671 inline const ossia::cent_u* timing_u::target()
const
4674 return &m_impl.m_value3;
4678 inline const ossia::frequency_u* timing_u::target()
const
4681 return &m_impl.m_value4;
4685 inline const ossia::mel_u* timing_u::target()
const
4688 return &m_impl.m_value5;
4692 inline const ossia::midi_pitch_u* timing_u::target()
const
4695 return &m_impl.m_value6;
4699 inline const ossia::millisecond_u* timing_u::target()
const
4702 return &m_impl.m_value7;
4706 inline const ossia::playback_speed_u* timing_u::target()
const
4709 return &m_impl.m_value8;
4713 inline ossia::second_u* timing_u::target()
4716 return &m_impl.m_value0;
4720 inline ossia::bark_u* timing_u::target()
4723 return &m_impl.m_value1;
4727 inline ossia::bpm_u* timing_u::target()
4730 return &m_impl.m_value2;
4734 inline ossia::cent_u* timing_u::target()
4737 return &m_impl.m_value3;
4741 inline ossia::frequency_u* timing_u::target()
4744 return &m_impl.m_value4;
4748 inline ossia::mel_u* timing_u::target()
4751 return &m_impl.m_value5;
4755 inline ossia::midi_pitch_u* timing_u::target()
4758 return &m_impl.m_value6;
4762 inline ossia::millisecond_u* timing_u::target()
4765 return &m_impl.m_value7;
4769 inline ossia::playback_speed_u* timing_u::target()
4772 return &m_impl.m_value8;
4776 inline const ossia::second_u& timing_u::get()
const
4779 return m_impl.m_value0;
4780 ossia_do_throw(std::runtime_error,
"timing_u: bad type");
4783 inline const ossia::bark_u& timing_u::get()
const
4786 return m_impl.m_value1;
4787 ossia_do_throw(std::runtime_error,
"timing_u: bad type");
4790 inline const ossia::bpm_u& timing_u::get()
const
4793 return m_impl.m_value2;
4794 ossia_do_throw(std::runtime_error,
"timing_u: bad type");
4797 inline const ossia::cent_u& timing_u::get()
const
4800 return m_impl.m_value3;
4801 ossia_do_throw(std::runtime_error,
"timing_u: bad type");
4804 inline const ossia::frequency_u& timing_u::get()
const
4807 return m_impl.m_value4;
4808 ossia_do_throw(std::runtime_error,
"timing_u: bad type");
4811 inline const ossia::mel_u& timing_u::get()
const
4814 return m_impl.m_value5;
4815 ossia_do_throw(std::runtime_error,
"timing_u: bad type");
4818 inline const ossia::midi_pitch_u& timing_u::get()
const
4821 return m_impl.m_value6;
4822 ossia_do_throw(std::runtime_error,
"timing_u: bad type");
4825 inline const ossia::millisecond_u& timing_u::get()
const
4828 return m_impl.m_value7;
4829 ossia_do_throw(std::runtime_error,
"timing_u: bad type");
4832 inline const ossia::playback_speed_u& timing_u::get()
const
4835 return m_impl.m_value8;
4836 ossia_do_throw(std::runtime_error,
"timing_u: bad type");
4839 inline ossia::second_u& timing_u::get()
4842 return m_impl.m_value0;
4843 ossia_do_throw(std::runtime_error,
"timing_u: bad type");
4846 inline ossia::bark_u& timing_u::get()
4849 return m_impl.m_value1;
4850 ossia_do_throw(std::runtime_error,
"timing_u: bad type");
4853 inline ossia::bpm_u& timing_u::get()
4856 return m_impl.m_value2;
4857 ossia_do_throw(std::runtime_error,
"timing_u: bad type");
4860 inline ossia::cent_u& timing_u::get()
4863 return m_impl.m_value3;
4864 ossia_do_throw(std::runtime_error,
"timing_u: bad type");
4867 inline ossia::frequency_u& timing_u::get()
4870 return m_impl.m_value4;
4871 ossia_do_throw(std::runtime_error,
"timing_u: bad type");
4874 inline ossia::mel_u& timing_u::get()
4877 return m_impl.m_value5;
4878 ossia_do_throw(std::runtime_error,
"timing_u: bad type");
4881 inline ossia::midi_pitch_u& timing_u::get()
4884 return m_impl.m_value6;
4885 ossia_do_throw(std::runtime_error,
"timing_u: bad type");
4888 inline ossia::millisecond_u& timing_u::get()
4891 return m_impl.m_value7;
4892 ossia_do_throw(std::runtime_error,
"timing_u: bad type");
4895 inline ossia::playback_speed_u& timing_u::get()
4898 return m_impl.m_value8;
4899 ossia_do_throw(std::runtime_error,
"timing_u: bad type");
4901 template <
typename Visitor>
4902 auto apply_nonnull(Visitor&& functor,
const timing_u& var)
4906 case timing_u::Type::Type0:
4907 return functor(var.m_impl.m_value0);
4908 case timing_u::Type::Type1:
4909 return functor(var.m_impl.m_value1);
4910 case timing_u::Type::Type2:
4911 return functor(var.m_impl.m_value2);
4912 case timing_u::Type::Type3:
4913 return functor(var.m_impl.m_value3);
4914 case timing_u::Type::Type4:
4915 return functor(var.m_impl.m_value4);
4916 case timing_u::Type::Type5:
4917 return functor(var.m_impl.m_value5);
4918 case timing_u::Type::Type6:
4919 return functor(var.m_impl.m_value6);
4920 case timing_u::Type::Type7:
4921 return functor(var.m_impl.m_value7);
4922 case timing_u::Type::Type8:
4923 return functor(var.m_impl.m_value8);
4925 ossia_do_throw(std::runtime_error,
"timing_u: bad type");
4928 template <
typename Visitor>
4929 auto apply_nonnull(Visitor&& functor, timing_u& var)
4933 case timing_u::Type::Type0:
4934 return functor(var.m_impl.m_value0);
4935 case timing_u::Type::Type1:
4936 return functor(var.m_impl.m_value1);
4937 case timing_u::Type::Type2:
4938 return functor(var.m_impl.m_value2);
4939 case timing_u::Type::Type3:
4940 return functor(var.m_impl.m_value3);
4941 case timing_u::Type::Type4:
4942 return functor(var.m_impl.m_value4);
4943 case timing_u::Type::Type5:
4944 return functor(var.m_impl.m_value5);
4945 case timing_u::Type::Type6:
4946 return functor(var.m_impl.m_value6);
4947 case timing_u::Type::Type7:
4948 return functor(var.m_impl.m_value7);
4949 case timing_u::Type::Type8:
4950 return functor(var.m_impl.m_value8);
4952 ossia_do_throw(std::runtime_error,
"timing_u: bad type");
4955 template <
typename Visitor>
4956 auto apply_nonnull(Visitor&& functor, timing_u&& var)
4960 case timing_u::Type::Type0:
4961 return functor(std::move(var.m_impl.m_value0));
4962 case timing_u::Type::Type1:
4963 return functor(std::move(var.m_impl.m_value1));
4964 case timing_u::Type::Type2:
4965 return functor(std::move(var.m_impl.m_value2));
4966 case timing_u::Type::Type3:
4967 return functor(std::move(var.m_impl.m_value3));
4968 case timing_u::Type::Type4:
4969 return functor(std::move(var.m_impl.m_value4));
4970 case timing_u::Type::Type5:
4971 return functor(std::move(var.m_impl.m_value5));
4972 case timing_u::Type::Type6:
4973 return functor(std::move(var.m_impl.m_value6));
4974 case timing_u::Type::Type7:
4975 return functor(std::move(var.m_impl.m_value7));
4976 case timing_u::Type::Type8:
4977 return functor(std::move(var.m_impl.m_value8));
4979 ossia_do_throw(std::runtime_error,
"timing_u: bad type");
4982 template <
typename Visitor>
4983 auto apply(Visitor&& functor,
const timing_u& var)
4987 case timing_u::Type::Type0:
4988 return functor(var.m_impl.m_value0);
4989 case timing_u::Type::Type1:
4990 return functor(var.m_impl.m_value1);
4991 case timing_u::Type::Type2:
4992 return functor(var.m_impl.m_value2);
4993 case timing_u::Type::Type3:
4994 return functor(var.m_impl.m_value3);
4995 case timing_u::Type::Type4:
4996 return functor(var.m_impl.m_value4);
4997 case timing_u::Type::Type5:
4998 return functor(var.m_impl.m_value5);
4999 case timing_u::Type::Type6:
5000 return functor(var.m_impl.m_value6);
5001 case timing_u::Type::Type7:
5002 return functor(var.m_impl.m_value7);
5003 case timing_u::Type::Type8:
5004 return functor(var.m_impl.m_value8);
5009 template <
typename Visitor>
5010 auto apply(Visitor&& functor, timing_u& var)
5014 case timing_u::Type::Type0:
5015 return functor(var.m_impl.m_value0);
5016 case timing_u::Type::Type1:
5017 return functor(var.m_impl.m_value1);
5018 case timing_u::Type::Type2:
5019 return functor(var.m_impl.m_value2);
5020 case timing_u::Type::Type3:
5021 return functor(var.m_impl.m_value3);
5022 case timing_u::Type::Type4:
5023 return functor(var.m_impl.m_value4);
5024 case timing_u::Type::Type5:
5025 return functor(var.m_impl.m_value5);
5026 case timing_u::Type::Type6:
5027 return functor(var.m_impl.m_value6);
5028 case timing_u::Type::Type7:
5029 return functor(var.m_impl.m_value7);
5030 case timing_u::Type::Type8:
5031 return functor(var.m_impl.m_value8);
5036 template <
typename Visitor>
5037 auto apply(Visitor&& functor, timing_u&& var)
5041 case timing_u::Type::Type0:
5042 return functor(std::move(var.m_impl.m_value0));
5043 case timing_u::Type::Type1:
5044 return functor(std::move(var.m_impl.m_value1));
5045 case timing_u::Type::Type2:
5046 return functor(std::move(var.m_impl.m_value2));
5047 case timing_u::Type::Type3:
5048 return functor(std::move(var.m_impl.m_value3));
5049 case timing_u::Type::Type4:
5050 return functor(std::move(var.m_impl.m_value4));
5051 case timing_u::Type::Type5:
5052 return functor(std::move(var.m_impl.m_value5));
5053 case timing_u::Type::Type6:
5054 return functor(std::move(var.m_impl.m_value6));
5055 case timing_u::Type::Type7:
5056 return functor(std::move(var.m_impl.m_value7));
5057 case timing_u::Type::Type8:
5058 return functor(std::move(var.m_impl.m_value8));
5063 inline bool operator==(
const timing_u& lhs,
const timing_u& rhs)
5065 return (lhs.m_type == rhs.m_type);
5067 inline bool operator!=(
const timing_u& lhs,
const timing_u& rhs)
5069 return (lhs.m_type != rhs.m_type);
5071 inline bool operator==(
const timing_u& lhs,
const ossia::second_u& rhs)
5073 return (lhs.m_type == timing_u::Type::Type0);
5075 inline bool operator==(
const ossia::second_u& lhs,
const timing_u& rhs)
5077 return (rhs.m_type == timing_u::Type::Type0);
5079 inline bool operator!=(
const timing_u& lhs,
const ossia::second_u& rhs)
5081 return (lhs.m_type != timing_u::Type::Type0);
5083 inline bool operator!=(
const ossia::second_u& lhs,
const timing_u& rhs)
5085 return (rhs.m_type != timing_u::Type::Type0);
5087 inline bool operator==(
const timing_u& lhs,
const ossia::bark_u& rhs)
5089 return (lhs.m_type == timing_u::Type::Type1);
5091 inline bool operator==(
const ossia::bark_u& lhs,
const timing_u& rhs)
5093 return (rhs.m_type == timing_u::Type::Type1);
5095 inline bool operator!=(
const timing_u& lhs,
const ossia::bark_u& rhs)
5097 return (lhs.m_type != timing_u::Type::Type1);
5099 inline bool operator!=(
const ossia::bark_u& lhs,
const timing_u& rhs)
5101 return (rhs.m_type != timing_u::Type::Type1);
5103 inline bool operator==(
const timing_u& lhs,
const ossia::bpm_u& rhs)
5105 return (lhs.m_type == timing_u::Type::Type2);
5107 inline bool operator==(
const ossia::bpm_u& lhs,
const timing_u& rhs)
5109 return (rhs.m_type == timing_u::Type::Type2);
5111 inline bool operator!=(
const timing_u& lhs,
const ossia::bpm_u& rhs)
5113 return (lhs.m_type != timing_u::Type::Type2);
5115 inline bool operator!=(
const ossia::bpm_u& lhs,
const timing_u& rhs)
5117 return (rhs.m_type != timing_u::Type::Type2);
5119 inline bool operator==(
const timing_u& lhs,
const ossia::cent_u& rhs)
5121 return (lhs.m_type == timing_u::Type::Type3);
5123 inline bool operator==(
const ossia::cent_u& lhs,
const timing_u& rhs)
5125 return (rhs.m_type == timing_u::Type::Type3);
5127 inline bool operator!=(
const timing_u& lhs,
const ossia::cent_u& rhs)
5129 return (lhs.m_type != timing_u::Type::Type3);
5131 inline bool operator!=(
const ossia::cent_u& lhs,
const timing_u& rhs)
5133 return (rhs.m_type != timing_u::Type::Type3);
5135 inline bool operator==(
const timing_u& lhs,
const ossia::frequency_u& rhs)
5137 return (lhs.m_type == timing_u::Type::Type4);
5139 inline bool operator==(
const ossia::frequency_u& lhs,
const timing_u& rhs)
5141 return (rhs.m_type == timing_u::Type::Type4);
5143 inline bool operator!=(
const timing_u& lhs,
const ossia::frequency_u& rhs)
5145 return (lhs.m_type != timing_u::Type::Type4);
5147 inline bool operator!=(
const ossia::frequency_u& lhs,
const timing_u& rhs)
5149 return (rhs.m_type != timing_u::Type::Type4);
5151 inline bool operator==(
const timing_u& lhs,
const ossia::mel_u& rhs)
5153 return (lhs.m_type == timing_u::Type::Type5);
5155 inline bool operator==(
const ossia::mel_u& lhs,
const timing_u& rhs)
5157 return (rhs.m_type == timing_u::Type::Type5);
5159 inline bool operator!=(
const timing_u& lhs,
const ossia::mel_u& rhs)
5161 return (lhs.m_type != timing_u::Type::Type5);
5163 inline bool operator!=(
const ossia::mel_u& lhs,
const timing_u& rhs)
5165 return (rhs.m_type != timing_u::Type::Type5);
5167 inline bool operator==(
const timing_u& lhs,
const ossia::midi_pitch_u& rhs)
5169 return (lhs.m_type == timing_u::Type::Type6);
5171 inline bool operator==(
const ossia::midi_pitch_u& lhs,
const timing_u& rhs)
5173 return (rhs.m_type == timing_u::Type::Type6);
5175 inline bool operator!=(
const timing_u& lhs,
const ossia::midi_pitch_u& rhs)
5177 return (lhs.m_type != timing_u::Type::Type6);
5179 inline bool operator!=(
const ossia::midi_pitch_u& lhs,
const timing_u& rhs)
5181 return (rhs.m_type != timing_u::Type::Type6);
5183 inline bool operator==(
const timing_u& lhs,
const ossia::millisecond_u& rhs)
5185 return (lhs.m_type == timing_u::Type::Type7);
5187 inline bool operator==(
const ossia::millisecond_u& lhs,
const timing_u& rhs)
5189 return (rhs.m_type == timing_u::Type::Type7);
5191 inline bool operator!=(
const timing_u& lhs,
const ossia::millisecond_u& rhs)
5193 return (lhs.m_type != timing_u::Type::Type7);
5195 inline bool operator!=(
const ossia::millisecond_u& lhs,
const timing_u& rhs)
5197 return (rhs.m_type != timing_u::Type::Type7);
5199 inline bool operator==(
const timing_u& lhs,
const ossia::playback_speed_u& rhs)
5201 return (lhs.m_type == timing_u::Type::Type8);
5203 inline bool operator==(
const ossia::playback_speed_u& lhs,
const timing_u& rhs)
5205 return (rhs.m_type == timing_u::Type::Type8);
5207 inline bool operator!=(
const timing_u& lhs,
const ossia::playback_speed_u& rhs)
5209 return (lhs.m_type != timing_u::Type::Type8);
5211 inline bool operator!=(
const ossia::playback_speed_u& lhs,
const timing_u& rhs)
5213 return (rhs.m_type != timing_u::Type::Type8);
5223 ossia::distance_u m_value0;
5225 ossia::position_u m_value1;
5227 ossia::speed_u m_value2;
5229 ossia::orientation_u m_value3;
5231 ossia::angle_u m_value4;
5233 ossia::color_u m_value5;
5235 ossia::gain_u m_value6;
5237 ossia::timing_u m_value7;
5264 static const constexpr
auto npos = Npos;
5265 int which() const noexcept {
return m_type; }
5267 operator bool() const noexcept {
return m_type != npos; }
5268 template <
typename T>
5269 const T* target()
const;
5270 template <
typename T>
5272 template <
typename T>
5273 const T& get()
const;
5274 template <
typename T>
5277 template <
typename T>
5279 unit_variant() noexcept
5283 ~unit_variant() noexcept { }
5284 unit_variant(ossia::distance_u v) noexcept
5287 new(&m_impl.m_value0) ossia::distance_u{v};
5289 unit_variant(ossia::position_u v) noexcept
5292 new(&m_impl.m_value1) ossia::position_u{v};
5294 unit_variant(ossia::speed_u v) noexcept
5297 new(&m_impl.m_value2) ossia::speed_u{v};
5299 unit_variant(ossia::orientation_u v) noexcept
5302 new(&m_impl.m_value3) ossia::orientation_u{v};
5304 unit_variant(ossia::angle_u v) noexcept
5307 new(&m_impl.m_value4) ossia::angle_u{v};
5309 unit_variant(ossia::color_u v) noexcept
5312 new(&m_impl.m_value5) ossia::color_u{v};
5314 unit_variant(ossia::gain_u v) noexcept
5317 new(&m_impl.m_value6) ossia::gain_u{v};
5319 unit_variant(ossia::timing_u v) noexcept
5322 new(&m_impl.m_value7) ossia::timing_u{v};
5324 unit_variant(
const unit_variant& other) noexcept
5325 : m_type{other.m_type}
5330 new(&m_impl.m_value0) ossia::distance_u{other.m_impl.m_value0};
5333 new(&m_impl.m_value1) ossia::position_u{other.m_impl.m_value1};
5336 new(&m_impl.m_value2) ossia::speed_u{other.m_impl.m_value2};
5339 new(&m_impl.m_value3) ossia::orientation_u{other.m_impl.m_value3};
5342 new(&m_impl.m_value4) ossia::angle_u{other.m_impl.m_value4};
5345 new(&m_impl.m_value5) ossia::color_u{other.m_impl.m_value5};
5348 new(&m_impl.m_value6) ossia::gain_u{other.m_impl.m_value6};
5351 new(&m_impl.m_value7) ossia::timing_u{other.m_impl.m_value7};
5357 unit_variant(unit_variant&& other) noexcept
5358 : m_type{other.m_type}
5363 new(&m_impl.m_value0) ossia::distance_u{std::move(other.m_impl.m_value0)};
5366 new(&m_impl.m_value1) ossia::position_u{std::move(other.m_impl.m_value1)};
5369 new(&m_impl.m_value2) ossia::speed_u{std::move(other.m_impl.m_value2)};
5372 new(&m_impl.m_value3) ossia::orientation_u{std::move(other.m_impl.m_value3)};
5375 new(&m_impl.m_value4) ossia::angle_u{std::move(other.m_impl.m_value4)};
5378 new(&m_impl.m_value5) ossia::color_u{std::move(other.m_impl.m_value5)};
5381 new(&m_impl.m_value6) ossia::gain_u{std::move(other.m_impl.m_value6)};
5384 new(&m_impl.m_value7) ossia::timing_u{std::move(other.m_impl.m_value7)};
5390 unit_variant& operator=(
const unit_variant& other) noexcept
5393 m_type = other.m_type;
5397 new(&m_impl.m_value0) ossia::distance_u{other.m_impl.m_value0};
5400 new(&m_impl.m_value1) ossia::position_u{other.m_impl.m_value1};
5403 new(&m_impl.m_value2) ossia::speed_u{other.m_impl.m_value2};
5406 new(&m_impl.m_value3) ossia::orientation_u{other.m_impl.m_value3};
5409 new(&m_impl.m_value4) ossia::angle_u{other.m_impl.m_value4};
5412 new(&m_impl.m_value5) ossia::color_u{other.m_impl.m_value5};
5415 new(&m_impl.m_value6) ossia::gain_u{other.m_impl.m_value6};
5418 new(&m_impl.m_value7) ossia::timing_u{other.m_impl.m_value7};
5425 unit_variant& operator=(unit_variant&& other) noexcept
5428 m_type = other.m_type;
5432 new(&m_impl.m_value0) ossia::distance_u{std::move(other.m_impl.m_value0)};
5435 new(&m_impl.m_value1) ossia::position_u{std::move(other.m_impl.m_value1)};
5438 new(&m_impl.m_value2) ossia::speed_u{std::move(other.m_impl.m_value2)};
5441 new(&m_impl.m_value3) ossia::orientation_u{std::move(other.m_impl.m_value3)};
5444 new(&m_impl.m_value4) ossia::angle_u{std::move(other.m_impl.m_value4)};
5447 new(&m_impl.m_value5) ossia::color_u{std::move(other.m_impl.m_value5)};
5450 new(&m_impl.m_value6) ossia::gain_u{std::move(other.m_impl.m_value6)};
5453 new(&m_impl.m_value7) ossia::timing_u{std::move(other.m_impl.m_value7)};
5462 inline const ossia::distance_u* unit_variant::target()
const
5465 return &m_impl.m_value0;
5469 inline const ossia::position_u* unit_variant::target()
const
5472 return &m_impl.m_value1;
5476 inline const ossia::speed_u* unit_variant::target()
const
5479 return &m_impl.m_value2;
5483 inline const ossia::orientation_u* unit_variant::target()
const
5486 return &m_impl.m_value3;
5490 inline const ossia::angle_u* unit_variant::target()
const
5493 return &m_impl.m_value4;
5497 inline const ossia::color_u* unit_variant::target()
const
5500 return &m_impl.m_value5;
5504 inline const ossia::gain_u* unit_variant::target()
const
5507 return &m_impl.m_value6;
5511 inline const ossia::timing_u* unit_variant::target()
const
5514 return &m_impl.m_value7;
5518 inline ossia::distance_u* unit_variant::target()
5521 return &m_impl.m_value0;
5525 inline ossia::position_u* unit_variant::target()
5528 return &m_impl.m_value1;
5532 inline ossia::speed_u* unit_variant::target()
5535 return &m_impl.m_value2;
5539 inline ossia::orientation_u* unit_variant::target()
5542 return &m_impl.m_value3;
5546 inline ossia::angle_u* unit_variant::target()
5549 return &m_impl.m_value4;
5553 inline ossia::color_u* unit_variant::target()
5556 return &m_impl.m_value5;
5560 inline ossia::gain_u* unit_variant::target()
5563 return &m_impl.m_value6;
5567 inline ossia::timing_u* unit_variant::target()
5570 return &m_impl.m_value7;
5574 inline const ossia::distance_u& unit_variant::get()
const
5577 return m_impl.m_value0;
5578 ossia_do_throw(std::runtime_error,
"unit_variant: bad type");
5581 inline const ossia::position_u& unit_variant::get()
const
5584 return m_impl.m_value1;
5585 ossia_do_throw(std::runtime_error,
"unit_variant: bad type");
5588 inline const ossia::speed_u& unit_variant::get()
const
5591 return m_impl.m_value2;
5592 ossia_do_throw(std::runtime_error,
"unit_variant: bad type");
5595 inline const ossia::orientation_u& unit_variant::get()
const
5598 return m_impl.m_value3;
5599 ossia_do_throw(std::runtime_error,
"unit_variant: bad type");
5602 inline const ossia::angle_u& unit_variant::get()
const
5605 return m_impl.m_value4;
5606 ossia_do_throw(std::runtime_error,
"unit_variant: bad type");
5609 inline const ossia::color_u& unit_variant::get()
const
5612 return m_impl.m_value5;
5613 ossia_do_throw(std::runtime_error,
"unit_variant: bad type");
5616 inline const ossia::gain_u& unit_variant::get()
const
5619 return m_impl.m_value6;
5620 ossia_do_throw(std::runtime_error,
"unit_variant: bad type");
5623 inline const ossia::timing_u& unit_variant::get()
const
5626 return m_impl.m_value7;
5627 ossia_do_throw(std::runtime_error,
"unit_variant: bad type");
5630 inline ossia::distance_u& unit_variant::get()
5633 return m_impl.m_value0;
5634 ossia_do_throw(std::runtime_error,
"unit_variant: bad type");
5637 inline ossia::position_u& unit_variant::get()
5640 return m_impl.m_value1;
5641 ossia_do_throw(std::runtime_error,
"unit_variant: bad type");
5644 inline ossia::speed_u& unit_variant::get()
5647 return m_impl.m_value2;
5648 ossia_do_throw(std::runtime_error,
"unit_variant: bad type");
5651 inline ossia::orientation_u& unit_variant::get()
5654 return m_impl.m_value3;
5655 ossia_do_throw(std::runtime_error,
"unit_variant: bad type");
5658 inline ossia::angle_u& unit_variant::get()
5661 return m_impl.m_value4;
5662 ossia_do_throw(std::runtime_error,
"unit_variant: bad type");
5665 inline ossia::color_u& unit_variant::get()
5668 return m_impl.m_value5;
5669 ossia_do_throw(std::runtime_error,
"unit_variant: bad type");
5672 inline ossia::gain_u& unit_variant::get()
5675 return m_impl.m_value6;
5676 ossia_do_throw(std::runtime_error,
"unit_variant: bad type");
5679 inline ossia::timing_u& unit_variant::get()
5682 return m_impl.m_value7;
5683 ossia_do_throw(std::runtime_error,
"unit_variant: bad type");
5685 template <
typename Visitor>
5686 auto apply_nonnull(Visitor&& functor,
const unit_variant& var)
5690 case unit_variant::Type::Type0:
5691 return functor(var.m_impl.m_value0);
5692 case unit_variant::Type::Type1:
5693 return functor(var.m_impl.m_value1);
5694 case unit_variant::Type::Type2:
5695 return functor(var.m_impl.m_value2);
5696 case unit_variant::Type::Type3:
5697 return functor(var.m_impl.m_value3);
5698 case unit_variant::Type::Type4:
5699 return functor(var.m_impl.m_value4);
5700 case unit_variant::Type::Type5:
5701 return functor(var.m_impl.m_value5);
5702 case unit_variant::Type::Type6:
5703 return functor(var.m_impl.m_value6);
5704 case unit_variant::Type::Type7:
5705 return functor(var.m_impl.m_value7);
5707 ossia_do_throw(std::runtime_error,
"unit_variant: bad type");
5710 template <
typename Visitor>
5711 auto apply_nonnull(Visitor&& functor, unit_variant& var)
5715 case unit_variant::Type::Type0:
5716 return functor(var.m_impl.m_value0);
5717 case unit_variant::Type::Type1:
5718 return functor(var.m_impl.m_value1);
5719 case unit_variant::Type::Type2:
5720 return functor(var.m_impl.m_value2);
5721 case unit_variant::Type::Type3:
5722 return functor(var.m_impl.m_value3);
5723 case unit_variant::Type::Type4:
5724 return functor(var.m_impl.m_value4);
5725 case unit_variant::Type::Type5:
5726 return functor(var.m_impl.m_value5);
5727 case unit_variant::Type::Type6:
5728 return functor(var.m_impl.m_value6);
5729 case unit_variant::Type::Type7:
5730 return functor(var.m_impl.m_value7);
5732 ossia_do_throw(std::runtime_error,
"unit_variant: bad type");
5735 template <
typename Visitor>
5736 auto apply_nonnull(Visitor&& functor, unit_variant&& var)
5740 case unit_variant::Type::Type0:
5741 return functor(std::move(var.m_impl.m_value0));
5742 case unit_variant::Type::Type1:
5743 return functor(std::move(var.m_impl.m_value1));
5744 case unit_variant::Type::Type2:
5745 return functor(std::move(var.m_impl.m_value2));
5746 case unit_variant::Type::Type3:
5747 return functor(std::move(var.m_impl.m_value3));
5748 case unit_variant::Type::Type4:
5749 return functor(std::move(var.m_impl.m_value4));
5750 case unit_variant::Type::Type5:
5751 return functor(std::move(var.m_impl.m_value5));
5752 case unit_variant::Type::Type6:
5753 return functor(std::move(var.m_impl.m_value6));
5754 case unit_variant::Type::Type7:
5755 return functor(std::move(var.m_impl.m_value7));
5757 ossia_do_throw(std::runtime_error,
"unit_variant: bad type");
5760 template <
typename Visitor>
5761 auto apply(Visitor&& functor,
const unit_variant& var)
5765 case unit_variant::Type::Type0:
5766 return functor(var.m_impl.m_value0);
5767 case unit_variant::Type::Type1:
5768 return functor(var.m_impl.m_value1);
5769 case unit_variant::Type::Type2:
5770 return functor(var.m_impl.m_value2);
5771 case unit_variant::Type::Type3:
5772 return functor(var.m_impl.m_value3);
5773 case unit_variant::Type::Type4:
5774 return functor(var.m_impl.m_value4);
5775 case unit_variant::Type::Type5:
5776 return functor(var.m_impl.m_value5);
5777 case unit_variant::Type::Type6:
5778 return functor(var.m_impl.m_value6);
5779 case unit_variant::Type::Type7:
5780 return functor(var.m_impl.m_value7);
5785 template <
typename Visitor>
5786 auto apply(Visitor&& functor, unit_variant& var)
5790 case unit_variant::Type::Type0:
5791 return functor(var.m_impl.m_value0);
5792 case unit_variant::Type::Type1:
5793 return functor(var.m_impl.m_value1);
5794 case unit_variant::Type::Type2:
5795 return functor(var.m_impl.m_value2);
5796 case unit_variant::Type::Type3:
5797 return functor(var.m_impl.m_value3);
5798 case unit_variant::Type::Type4:
5799 return functor(var.m_impl.m_value4);
5800 case unit_variant::Type::Type5:
5801 return functor(var.m_impl.m_value5);
5802 case unit_variant::Type::Type6:
5803 return functor(var.m_impl.m_value6);
5804 case unit_variant::Type::Type7:
5805 return functor(var.m_impl.m_value7);
5810 template <
typename Visitor>
5811 auto apply(Visitor&& functor, unit_variant&& var)
5815 case unit_variant::Type::Type0:
5816 return functor(std::move(var.m_impl.m_value0));
5817 case unit_variant::Type::Type1:
5818 return functor(std::move(var.m_impl.m_value1));
5819 case unit_variant::Type::Type2:
5820 return functor(std::move(var.m_impl.m_value2));
5821 case unit_variant::Type::Type3:
5822 return functor(std::move(var.m_impl.m_value3));
5823 case unit_variant::Type::Type4:
5824 return functor(std::move(var.m_impl.m_value4));
5825 case unit_variant::Type::Type5:
5826 return functor(std::move(var.m_impl.m_value5));
5827 case unit_variant::Type::Type6:
5828 return functor(std::move(var.m_impl.m_value6));
5829 case unit_variant::Type::Type7:
5830 return functor(std::move(var.m_impl.m_value7));
5835 inline bool operator==(
const unit_variant& lhs,
const unit_variant& rhs)
5837 if(lhs.m_type == rhs.m_type)
5841 case unit_variant::Type::Type0:
5842 return lhs.m_impl.m_value0 == rhs.m_impl.m_value0;
5843 case unit_variant::Type::Type1:
5844 return lhs.m_impl.m_value1 == rhs.m_impl.m_value1;
5845 case unit_variant::Type::Type2:
5846 return lhs.m_impl.m_value2 == rhs.m_impl.m_value2;
5847 case unit_variant::Type::Type3:
5848 return lhs.m_impl.m_value3 == rhs.m_impl.m_value3;
5849 case unit_variant::Type::Type4:
5850 return lhs.m_impl.m_value4 == rhs.m_impl.m_value4;
5851 case unit_variant::Type::Type5:
5852 return lhs.m_impl.m_value5 == rhs.m_impl.m_value5;
5853 case unit_variant::Type::Type6:
5854 return lhs.m_impl.m_value6 == rhs.m_impl.m_value6;
5855 case unit_variant::Type::Type7:
5856 return lhs.m_impl.m_value7 == rhs.m_impl.m_value7;
5863 inline bool operator!=(
const unit_variant& lhs,
const unit_variant& rhs)
5865 if(lhs.m_type != rhs.m_type)
5869 case unit_variant::Type::Type0:
5870 return lhs.m_impl.m_value0 != rhs.m_impl.m_value0;
5871 case unit_variant::Type::Type1:
5872 return lhs.m_impl.m_value1 != rhs.m_impl.m_value1;
5873 case unit_variant::Type::Type2:
5874 return lhs.m_impl.m_value2 != rhs.m_impl.m_value2;
5875 case unit_variant::Type::Type3:
5876 return lhs.m_impl.m_value3 != rhs.m_impl.m_value3;
5877 case unit_variant::Type::Type4:
5878 return lhs.m_impl.m_value4 != rhs.m_impl.m_value4;
5879 case unit_variant::Type::Type5:
5880 return lhs.m_impl.m_value5 != rhs.m_impl.m_value5;
5881 case unit_variant::Type::Type6:
5882 return lhs.m_impl.m_value6 != rhs.m_impl.m_value6;
5883 case unit_variant::Type::Type7:
5884 return lhs.m_impl.m_value7 != rhs.m_impl.m_value7;
5890 inline bool operator==(
const unit_variant& lhs,
const ossia::distance_u& rhs)
5892 return (lhs.m_type == unit_variant::Type::Type0) && (lhs.m_impl.m_value0 == rhs);
5894 inline bool operator==(
const ossia::distance_u& lhs,
const unit_variant& rhs)
5896 return (rhs.m_type == unit_variant::Type::Type0) && (rhs.m_impl.m_value0 == lhs);
5898 inline bool operator!=(
const unit_variant& lhs,
const ossia::distance_u& rhs)
5900 return (lhs.m_type != unit_variant::Type::Type0) || (lhs.m_impl.m_value0 != rhs);
5902 inline bool operator!=(
const ossia::distance_u& lhs,
const unit_variant& rhs)
5904 return (rhs.m_type != unit_variant::Type::Type0) || (rhs.m_impl.m_value0 != lhs);
5906 inline bool operator==(
const unit_variant& lhs,
const ossia::position_u& rhs)
5908 return (lhs.m_type == unit_variant::Type::Type1) && (lhs.m_impl.m_value1 == rhs);
5910 inline bool operator==(
const ossia::position_u& lhs,
const unit_variant& rhs)
5912 return (rhs.m_type == unit_variant::Type::Type1) && (rhs.m_impl.m_value1 == lhs);
5914 inline bool operator!=(
const unit_variant& lhs,
const ossia::position_u& rhs)
5916 return (lhs.m_type != unit_variant::Type::Type1) || (lhs.m_impl.m_value1 != rhs);
5918 inline bool operator!=(
const ossia::position_u& lhs,
const unit_variant& rhs)
5920 return (rhs.m_type != unit_variant::Type::Type1) || (rhs.m_impl.m_value1 != lhs);
5922 inline bool operator==(
const unit_variant& lhs,
const ossia::speed_u& rhs)
5924 return (lhs.m_type == unit_variant::Type::Type2) && (lhs.m_impl.m_value2 == rhs);
5926 inline bool operator==(
const ossia::speed_u& lhs,
const unit_variant& rhs)
5928 return (rhs.m_type == unit_variant::Type::Type2) && (rhs.m_impl.m_value2 == lhs);
5930 inline bool operator!=(
const unit_variant& lhs,
const ossia::speed_u& rhs)
5932 return (lhs.m_type != unit_variant::Type::Type2) || (lhs.m_impl.m_value2 != rhs);
5934 inline bool operator!=(
const ossia::speed_u& lhs,
const unit_variant& rhs)
5936 return (rhs.m_type != unit_variant::Type::Type2) || (rhs.m_impl.m_value2 != lhs);
5938 inline bool operator==(
const unit_variant& lhs,
const ossia::orientation_u& rhs)
5940 return (lhs.m_type == unit_variant::Type::Type3) && (lhs.m_impl.m_value3 == rhs);
5942 inline bool operator==(
const ossia::orientation_u& lhs,
const unit_variant& rhs)
5944 return (rhs.m_type == unit_variant::Type::Type3) && (rhs.m_impl.m_value3 == lhs);
5946 inline bool operator!=(
const unit_variant& lhs,
const ossia::orientation_u& rhs)
5948 return (lhs.m_type != unit_variant::Type::Type3) || (lhs.m_impl.m_value3 != rhs);
5950 inline bool operator!=(
const ossia::orientation_u& lhs,
const unit_variant& rhs)
5952 return (rhs.m_type != unit_variant::Type::Type3) || (rhs.m_impl.m_value3 != lhs);
5954 inline bool operator==(
const unit_variant& lhs,
const ossia::angle_u& rhs)
5956 return (lhs.m_type == unit_variant::Type::Type4) && (lhs.m_impl.m_value4 == rhs);
5958 inline bool operator==(
const ossia::angle_u& lhs,
const unit_variant& rhs)
5960 return (rhs.m_type == unit_variant::Type::Type4) && (rhs.m_impl.m_value4 == lhs);
5962 inline bool operator!=(
const unit_variant& lhs,
const ossia::angle_u& rhs)
5964 return (lhs.m_type != unit_variant::Type::Type4) || (lhs.m_impl.m_value4 != rhs);
5966 inline bool operator!=(
const ossia::angle_u& lhs,
const unit_variant& rhs)
5968 return (rhs.m_type != unit_variant::Type::Type4) || (rhs.m_impl.m_value4 != lhs);
5970 inline bool operator==(
const unit_variant& lhs,
const ossia::color_u& rhs)
5972 return (lhs.m_type == unit_variant::Type::Type5) && (lhs.m_impl.m_value5 == rhs);
5974 inline bool operator==(
const ossia::color_u& lhs,
const unit_variant& rhs)
5976 return (rhs.m_type == unit_variant::Type::Type5) && (rhs.m_impl.m_value5 == lhs);
5978 inline bool operator!=(
const unit_variant& lhs,
const ossia::color_u& rhs)
5980 return (lhs.m_type != unit_variant::Type::Type5) || (lhs.m_impl.m_value5 != rhs);
5982 inline bool operator!=(
const ossia::color_u& lhs,
const unit_variant& rhs)
5984 return (rhs.m_type != unit_variant::Type::Type5) || (rhs.m_impl.m_value5 != lhs);
5986 inline bool operator==(
const unit_variant& lhs,
const ossia::gain_u& rhs)
5988 return (lhs.m_type == unit_variant::Type::Type6) && (lhs.m_impl.m_value6 == rhs);
5990 inline bool operator==(
const ossia::gain_u& lhs,
const unit_variant& rhs)
5992 return (rhs.m_type == unit_variant::Type::Type6) && (rhs.m_impl.m_value6 == lhs);
5994 inline bool operator!=(
const unit_variant& lhs,
const ossia::gain_u& rhs)
5996 return (lhs.m_type != unit_variant::Type::Type6) || (lhs.m_impl.m_value6 != rhs);
5998 inline bool operator!=(
const ossia::gain_u& lhs,
const unit_variant& rhs)
6000 return (rhs.m_type != unit_variant::Type::Type6) || (rhs.m_impl.m_value6 != lhs);
6002 inline bool operator==(
const unit_variant& lhs,
const ossia::timing_u& rhs)
6004 return (lhs.m_type == unit_variant::Type::Type7) && (lhs.m_impl.m_value7 == rhs);
6006 inline bool operator==(
const ossia::timing_u& lhs,
const unit_variant& rhs)
6008 return (rhs.m_type == unit_variant::Type::Type7) && (rhs.m_impl.m_value7 == lhs);
6010 inline bool operator!=(
const unit_variant& lhs,
const ossia::timing_u& rhs)
6012 return (lhs.m_type != unit_variant::Type::Type7) || (lhs.m_impl.m_value7 != rhs);
6014 inline bool operator!=(
const ossia::timing_u& lhs,
const unit_variant& rhs)
6016 return (rhs.m_type != unit_variant::Type::Type7) || (rhs.m_impl.m_value7 != lhs);
constexpr OSSIA_INLINE auto max(const T a, const U b) noexcept -> typename std::conditional<(sizeof(T) > sizeof(U)), T, U >::type
max function tailored for values
Definition: math.hpp:96
val_type matching_type(const unit_t &u)
underlying_type Get the implementation type of an unit
Definition: dataspace_visitors.cpp:198