9 ossia::degree m_value0;
11 ossia::radian m_value1;
40 static const constexpr
auto npos = Npos;
41 int which()
const {
return m_type; }
43 operator bool()
const {
return m_type != npos; }
45 const T* target()
const;
59 ~angle() { destruct_impl(); }
60 angle(ossia::degree v)
63 new(&m_impl.m_value0) ossia::degree{v};
65 angle(ossia::radian v)
68 new(&m_impl.m_value1) ossia::radian{v};
70 angle(
const angle& other)
71 : m_type{other.m_type}
76 new(&m_impl.m_value0) ossia::degree{other.m_impl.m_value0};
79 new(&m_impl.m_value1) ossia::radian{other.m_impl.m_value1};
86 : m_type{other.m_type}
91 new(&m_impl.m_value0) ossia::degree{std::move(other.m_impl.m_value0)};
94 new(&m_impl.m_value1) ossia::radian{std::move(other.m_impl.m_value1)};
100 angle& operator=(
const angle& other)
103 m_type = other.m_type;
107 new(&m_impl.m_value0) ossia::degree{other.m_impl.m_value0};
110 new(&m_impl.m_value1) ossia::radian{other.m_impl.m_value1};
117 angle& operator=(angle&& other)
120 m_type = other.m_type;
124 new(&m_impl.m_value0) ossia::degree{std::move(other.m_impl.m_value0)};
127 new(&m_impl.m_value1) ossia::radian{std::move(other.m_impl.m_value1)};
136 inline const ossia::degree* angle::target()
const
139 return &m_impl.m_value0;
143 inline const ossia::radian* angle::target()
const
146 return &m_impl.m_value1;
150 inline ossia::degree* angle::target()
153 return &m_impl.m_value0;
157 inline ossia::radian* angle::target()
160 return &m_impl.m_value1;
164 inline const ossia::degree& angle::get()
const
167 return m_impl.m_value0;
168 ossia_do_throw(std::runtime_error,
"angle: bad type");
171 inline const ossia::radian& angle::get()
const
174 return m_impl.m_value1;
175 ossia_do_throw(std::runtime_error,
"angle: bad type");
178 inline ossia::degree& angle::get()
181 return m_impl.m_value0;
182 ossia_do_throw(std::runtime_error,
"angle: bad type");
185 inline ossia::radian& angle::get()
188 return m_impl.m_value1;
189 ossia_do_throw(std::runtime_error,
"angle: bad type");
191 template <
typename Visitor>
192 auto apply_nonnull(Visitor&& functor,
const angle& var)
196 case angle::Type::Type0:
197 return functor(var.m_impl.m_value0);
198 case angle::Type::Type1:
199 return functor(var.m_impl.m_value1);
201 ossia_do_throw(std::runtime_error,
"angle: bad type");
204 template <
typename Visitor>
205 auto apply_nonnull(Visitor&& functor, angle& var)
209 case angle::Type::Type0:
210 return functor(var.m_impl.m_value0);
211 case angle::Type::Type1:
212 return functor(var.m_impl.m_value1);
214 ossia_do_throw(std::runtime_error,
"angle: bad type");
217 template <
typename Visitor>
218 auto apply_nonnull(Visitor&& functor, angle&& var)
222 case angle::Type::Type0:
223 return functor(std::move(var.m_impl.m_value0));
224 case angle::Type::Type1:
225 return functor(std::move(var.m_impl.m_value1));
227 ossia_do_throw(std::runtime_error,
"angle: bad type");
230 template <
typename Visitor>
231 auto apply(Visitor&& functor,
const angle& var)
235 case angle::Type::Type0:
236 return functor(var.m_impl.m_value0);
237 case angle::Type::Type1:
238 return functor(var.m_impl.m_value1);
243 template <
typename Visitor>
244 auto apply(Visitor&& functor, angle& var)
248 case angle::Type::Type0:
249 return functor(var.m_impl.m_value0);
250 case angle::Type::Type1:
251 return functor(var.m_impl.m_value1);
256 template <
typename Visitor>
257 auto apply(Visitor&& functor, angle&& var)
261 case angle::Type::Type0:
262 return functor(std::move(var.m_impl.m_value0));
263 case angle::Type::Type1:
264 return functor(std::move(var.m_impl.m_value1));
269 inline bool operator==(
const angle& lhs,
const angle& rhs)
271 if(lhs.m_type == rhs.m_type)
275 case angle::Type::Type0:
276 return lhs.m_impl.m_value0 == rhs.m_impl.m_value0;
277 case angle::Type::Type1:
278 return lhs.m_impl.m_value1 == rhs.m_impl.m_value1;
285 inline bool operator!=(
const angle& lhs,
const angle& rhs)
287 if(lhs.m_type != rhs.m_type)
291 case angle::Type::Type0:
292 return lhs.m_impl.m_value0 != rhs.m_impl.m_value0;
293 case angle::Type::Type1:
294 return lhs.m_impl.m_value1 != rhs.m_impl.m_value1;
300 inline bool operator==(
const angle& lhs,
const ossia::degree& rhs)
302 return (lhs.m_type == angle::Type::Type0) && (lhs.m_impl.m_value0 == rhs);
304 inline bool operator==(
const ossia::degree& lhs,
const angle& rhs)
306 return (rhs.m_type == angle::Type::Type0) && (rhs.m_impl.m_value0 == lhs);
308 inline bool operator!=(
const angle& lhs,
const ossia::degree& rhs)
310 return (lhs.m_type != angle::Type::Type0) || (lhs.m_impl.m_value0 != rhs);
312 inline bool operator!=(
const ossia::degree& lhs,
const angle& rhs)
314 return (rhs.m_type != angle::Type::Type0) || (rhs.m_impl.m_value0 != lhs);
316 inline bool operator==(
const angle& lhs,
const ossia::radian& rhs)
318 return (lhs.m_type == angle::Type::Type1) && (lhs.m_impl.m_value1 == rhs);
320 inline bool operator==(
const ossia::radian& lhs,
const angle& rhs)
322 return (rhs.m_type == angle::Type::Type1) && (rhs.m_impl.m_value1 == lhs);
324 inline bool operator!=(
const angle& lhs,
const ossia::radian& rhs)
326 return (lhs.m_type != angle::Type::Type1) || (lhs.m_impl.m_value1 != rhs);
328 inline bool operator!=(
const ossia::radian& lhs,
const angle& rhs)
330 return (rhs.m_type != angle::Type::Type1) || (rhs.m_impl.m_value1 != lhs);
340 ossia::argb m_value0;
342 ossia::rgba m_value1;
348 ossia::argb8 m_value4;
350 ossia::rgba8 m_value5;
354 ossia::cmy8 m_value7;
392 static const constexpr
auto npos = Npos;
393 int which()
const {
return m_type; }
395 operator bool()
const {
return m_type != npos; }
396 template <
typename T>
397 const T* target()
const;
398 template <
typename T>
400 template <
typename T>
401 const T& get()
const;
402 template <
typename T>
405 template <
typename T>
411 ~color() { destruct_impl(); }
415 new(&m_impl.m_value0) ossia::argb{v};
420 new(&m_impl.m_value1) ossia::rgba{v};
425 new(&m_impl.m_value2) ossia::rgb{v};
430 new(&m_impl.m_value3) ossia::bgr{v};
432 color(ossia::argb8 v)
435 new(&m_impl.m_value4) ossia::argb8{v};
437 color(ossia::rgba8 v)
440 new(&m_impl.m_value5) ossia::rgba8{v};
445 new(&m_impl.m_value6) ossia::hsv{v};
450 new(&m_impl.m_value7) ossia::cmy8{v};
455 new(&m_impl.m_value8) ossia::xyz{v};
457 color(
const color& other)
458 : m_type{other.m_type}
463 new(&m_impl.m_value0) ossia::argb{other.m_impl.m_value0};
466 new(&m_impl.m_value1) ossia::rgba{other.m_impl.m_value1};
469 new(&m_impl.m_value2) ossia::rgb{other.m_impl.m_value2};
472 new(&m_impl.m_value3) ossia::bgr{other.m_impl.m_value3};
475 new(&m_impl.m_value4) ossia::argb8{other.m_impl.m_value4};
478 new(&m_impl.m_value5) ossia::rgba8{other.m_impl.m_value5};
481 new(&m_impl.m_value6) ossia::hsv{other.m_impl.m_value6};
484 new(&m_impl.m_value7) ossia::cmy8{other.m_impl.m_value7};
487 new(&m_impl.m_value8) ossia::xyz{other.m_impl.m_value8};
494 : m_type{other.m_type}
499 new(&m_impl.m_value0) ossia::argb{std::move(other.m_impl.m_value0)};
502 new(&m_impl.m_value1) ossia::rgba{std::move(other.m_impl.m_value1)};
505 new(&m_impl.m_value2) ossia::rgb{std::move(other.m_impl.m_value2)};
508 new(&m_impl.m_value3) ossia::bgr{std::move(other.m_impl.m_value3)};
511 new(&m_impl.m_value4) ossia::argb8{std::move(other.m_impl.m_value4)};
514 new(&m_impl.m_value5) ossia::rgba8{std::move(other.m_impl.m_value5)};
517 new(&m_impl.m_value6) ossia::hsv{std::move(other.m_impl.m_value6)};
520 new(&m_impl.m_value7) ossia::cmy8{std::move(other.m_impl.m_value7)};
523 new(&m_impl.m_value8) ossia::xyz{std::move(other.m_impl.m_value8)};
529 color& operator=(
const color& other)
532 m_type = other.m_type;
536 new(&m_impl.m_value0) ossia::argb{other.m_impl.m_value0};
539 new(&m_impl.m_value1) ossia::rgba{other.m_impl.m_value1};
542 new(&m_impl.m_value2) ossia::rgb{other.m_impl.m_value2};
545 new(&m_impl.m_value3) ossia::bgr{other.m_impl.m_value3};
548 new(&m_impl.m_value4) ossia::argb8{other.m_impl.m_value4};
551 new(&m_impl.m_value5) ossia::rgba8{other.m_impl.m_value5};
554 new(&m_impl.m_value6) ossia::hsv{other.m_impl.m_value6};
557 new(&m_impl.m_value7) ossia::cmy8{other.m_impl.m_value7};
560 new(&m_impl.m_value8) ossia::xyz{other.m_impl.m_value8};
567 color& operator=(color&& other)
570 m_type = other.m_type;
574 new(&m_impl.m_value0) ossia::argb{std::move(other.m_impl.m_value0)};
577 new(&m_impl.m_value1) ossia::rgba{std::move(other.m_impl.m_value1)};
580 new(&m_impl.m_value2) ossia::rgb{std::move(other.m_impl.m_value2)};
583 new(&m_impl.m_value3) ossia::bgr{std::move(other.m_impl.m_value3)};
586 new(&m_impl.m_value4) ossia::argb8{std::move(other.m_impl.m_value4)};
589 new(&m_impl.m_value5) ossia::rgba8{std::move(other.m_impl.m_value5)};
592 new(&m_impl.m_value6) ossia::hsv{std::move(other.m_impl.m_value6)};
595 new(&m_impl.m_value7) ossia::cmy8{std::move(other.m_impl.m_value7)};
598 new(&m_impl.m_value8) ossia::xyz{std::move(other.m_impl.m_value8)};
607 inline const ossia::argb* color::target()
const
610 return &m_impl.m_value0;
614 inline const ossia::rgba* color::target()
const
617 return &m_impl.m_value1;
621 inline const ossia::rgb* color::target()
const
624 return &m_impl.m_value2;
628 inline const ossia::bgr* color::target()
const
631 return &m_impl.m_value3;
635 inline const ossia::argb8* color::target()
const
638 return &m_impl.m_value4;
642 inline const ossia::rgba8* color::target()
const
645 return &m_impl.m_value5;
649 inline const ossia::hsv* color::target()
const
652 return &m_impl.m_value6;
656 inline const ossia::cmy8* color::target()
const
659 return &m_impl.m_value7;
663 inline const ossia::xyz* color::target()
const
666 return &m_impl.m_value8;
670 inline ossia::argb* color::target()
673 return &m_impl.m_value0;
677 inline ossia::rgba* color::target()
680 return &m_impl.m_value1;
684 inline ossia::rgb* color::target()
687 return &m_impl.m_value2;
691 inline ossia::bgr* color::target()
694 return &m_impl.m_value3;
698 inline ossia::argb8* color::target()
701 return &m_impl.m_value4;
705 inline ossia::rgba8* color::target()
708 return &m_impl.m_value5;
712 inline ossia::hsv* color::target()
715 return &m_impl.m_value6;
719 inline ossia::cmy8* color::target()
722 return &m_impl.m_value7;
726 inline ossia::xyz* color::target()
729 return &m_impl.m_value8;
733 inline const ossia::argb& color::get()
const
736 return m_impl.m_value0;
737 ossia_do_throw(std::runtime_error,
"color: bad type");
740 inline const ossia::rgba& color::get()
const
743 return m_impl.m_value1;
744 ossia_do_throw(std::runtime_error,
"color: bad type");
747 inline const ossia::rgb& color::get()
const
750 return m_impl.m_value2;
751 ossia_do_throw(std::runtime_error,
"color: bad type");
754 inline const ossia::bgr& color::get()
const
757 return m_impl.m_value3;
758 ossia_do_throw(std::runtime_error,
"color: bad type");
761 inline const ossia::argb8& color::get()
const
764 return m_impl.m_value4;
765 ossia_do_throw(std::runtime_error,
"color: bad type");
768 inline const ossia::rgba8& color::get()
const
771 return m_impl.m_value5;
772 ossia_do_throw(std::runtime_error,
"color: bad type");
775 inline const ossia::hsv& color::get()
const
778 return m_impl.m_value6;
779 ossia_do_throw(std::runtime_error,
"color: bad type");
782 inline const ossia::cmy8& color::get()
const
785 return m_impl.m_value7;
786 ossia_do_throw(std::runtime_error,
"color: bad type");
789 inline const ossia::xyz& color::get()
const
792 return m_impl.m_value8;
793 ossia_do_throw(std::runtime_error,
"color: bad type");
796 inline ossia::argb& color::get()
799 return m_impl.m_value0;
800 ossia_do_throw(std::runtime_error,
"color: bad type");
803 inline ossia::rgba& color::get()
806 return m_impl.m_value1;
807 ossia_do_throw(std::runtime_error,
"color: bad type");
810 inline ossia::rgb& color::get()
813 return m_impl.m_value2;
814 ossia_do_throw(std::runtime_error,
"color: bad type");
817 inline ossia::bgr& color::get()
820 return m_impl.m_value3;
821 ossia_do_throw(std::runtime_error,
"color: bad type");
824 inline ossia::argb8& color::get()
827 return m_impl.m_value4;
828 ossia_do_throw(std::runtime_error,
"color: bad type");
831 inline ossia::rgba8& color::get()
834 return m_impl.m_value5;
835 ossia_do_throw(std::runtime_error,
"color: bad type");
838 inline ossia::hsv& color::get()
841 return m_impl.m_value6;
842 ossia_do_throw(std::runtime_error,
"color: bad type");
845 inline ossia::cmy8& color::get()
848 return m_impl.m_value7;
849 ossia_do_throw(std::runtime_error,
"color: bad type");
852 inline ossia::xyz& color::get()
855 return m_impl.m_value8;
856 ossia_do_throw(std::runtime_error,
"color: bad type");
858 template <
typename Visitor>
859 auto apply_nonnull(Visitor&& functor,
const color& var)
863 case color::Type::Type0:
864 return functor(var.m_impl.m_value0);
865 case color::Type::Type1:
866 return functor(var.m_impl.m_value1);
867 case color::Type::Type2:
868 return functor(var.m_impl.m_value2);
869 case color::Type::Type3:
870 return functor(var.m_impl.m_value3);
871 case color::Type::Type4:
872 return functor(var.m_impl.m_value4);
873 case color::Type::Type5:
874 return functor(var.m_impl.m_value5);
875 case color::Type::Type6:
876 return functor(var.m_impl.m_value6);
877 case color::Type::Type7:
878 return functor(var.m_impl.m_value7);
879 case color::Type::Type8:
880 return functor(var.m_impl.m_value8);
882 ossia_do_throw(std::runtime_error,
"color: bad type");
885 template <
typename Visitor>
886 auto apply_nonnull(Visitor&& functor, color& var)
890 case color::Type::Type0:
891 return functor(var.m_impl.m_value0);
892 case color::Type::Type1:
893 return functor(var.m_impl.m_value1);
894 case color::Type::Type2:
895 return functor(var.m_impl.m_value2);
896 case color::Type::Type3:
897 return functor(var.m_impl.m_value3);
898 case color::Type::Type4:
899 return functor(var.m_impl.m_value4);
900 case color::Type::Type5:
901 return functor(var.m_impl.m_value5);
902 case color::Type::Type6:
903 return functor(var.m_impl.m_value6);
904 case color::Type::Type7:
905 return functor(var.m_impl.m_value7);
906 case color::Type::Type8:
907 return functor(var.m_impl.m_value8);
909 ossia_do_throw(std::runtime_error,
"color: bad type");
912 template <
typename Visitor>
913 auto apply_nonnull(Visitor&& functor, color&& var)
917 case color::Type::Type0:
918 return functor(std::move(var.m_impl.m_value0));
919 case color::Type::Type1:
920 return functor(std::move(var.m_impl.m_value1));
921 case color::Type::Type2:
922 return functor(std::move(var.m_impl.m_value2));
923 case color::Type::Type3:
924 return functor(std::move(var.m_impl.m_value3));
925 case color::Type::Type4:
926 return functor(std::move(var.m_impl.m_value4));
927 case color::Type::Type5:
928 return functor(std::move(var.m_impl.m_value5));
929 case color::Type::Type6:
930 return functor(std::move(var.m_impl.m_value6));
931 case color::Type::Type7:
932 return functor(std::move(var.m_impl.m_value7));
933 case color::Type::Type8:
934 return functor(std::move(var.m_impl.m_value8));
936 ossia_do_throw(std::runtime_error,
"color: bad type");
939 template <
typename Visitor>
940 auto apply(Visitor&& functor,
const color& var)
944 case color::Type::Type0:
945 return functor(var.m_impl.m_value0);
946 case color::Type::Type1:
947 return functor(var.m_impl.m_value1);
948 case color::Type::Type2:
949 return functor(var.m_impl.m_value2);
950 case color::Type::Type3:
951 return functor(var.m_impl.m_value3);
952 case color::Type::Type4:
953 return functor(var.m_impl.m_value4);
954 case color::Type::Type5:
955 return functor(var.m_impl.m_value5);
956 case color::Type::Type6:
957 return functor(var.m_impl.m_value6);
958 case color::Type::Type7:
959 return functor(var.m_impl.m_value7);
960 case color::Type::Type8:
961 return functor(var.m_impl.m_value8);
966 template <
typename Visitor>
967 auto apply(Visitor&& functor, color& var)
971 case color::Type::Type0:
972 return functor(var.m_impl.m_value0);
973 case color::Type::Type1:
974 return functor(var.m_impl.m_value1);
975 case color::Type::Type2:
976 return functor(var.m_impl.m_value2);
977 case color::Type::Type3:
978 return functor(var.m_impl.m_value3);
979 case color::Type::Type4:
980 return functor(var.m_impl.m_value4);
981 case color::Type::Type5:
982 return functor(var.m_impl.m_value5);
983 case color::Type::Type6:
984 return functor(var.m_impl.m_value6);
985 case color::Type::Type7:
986 return functor(var.m_impl.m_value7);
987 case color::Type::Type8:
988 return functor(var.m_impl.m_value8);
993 template <
typename Visitor>
994 auto apply(Visitor&& functor, color&& var)
998 case color::Type::Type0:
999 return functor(std::move(var.m_impl.m_value0));
1000 case color::Type::Type1:
1001 return functor(std::move(var.m_impl.m_value1));
1002 case color::Type::Type2:
1003 return functor(std::move(var.m_impl.m_value2));
1004 case color::Type::Type3:
1005 return functor(std::move(var.m_impl.m_value3));
1006 case color::Type::Type4:
1007 return functor(std::move(var.m_impl.m_value4));
1008 case color::Type::Type5:
1009 return functor(std::move(var.m_impl.m_value5));
1010 case color::Type::Type6:
1011 return functor(std::move(var.m_impl.m_value6));
1012 case color::Type::Type7:
1013 return functor(std::move(var.m_impl.m_value7));
1014 case color::Type::Type8:
1015 return functor(std::move(var.m_impl.m_value8));
1020 inline bool operator==(
const color& lhs,
const color& rhs)
1022 if(lhs.m_type == rhs.m_type)
1026 case color::Type::Type0:
1027 return lhs.m_impl.m_value0 == rhs.m_impl.m_value0;
1028 case color::Type::Type1:
1029 return lhs.m_impl.m_value1 == rhs.m_impl.m_value1;
1030 case color::Type::Type2:
1031 return lhs.m_impl.m_value2 == rhs.m_impl.m_value2;
1032 case color::Type::Type3:
1033 return lhs.m_impl.m_value3 == rhs.m_impl.m_value3;
1034 case color::Type::Type4:
1035 return lhs.m_impl.m_value4 == rhs.m_impl.m_value4;
1036 case color::Type::Type5:
1037 return lhs.m_impl.m_value5 == rhs.m_impl.m_value5;
1038 case color::Type::Type6:
1039 return lhs.m_impl.m_value6 == rhs.m_impl.m_value6;
1040 case color::Type::Type7:
1041 return lhs.m_impl.m_value7 == rhs.m_impl.m_value7;
1042 case color::Type::Type8:
1043 return lhs.m_impl.m_value8 == rhs.m_impl.m_value8;
1050 inline bool operator!=(
const color& lhs,
const color& rhs)
1052 if(lhs.m_type != rhs.m_type)
1056 case color::Type::Type0:
1057 return lhs.m_impl.m_value0 != rhs.m_impl.m_value0;
1058 case color::Type::Type1:
1059 return lhs.m_impl.m_value1 != rhs.m_impl.m_value1;
1060 case color::Type::Type2:
1061 return lhs.m_impl.m_value2 != rhs.m_impl.m_value2;
1062 case color::Type::Type3:
1063 return lhs.m_impl.m_value3 != rhs.m_impl.m_value3;
1064 case color::Type::Type4:
1065 return lhs.m_impl.m_value4 != rhs.m_impl.m_value4;
1066 case color::Type::Type5:
1067 return lhs.m_impl.m_value5 != rhs.m_impl.m_value5;
1068 case color::Type::Type6:
1069 return lhs.m_impl.m_value6 != rhs.m_impl.m_value6;
1070 case color::Type::Type7:
1071 return lhs.m_impl.m_value7 != rhs.m_impl.m_value7;
1072 case color::Type::Type8:
1073 return lhs.m_impl.m_value8 != rhs.m_impl.m_value8;
1079 inline bool operator==(
const color& lhs,
const ossia::argb& rhs)
1081 return (lhs.m_type == color::Type::Type0) && (lhs.m_impl.m_value0 == rhs);
1083 inline bool operator==(
const ossia::argb& lhs,
const color& rhs)
1085 return (rhs.m_type == color::Type::Type0) && (rhs.m_impl.m_value0 == lhs);
1087 inline bool operator!=(
const color& lhs,
const ossia::argb& rhs)
1089 return (lhs.m_type != color::Type::Type0) || (lhs.m_impl.m_value0 != rhs);
1091 inline bool operator!=(
const ossia::argb& lhs,
const color& rhs)
1093 return (rhs.m_type != color::Type::Type0) || (rhs.m_impl.m_value0 != lhs);
1095 inline bool operator==(
const color& lhs,
const ossia::rgba& rhs)
1097 return (lhs.m_type == color::Type::Type1) && (lhs.m_impl.m_value1 == rhs);
1099 inline bool operator==(
const ossia::rgba& lhs,
const color& rhs)
1101 return (rhs.m_type == color::Type::Type1) && (rhs.m_impl.m_value1 == lhs);
1103 inline bool operator!=(
const color& lhs,
const ossia::rgba& rhs)
1105 return (lhs.m_type != color::Type::Type1) || (lhs.m_impl.m_value1 != rhs);
1107 inline bool operator!=(
const ossia::rgba& lhs,
const color& rhs)
1109 return (rhs.m_type != color::Type::Type1) || (rhs.m_impl.m_value1 != lhs);
1111 inline bool operator==(
const color& lhs,
const ossia::rgb& rhs)
1113 return (lhs.m_type == color::Type::Type2) && (lhs.m_impl.m_value2 == rhs);
1115 inline bool operator==(
const ossia::rgb& lhs,
const color& rhs)
1117 return (rhs.m_type == color::Type::Type2) && (rhs.m_impl.m_value2 == lhs);
1119 inline bool operator!=(
const color& lhs,
const ossia::rgb& rhs)
1121 return (lhs.m_type != color::Type::Type2) || (lhs.m_impl.m_value2 != rhs);
1123 inline bool operator!=(
const ossia::rgb& lhs,
const color& rhs)
1125 return (rhs.m_type != color::Type::Type2) || (rhs.m_impl.m_value2 != lhs);
1127 inline bool operator==(
const color& lhs,
const ossia::bgr& rhs)
1129 return (lhs.m_type == color::Type::Type3) && (lhs.m_impl.m_value3 == rhs);
1131 inline bool operator==(
const ossia::bgr& lhs,
const color& rhs)
1133 return (rhs.m_type == color::Type::Type3) && (rhs.m_impl.m_value3 == lhs);
1135 inline bool operator!=(
const color& lhs,
const ossia::bgr& rhs)
1137 return (lhs.m_type != color::Type::Type3) || (lhs.m_impl.m_value3 != rhs);
1139 inline bool operator!=(
const ossia::bgr& lhs,
const color& rhs)
1141 return (rhs.m_type != color::Type::Type3) || (rhs.m_impl.m_value3 != lhs);
1143 inline bool operator==(
const color& lhs,
const ossia::argb8& rhs)
1145 return (lhs.m_type == color::Type::Type4) && (lhs.m_impl.m_value4 == rhs);
1147 inline bool operator==(
const ossia::argb8& lhs,
const color& rhs)
1149 return (rhs.m_type == color::Type::Type4) && (rhs.m_impl.m_value4 == lhs);
1151 inline bool operator!=(
const color& lhs,
const ossia::argb8& rhs)
1153 return (lhs.m_type != color::Type::Type4) || (lhs.m_impl.m_value4 != rhs);
1155 inline bool operator!=(
const ossia::argb8& lhs,
const color& rhs)
1157 return (rhs.m_type != color::Type::Type4) || (rhs.m_impl.m_value4 != lhs);
1159 inline bool operator==(
const color& lhs,
const ossia::rgba8& rhs)
1161 return (lhs.m_type == color::Type::Type5) && (lhs.m_impl.m_value5 == rhs);
1163 inline bool operator==(
const ossia::rgba8& lhs,
const color& rhs)
1165 return (rhs.m_type == color::Type::Type5) && (rhs.m_impl.m_value5 == lhs);
1167 inline bool operator!=(
const color& lhs,
const ossia::rgba8& rhs)
1169 return (lhs.m_type != color::Type::Type5) || (lhs.m_impl.m_value5 != rhs);
1171 inline bool operator!=(
const ossia::rgba8& lhs,
const color& rhs)
1173 return (rhs.m_type != color::Type::Type5) || (rhs.m_impl.m_value5 != lhs);
1175 inline bool operator==(
const color& lhs,
const ossia::hsv& rhs)
1177 return (lhs.m_type == color::Type::Type6) && (lhs.m_impl.m_value6 == rhs);
1179 inline bool operator==(
const ossia::hsv& lhs,
const color& rhs)
1181 return (rhs.m_type == color::Type::Type6) && (rhs.m_impl.m_value6 == lhs);
1183 inline bool operator!=(
const color& lhs,
const ossia::hsv& rhs)
1185 return (lhs.m_type != color::Type::Type6) || (lhs.m_impl.m_value6 != rhs);
1187 inline bool operator!=(
const ossia::hsv& lhs,
const color& rhs)
1189 return (rhs.m_type != color::Type::Type6) || (rhs.m_impl.m_value6 != lhs);
1191 inline bool operator==(
const color& lhs,
const ossia::cmy8& rhs)
1193 return (lhs.m_type == color::Type::Type7) && (lhs.m_impl.m_value7 == rhs);
1195 inline bool operator==(
const ossia::cmy8& lhs,
const color& rhs)
1197 return (rhs.m_type == color::Type::Type7) && (rhs.m_impl.m_value7 == lhs);
1199 inline bool operator!=(
const color& lhs,
const ossia::cmy8& rhs)
1201 return (lhs.m_type != color::Type::Type7) || (lhs.m_impl.m_value7 != rhs);
1203 inline bool operator!=(
const ossia::cmy8& lhs,
const color& rhs)
1205 return (rhs.m_type != color::Type::Type7) || (rhs.m_impl.m_value7 != lhs);
1207 inline bool operator==(
const color& lhs,
const ossia::xyz& rhs)
1209 return (lhs.m_type == color::Type::Type8) && (lhs.m_impl.m_value8 == rhs);
1211 inline bool operator==(
const ossia::xyz& lhs,
const color& rhs)
1213 return (rhs.m_type == color::Type::Type8) && (rhs.m_impl.m_value8 == lhs);
1215 inline bool operator!=(
const color& lhs,
const ossia::xyz& rhs)
1217 return (lhs.m_type != color::Type::Type8) || (lhs.m_impl.m_value8 != rhs);
1219 inline bool operator!=(
const ossia::xyz& lhs,
const color& rhs)
1221 return (rhs.m_type != color::Type::Type8) || (rhs.m_impl.m_value8 != lhs);
1231 ossia::meter m_value0;
1233 ossia::kilometer m_value1;
1235 ossia::decimeter m_value2;
1237 ossia::centimeter m_value3;
1239 ossia::millimeter m_value4;
1241 ossia::micrometer m_value5;
1243 ossia::nanometer m_value6;
1245 ossia::picometer m_value7;
1247 ossia::inch m_value8;
1249 ossia::foot m_value9;
1251 ossia::mile m_value10;
1277 void destruct_impl()
1289 static const constexpr
auto npos = Npos;
1290 int which()
const {
return m_type; }
1292 operator bool()
const {
return m_type != npos; }
1293 template <
typename T>
1294 const T* target()
const;
1295 template <
typename T>
1297 template <
typename T>
1298 const T& get()
const;
1299 template <
typename T>
1302 template <
typename T>
1308 ~distance() { destruct_impl(); }
1309 distance(ossia::meter v)
1312 new(&m_impl.m_value0) ossia::meter{v};
1314 distance(ossia::kilometer v)
1317 new(&m_impl.m_value1) ossia::kilometer{v};
1319 distance(ossia::decimeter v)
1322 new(&m_impl.m_value2) ossia::decimeter{v};
1324 distance(ossia::centimeter v)
1327 new(&m_impl.m_value3) ossia::centimeter{v};
1329 distance(ossia::millimeter v)
1332 new(&m_impl.m_value4) ossia::millimeter{v};
1334 distance(ossia::micrometer v)
1337 new(&m_impl.m_value5) ossia::micrometer{v};
1339 distance(ossia::nanometer v)
1342 new(&m_impl.m_value6) ossia::nanometer{v};
1344 distance(ossia::picometer v)
1347 new(&m_impl.m_value7) ossia::picometer{v};
1349 distance(ossia::inch v)
1352 new(&m_impl.m_value8) ossia::inch{v};
1354 distance(ossia::foot v)
1357 new(&m_impl.m_value9) ossia::foot{v};
1359 distance(ossia::mile v)
1362 new(&m_impl.m_value10) ossia::mile{v};
1364 distance(
const distance& other)
1365 : m_type{other.m_type}
1370 new(&m_impl.m_value0) ossia::meter{other.m_impl.m_value0};
1373 new(&m_impl.m_value1) ossia::kilometer{other.m_impl.m_value1};
1376 new(&m_impl.m_value2) ossia::decimeter{other.m_impl.m_value2};
1379 new(&m_impl.m_value3) ossia::centimeter{other.m_impl.m_value3};
1382 new(&m_impl.m_value4) ossia::millimeter{other.m_impl.m_value4};
1385 new(&m_impl.m_value5) ossia::micrometer{other.m_impl.m_value5};
1388 new(&m_impl.m_value6) ossia::nanometer{other.m_impl.m_value6};
1391 new(&m_impl.m_value7) ossia::picometer{other.m_impl.m_value7};
1394 new(&m_impl.m_value8) ossia::inch{other.m_impl.m_value8};
1397 new(&m_impl.m_value9) ossia::foot{other.m_impl.m_value9};
1400 new(&m_impl.m_value10) ossia::mile{other.m_impl.m_value10};
1406 distance(distance&& other)
1407 : m_type{other.m_type}
1412 new(&m_impl.m_value0) ossia::meter{std::move(other.m_impl.m_value0)};
1415 new(&m_impl.m_value1) ossia::kilometer{std::move(other.m_impl.m_value1)};
1418 new(&m_impl.m_value2) ossia::decimeter{std::move(other.m_impl.m_value2)};
1421 new(&m_impl.m_value3) ossia::centimeter{std::move(other.m_impl.m_value3)};
1424 new(&m_impl.m_value4) ossia::millimeter{std::move(other.m_impl.m_value4)};
1427 new(&m_impl.m_value5) ossia::micrometer{std::move(other.m_impl.m_value5)};
1430 new(&m_impl.m_value6) ossia::nanometer{std::move(other.m_impl.m_value6)};
1433 new(&m_impl.m_value7) ossia::picometer{std::move(other.m_impl.m_value7)};
1436 new(&m_impl.m_value8) ossia::inch{std::move(other.m_impl.m_value8)};
1439 new(&m_impl.m_value9) ossia::foot{std::move(other.m_impl.m_value9)};
1442 new(&m_impl.m_value10) ossia::mile{std::move(other.m_impl.m_value10)};
1448 distance& operator=(
const distance& other)
1451 m_type = other.m_type;
1455 new(&m_impl.m_value0) ossia::meter{other.m_impl.m_value0};
1458 new(&m_impl.m_value1) ossia::kilometer{other.m_impl.m_value1};
1461 new(&m_impl.m_value2) ossia::decimeter{other.m_impl.m_value2};
1464 new(&m_impl.m_value3) ossia::centimeter{other.m_impl.m_value3};
1467 new(&m_impl.m_value4) ossia::millimeter{other.m_impl.m_value4};
1470 new(&m_impl.m_value5) ossia::micrometer{other.m_impl.m_value5};
1473 new(&m_impl.m_value6) ossia::nanometer{other.m_impl.m_value6};
1476 new(&m_impl.m_value7) ossia::picometer{other.m_impl.m_value7};
1479 new(&m_impl.m_value8) ossia::inch{other.m_impl.m_value8};
1482 new(&m_impl.m_value9) ossia::foot{other.m_impl.m_value9};
1485 new(&m_impl.m_value10) ossia::mile{other.m_impl.m_value10};
1492 distance& operator=(distance&& other)
1495 m_type = other.m_type;
1499 new(&m_impl.m_value0) ossia::meter{std::move(other.m_impl.m_value0)};
1502 new(&m_impl.m_value1) ossia::kilometer{std::move(other.m_impl.m_value1)};
1505 new(&m_impl.m_value2) ossia::decimeter{std::move(other.m_impl.m_value2)};
1508 new(&m_impl.m_value3) ossia::centimeter{std::move(other.m_impl.m_value3)};
1511 new(&m_impl.m_value4) ossia::millimeter{std::move(other.m_impl.m_value4)};
1514 new(&m_impl.m_value5) ossia::micrometer{std::move(other.m_impl.m_value5)};
1517 new(&m_impl.m_value6) ossia::nanometer{std::move(other.m_impl.m_value6)};
1520 new(&m_impl.m_value7) ossia::picometer{std::move(other.m_impl.m_value7)};
1523 new(&m_impl.m_value8) ossia::inch{std::move(other.m_impl.m_value8)};
1526 new(&m_impl.m_value9) ossia::foot{std::move(other.m_impl.m_value9)};
1529 new(&m_impl.m_value10) ossia::mile{std::move(other.m_impl.m_value10)};
1538 inline const ossia::meter* distance::target()
const
1541 return &m_impl.m_value0;
1545 inline const ossia::kilometer* distance::target()
const
1548 return &m_impl.m_value1;
1552 inline const ossia::decimeter* distance::target()
const
1555 return &m_impl.m_value2;
1559 inline const ossia::centimeter* distance::target()
const
1562 return &m_impl.m_value3;
1566 inline const ossia::millimeter* distance::target()
const
1569 return &m_impl.m_value4;
1573 inline const ossia::micrometer* distance::target()
const
1576 return &m_impl.m_value5;
1580 inline const ossia::nanometer* distance::target()
const
1583 return &m_impl.m_value6;
1587 inline const ossia::picometer* distance::target()
const
1590 return &m_impl.m_value7;
1594 inline const ossia::inch* distance::target()
const
1597 return &m_impl.m_value8;
1601 inline const ossia::foot* distance::target()
const
1604 return &m_impl.m_value9;
1608 inline const ossia::mile* distance::target()
const
1610 if(m_type == Type10)
1611 return &m_impl.m_value10;
1615 inline ossia::meter* distance::target()
1618 return &m_impl.m_value0;
1622 inline ossia::kilometer* distance::target()
1625 return &m_impl.m_value1;
1629 inline ossia::decimeter* distance::target()
1632 return &m_impl.m_value2;
1636 inline ossia::centimeter* distance::target()
1639 return &m_impl.m_value3;
1643 inline ossia::millimeter* distance::target()
1646 return &m_impl.m_value4;
1650 inline ossia::micrometer* distance::target()
1653 return &m_impl.m_value5;
1657 inline ossia::nanometer* distance::target()
1660 return &m_impl.m_value6;
1664 inline ossia::picometer* distance::target()
1667 return &m_impl.m_value7;
1671 inline ossia::inch* distance::target()
1674 return &m_impl.m_value8;
1678 inline ossia::foot* distance::target()
1681 return &m_impl.m_value9;
1685 inline ossia::mile* distance::target()
1687 if(m_type == Type10)
1688 return &m_impl.m_value10;
1692 inline const ossia::meter& distance::get()
const
1695 return m_impl.m_value0;
1696 ossia_do_throw(std::runtime_error,
"distance: bad type");
1699 inline const ossia::kilometer& distance::get()
const
1702 return m_impl.m_value1;
1703 ossia_do_throw(std::runtime_error,
"distance: bad type");
1706 inline const ossia::decimeter& distance::get()
const
1709 return m_impl.m_value2;
1710 ossia_do_throw(std::runtime_error,
"distance: bad type");
1713 inline const ossia::centimeter& distance::get()
const
1716 return m_impl.m_value3;
1717 ossia_do_throw(std::runtime_error,
"distance: bad type");
1720 inline const ossia::millimeter& distance::get()
const
1723 return m_impl.m_value4;
1724 ossia_do_throw(std::runtime_error,
"distance: bad type");
1727 inline const ossia::micrometer& distance::get()
const
1730 return m_impl.m_value5;
1731 ossia_do_throw(std::runtime_error,
"distance: bad type");
1734 inline const ossia::nanometer& distance::get()
const
1737 return m_impl.m_value6;
1738 ossia_do_throw(std::runtime_error,
"distance: bad type");
1741 inline const ossia::picometer& distance::get()
const
1744 return m_impl.m_value7;
1745 ossia_do_throw(std::runtime_error,
"distance: bad type");
1748 inline const ossia::inch& distance::get()
const
1751 return m_impl.m_value8;
1752 ossia_do_throw(std::runtime_error,
"distance: bad type");
1755 inline const ossia::foot& distance::get()
const
1758 return m_impl.m_value9;
1759 ossia_do_throw(std::runtime_error,
"distance: bad type");
1762 inline const ossia::mile& distance::get()
const
1764 if(m_type == Type10)
1765 return m_impl.m_value10;
1766 ossia_do_throw(std::runtime_error,
"distance: bad type");
1769 inline ossia::meter& distance::get()
1772 return m_impl.m_value0;
1773 ossia_do_throw(std::runtime_error,
"distance: bad type");
1776 inline ossia::kilometer& distance::get()
1779 return m_impl.m_value1;
1780 ossia_do_throw(std::runtime_error,
"distance: bad type");
1783 inline ossia::decimeter& distance::get()
1786 return m_impl.m_value2;
1787 ossia_do_throw(std::runtime_error,
"distance: bad type");
1790 inline ossia::centimeter& distance::get()
1793 return m_impl.m_value3;
1794 ossia_do_throw(std::runtime_error,
"distance: bad type");
1797 inline ossia::millimeter& distance::get()
1800 return m_impl.m_value4;
1801 ossia_do_throw(std::runtime_error,
"distance: bad type");
1804 inline ossia::micrometer& distance::get()
1807 return m_impl.m_value5;
1808 ossia_do_throw(std::runtime_error,
"distance: bad type");
1811 inline ossia::nanometer& distance::get()
1814 return m_impl.m_value6;
1815 ossia_do_throw(std::runtime_error,
"distance: bad type");
1818 inline ossia::picometer& distance::get()
1821 return m_impl.m_value7;
1822 ossia_do_throw(std::runtime_error,
"distance: bad type");
1825 inline ossia::inch& distance::get()
1828 return m_impl.m_value8;
1829 ossia_do_throw(std::runtime_error,
"distance: bad type");
1832 inline ossia::foot& distance::get()
1835 return m_impl.m_value9;
1836 ossia_do_throw(std::runtime_error,
"distance: bad type");
1839 inline ossia::mile& distance::get()
1841 if(m_type == Type10)
1842 return m_impl.m_value10;
1843 ossia_do_throw(std::runtime_error,
"distance: bad type");
1845 template <
typename Visitor>
1846 auto apply_nonnull(Visitor&& functor,
const distance& var)
1850 case distance::Type::Type0:
1851 return functor(var.m_impl.m_value0);
1852 case distance::Type::Type1:
1853 return functor(var.m_impl.m_value1);
1854 case distance::Type::Type2:
1855 return functor(var.m_impl.m_value2);
1856 case distance::Type::Type3:
1857 return functor(var.m_impl.m_value3);
1858 case distance::Type::Type4:
1859 return functor(var.m_impl.m_value4);
1860 case distance::Type::Type5:
1861 return functor(var.m_impl.m_value5);
1862 case distance::Type::Type6:
1863 return functor(var.m_impl.m_value6);
1864 case distance::Type::Type7:
1865 return functor(var.m_impl.m_value7);
1866 case distance::Type::Type8:
1867 return functor(var.m_impl.m_value8);
1868 case distance::Type::Type9:
1869 return functor(var.m_impl.m_value9);
1870 case distance::Type::Type10:
1871 return functor(var.m_impl.m_value10);
1873 ossia_do_throw(std::runtime_error,
"distance: bad type");
1876 template <
typename Visitor>
1877 auto apply_nonnull(Visitor&& functor, distance& var)
1881 case distance::Type::Type0:
1882 return functor(var.m_impl.m_value0);
1883 case distance::Type::Type1:
1884 return functor(var.m_impl.m_value1);
1885 case distance::Type::Type2:
1886 return functor(var.m_impl.m_value2);
1887 case distance::Type::Type3:
1888 return functor(var.m_impl.m_value3);
1889 case distance::Type::Type4:
1890 return functor(var.m_impl.m_value4);
1891 case distance::Type::Type5:
1892 return functor(var.m_impl.m_value5);
1893 case distance::Type::Type6:
1894 return functor(var.m_impl.m_value6);
1895 case distance::Type::Type7:
1896 return functor(var.m_impl.m_value7);
1897 case distance::Type::Type8:
1898 return functor(var.m_impl.m_value8);
1899 case distance::Type::Type9:
1900 return functor(var.m_impl.m_value9);
1901 case distance::Type::Type10:
1902 return functor(var.m_impl.m_value10);
1904 ossia_do_throw(std::runtime_error,
"distance: bad type");
1907 template <
typename Visitor>
1908 auto apply_nonnull(Visitor&& functor, distance&& var)
1912 case distance::Type::Type0:
1913 return functor(std::move(var.m_impl.m_value0));
1914 case distance::Type::Type1:
1915 return functor(std::move(var.m_impl.m_value1));
1916 case distance::Type::Type2:
1917 return functor(std::move(var.m_impl.m_value2));
1918 case distance::Type::Type3:
1919 return functor(std::move(var.m_impl.m_value3));
1920 case distance::Type::Type4:
1921 return functor(std::move(var.m_impl.m_value4));
1922 case distance::Type::Type5:
1923 return functor(std::move(var.m_impl.m_value5));
1924 case distance::Type::Type6:
1925 return functor(std::move(var.m_impl.m_value6));
1926 case distance::Type::Type7:
1927 return functor(std::move(var.m_impl.m_value7));
1928 case distance::Type::Type8:
1929 return functor(std::move(var.m_impl.m_value8));
1930 case distance::Type::Type9:
1931 return functor(std::move(var.m_impl.m_value9));
1932 case distance::Type::Type10:
1933 return functor(std::move(var.m_impl.m_value10));
1935 ossia_do_throw(std::runtime_error,
"distance: bad type");
1938 template <
typename Visitor>
1939 auto apply(Visitor&& functor,
const distance& var)
1943 case distance::Type::Type0:
1944 return functor(var.m_impl.m_value0);
1945 case distance::Type::Type1:
1946 return functor(var.m_impl.m_value1);
1947 case distance::Type::Type2:
1948 return functor(var.m_impl.m_value2);
1949 case distance::Type::Type3:
1950 return functor(var.m_impl.m_value3);
1951 case distance::Type::Type4:
1952 return functor(var.m_impl.m_value4);
1953 case distance::Type::Type5:
1954 return functor(var.m_impl.m_value5);
1955 case distance::Type::Type6:
1956 return functor(var.m_impl.m_value6);
1957 case distance::Type::Type7:
1958 return functor(var.m_impl.m_value7);
1959 case distance::Type::Type8:
1960 return functor(var.m_impl.m_value8);
1961 case distance::Type::Type9:
1962 return functor(var.m_impl.m_value9);
1963 case distance::Type::Type10:
1964 return functor(var.m_impl.m_value10);
1969 template <
typename Visitor>
1970 auto apply(Visitor&& functor, distance& var)
1974 case distance::Type::Type0:
1975 return functor(var.m_impl.m_value0);
1976 case distance::Type::Type1:
1977 return functor(var.m_impl.m_value1);
1978 case distance::Type::Type2:
1979 return functor(var.m_impl.m_value2);
1980 case distance::Type::Type3:
1981 return functor(var.m_impl.m_value3);
1982 case distance::Type::Type4:
1983 return functor(var.m_impl.m_value4);
1984 case distance::Type::Type5:
1985 return functor(var.m_impl.m_value5);
1986 case distance::Type::Type6:
1987 return functor(var.m_impl.m_value6);
1988 case distance::Type::Type7:
1989 return functor(var.m_impl.m_value7);
1990 case distance::Type::Type8:
1991 return functor(var.m_impl.m_value8);
1992 case distance::Type::Type9:
1993 return functor(var.m_impl.m_value9);
1994 case distance::Type::Type10:
1995 return functor(var.m_impl.m_value10);
2000 template <
typename Visitor>
2001 auto apply(Visitor&& functor, distance&& var)
2005 case distance::Type::Type0:
2006 return functor(std::move(var.m_impl.m_value0));
2007 case distance::Type::Type1:
2008 return functor(std::move(var.m_impl.m_value1));
2009 case distance::Type::Type2:
2010 return functor(std::move(var.m_impl.m_value2));
2011 case distance::Type::Type3:
2012 return functor(std::move(var.m_impl.m_value3));
2013 case distance::Type::Type4:
2014 return functor(std::move(var.m_impl.m_value4));
2015 case distance::Type::Type5:
2016 return functor(std::move(var.m_impl.m_value5));
2017 case distance::Type::Type6:
2018 return functor(std::move(var.m_impl.m_value6));
2019 case distance::Type::Type7:
2020 return functor(std::move(var.m_impl.m_value7));
2021 case distance::Type::Type8:
2022 return functor(std::move(var.m_impl.m_value8));
2023 case distance::Type::Type9:
2024 return functor(std::move(var.m_impl.m_value9));
2025 case distance::Type::Type10:
2026 return functor(std::move(var.m_impl.m_value10));
2031 inline bool operator==(
const distance& lhs,
const distance& rhs)
2033 if(lhs.m_type == rhs.m_type)
2037 case distance::Type::Type0:
2038 return lhs.m_impl.m_value0 == rhs.m_impl.m_value0;
2039 case distance::Type::Type1:
2040 return lhs.m_impl.m_value1 == rhs.m_impl.m_value1;
2041 case distance::Type::Type2:
2042 return lhs.m_impl.m_value2 == rhs.m_impl.m_value2;
2043 case distance::Type::Type3:
2044 return lhs.m_impl.m_value3 == rhs.m_impl.m_value3;
2045 case distance::Type::Type4:
2046 return lhs.m_impl.m_value4 == rhs.m_impl.m_value4;
2047 case distance::Type::Type5:
2048 return lhs.m_impl.m_value5 == rhs.m_impl.m_value5;
2049 case distance::Type::Type6:
2050 return lhs.m_impl.m_value6 == rhs.m_impl.m_value6;
2051 case distance::Type::Type7:
2052 return lhs.m_impl.m_value7 == rhs.m_impl.m_value7;
2053 case distance::Type::Type8:
2054 return lhs.m_impl.m_value8 == rhs.m_impl.m_value8;
2055 case distance::Type::Type9:
2056 return lhs.m_impl.m_value9 == rhs.m_impl.m_value9;
2057 case distance::Type::Type10:
2058 return lhs.m_impl.m_value10 == rhs.m_impl.m_value10;
2065 inline bool operator!=(
const distance& lhs,
const distance& rhs)
2067 if(lhs.m_type != rhs.m_type)
2071 case distance::Type::Type0:
2072 return lhs.m_impl.m_value0 != rhs.m_impl.m_value0;
2073 case distance::Type::Type1:
2074 return lhs.m_impl.m_value1 != rhs.m_impl.m_value1;
2075 case distance::Type::Type2:
2076 return lhs.m_impl.m_value2 != rhs.m_impl.m_value2;
2077 case distance::Type::Type3:
2078 return lhs.m_impl.m_value3 != rhs.m_impl.m_value3;
2079 case distance::Type::Type4:
2080 return lhs.m_impl.m_value4 != rhs.m_impl.m_value4;
2081 case distance::Type::Type5:
2082 return lhs.m_impl.m_value5 != rhs.m_impl.m_value5;
2083 case distance::Type::Type6:
2084 return lhs.m_impl.m_value6 != rhs.m_impl.m_value6;
2085 case distance::Type::Type7:
2086 return lhs.m_impl.m_value7 != rhs.m_impl.m_value7;
2087 case distance::Type::Type8:
2088 return lhs.m_impl.m_value8 != rhs.m_impl.m_value8;
2089 case distance::Type::Type9:
2090 return lhs.m_impl.m_value9 != rhs.m_impl.m_value9;
2091 case distance::Type::Type10:
2092 return lhs.m_impl.m_value10 != rhs.m_impl.m_value10;
2098 inline bool operator==(
const distance& lhs,
const ossia::meter& rhs)
2100 return (lhs.m_type == distance::Type::Type0) && (lhs.m_impl.m_value0 == rhs);
2102 inline bool operator==(
const ossia::meter& lhs,
const distance& rhs)
2104 return (rhs.m_type == distance::Type::Type0) && (rhs.m_impl.m_value0 == lhs);
2106 inline bool operator!=(
const distance& lhs,
const ossia::meter& rhs)
2108 return (lhs.m_type != distance::Type::Type0) || (lhs.m_impl.m_value0 != rhs);
2110 inline bool operator!=(
const ossia::meter& lhs,
const distance& rhs)
2112 return (rhs.m_type != distance::Type::Type0) || (rhs.m_impl.m_value0 != lhs);
2114 inline bool operator==(
const distance& lhs,
const ossia::kilometer& rhs)
2116 return (lhs.m_type == distance::Type::Type1) && (lhs.m_impl.m_value1 == rhs);
2118 inline bool operator==(
const ossia::kilometer& lhs,
const distance& rhs)
2120 return (rhs.m_type == distance::Type::Type1) && (rhs.m_impl.m_value1 == lhs);
2122 inline bool operator!=(
const distance& lhs,
const ossia::kilometer& rhs)
2124 return (lhs.m_type != distance::Type::Type1) || (lhs.m_impl.m_value1 != rhs);
2126 inline bool operator!=(
const ossia::kilometer& lhs,
const distance& rhs)
2128 return (rhs.m_type != distance::Type::Type1) || (rhs.m_impl.m_value1 != lhs);
2130 inline bool operator==(
const distance& lhs,
const ossia::decimeter& rhs)
2132 return (lhs.m_type == distance::Type::Type2) && (lhs.m_impl.m_value2 == rhs);
2134 inline bool operator==(
const ossia::decimeter& lhs,
const distance& rhs)
2136 return (rhs.m_type == distance::Type::Type2) && (rhs.m_impl.m_value2 == lhs);
2138 inline bool operator!=(
const distance& lhs,
const ossia::decimeter& rhs)
2140 return (lhs.m_type != distance::Type::Type2) || (lhs.m_impl.m_value2 != rhs);
2142 inline bool operator!=(
const ossia::decimeter& lhs,
const distance& rhs)
2144 return (rhs.m_type != distance::Type::Type2) || (rhs.m_impl.m_value2 != lhs);
2146 inline bool operator==(
const distance& lhs,
const ossia::centimeter& rhs)
2148 return (lhs.m_type == distance::Type::Type3) && (lhs.m_impl.m_value3 == rhs);
2150 inline bool operator==(
const ossia::centimeter& lhs,
const distance& rhs)
2152 return (rhs.m_type == distance::Type::Type3) && (rhs.m_impl.m_value3 == lhs);
2154 inline bool operator!=(
const distance& lhs,
const ossia::centimeter& rhs)
2156 return (lhs.m_type != distance::Type::Type3) || (lhs.m_impl.m_value3 != rhs);
2158 inline bool operator!=(
const ossia::centimeter& lhs,
const distance& rhs)
2160 return (rhs.m_type != distance::Type::Type3) || (rhs.m_impl.m_value3 != lhs);
2162 inline bool operator==(
const distance& lhs,
const ossia::millimeter& rhs)
2164 return (lhs.m_type == distance::Type::Type4) && (lhs.m_impl.m_value4 == rhs);
2166 inline bool operator==(
const ossia::millimeter& lhs,
const distance& rhs)
2168 return (rhs.m_type == distance::Type::Type4) && (rhs.m_impl.m_value4 == lhs);
2170 inline bool operator!=(
const distance& lhs,
const ossia::millimeter& rhs)
2172 return (lhs.m_type != distance::Type::Type4) || (lhs.m_impl.m_value4 != rhs);
2174 inline bool operator!=(
const ossia::millimeter& lhs,
const distance& rhs)
2176 return (rhs.m_type != distance::Type::Type4) || (rhs.m_impl.m_value4 != lhs);
2178 inline bool operator==(
const distance& lhs,
const ossia::micrometer& rhs)
2180 return (lhs.m_type == distance::Type::Type5) && (lhs.m_impl.m_value5 == rhs);
2182 inline bool operator==(
const ossia::micrometer& lhs,
const distance& rhs)
2184 return (rhs.m_type == distance::Type::Type5) && (rhs.m_impl.m_value5 == lhs);
2186 inline bool operator!=(
const distance& lhs,
const ossia::micrometer& rhs)
2188 return (lhs.m_type != distance::Type::Type5) || (lhs.m_impl.m_value5 != rhs);
2190 inline bool operator!=(
const ossia::micrometer& lhs,
const distance& rhs)
2192 return (rhs.m_type != distance::Type::Type5) || (rhs.m_impl.m_value5 != lhs);
2194 inline bool operator==(
const distance& lhs,
const ossia::nanometer& rhs)
2196 return (lhs.m_type == distance::Type::Type6) && (lhs.m_impl.m_value6 == rhs);
2198 inline bool operator==(
const ossia::nanometer& lhs,
const distance& rhs)
2200 return (rhs.m_type == distance::Type::Type6) && (rhs.m_impl.m_value6 == lhs);
2202 inline bool operator!=(
const distance& lhs,
const ossia::nanometer& rhs)
2204 return (lhs.m_type != distance::Type::Type6) || (lhs.m_impl.m_value6 != rhs);
2206 inline bool operator!=(
const ossia::nanometer& lhs,
const distance& rhs)
2208 return (rhs.m_type != distance::Type::Type6) || (rhs.m_impl.m_value6 != lhs);
2210 inline bool operator==(
const distance& lhs,
const ossia::picometer& rhs)
2212 return (lhs.m_type == distance::Type::Type7) && (lhs.m_impl.m_value7 == rhs);
2214 inline bool operator==(
const ossia::picometer& lhs,
const distance& rhs)
2216 return (rhs.m_type == distance::Type::Type7) && (rhs.m_impl.m_value7 == lhs);
2218 inline bool operator!=(
const distance& lhs,
const ossia::picometer& rhs)
2220 return (lhs.m_type != distance::Type::Type7) || (lhs.m_impl.m_value7 != rhs);
2222 inline bool operator!=(
const ossia::picometer& lhs,
const distance& rhs)
2224 return (rhs.m_type != distance::Type::Type7) || (rhs.m_impl.m_value7 != lhs);
2226 inline bool operator==(
const distance& lhs,
const ossia::inch& rhs)
2228 return (lhs.m_type == distance::Type::Type8) && (lhs.m_impl.m_value8 == rhs);
2230 inline bool operator==(
const ossia::inch& lhs,
const distance& rhs)
2232 return (rhs.m_type == distance::Type::Type8) && (rhs.m_impl.m_value8 == lhs);
2234 inline bool operator!=(
const distance& lhs,
const ossia::inch& rhs)
2236 return (lhs.m_type != distance::Type::Type8) || (lhs.m_impl.m_value8 != rhs);
2238 inline bool operator!=(
const ossia::inch& lhs,
const distance& rhs)
2240 return (rhs.m_type != distance::Type::Type8) || (rhs.m_impl.m_value8 != lhs);
2242 inline bool operator==(
const distance& lhs,
const ossia::foot& rhs)
2244 return (lhs.m_type == distance::Type::Type9) && (lhs.m_impl.m_value9 == rhs);
2246 inline bool operator==(
const ossia::foot& lhs,
const distance& rhs)
2248 return (rhs.m_type == distance::Type::Type9) && (rhs.m_impl.m_value9 == lhs);
2250 inline bool operator!=(
const distance& lhs,
const ossia::foot& rhs)
2252 return (lhs.m_type != distance::Type::Type9) || (lhs.m_impl.m_value9 != rhs);
2254 inline bool operator!=(
const ossia::foot& lhs,
const distance& rhs)
2256 return (rhs.m_type != distance::Type::Type9) || (rhs.m_impl.m_value9 != lhs);
2258 inline bool operator==(
const distance& lhs,
const ossia::mile& rhs)
2260 return (lhs.m_type == distance::Type::Type10) && (lhs.m_impl.m_value10 == rhs);
2262 inline bool operator==(
const ossia::mile& lhs,
const distance& rhs)
2264 return (rhs.m_type == distance::Type::Type10) && (rhs.m_impl.m_value10 == lhs);
2266 inline bool operator!=(
const distance& lhs,
const ossia::mile& rhs)
2268 return (lhs.m_type != distance::Type::Type10) || (lhs.m_impl.m_value10 != rhs);
2270 inline bool operator!=(
const ossia::mile& lhs,
const distance& rhs)
2272 return (rhs.m_type != distance::Type::Type10) || (rhs.m_impl.m_value10 != lhs);
2282 ossia::linear m_value0;
2284 ossia::midigain m_value1;
2286 ossia::decibel m_value2;
2288 ossia::decibel_raw m_value3;
2307 void destruct_impl()
2319 static const constexpr
auto npos = Npos;
2320 int which()
const {
return m_type; }
2322 operator bool()
const {
return m_type != npos; }
2323 template <
typename T>
2324 const T* target()
const;
2325 template <
typename T>
2327 template <
typename T>
2328 const T& get()
const;
2329 template <
typename T>
2332 template <
typename T>
2338 ~gain() { destruct_impl(); }
2339 gain(ossia::linear v)
2342 new(&m_impl.m_value0) ossia::linear{v};
2344 gain(ossia::midigain v)
2347 new(&m_impl.m_value1) ossia::midigain{v};
2349 gain(ossia::decibel v)
2352 new(&m_impl.m_value2) ossia::decibel{v};
2354 gain(ossia::decibel_raw v)
2357 new(&m_impl.m_value3) ossia::decibel_raw{v};
2359 gain(
const gain& other)
2360 : m_type{other.m_type}
2365 new(&m_impl.m_value0) ossia::linear{other.m_impl.m_value0};
2368 new(&m_impl.m_value1) ossia::midigain{other.m_impl.m_value1};
2371 new(&m_impl.m_value2) ossia::decibel{other.m_impl.m_value2};
2374 new(&m_impl.m_value3) ossia::decibel_raw{other.m_impl.m_value3};
2381 : m_type{other.m_type}
2386 new(&m_impl.m_value0) ossia::linear{std::move(other.m_impl.m_value0)};
2389 new(&m_impl.m_value1) ossia::midigain{std::move(other.m_impl.m_value1)};
2392 new(&m_impl.m_value2) ossia::decibel{std::move(other.m_impl.m_value2)};
2395 new(&m_impl.m_value3) ossia::decibel_raw{std::move(other.m_impl.m_value3)};
2401 gain& operator=(
const gain& other)
2404 m_type = other.m_type;
2408 new(&m_impl.m_value0) ossia::linear{other.m_impl.m_value0};
2411 new(&m_impl.m_value1) ossia::midigain{other.m_impl.m_value1};
2414 new(&m_impl.m_value2) ossia::decibel{other.m_impl.m_value2};
2417 new(&m_impl.m_value3) ossia::decibel_raw{other.m_impl.m_value3};
2424 gain& operator=(gain&& other)
2427 m_type = other.m_type;
2431 new(&m_impl.m_value0) ossia::linear{std::move(other.m_impl.m_value0)};
2434 new(&m_impl.m_value1) ossia::midigain{std::move(other.m_impl.m_value1)};
2437 new(&m_impl.m_value2) ossia::decibel{std::move(other.m_impl.m_value2)};
2440 new(&m_impl.m_value3) ossia::decibel_raw{std::move(other.m_impl.m_value3)};
2449 inline const ossia::linear* gain::target()
const
2452 return &m_impl.m_value0;
2456 inline const ossia::midigain* gain::target()
const
2459 return &m_impl.m_value1;
2463 inline const ossia::decibel* gain::target()
const
2466 return &m_impl.m_value2;
2470 inline const ossia::decibel_raw* gain::target()
const
2473 return &m_impl.m_value3;
2477 inline ossia::linear* gain::target()
2480 return &m_impl.m_value0;
2484 inline ossia::midigain* gain::target()
2487 return &m_impl.m_value1;
2491 inline ossia::decibel* gain::target()
2494 return &m_impl.m_value2;
2498 inline ossia::decibel_raw* gain::target()
2501 return &m_impl.m_value3;
2505 inline const ossia::linear& gain::get()
const
2508 return m_impl.m_value0;
2509 ossia_do_throw(std::runtime_error,
"gain: bad type");
2512 inline const ossia::midigain& gain::get()
const
2515 return m_impl.m_value1;
2516 ossia_do_throw(std::runtime_error,
"gain: bad type");
2519 inline const ossia::decibel& gain::get()
const
2522 return m_impl.m_value2;
2523 ossia_do_throw(std::runtime_error,
"gain: bad type");
2526 inline const ossia::decibel_raw& gain::get()
const
2529 return m_impl.m_value3;
2530 ossia_do_throw(std::runtime_error,
"gain: bad type");
2533 inline ossia::linear& gain::get()
2536 return m_impl.m_value0;
2537 ossia_do_throw(std::runtime_error,
"gain: bad type");
2540 inline ossia::midigain& gain::get()
2543 return m_impl.m_value1;
2544 ossia_do_throw(std::runtime_error,
"gain: bad type");
2547 inline ossia::decibel& gain::get()
2550 return m_impl.m_value2;
2551 ossia_do_throw(std::runtime_error,
"gain: bad type");
2554 inline ossia::decibel_raw& gain::get()
2557 return m_impl.m_value3;
2558 ossia_do_throw(std::runtime_error,
"gain: bad type");
2560 template <
typename Visitor>
2561 auto apply_nonnull(Visitor&& functor,
const gain& var)
2565 case gain::Type::Type0:
2566 return functor(var.m_impl.m_value0);
2567 case gain::Type::Type1:
2568 return functor(var.m_impl.m_value1);
2569 case gain::Type::Type2:
2570 return functor(var.m_impl.m_value2);
2571 case gain::Type::Type3:
2572 return functor(var.m_impl.m_value3);
2574 ossia_do_throw(std::runtime_error,
"gain: bad type");
2577 template <
typename Visitor>
2578 auto apply_nonnull(Visitor&& functor, gain& var)
2582 case gain::Type::Type0:
2583 return functor(var.m_impl.m_value0);
2584 case gain::Type::Type1:
2585 return functor(var.m_impl.m_value1);
2586 case gain::Type::Type2:
2587 return functor(var.m_impl.m_value2);
2588 case gain::Type::Type3:
2589 return functor(var.m_impl.m_value3);
2591 ossia_do_throw(std::runtime_error,
"gain: bad type");
2594 template <
typename Visitor>
2595 auto apply_nonnull(Visitor&& functor, gain&& var)
2599 case gain::Type::Type0:
2600 return functor(std::move(var.m_impl.m_value0));
2601 case gain::Type::Type1:
2602 return functor(std::move(var.m_impl.m_value1));
2603 case gain::Type::Type2:
2604 return functor(std::move(var.m_impl.m_value2));
2605 case gain::Type::Type3:
2606 return functor(std::move(var.m_impl.m_value3));
2608 ossia_do_throw(std::runtime_error,
"gain: bad type");
2611 template <
typename Visitor>
2612 auto apply(Visitor&& functor,
const gain& var)
2616 case gain::Type::Type0:
2617 return functor(var.m_impl.m_value0);
2618 case gain::Type::Type1:
2619 return functor(var.m_impl.m_value1);
2620 case gain::Type::Type2:
2621 return functor(var.m_impl.m_value2);
2622 case gain::Type::Type3:
2623 return functor(var.m_impl.m_value3);
2628 template <
typename Visitor>
2629 auto apply(Visitor&& functor, gain& var)
2633 case gain::Type::Type0:
2634 return functor(var.m_impl.m_value0);
2635 case gain::Type::Type1:
2636 return functor(var.m_impl.m_value1);
2637 case gain::Type::Type2:
2638 return functor(var.m_impl.m_value2);
2639 case gain::Type::Type3:
2640 return functor(var.m_impl.m_value3);
2645 template <
typename Visitor>
2646 auto apply(Visitor&& functor, gain&& var)
2650 case gain::Type::Type0:
2651 return functor(std::move(var.m_impl.m_value0));
2652 case gain::Type::Type1:
2653 return functor(std::move(var.m_impl.m_value1));
2654 case gain::Type::Type2:
2655 return functor(std::move(var.m_impl.m_value2));
2656 case gain::Type::Type3:
2657 return functor(std::move(var.m_impl.m_value3));
2662 inline bool operator==(
const gain& lhs,
const gain& rhs)
2664 if(lhs.m_type == rhs.m_type)
2668 case gain::Type::Type0:
2669 return lhs.m_impl.m_value0 == rhs.m_impl.m_value0;
2670 case gain::Type::Type1:
2671 return lhs.m_impl.m_value1 == rhs.m_impl.m_value1;
2672 case gain::Type::Type2:
2673 return lhs.m_impl.m_value2 == rhs.m_impl.m_value2;
2674 case gain::Type::Type3:
2675 return lhs.m_impl.m_value3 == rhs.m_impl.m_value3;
2682 inline bool operator!=(
const gain& lhs,
const gain& rhs)
2684 if(lhs.m_type != rhs.m_type)
2688 case gain::Type::Type0:
2689 return lhs.m_impl.m_value0 != rhs.m_impl.m_value0;
2690 case gain::Type::Type1:
2691 return lhs.m_impl.m_value1 != rhs.m_impl.m_value1;
2692 case gain::Type::Type2:
2693 return lhs.m_impl.m_value2 != rhs.m_impl.m_value2;
2694 case gain::Type::Type3:
2695 return lhs.m_impl.m_value3 != rhs.m_impl.m_value3;
2701 inline bool operator==(
const gain& lhs,
const ossia::linear& rhs)
2703 return (lhs.m_type == gain::Type::Type0) && (lhs.m_impl.m_value0 == rhs);
2705 inline bool operator==(
const ossia::linear& lhs,
const gain& rhs)
2707 return (rhs.m_type == gain::Type::Type0) && (rhs.m_impl.m_value0 == lhs);
2709 inline bool operator!=(
const gain& lhs,
const ossia::linear& rhs)
2711 return (lhs.m_type != gain::Type::Type0) || (lhs.m_impl.m_value0 != rhs);
2713 inline bool operator!=(
const ossia::linear& lhs,
const gain& rhs)
2715 return (rhs.m_type != gain::Type::Type0) || (rhs.m_impl.m_value0 != lhs);
2717 inline bool operator==(
const gain& lhs,
const ossia::midigain& rhs)
2719 return (lhs.m_type == gain::Type::Type1) && (lhs.m_impl.m_value1 == rhs);
2721 inline bool operator==(
const ossia::midigain& lhs,
const gain& rhs)
2723 return (rhs.m_type == gain::Type::Type1) && (rhs.m_impl.m_value1 == lhs);
2725 inline bool operator!=(
const gain& lhs,
const ossia::midigain& rhs)
2727 return (lhs.m_type != gain::Type::Type1) || (lhs.m_impl.m_value1 != rhs);
2729 inline bool operator!=(
const ossia::midigain& lhs,
const gain& rhs)
2731 return (rhs.m_type != gain::Type::Type1) || (rhs.m_impl.m_value1 != lhs);
2733 inline bool operator==(
const gain& lhs,
const ossia::decibel& rhs)
2735 return (lhs.m_type == gain::Type::Type2) && (lhs.m_impl.m_value2 == rhs);
2737 inline bool operator==(
const ossia::decibel& lhs,
const gain& rhs)
2739 return (rhs.m_type == gain::Type::Type2) && (rhs.m_impl.m_value2 == lhs);
2741 inline bool operator!=(
const gain& lhs,
const ossia::decibel& rhs)
2743 return (lhs.m_type != gain::Type::Type2) || (lhs.m_impl.m_value2 != rhs);
2745 inline bool operator!=(
const ossia::decibel& lhs,
const gain& rhs)
2747 return (rhs.m_type != gain::Type::Type2) || (rhs.m_impl.m_value2 != lhs);
2749 inline bool operator==(
const gain& lhs,
const ossia::decibel_raw& rhs)
2751 return (lhs.m_type == gain::Type::Type3) && (lhs.m_impl.m_value3 == rhs);
2753 inline bool operator==(
const ossia::decibel_raw& lhs,
const gain& rhs)
2755 return (rhs.m_type == gain::Type::Type3) && (rhs.m_impl.m_value3 == lhs);
2757 inline bool operator!=(
const gain& lhs,
const ossia::decibel_raw& rhs)
2759 return (lhs.m_type != gain::Type::Type3) || (lhs.m_impl.m_value3 != rhs);
2761 inline bool operator!=(
const ossia::decibel_raw& lhs,
const gain& rhs)
2763 return (rhs.m_type != gain::Type::Type3) || (rhs.m_impl.m_value3 != lhs);
2773 ossia::quaternion m_value0;
2775 ossia::euler m_value1;
2777 ossia::axis m_value2;
2795 void destruct_impl()
2807 static const constexpr
auto npos = Npos;
2808 int which()
const {
return m_type; }
2810 operator bool()
const {
return m_type != npos; }
2811 template <
typename T>
2812 const T* target()
const;
2813 template <
typename T>
2815 template <
typename T>
2816 const T& get()
const;
2817 template <
typename T>
2820 template <
typename T>
2826 ~orientation() { destruct_impl(); }
2827 orientation(ossia::quaternion v)
2830 new(&m_impl.m_value0) ossia::quaternion{v};
2832 orientation(ossia::euler v)
2835 new(&m_impl.m_value1) ossia::euler{v};
2837 orientation(ossia::axis v)
2840 new(&m_impl.m_value2) ossia::axis{v};
2842 orientation(
const orientation& other)
2843 : m_type{other.m_type}
2848 new(&m_impl.m_value0) ossia::quaternion{other.m_impl.m_value0};
2851 new(&m_impl.m_value1) ossia::euler{other.m_impl.m_value1};
2854 new(&m_impl.m_value2) ossia::axis{other.m_impl.m_value2};
2860 orientation(orientation&& other)
2861 : m_type{other.m_type}
2866 new(&m_impl.m_value0) ossia::quaternion{std::move(other.m_impl.m_value0)};
2869 new(&m_impl.m_value1) ossia::euler{std::move(other.m_impl.m_value1)};
2872 new(&m_impl.m_value2) ossia::axis{std::move(other.m_impl.m_value2)};
2878 orientation& operator=(
const orientation& other)
2881 m_type = other.m_type;
2885 new(&m_impl.m_value0) ossia::quaternion{other.m_impl.m_value0};
2888 new(&m_impl.m_value1) ossia::euler{other.m_impl.m_value1};
2891 new(&m_impl.m_value2) ossia::axis{other.m_impl.m_value2};
2898 orientation& operator=(orientation&& other)
2901 m_type = other.m_type;
2905 new(&m_impl.m_value0) ossia::quaternion{std::move(other.m_impl.m_value0)};
2908 new(&m_impl.m_value1) ossia::euler{std::move(other.m_impl.m_value1)};
2911 new(&m_impl.m_value2) ossia::axis{std::move(other.m_impl.m_value2)};
2920 inline const ossia::quaternion* orientation::target()
const
2923 return &m_impl.m_value0;
2927 inline const ossia::euler* orientation::target()
const
2930 return &m_impl.m_value1;
2934 inline const ossia::axis* orientation::target()
const
2937 return &m_impl.m_value2;
2941 inline ossia::quaternion* orientation::target()
2944 return &m_impl.m_value0;
2948 inline ossia::euler* orientation::target()
2951 return &m_impl.m_value1;
2955 inline ossia::axis* orientation::target()
2958 return &m_impl.m_value2;
2962 inline const ossia::quaternion& orientation::get()
const
2965 return m_impl.m_value0;
2966 ossia_do_throw(std::runtime_error,
"orientation: bad type");
2969 inline const ossia::euler& orientation::get()
const
2972 return m_impl.m_value1;
2973 ossia_do_throw(std::runtime_error,
"orientation: bad type");
2976 inline const ossia::axis& orientation::get()
const
2979 return m_impl.m_value2;
2980 ossia_do_throw(std::runtime_error,
"orientation: bad type");
2983 inline ossia::quaternion& orientation::get()
2986 return m_impl.m_value0;
2987 ossia_do_throw(std::runtime_error,
"orientation: bad type");
2990 inline ossia::euler& orientation::get()
2993 return m_impl.m_value1;
2994 ossia_do_throw(std::runtime_error,
"orientation: bad type");
2997 inline ossia::axis& orientation::get()
3000 return m_impl.m_value2;
3001 ossia_do_throw(std::runtime_error,
"orientation: bad type");
3003 template <
typename Visitor>
3004 auto apply_nonnull(Visitor&& functor,
const orientation& var)
3008 case orientation::Type::Type0:
3009 return functor(var.m_impl.m_value0);
3010 case orientation::Type::Type1:
3011 return functor(var.m_impl.m_value1);
3012 case orientation::Type::Type2:
3013 return functor(var.m_impl.m_value2);
3015 ossia_do_throw(std::runtime_error,
"orientation: bad type");
3018 template <
typename Visitor>
3019 auto apply_nonnull(Visitor&& functor, orientation& var)
3023 case orientation::Type::Type0:
3024 return functor(var.m_impl.m_value0);
3025 case orientation::Type::Type1:
3026 return functor(var.m_impl.m_value1);
3027 case orientation::Type::Type2:
3028 return functor(var.m_impl.m_value2);
3030 ossia_do_throw(std::runtime_error,
"orientation: bad type");
3033 template <
typename Visitor>
3034 auto apply_nonnull(Visitor&& functor, orientation&& var)
3038 case orientation::Type::Type0:
3039 return functor(std::move(var.m_impl.m_value0));
3040 case orientation::Type::Type1:
3041 return functor(std::move(var.m_impl.m_value1));
3042 case orientation::Type::Type2:
3043 return functor(std::move(var.m_impl.m_value2));
3045 ossia_do_throw(std::runtime_error,
"orientation: bad type");
3048 template <
typename Visitor>
3049 auto apply(Visitor&& functor,
const orientation& var)
3053 case orientation::Type::Type0:
3054 return functor(var.m_impl.m_value0);
3055 case orientation::Type::Type1:
3056 return functor(var.m_impl.m_value1);
3057 case orientation::Type::Type2:
3058 return functor(var.m_impl.m_value2);
3063 template <
typename Visitor>
3064 auto apply(Visitor&& functor, orientation& var)
3068 case orientation::Type::Type0:
3069 return functor(var.m_impl.m_value0);
3070 case orientation::Type::Type1:
3071 return functor(var.m_impl.m_value1);
3072 case orientation::Type::Type2:
3073 return functor(var.m_impl.m_value2);
3078 template <
typename Visitor>
3079 auto apply(Visitor&& functor, orientation&& var)
3083 case orientation::Type::Type0:
3084 return functor(std::move(var.m_impl.m_value0));
3085 case orientation::Type::Type1:
3086 return functor(std::move(var.m_impl.m_value1));
3087 case orientation::Type::Type2:
3088 return functor(std::move(var.m_impl.m_value2));
3093 inline bool operator==(
const orientation& lhs,
const orientation& rhs)
3095 if(lhs.m_type == rhs.m_type)
3099 case orientation::Type::Type0:
3100 return lhs.m_impl.m_value0 == rhs.m_impl.m_value0;
3101 case orientation::Type::Type1:
3102 return lhs.m_impl.m_value1 == rhs.m_impl.m_value1;
3103 case orientation::Type::Type2:
3104 return lhs.m_impl.m_value2 == rhs.m_impl.m_value2;
3111 inline bool operator!=(
const orientation& lhs,
const orientation& rhs)
3113 if(lhs.m_type != rhs.m_type)
3117 case orientation::Type::Type0:
3118 return lhs.m_impl.m_value0 != rhs.m_impl.m_value0;
3119 case orientation::Type::Type1:
3120 return lhs.m_impl.m_value1 != rhs.m_impl.m_value1;
3121 case orientation::Type::Type2:
3122 return lhs.m_impl.m_value2 != rhs.m_impl.m_value2;
3128 inline bool operator==(
const orientation& lhs,
const ossia::quaternion& rhs)
3130 return (lhs.m_type == orientation::Type::Type0) && (lhs.m_impl.m_value0 == rhs);
3132 inline bool operator==(
const ossia::quaternion& lhs,
const orientation& rhs)
3134 return (rhs.m_type == orientation::Type::Type0) && (rhs.m_impl.m_value0 == lhs);
3136 inline bool operator!=(
const orientation& lhs,
const ossia::quaternion& rhs)
3138 return (lhs.m_type != orientation::Type::Type0) || (lhs.m_impl.m_value0 != rhs);
3140 inline bool operator!=(
const ossia::quaternion& lhs,
const orientation& rhs)
3142 return (rhs.m_type != orientation::Type::Type0) || (rhs.m_impl.m_value0 != lhs);
3144 inline bool operator==(
const orientation& lhs,
const ossia::euler& rhs)
3146 return (lhs.m_type == orientation::Type::Type1) && (lhs.m_impl.m_value1 == rhs);
3148 inline bool operator==(
const ossia::euler& lhs,
const orientation& rhs)
3150 return (rhs.m_type == orientation::Type::Type1) && (rhs.m_impl.m_value1 == lhs);
3152 inline bool operator!=(
const orientation& lhs,
const ossia::euler& rhs)
3154 return (lhs.m_type != orientation::Type::Type1) || (lhs.m_impl.m_value1 != rhs);
3156 inline bool operator!=(
const ossia::euler& lhs,
const orientation& rhs)
3158 return (rhs.m_type != orientation::Type::Type1) || (rhs.m_impl.m_value1 != lhs);
3160 inline bool operator==(
const orientation& lhs,
const ossia::axis& rhs)
3162 return (lhs.m_type == orientation::Type::Type2) && (lhs.m_impl.m_value2 == rhs);
3164 inline bool operator==(
const ossia::axis& lhs,
const orientation& rhs)
3166 return (rhs.m_type == orientation::Type::Type2) && (rhs.m_impl.m_value2 == lhs);
3168 inline bool operator!=(
const orientation& lhs,
const ossia::axis& rhs)
3170 return (lhs.m_type != orientation::Type::Type2) || (lhs.m_impl.m_value2 != rhs);
3172 inline bool operator!=(
const ossia::axis& lhs,
const orientation& rhs)
3174 return (rhs.m_type != orientation::Type::Type2) || (rhs.m_impl.m_value2 != lhs);
3184 ossia::cartesian_3d m_value0;
3186 ossia::cartesian_2d m_value1;
3188 ossia::spherical m_value2;
3190 ossia::polar m_value3;
3192 ossia::aed m_value4;
3196 ossia::opengl m_value6;
3198 ossia::cylindrical m_value7;
3200 ossia::azd m_value8;
3224 void destruct_impl()
3236 static const constexpr
auto npos = Npos;
3237 int which()
const {
return m_type; }
3239 operator bool()
const {
return m_type != npos; }
3240 template <
typename T>
3241 const T* target()
const;
3242 template <
typename T>
3244 template <
typename T>
3245 const T& get()
const;
3246 template <
typename T>
3249 template <
typename T>
3255 ~position() { destruct_impl(); }
3256 position(ossia::cartesian_3d v)
3259 new(&m_impl.m_value0) ossia::cartesian_3d{v};
3261 position(ossia::cartesian_2d v)
3264 new(&m_impl.m_value1) ossia::cartesian_2d{v};
3266 position(ossia::spherical v)
3269 new(&m_impl.m_value2) ossia::spherical{v};
3271 position(ossia::polar v)
3274 new(&m_impl.m_value3) ossia::polar{v};
3276 position(ossia::aed v)
3279 new(&m_impl.m_value4) ossia::aed{v};
3281 position(ossia::ad v)
3284 new(&m_impl.m_value5) ossia::ad{v};
3286 position(ossia::opengl v)
3289 new(&m_impl.m_value6) ossia::opengl{v};
3291 position(ossia::cylindrical v)
3294 new(&m_impl.m_value7) ossia::cylindrical{v};
3296 position(ossia::azd v)
3299 new(&m_impl.m_value8) ossia::azd{v};
3301 position(
const position& other)
3302 : m_type{other.m_type}
3307 new(&m_impl.m_value0) ossia::cartesian_3d{other.m_impl.m_value0};
3310 new(&m_impl.m_value1) ossia::cartesian_2d{other.m_impl.m_value1};
3313 new(&m_impl.m_value2) ossia::spherical{other.m_impl.m_value2};
3316 new(&m_impl.m_value3) ossia::polar{other.m_impl.m_value3};
3319 new(&m_impl.m_value4) ossia::aed{other.m_impl.m_value4};
3322 new(&m_impl.m_value5) ossia::ad{other.m_impl.m_value5};
3325 new(&m_impl.m_value6) ossia::opengl{other.m_impl.m_value6};
3328 new(&m_impl.m_value7) ossia::cylindrical{other.m_impl.m_value7};
3331 new(&m_impl.m_value8) ossia::azd{other.m_impl.m_value8};
3337 position(position&& other)
3338 : m_type{other.m_type}
3343 new(&m_impl.m_value0) ossia::cartesian_3d{std::move(other.m_impl.m_value0)};
3346 new(&m_impl.m_value1) ossia::cartesian_2d{std::move(other.m_impl.m_value1)};
3349 new(&m_impl.m_value2) ossia::spherical{std::move(other.m_impl.m_value2)};
3352 new(&m_impl.m_value3) ossia::polar{std::move(other.m_impl.m_value3)};
3355 new(&m_impl.m_value4) ossia::aed{std::move(other.m_impl.m_value4)};
3358 new(&m_impl.m_value5) ossia::ad{std::move(other.m_impl.m_value5)};
3361 new(&m_impl.m_value6) ossia::opengl{std::move(other.m_impl.m_value6)};
3364 new(&m_impl.m_value7) ossia::cylindrical{std::move(other.m_impl.m_value7)};
3367 new(&m_impl.m_value8) ossia::azd{std::move(other.m_impl.m_value8)};
3373 position& operator=(
const position& other)
3376 m_type = other.m_type;
3380 new(&m_impl.m_value0) ossia::cartesian_3d{other.m_impl.m_value0};
3383 new(&m_impl.m_value1) ossia::cartesian_2d{other.m_impl.m_value1};
3386 new(&m_impl.m_value2) ossia::spherical{other.m_impl.m_value2};
3389 new(&m_impl.m_value3) ossia::polar{other.m_impl.m_value3};
3392 new(&m_impl.m_value4) ossia::aed{other.m_impl.m_value4};
3395 new(&m_impl.m_value5) ossia::ad{other.m_impl.m_value5};
3398 new(&m_impl.m_value6) ossia::opengl{other.m_impl.m_value6};
3401 new(&m_impl.m_value7) ossia::cylindrical{other.m_impl.m_value7};
3404 new(&m_impl.m_value8) ossia::azd{other.m_impl.m_value8};
3411 position& operator=(position&& other)
3414 m_type = other.m_type;
3418 new(&m_impl.m_value0) ossia::cartesian_3d{std::move(other.m_impl.m_value0)};
3421 new(&m_impl.m_value1) ossia::cartesian_2d{std::move(other.m_impl.m_value1)};
3424 new(&m_impl.m_value2) ossia::spherical{std::move(other.m_impl.m_value2)};
3427 new(&m_impl.m_value3) ossia::polar{std::move(other.m_impl.m_value3)};
3430 new(&m_impl.m_value4) ossia::aed{std::move(other.m_impl.m_value4)};
3433 new(&m_impl.m_value5) ossia::ad{std::move(other.m_impl.m_value5)};
3436 new(&m_impl.m_value6) ossia::opengl{std::move(other.m_impl.m_value6)};
3439 new(&m_impl.m_value7) ossia::cylindrical{std::move(other.m_impl.m_value7)};
3442 new(&m_impl.m_value8) ossia::azd{std::move(other.m_impl.m_value8)};
3451 inline const ossia::cartesian_3d* position::target()
const
3454 return &m_impl.m_value0;
3458 inline const ossia::cartesian_2d* position::target()
const
3461 return &m_impl.m_value1;
3465 inline const ossia::spherical* position::target()
const
3468 return &m_impl.m_value2;
3472 inline const ossia::polar* position::target()
const
3475 return &m_impl.m_value3;
3479 inline const ossia::aed* position::target()
const
3482 return &m_impl.m_value4;
3486 inline const ossia::ad* position::target()
const
3489 return &m_impl.m_value5;
3493 inline const ossia::opengl* position::target()
const
3496 return &m_impl.m_value6;
3500 inline const ossia::cylindrical* position::target()
const
3503 return &m_impl.m_value7;
3507 inline const ossia::azd* position::target()
const
3510 return &m_impl.m_value8;
3514 inline ossia::cartesian_3d* position::target()
3517 return &m_impl.m_value0;
3521 inline ossia::cartesian_2d* position::target()
3524 return &m_impl.m_value1;
3528 inline ossia::spherical* position::target()
3531 return &m_impl.m_value2;
3535 inline ossia::polar* position::target()
3538 return &m_impl.m_value3;
3542 inline ossia::aed* position::target()
3545 return &m_impl.m_value4;
3549 inline ossia::ad* position::target()
3552 return &m_impl.m_value5;
3556 inline ossia::opengl* position::target()
3559 return &m_impl.m_value6;
3563 inline ossia::cylindrical* position::target()
3566 return &m_impl.m_value7;
3570 inline ossia::azd* position::target()
3573 return &m_impl.m_value8;
3577 inline const ossia::cartesian_3d& position::get()
const
3580 return m_impl.m_value0;
3581 ossia_do_throw(std::runtime_error,
"position: bad type");
3584 inline const ossia::cartesian_2d& position::get()
const
3587 return m_impl.m_value1;
3588 ossia_do_throw(std::runtime_error,
"position: bad type");
3591 inline const ossia::spherical& position::get()
const
3594 return m_impl.m_value2;
3595 ossia_do_throw(std::runtime_error,
"position: bad type");
3598 inline const ossia::polar& position::get()
const
3601 return m_impl.m_value3;
3602 ossia_do_throw(std::runtime_error,
"position: bad type");
3605 inline const ossia::aed& position::get()
const
3608 return m_impl.m_value4;
3609 ossia_do_throw(std::runtime_error,
"position: bad type");
3612 inline const ossia::ad& position::get()
const
3615 return m_impl.m_value5;
3616 ossia_do_throw(std::runtime_error,
"position: bad type");
3619 inline const ossia::opengl& position::get()
const
3622 return m_impl.m_value6;
3623 ossia_do_throw(std::runtime_error,
"position: bad type");
3626 inline const ossia::cylindrical& position::get()
const
3629 return m_impl.m_value7;
3630 ossia_do_throw(std::runtime_error,
"position: bad type");
3633 inline const ossia::azd& position::get()
const
3636 return m_impl.m_value8;
3637 ossia_do_throw(std::runtime_error,
"position: bad type");
3640 inline ossia::cartesian_3d& position::get()
3643 return m_impl.m_value0;
3644 ossia_do_throw(std::runtime_error,
"position: bad type");
3647 inline ossia::cartesian_2d& position::get()
3650 return m_impl.m_value1;
3651 ossia_do_throw(std::runtime_error,
"position: bad type");
3654 inline ossia::spherical& position::get()
3657 return m_impl.m_value2;
3658 ossia_do_throw(std::runtime_error,
"position: bad type");
3661 inline ossia::polar& position::get()
3664 return m_impl.m_value3;
3665 ossia_do_throw(std::runtime_error,
"position: bad type");
3668 inline ossia::aed& position::get()
3671 return m_impl.m_value4;
3672 ossia_do_throw(std::runtime_error,
"position: bad type");
3675 inline ossia::ad& position::get()
3678 return m_impl.m_value5;
3679 ossia_do_throw(std::runtime_error,
"position: bad type");
3682 inline ossia::opengl& position::get()
3685 return m_impl.m_value6;
3686 ossia_do_throw(std::runtime_error,
"position: bad type");
3689 inline ossia::cylindrical& position::get()
3692 return m_impl.m_value7;
3693 ossia_do_throw(std::runtime_error,
"position: bad type");
3696 inline ossia::azd& position::get()
3699 return m_impl.m_value8;
3700 ossia_do_throw(std::runtime_error,
"position: bad type");
3702 template <
typename Visitor>
3703 auto apply_nonnull(Visitor&& functor,
const position& var)
3707 case position::Type::Type0:
3708 return functor(var.m_impl.m_value0);
3709 case position::Type::Type1:
3710 return functor(var.m_impl.m_value1);
3711 case position::Type::Type2:
3712 return functor(var.m_impl.m_value2);
3713 case position::Type::Type3:
3714 return functor(var.m_impl.m_value3);
3715 case position::Type::Type4:
3716 return functor(var.m_impl.m_value4);
3717 case position::Type::Type5:
3718 return functor(var.m_impl.m_value5);
3719 case position::Type::Type6:
3720 return functor(var.m_impl.m_value6);
3721 case position::Type::Type7:
3722 return functor(var.m_impl.m_value7);
3723 case position::Type::Type8:
3724 return functor(var.m_impl.m_value8);
3726 ossia_do_throw(std::runtime_error,
"position: bad type");
3729 template <
typename Visitor>
3730 auto apply_nonnull(Visitor&& functor, position& var)
3734 case position::Type::Type0:
3735 return functor(var.m_impl.m_value0);
3736 case position::Type::Type1:
3737 return functor(var.m_impl.m_value1);
3738 case position::Type::Type2:
3739 return functor(var.m_impl.m_value2);
3740 case position::Type::Type3:
3741 return functor(var.m_impl.m_value3);
3742 case position::Type::Type4:
3743 return functor(var.m_impl.m_value4);
3744 case position::Type::Type5:
3745 return functor(var.m_impl.m_value5);
3746 case position::Type::Type6:
3747 return functor(var.m_impl.m_value6);
3748 case position::Type::Type7:
3749 return functor(var.m_impl.m_value7);
3750 case position::Type::Type8:
3751 return functor(var.m_impl.m_value8);
3753 ossia_do_throw(std::runtime_error,
"position: bad type");
3756 template <
typename Visitor>
3757 auto apply_nonnull(Visitor&& functor, position&& var)
3761 case position::Type::Type0:
3762 return functor(std::move(var.m_impl.m_value0));
3763 case position::Type::Type1:
3764 return functor(std::move(var.m_impl.m_value1));
3765 case position::Type::Type2:
3766 return functor(std::move(var.m_impl.m_value2));
3767 case position::Type::Type3:
3768 return functor(std::move(var.m_impl.m_value3));
3769 case position::Type::Type4:
3770 return functor(std::move(var.m_impl.m_value4));
3771 case position::Type::Type5:
3772 return functor(std::move(var.m_impl.m_value5));
3773 case position::Type::Type6:
3774 return functor(std::move(var.m_impl.m_value6));
3775 case position::Type::Type7:
3776 return functor(std::move(var.m_impl.m_value7));
3777 case position::Type::Type8:
3778 return functor(std::move(var.m_impl.m_value8));
3780 ossia_do_throw(std::runtime_error,
"position: bad type");
3783 template <
typename Visitor>
3784 auto apply(Visitor&& functor,
const position& var)
3788 case position::Type::Type0:
3789 return functor(var.m_impl.m_value0);
3790 case position::Type::Type1:
3791 return functor(var.m_impl.m_value1);
3792 case position::Type::Type2:
3793 return functor(var.m_impl.m_value2);
3794 case position::Type::Type3:
3795 return functor(var.m_impl.m_value3);
3796 case position::Type::Type4:
3797 return functor(var.m_impl.m_value4);
3798 case position::Type::Type5:
3799 return functor(var.m_impl.m_value5);
3800 case position::Type::Type6:
3801 return functor(var.m_impl.m_value6);
3802 case position::Type::Type7:
3803 return functor(var.m_impl.m_value7);
3804 case position::Type::Type8:
3805 return functor(var.m_impl.m_value8);
3810 template <
typename Visitor>
3811 auto apply(Visitor&& functor, position& var)
3815 case position::Type::Type0:
3816 return functor(var.m_impl.m_value0);
3817 case position::Type::Type1:
3818 return functor(var.m_impl.m_value1);
3819 case position::Type::Type2:
3820 return functor(var.m_impl.m_value2);
3821 case position::Type::Type3:
3822 return functor(var.m_impl.m_value3);
3823 case position::Type::Type4:
3824 return functor(var.m_impl.m_value4);
3825 case position::Type::Type5:
3826 return functor(var.m_impl.m_value5);
3827 case position::Type::Type6:
3828 return functor(var.m_impl.m_value6);
3829 case position::Type::Type7:
3830 return functor(var.m_impl.m_value7);
3831 case position::Type::Type8:
3832 return functor(var.m_impl.m_value8);
3837 template <
typename Visitor>
3838 auto apply(Visitor&& functor, position&& var)
3842 case position::Type::Type0:
3843 return functor(std::move(var.m_impl.m_value0));
3844 case position::Type::Type1:
3845 return functor(std::move(var.m_impl.m_value1));
3846 case position::Type::Type2:
3847 return functor(std::move(var.m_impl.m_value2));
3848 case position::Type::Type3:
3849 return functor(std::move(var.m_impl.m_value3));
3850 case position::Type::Type4:
3851 return functor(std::move(var.m_impl.m_value4));
3852 case position::Type::Type5:
3853 return functor(std::move(var.m_impl.m_value5));
3854 case position::Type::Type6:
3855 return functor(std::move(var.m_impl.m_value6));
3856 case position::Type::Type7:
3857 return functor(std::move(var.m_impl.m_value7));
3858 case position::Type::Type8:
3859 return functor(std::move(var.m_impl.m_value8));
3864 inline bool operator==(
const position& lhs,
const position& rhs)
3866 if(lhs.m_type == rhs.m_type)
3870 case position::Type::Type0:
3871 return lhs.m_impl.m_value0 == rhs.m_impl.m_value0;
3872 case position::Type::Type1:
3873 return lhs.m_impl.m_value1 == rhs.m_impl.m_value1;
3874 case position::Type::Type2:
3875 return lhs.m_impl.m_value2 == rhs.m_impl.m_value2;
3876 case position::Type::Type3:
3877 return lhs.m_impl.m_value3 == rhs.m_impl.m_value3;
3878 case position::Type::Type4:
3879 return lhs.m_impl.m_value4 == rhs.m_impl.m_value4;
3880 case position::Type::Type5:
3881 return lhs.m_impl.m_value5 == rhs.m_impl.m_value5;
3882 case position::Type::Type6:
3883 return lhs.m_impl.m_value6 == rhs.m_impl.m_value6;
3884 case position::Type::Type7:
3885 return lhs.m_impl.m_value7 == rhs.m_impl.m_value7;
3886 case position::Type::Type8:
3887 return lhs.m_impl.m_value8 == rhs.m_impl.m_value8;
3894 inline bool operator!=(
const position& lhs,
const position& rhs)
3896 if(lhs.m_type != rhs.m_type)
3900 case position::Type::Type0:
3901 return lhs.m_impl.m_value0 != rhs.m_impl.m_value0;
3902 case position::Type::Type1:
3903 return lhs.m_impl.m_value1 != rhs.m_impl.m_value1;
3904 case position::Type::Type2:
3905 return lhs.m_impl.m_value2 != rhs.m_impl.m_value2;
3906 case position::Type::Type3:
3907 return lhs.m_impl.m_value3 != rhs.m_impl.m_value3;
3908 case position::Type::Type4:
3909 return lhs.m_impl.m_value4 != rhs.m_impl.m_value4;
3910 case position::Type::Type5:
3911 return lhs.m_impl.m_value5 != rhs.m_impl.m_value5;
3912 case position::Type::Type6:
3913 return lhs.m_impl.m_value6 != rhs.m_impl.m_value6;
3914 case position::Type::Type7:
3915 return lhs.m_impl.m_value7 != rhs.m_impl.m_value7;
3916 case position::Type::Type8:
3917 return lhs.m_impl.m_value8 != rhs.m_impl.m_value8;
3923 inline bool operator==(
const position& lhs,
const ossia::cartesian_3d& rhs)
3925 return (lhs.m_type == position::Type::Type0) && (lhs.m_impl.m_value0 == rhs);
3927 inline bool operator==(
const ossia::cartesian_3d& lhs,
const position& rhs)
3929 return (rhs.m_type == position::Type::Type0) && (rhs.m_impl.m_value0 == lhs);
3931 inline bool operator!=(
const position& lhs,
const ossia::cartesian_3d& rhs)
3933 return (lhs.m_type != position::Type::Type0) || (lhs.m_impl.m_value0 != rhs);
3935 inline bool operator!=(
const ossia::cartesian_3d& lhs,
const position& rhs)
3937 return (rhs.m_type != position::Type::Type0) || (rhs.m_impl.m_value0 != lhs);
3939 inline bool operator==(
const position& lhs,
const ossia::cartesian_2d& rhs)
3941 return (lhs.m_type == position::Type::Type1) && (lhs.m_impl.m_value1 == rhs);
3943 inline bool operator==(
const ossia::cartesian_2d& lhs,
const position& rhs)
3945 return (rhs.m_type == position::Type::Type1) && (rhs.m_impl.m_value1 == lhs);
3947 inline bool operator!=(
const position& lhs,
const ossia::cartesian_2d& rhs)
3949 return (lhs.m_type != position::Type::Type1) || (lhs.m_impl.m_value1 != rhs);
3951 inline bool operator!=(
const ossia::cartesian_2d& lhs,
const position& rhs)
3953 return (rhs.m_type != position::Type::Type1) || (rhs.m_impl.m_value1 != lhs);
3955 inline bool operator==(
const position& lhs,
const ossia::spherical& rhs)
3957 return (lhs.m_type == position::Type::Type2) && (lhs.m_impl.m_value2 == rhs);
3959 inline bool operator==(
const ossia::spherical& lhs,
const position& rhs)
3961 return (rhs.m_type == position::Type::Type2) && (rhs.m_impl.m_value2 == lhs);
3963 inline bool operator!=(
const position& lhs,
const ossia::spherical& rhs)
3965 return (lhs.m_type != position::Type::Type2) || (lhs.m_impl.m_value2 != rhs);
3967 inline bool operator!=(
const ossia::spherical& lhs,
const position& rhs)
3969 return (rhs.m_type != position::Type::Type2) || (rhs.m_impl.m_value2 != lhs);
3971 inline bool operator==(
const position& lhs,
const ossia::polar& rhs)
3973 return (lhs.m_type == position::Type::Type3) && (lhs.m_impl.m_value3 == rhs);
3975 inline bool operator==(
const ossia::polar& lhs,
const position& rhs)
3977 return (rhs.m_type == position::Type::Type3) && (rhs.m_impl.m_value3 == lhs);
3979 inline bool operator!=(
const position& lhs,
const ossia::polar& rhs)
3981 return (lhs.m_type != position::Type::Type3) || (lhs.m_impl.m_value3 != rhs);
3983 inline bool operator!=(
const ossia::polar& lhs,
const position& rhs)
3985 return (rhs.m_type != position::Type::Type3) || (rhs.m_impl.m_value3 != lhs);
3987 inline bool operator==(
const position& lhs,
const ossia::aed& rhs)
3989 return (lhs.m_type == position::Type::Type4) && (lhs.m_impl.m_value4 == rhs);
3991 inline bool operator==(
const ossia::aed& lhs,
const position& rhs)
3993 return (rhs.m_type == position::Type::Type4) && (rhs.m_impl.m_value4 == lhs);
3995 inline bool operator!=(
const position& lhs,
const ossia::aed& rhs)
3997 return (lhs.m_type != position::Type::Type4) || (lhs.m_impl.m_value4 != rhs);
3999 inline bool operator!=(
const ossia::aed& lhs,
const position& rhs)
4001 return (rhs.m_type != position::Type::Type4) || (rhs.m_impl.m_value4 != lhs);
4003 inline bool operator==(
const position& lhs,
const ossia::ad& rhs)
4005 return (lhs.m_type == position::Type::Type5) && (lhs.m_impl.m_value5 == rhs);
4007 inline bool operator==(
const ossia::ad& lhs,
const position& rhs)
4009 return (rhs.m_type == position::Type::Type5) && (rhs.m_impl.m_value5 == lhs);
4011 inline bool operator!=(
const position& lhs,
const ossia::ad& rhs)
4013 return (lhs.m_type != position::Type::Type5) || (lhs.m_impl.m_value5 != rhs);
4015 inline bool operator!=(
const ossia::ad& lhs,
const position& rhs)
4017 return (rhs.m_type != position::Type::Type5) || (rhs.m_impl.m_value5 != lhs);
4019 inline bool operator==(
const position& lhs,
const ossia::opengl& rhs)
4021 return (lhs.m_type == position::Type::Type6) && (lhs.m_impl.m_value6 == rhs);
4023 inline bool operator==(
const ossia::opengl& lhs,
const position& rhs)
4025 return (rhs.m_type == position::Type::Type6) && (rhs.m_impl.m_value6 == lhs);
4027 inline bool operator!=(
const position& lhs,
const ossia::opengl& rhs)
4029 return (lhs.m_type != position::Type::Type6) || (lhs.m_impl.m_value6 != rhs);
4031 inline bool operator!=(
const ossia::opengl& lhs,
const position& rhs)
4033 return (rhs.m_type != position::Type::Type6) || (rhs.m_impl.m_value6 != lhs);
4035 inline bool operator==(
const position& lhs,
const ossia::cylindrical& rhs)
4037 return (lhs.m_type == position::Type::Type7) && (lhs.m_impl.m_value7 == rhs);
4039 inline bool operator==(
const ossia::cylindrical& lhs,
const position& rhs)
4041 return (rhs.m_type == position::Type::Type7) && (rhs.m_impl.m_value7 == lhs);
4043 inline bool operator!=(
const position& lhs,
const ossia::cylindrical& rhs)
4045 return (lhs.m_type != position::Type::Type7) || (lhs.m_impl.m_value7 != rhs);
4047 inline bool operator!=(
const ossia::cylindrical& lhs,
const position& rhs)
4049 return (rhs.m_type != position::Type::Type7) || (rhs.m_impl.m_value7 != lhs);
4051 inline bool operator==(
const position& lhs,
const ossia::azd& rhs)
4053 return (lhs.m_type == position::Type::Type8) && (lhs.m_impl.m_value8 == rhs);
4055 inline bool operator==(
const ossia::azd& lhs,
const position& rhs)
4057 return (rhs.m_type == position::Type::Type8) && (rhs.m_impl.m_value8 == lhs);
4059 inline bool operator!=(
const position& lhs,
const ossia::azd& rhs)
4061 return (lhs.m_type != position::Type::Type8) || (lhs.m_impl.m_value8 != rhs);
4063 inline bool operator!=(
const ossia::azd& lhs,
const position& rhs)
4065 return (rhs.m_type != position::Type::Type8) || (rhs.m_impl.m_value8 != lhs);
4075 ossia::meter_per_second m_value0;
4077 ossia::miles_per_hour m_value1;
4079 ossia::kilometer_per_hour m_value2;
4081 ossia::knot m_value3;
4083 ossia::foot_per_second m_value4;
4085 ossia::foot_per_hour m_value5;
4106 void destruct_impl()
4118 static const constexpr
auto npos = Npos;
4119 int which()
const {
return m_type; }
4121 operator bool()
const {
return m_type != npos; }
4122 template <
typename T>
4123 const T* target()
const;
4124 template <
typename T>
4126 template <
typename T>
4127 const T& get()
const;
4128 template <
typename T>
4131 template <
typename T>
4137 ~speed() { destruct_impl(); }
4138 speed(ossia::meter_per_second v)
4141 new(&m_impl.m_value0) ossia::meter_per_second{v};
4143 speed(ossia::miles_per_hour v)
4146 new(&m_impl.m_value1) ossia::miles_per_hour{v};
4148 speed(ossia::kilometer_per_hour v)
4151 new(&m_impl.m_value2) ossia::kilometer_per_hour{v};
4153 speed(ossia::knot v)
4156 new(&m_impl.m_value3) ossia::knot{v};
4158 speed(ossia::foot_per_second v)
4161 new(&m_impl.m_value4) ossia::foot_per_second{v};
4163 speed(ossia::foot_per_hour v)
4166 new(&m_impl.m_value5) ossia::foot_per_hour{v};
4168 speed(
const speed& other)
4169 : m_type{other.m_type}
4174 new(&m_impl.m_value0) ossia::meter_per_second{other.m_impl.m_value0};
4177 new(&m_impl.m_value1) ossia::miles_per_hour{other.m_impl.m_value1};
4180 new(&m_impl.m_value2) ossia::kilometer_per_hour{other.m_impl.m_value2};
4183 new(&m_impl.m_value3) ossia::knot{other.m_impl.m_value3};
4186 new(&m_impl.m_value4) ossia::foot_per_second{other.m_impl.m_value4};
4189 new(&m_impl.m_value5) ossia::foot_per_hour{other.m_impl.m_value5};
4195 speed(speed&& other)
4196 : m_type{other.m_type}
4201 new(&m_impl.m_value0) ossia::meter_per_second{std::move(other.m_impl.m_value0)};
4204 new(&m_impl.m_value1) ossia::miles_per_hour{std::move(other.m_impl.m_value1)};
4207 new(&m_impl.m_value2)
4208 ossia::kilometer_per_hour{std::move(other.m_impl.m_value2)};
4211 new(&m_impl.m_value3) ossia::knot{std::move(other.m_impl.m_value3)};
4214 new(&m_impl.m_value4) ossia::foot_per_second{std::move(other.m_impl.m_value4)};
4217 new(&m_impl.m_value5) ossia::foot_per_hour{std::move(other.m_impl.m_value5)};
4223 speed& operator=(
const speed& other)
4226 m_type = other.m_type;
4230 new(&m_impl.m_value0) ossia::meter_per_second{other.m_impl.m_value0};
4233 new(&m_impl.m_value1) ossia::miles_per_hour{other.m_impl.m_value1};
4236 new(&m_impl.m_value2) ossia::kilometer_per_hour{other.m_impl.m_value2};
4239 new(&m_impl.m_value3) ossia::knot{other.m_impl.m_value3};
4242 new(&m_impl.m_value4) ossia::foot_per_second{other.m_impl.m_value4};
4245 new(&m_impl.m_value5) ossia::foot_per_hour{other.m_impl.m_value5};
4252 speed& operator=(speed&& other)
4255 m_type = other.m_type;
4259 new(&m_impl.m_value0) ossia::meter_per_second{std::move(other.m_impl.m_value0)};
4262 new(&m_impl.m_value1) ossia::miles_per_hour{std::move(other.m_impl.m_value1)};
4265 new(&m_impl.m_value2)
4266 ossia::kilometer_per_hour{std::move(other.m_impl.m_value2)};
4269 new(&m_impl.m_value3) ossia::knot{std::move(other.m_impl.m_value3)};
4272 new(&m_impl.m_value4) ossia::foot_per_second{std::move(other.m_impl.m_value4)};
4275 new(&m_impl.m_value5) ossia::foot_per_hour{std::move(other.m_impl.m_value5)};
4284 inline const ossia::meter_per_second* speed::target()
const
4287 return &m_impl.m_value0;
4291 inline const ossia::miles_per_hour* speed::target()
const
4294 return &m_impl.m_value1;
4298 inline const ossia::kilometer_per_hour* speed::target()
const
4301 return &m_impl.m_value2;
4305 inline const ossia::knot* speed::target()
const
4308 return &m_impl.m_value3;
4312 inline const ossia::foot_per_second* speed::target()
const
4315 return &m_impl.m_value4;
4319 inline const ossia::foot_per_hour* speed::target()
const
4322 return &m_impl.m_value5;
4326 inline ossia::meter_per_second* speed::target()
4329 return &m_impl.m_value0;
4333 inline ossia::miles_per_hour* speed::target()
4336 return &m_impl.m_value1;
4340 inline ossia::kilometer_per_hour* speed::target()
4343 return &m_impl.m_value2;
4347 inline ossia::knot* speed::target()
4350 return &m_impl.m_value3;
4354 inline ossia::foot_per_second* speed::target()
4357 return &m_impl.m_value4;
4361 inline ossia::foot_per_hour* speed::target()
4364 return &m_impl.m_value5;
4368 inline const ossia::meter_per_second& speed::get()
const
4371 return m_impl.m_value0;
4372 ossia_do_throw(std::runtime_error,
"speed: bad type");
4375 inline const ossia::miles_per_hour& speed::get()
const
4378 return m_impl.m_value1;
4379 ossia_do_throw(std::runtime_error,
"speed: bad type");
4382 inline const ossia::kilometer_per_hour& speed::get()
const
4385 return m_impl.m_value2;
4386 ossia_do_throw(std::runtime_error,
"speed: bad type");
4389 inline const ossia::knot& speed::get()
const
4392 return m_impl.m_value3;
4393 ossia_do_throw(std::runtime_error,
"speed: bad type");
4396 inline const ossia::foot_per_second& speed::get()
const
4399 return m_impl.m_value4;
4400 ossia_do_throw(std::runtime_error,
"speed: bad type");
4403 inline const ossia::foot_per_hour& speed::get()
const
4406 return m_impl.m_value5;
4407 ossia_do_throw(std::runtime_error,
"speed: bad type");
4410 inline ossia::meter_per_second& speed::get()
4413 return m_impl.m_value0;
4414 ossia_do_throw(std::runtime_error,
"speed: bad type");
4417 inline ossia::miles_per_hour& speed::get()
4420 return m_impl.m_value1;
4421 ossia_do_throw(std::runtime_error,
"speed: bad type");
4424 inline ossia::kilometer_per_hour& speed::get()
4427 return m_impl.m_value2;
4428 ossia_do_throw(std::runtime_error,
"speed: bad type");
4431 inline ossia::knot& speed::get()
4434 return m_impl.m_value3;
4435 ossia_do_throw(std::runtime_error,
"speed: bad type");
4438 inline ossia::foot_per_second& speed::get()
4441 return m_impl.m_value4;
4442 ossia_do_throw(std::runtime_error,
"speed: bad type");
4445 inline ossia::foot_per_hour& speed::get()
4448 return m_impl.m_value5;
4449 ossia_do_throw(std::runtime_error,
"speed: bad type");
4451 template <
typename Visitor>
4452 auto apply_nonnull(Visitor&& functor,
const speed& var)
4456 case speed::Type::Type0:
4457 return functor(var.m_impl.m_value0);
4458 case speed::Type::Type1:
4459 return functor(var.m_impl.m_value1);
4460 case speed::Type::Type2:
4461 return functor(var.m_impl.m_value2);
4462 case speed::Type::Type3:
4463 return functor(var.m_impl.m_value3);
4464 case speed::Type::Type4:
4465 return functor(var.m_impl.m_value4);
4466 case speed::Type::Type5:
4467 return functor(var.m_impl.m_value5);
4469 ossia_do_throw(std::runtime_error,
"speed: bad type");
4472 template <
typename Visitor>
4473 auto apply_nonnull(Visitor&& functor, speed& var)
4477 case speed::Type::Type0:
4478 return functor(var.m_impl.m_value0);
4479 case speed::Type::Type1:
4480 return functor(var.m_impl.m_value1);
4481 case speed::Type::Type2:
4482 return functor(var.m_impl.m_value2);
4483 case speed::Type::Type3:
4484 return functor(var.m_impl.m_value3);
4485 case speed::Type::Type4:
4486 return functor(var.m_impl.m_value4);
4487 case speed::Type::Type5:
4488 return functor(var.m_impl.m_value5);
4490 ossia_do_throw(std::runtime_error,
"speed: bad type");
4493 template <
typename Visitor>
4494 auto apply_nonnull(Visitor&& functor, speed&& var)
4498 case speed::Type::Type0:
4499 return functor(std::move(var.m_impl.m_value0));
4500 case speed::Type::Type1:
4501 return functor(std::move(var.m_impl.m_value1));
4502 case speed::Type::Type2:
4503 return functor(std::move(var.m_impl.m_value2));
4504 case speed::Type::Type3:
4505 return functor(std::move(var.m_impl.m_value3));
4506 case speed::Type::Type4:
4507 return functor(std::move(var.m_impl.m_value4));
4508 case speed::Type::Type5:
4509 return functor(std::move(var.m_impl.m_value5));
4511 ossia_do_throw(std::runtime_error,
"speed: bad type");
4514 template <
typename Visitor>
4515 auto apply(Visitor&& functor,
const speed& var)
4519 case speed::Type::Type0:
4520 return functor(var.m_impl.m_value0);
4521 case speed::Type::Type1:
4522 return functor(var.m_impl.m_value1);
4523 case speed::Type::Type2:
4524 return functor(var.m_impl.m_value2);
4525 case speed::Type::Type3:
4526 return functor(var.m_impl.m_value3);
4527 case speed::Type::Type4:
4528 return functor(var.m_impl.m_value4);
4529 case speed::Type::Type5:
4530 return functor(var.m_impl.m_value5);
4535 template <
typename Visitor>
4536 auto apply(Visitor&& functor, speed& var)
4540 case speed::Type::Type0:
4541 return functor(var.m_impl.m_value0);
4542 case speed::Type::Type1:
4543 return functor(var.m_impl.m_value1);
4544 case speed::Type::Type2:
4545 return functor(var.m_impl.m_value2);
4546 case speed::Type::Type3:
4547 return functor(var.m_impl.m_value3);
4548 case speed::Type::Type4:
4549 return functor(var.m_impl.m_value4);
4550 case speed::Type::Type5:
4551 return functor(var.m_impl.m_value5);
4556 template <
typename Visitor>
4557 auto apply(Visitor&& functor, speed&& var)
4561 case speed::Type::Type0:
4562 return functor(std::move(var.m_impl.m_value0));
4563 case speed::Type::Type1:
4564 return functor(std::move(var.m_impl.m_value1));
4565 case speed::Type::Type2:
4566 return functor(std::move(var.m_impl.m_value2));
4567 case speed::Type::Type3:
4568 return functor(std::move(var.m_impl.m_value3));
4569 case speed::Type::Type4:
4570 return functor(std::move(var.m_impl.m_value4));
4571 case speed::Type::Type5:
4572 return functor(std::move(var.m_impl.m_value5));
4577 inline bool operator==(
const speed& lhs,
const speed& rhs)
4579 if(lhs.m_type == rhs.m_type)
4583 case speed::Type::Type0:
4584 return lhs.m_impl.m_value0 == rhs.m_impl.m_value0;
4585 case speed::Type::Type1:
4586 return lhs.m_impl.m_value1 == rhs.m_impl.m_value1;
4587 case speed::Type::Type2:
4588 return lhs.m_impl.m_value2 == rhs.m_impl.m_value2;
4589 case speed::Type::Type3:
4590 return lhs.m_impl.m_value3 == rhs.m_impl.m_value3;
4591 case speed::Type::Type4:
4592 return lhs.m_impl.m_value4 == rhs.m_impl.m_value4;
4593 case speed::Type::Type5:
4594 return lhs.m_impl.m_value5 == rhs.m_impl.m_value5;
4601 inline bool operator!=(
const speed& lhs,
const speed& rhs)
4603 if(lhs.m_type != rhs.m_type)
4607 case speed::Type::Type0:
4608 return lhs.m_impl.m_value0 != rhs.m_impl.m_value0;
4609 case speed::Type::Type1:
4610 return lhs.m_impl.m_value1 != rhs.m_impl.m_value1;
4611 case speed::Type::Type2:
4612 return lhs.m_impl.m_value2 != rhs.m_impl.m_value2;
4613 case speed::Type::Type3:
4614 return lhs.m_impl.m_value3 != rhs.m_impl.m_value3;
4615 case speed::Type::Type4:
4616 return lhs.m_impl.m_value4 != rhs.m_impl.m_value4;
4617 case speed::Type::Type5:
4618 return lhs.m_impl.m_value5 != rhs.m_impl.m_value5;
4624 inline bool operator==(
const speed& lhs,
const ossia::meter_per_second& rhs)
4626 return (lhs.m_type == speed::Type::Type0) && (lhs.m_impl.m_value0 == rhs);
4628 inline bool operator==(
const ossia::meter_per_second& lhs,
const speed& rhs)
4630 return (rhs.m_type == speed::Type::Type0) && (rhs.m_impl.m_value0 == lhs);
4632 inline bool operator!=(
const speed& lhs,
const ossia::meter_per_second& rhs)
4634 return (lhs.m_type != speed::Type::Type0) || (lhs.m_impl.m_value0 != rhs);
4636 inline bool operator!=(
const ossia::meter_per_second& lhs,
const speed& rhs)
4638 return (rhs.m_type != speed::Type::Type0) || (rhs.m_impl.m_value0 != lhs);
4640 inline bool operator==(
const speed& lhs,
const ossia::miles_per_hour& rhs)
4642 return (lhs.m_type == speed::Type::Type1) && (lhs.m_impl.m_value1 == rhs);
4644 inline bool operator==(
const ossia::miles_per_hour& lhs,
const speed& rhs)
4646 return (rhs.m_type == speed::Type::Type1) && (rhs.m_impl.m_value1 == lhs);
4648 inline bool operator!=(
const speed& lhs,
const ossia::miles_per_hour& rhs)
4650 return (lhs.m_type != speed::Type::Type1) || (lhs.m_impl.m_value1 != rhs);
4652 inline bool operator!=(
const ossia::miles_per_hour& lhs,
const speed& rhs)
4654 return (rhs.m_type != speed::Type::Type1) || (rhs.m_impl.m_value1 != lhs);
4656 inline bool operator==(
const speed& lhs,
const ossia::kilometer_per_hour& rhs)
4658 return (lhs.m_type == speed::Type::Type2) && (lhs.m_impl.m_value2 == rhs);
4660 inline bool operator==(
const ossia::kilometer_per_hour& lhs,
const speed& rhs)
4662 return (rhs.m_type == speed::Type::Type2) && (rhs.m_impl.m_value2 == lhs);
4664 inline bool operator!=(
const speed& lhs,
const ossia::kilometer_per_hour& rhs)
4666 return (lhs.m_type != speed::Type::Type2) || (lhs.m_impl.m_value2 != rhs);
4668 inline bool operator!=(
const ossia::kilometer_per_hour& lhs,
const speed& rhs)
4670 return (rhs.m_type != speed::Type::Type2) || (rhs.m_impl.m_value2 != lhs);
4672 inline bool operator==(
const speed& lhs,
const ossia::knot& rhs)
4674 return (lhs.m_type == speed::Type::Type3) && (lhs.m_impl.m_value3 == rhs);
4676 inline bool operator==(
const ossia::knot& lhs,
const speed& rhs)
4678 return (rhs.m_type == speed::Type::Type3) && (rhs.m_impl.m_value3 == lhs);
4680 inline bool operator!=(
const speed& lhs,
const ossia::knot& rhs)
4682 return (lhs.m_type != speed::Type::Type3) || (lhs.m_impl.m_value3 != rhs);
4684 inline bool operator!=(
const ossia::knot& lhs,
const speed& rhs)
4686 return (rhs.m_type != speed::Type::Type3) || (rhs.m_impl.m_value3 != lhs);
4688 inline bool operator==(
const speed& lhs,
const ossia::foot_per_second& rhs)
4690 return (lhs.m_type == speed::Type::Type4) && (lhs.m_impl.m_value4 == rhs);
4692 inline bool operator==(
const ossia::foot_per_second& lhs,
const speed& rhs)
4694 return (rhs.m_type == speed::Type::Type4) && (rhs.m_impl.m_value4 == lhs);
4696 inline bool operator!=(
const speed& lhs,
const ossia::foot_per_second& rhs)
4698 return (lhs.m_type != speed::Type::Type4) || (lhs.m_impl.m_value4 != rhs);
4700 inline bool operator!=(
const ossia::foot_per_second& lhs,
const speed& rhs)
4702 return (rhs.m_type != speed::Type::Type4) || (rhs.m_impl.m_value4 != lhs);
4704 inline bool operator==(
const speed& lhs,
const ossia::foot_per_hour& rhs)
4706 return (lhs.m_type == speed::Type::Type5) && (lhs.m_impl.m_value5 == rhs);
4708 inline bool operator==(
const ossia::foot_per_hour& lhs,
const speed& rhs)
4710 return (rhs.m_type == speed::Type::Type5) && (rhs.m_impl.m_value5 == lhs);
4712 inline bool operator!=(
const speed& lhs,
const ossia::foot_per_hour& rhs)
4714 return (lhs.m_type != speed::Type::Type5) || (lhs.m_impl.m_value5 != rhs);
4716 inline bool operator!=(
const ossia::foot_per_hour& lhs,
const speed& rhs)
4718 return (rhs.m_type != speed::Type::Type5) || (rhs.m_impl.m_value5 != lhs);
4728 ossia::second m_value0;
4730 ossia::bark m_value1;
4732 ossia::bpm m_value2;
4734 ossia::cent m_value3;
4736 ossia::frequency m_value4;
4738 ossia::mel m_value5;
4740 ossia::midi_pitch m_value6;
4742 ossia::millisecond m_value7;
4744 ossia::playback_speed m_value8;
4768 void destruct_impl()
4780 static const constexpr
auto npos = Npos;
4781 int which()
const {
return m_type; }
4783 operator bool()
const {
return m_type != npos; }
4784 template <
typename T>
4785 const T* target()
const;
4786 template <
typename T>
4788 template <
typename T>
4789 const T& get()
const;
4790 template <
typename T>
4793 template <
typename T>
4799 ~timing() { destruct_impl(); }
4800 timing(ossia::second v)
4803 new(&m_impl.m_value0) ossia::second{v};
4805 timing(ossia::bark v)
4808 new(&m_impl.m_value1) ossia::bark{v};
4810 timing(ossia::bpm v)
4813 new(&m_impl.m_value2) ossia::bpm{v};
4815 timing(ossia::cent v)
4818 new(&m_impl.m_value3) ossia::cent{v};
4820 timing(ossia::frequency v)
4823 new(&m_impl.m_value4) ossia::frequency{v};
4825 timing(ossia::mel v)
4828 new(&m_impl.m_value5) ossia::mel{v};
4830 timing(ossia::midi_pitch v)
4833 new(&m_impl.m_value6) ossia::midi_pitch{v};
4835 timing(ossia::millisecond v)
4838 new(&m_impl.m_value7) ossia::millisecond{v};
4840 timing(ossia::playback_speed v)
4843 new(&m_impl.m_value8) ossia::playback_speed{v};
4845 timing(
const timing& other)
4846 : m_type{other.m_type}
4851 new(&m_impl.m_value0) ossia::second{other.m_impl.m_value0};
4854 new(&m_impl.m_value1) ossia::bark{other.m_impl.m_value1};
4857 new(&m_impl.m_value2) ossia::bpm{other.m_impl.m_value2};
4860 new(&m_impl.m_value3) ossia::cent{other.m_impl.m_value3};
4863 new(&m_impl.m_value4) ossia::frequency{other.m_impl.m_value4};
4866 new(&m_impl.m_value5) ossia::mel{other.m_impl.m_value5};
4869 new(&m_impl.m_value6) ossia::midi_pitch{other.m_impl.m_value6};
4872 new(&m_impl.m_value7) ossia::millisecond{other.m_impl.m_value7};
4875 new(&m_impl.m_value8) ossia::playback_speed{other.m_impl.m_value8};
4881 timing(timing&& other)
4882 : m_type{other.m_type}
4887 new(&m_impl.m_value0) ossia::second{std::move(other.m_impl.m_value0)};
4890 new(&m_impl.m_value1) ossia::bark{std::move(other.m_impl.m_value1)};
4893 new(&m_impl.m_value2) ossia::bpm{std::move(other.m_impl.m_value2)};
4896 new(&m_impl.m_value3) ossia::cent{std::move(other.m_impl.m_value3)};
4899 new(&m_impl.m_value4) ossia::frequency{std::move(other.m_impl.m_value4)};
4902 new(&m_impl.m_value5) ossia::mel{std::move(other.m_impl.m_value5)};
4905 new(&m_impl.m_value6) ossia::midi_pitch{std::move(other.m_impl.m_value6)};
4908 new(&m_impl.m_value7) ossia::millisecond{std::move(other.m_impl.m_value7)};
4911 new(&m_impl.m_value8) ossia::playback_speed{std::move(other.m_impl.m_value8)};
4917 timing& operator=(
const timing& other)
4920 m_type = other.m_type;
4924 new(&m_impl.m_value0) ossia::second{other.m_impl.m_value0};
4927 new(&m_impl.m_value1) ossia::bark{other.m_impl.m_value1};
4930 new(&m_impl.m_value2) ossia::bpm{other.m_impl.m_value2};
4933 new(&m_impl.m_value3) ossia::cent{other.m_impl.m_value3};
4936 new(&m_impl.m_value4) ossia::frequency{other.m_impl.m_value4};
4939 new(&m_impl.m_value5) ossia::mel{other.m_impl.m_value5};
4942 new(&m_impl.m_value6) ossia::midi_pitch{other.m_impl.m_value6};
4945 new(&m_impl.m_value7) ossia::millisecond{other.m_impl.m_value7};
4948 new(&m_impl.m_value8) ossia::playback_speed{other.m_impl.m_value8};
4955 timing& operator=(timing&& other)
4958 m_type = other.m_type;
4962 new(&m_impl.m_value0) ossia::second{std::move(other.m_impl.m_value0)};
4965 new(&m_impl.m_value1) ossia::bark{std::move(other.m_impl.m_value1)};
4968 new(&m_impl.m_value2) ossia::bpm{std::move(other.m_impl.m_value2)};
4971 new(&m_impl.m_value3) ossia::cent{std::move(other.m_impl.m_value3)};
4974 new(&m_impl.m_value4) ossia::frequency{std::move(other.m_impl.m_value4)};
4977 new(&m_impl.m_value5) ossia::mel{std::move(other.m_impl.m_value5)};
4980 new(&m_impl.m_value6) ossia::midi_pitch{std::move(other.m_impl.m_value6)};
4983 new(&m_impl.m_value7) ossia::millisecond{std::move(other.m_impl.m_value7)};
4986 new(&m_impl.m_value8) ossia::playback_speed{std::move(other.m_impl.m_value8)};
4995 inline const ossia::second* timing::target()
const
4998 return &m_impl.m_value0;
5002 inline const ossia::bark* timing::target()
const
5005 return &m_impl.m_value1;
5009 inline const ossia::bpm* timing::target()
const
5012 return &m_impl.m_value2;
5016 inline const ossia::cent* timing::target()
const
5019 return &m_impl.m_value3;
5023 inline const ossia::frequency* timing::target()
const
5026 return &m_impl.m_value4;
5030 inline const ossia::mel* timing::target()
const
5033 return &m_impl.m_value5;
5037 inline const ossia::midi_pitch* timing::target()
const
5040 return &m_impl.m_value6;
5044 inline const ossia::millisecond* timing::target()
const
5047 return &m_impl.m_value7;
5051 inline const ossia::playback_speed* timing::target()
const
5054 return &m_impl.m_value8;
5058 inline ossia::second* timing::target()
5061 return &m_impl.m_value0;
5065 inline ossia::bark* timing::target()
5068 return &m_impl.m_value1;
5072 inline ossia::bpm* timing::target()
5075 return &m_impl.m_value2;
5079 inline ossia::cent* timing::target()
5082 return &m_impl.m_value3;
5086 inline ossia::frequency* timing::target()
5089 return &m_impl.m_value4;
5093 inline ossia::mel* timing::target()
5096 return &m_impl.m_value5;
5100 inline ossia::midi_pitch* timing::target()
5103 return &m_impl.m_value6;
5107 inline ossia::millisecond* timing::target()
5110 return &m_impl.m_value7;
5114 inline ossia::playback_speed* timing::target()
5117 return &m_impl.m_value8;
5121 inline const ossia::second& timing::get()
const
5124 return m_impl.m_value0;
5125 ossia_do_throw(std::runtime_error,
"timing: bad type");
5128 inline const ossia::bark& timing::get()
const
5131 return m_impl.m_value1;
5132 ossia_do_throw(std::runtime_error,
"timing: bad type");
5135 inline const ossia::bpm& timing::get()
const
5138 return m_impl.m_value2;
5139 ossia_do_throw(std::runtime_error,
"timing: bad type");
5142 inline const ossia::cent& timing::get()
const
5145 return m_impl.m_value3;
5146 ossia_do_throw(std::runtime_error,
"timing: bad type");
5149 inline const ossia::frequency& timing::get()
const
5152 return m_impl.m_value4;
5153 ossia_do_throw(std::runtime_error,
"timing: bad type");
5156 inline const ossia::mel& timing::get()
const
5159 return m_impl.m_value5;
5160 ossia_do_throw(std::runtime_error,
"timing: bad type");
5163 inline const ossia::midi_pitch& timing::get()
const
5166 return m_impl.m_value6;
5167 ossia_do_throw(std::runtime_error,
"timing: bad type");
5170 inline const ossia::millisecond& timing::get()
const
5173 return m_impl.m_value7;
5174 ossia_do_throw(std::runtime_error,
"timing: bad type");
5177 inline const ossia::playback_speed& timing::get()
const
5180 return m_impl.m_value8;
5181 ossia_do_throw(std::runtime_error,
"timing: bad type");
5184 inline ossia::second& timing::get()
5187 return m_impl.m_value0;
5188 ossia_do_throw(std::runtime_error,
"timing: bad type");
5191 inline ossia::bark& timing::get()
5194 return m_impl.m_value1;
5195 ossia_do_throw(std::runtime_error,
"timing: bad type");
5198 inline ossia::bpm& timing::get()
5201 return m_impl.m_value2;
5202 ossia_do_throw(std::runtime_error,
"timing: bad type");
5205 inline ossia::cent& timing::get()
5208 return m_impl.m_value3;
5209 ossia_do_throw(std::runtime_error,
"timing: bad type");
5212 inline ossia::frequency& timing::get()
5215 return m_impl.m_value4;
5216 ossia_do_throw(std::runtime_error,
"timing: bad type");
5219 inline ossia::mel& timing::get()
5222 return m_impl.m_value5;
5223 ossia_do_throw(std::runtime_error,
"timing: bad type");
5226 inline ossia::midi_pitch& timing::get()
5229 return m_impl.m_value6;
5230 ossia_do_throw(std::runtime_error,
"timing: bad type");
5233 inline ossia::millisecond& timing::get()
5236 return m_impl.m_value7;
5237 ossia_do_throw(std::runtime_error,
"timing: bad type");
5240 inline ossia::playback_speed& timing::get()
5243 return m_impl.m_value8;
5244 ossia_do_throw(std::runtime_error,
"timing: bad type");
5246 template <
typename Visitor>
5247 auto apply_nonnull(Visitor&& functor,
const timing& var)
5251 case timing::Type::Type0:
5252 return functor(var.m_impl.m_value0);
5253 case timing::Type::Type1:
5254 return functor(var.m_impl.m_value1);
5255 case timing::Type::Type2:
5256 return functor(var.m_impl.m_value2);
5257 case timing::Type::Type3:
5258 return functor(var.m_impl.m_value3);
5259 case timing::Type::Type4:
5260 return functor(var.m_impl.m_value4);
5261 case timing::Type::Type5:
5262 return functor(var.m_impl.m_value5);
5263 case timing::Type::Type6:
5264 return functor(var.m_impl.m_value6);
5265 case timing::Type::Type7:
5266 return functor(var.m_impl.m_value7);
5267 case timing::Type::Type8:
5268 return functor(var.m_impl.m_value8);
5270 ossia_do_throw(std::runtime_error,
"timing: bad type");
5273 template <
typename Visitor>
5274 auto apply_nonnull(Visitor&& functor, timing& var)
5278 case timing::Type::Type0:
5279 return functor(var.m_impl.m_value0);
5280 case timing::Type::Type1:
5281 return functor(var.m_impl.m_value1);
5282 case timing::Type::Type2:
5283 return functor(var.m_impl.m_value2);
5284 case timing::Type::Type3:
5285 return functor(var.m_impl.m_value3);
5286 case timing::Type::Type4:
5287 return functor(var.m_impl.m_value4);
5288 case timing::Type::Type5:
5289 return functor(var.m_impl.m_value5);
5290 case timing::Type::Type6:
5291 return functor(var.m_impl.m_value6);
5292 case timing::Type::Type7:
5293 return functor(var.m_impl.m_value7);
5294 case timing::Type::Type8:
5295 return functor(var.m_impl.m_value8);
5297 ossia_do_throw(std::runtime_error,
"timing: bad type");
5300 template <
typename Visitor>
5301 auto apply_nonnull(Visitor&& functor, timing&& var)
5305 case timing::Type::Type0:
5306 return functor(std::move(var.m_impl.m_value0));
5307 case timing::Type::Type1:
5308 return functor(std::move(var.m_impl.m_value1));
5309 case timing::Type::Type2:
5310 return functor(std::move(var.m_impl.m_value2));
5311 case timing::Type::Type3:
5312 return functor(std::move(var.m_impl.m_value3));
5313 case timing::Type::Type4:
5314 return functor(std::move(var.m_impl.m_value4));
5315 case timing::Type::Type5:
5316 return functor(std::move(var.m_impl.m_value5));
5317 case timing::Type::Type6:
5318 return functor(std::move(var.m_impl.m_value6));
5319 case timing::Type::Type7:
5320 return functor(std::move(var.m_impl.m_value7));
5321 case timing::Type::Type8:
5322 return functor(std::move(var.m_impl.m_value8));
5324 ossia_do_throw(std::runtime_error,
"timing: bad type");
5327 template <
typename Visitor>
5328 auto apply(Visitor&& functor,
const timing& var)
5332 case timing::Type::Type0:
5333 return functor(var.m_impl.m_value0);
5334 case timing::Type::Type1:
5335 return functor(var.m_impl.m_value1);
5336 case timing::Type::Type2:
5337 return functor(var.m_impl.m_value2);
5338 case timing::Type::Type3:
5339 return functor(var.m_impl.m_value3);
5340 case timing::Type::Type4:
5341 return functor(var.m_impl.m_value4);
5342 case timing::Type::Type5:
5343 return functor(var.m_impl.m_value5);
5344 case timing::Type::Type6:
5345 return functor(var.m_impl.m_value6);
5346 case timing::Type::Type7:
5347 return functor(var.m_impl.m_value7);
5348 case timing::Type::Type8:
5349 return functor(var.m_impl.m_value8);
5354 template <
typename Visitor>
5355 auto apply(Visitor&& functor, timing& var)
5359 case timing::Type::Type0:
5360 return functor(var.m_impl.m_value0);
5361 case timing::Type::Type1:
5362 return functor(var.m_impl.m_value1);
5363 case timing::Type::Type2:
5364 return functor(var.m_impl.m_value2);
5365 case timing::Type::Type3:
5366 return functor(var.m_impl.m_value3);
5367 case timing::Type::Type4:
5368 return functor(var.m_impl.m_value4);
5369 case timing::Type::Type5:
5370 return functor(var.m_impl.m_value5);
5371 case timing::Type::Type6:
5372 return functor(var.m_impl.m_value6);
5373 case timing::Type::Type7:
5374 return functor(var.m_impl.m_value7);
5375 case timing::Type::Type8:
5376 return functor(var.m_impl.m_value8);
5381 template <
typename Visitor>
5382 auto apply(Visitor&& functor, timing&& var)
5386 case timing::Type::Type0:
5387 return functor(std::move(var.m_impl.m_value0));
5388 case timing::Type::Type1:
5389 return functor(std::move(var.m_impl.m_value1));
5390 case timing::Type::Type2:
5391 return functor(std::move(var.m_impl.m_value2));
5392 case timing::Type::Type3:
5393 return functor(std::move(var.m_impl.m_value3));
5394 case timing::Type::Type4:
5395 return functor(std::move(var.m_impl.m_value4));
5396 case timing::Type::Type5:
5397 return functor(std::move(var.m_impl.m_value5));
5398 case timing::Type::Type6:
5399 return functor(std::move(var.m_impl.m_value6));
5400 case timing::Type::Type7:
5401 return functor(std::move(var.m_impl.m_value7));
5402 case timing::Type::Type8:
5403 return functor(std::move(var.m_impl.m_value8));
5408 inline bool operator==(
const timing& lhs,
const timing& rhs)
5410 if(lhs.m_type == rhs.m_type)
5414 case timing::Type::Type0:
5415 return lhs.m_impl.m_value0 == rhs.m_impl.m_value0;
5416 case timing::Type::Type1:
5417 return lhs.m_impl.m_value1 == rhs.m_impl.m_value1;
5418 case timing::Type::Type2:
5419 return lhs.m_impl.m_value2 == rhs.m_impl.m_value2;
5420 case timing::Type::Type3:
5421 return lhs.m_impl.m_value3 == rhs.m_impl.m_value3;
5422 case timing::Type::Type4:
5423 return lhs.m_impl.m_value4 == rhs.m_impl.m_value4;
5424 case timing::Type::Type5:
5425 return lhs.m_impl.m_value5 == rhs.m_impl.m_value5;
5426 case timing::Type::Type6:
5427 return lhs.m_impl.m_value6 == rhs.m_impl.m_value6;
5428 case timing::Type::Type7:
5429 return lhs.m_impl.m_value7 == rhs.m_impl.m_value7;
5430 case timing::Type::Type8:
5431 return lhs.m_impl.m_value8 == rhs.m_impl.m_value8;
5438 inline bool operator!=(
const timing& lhs,
const timing& rhs)
5440 if(lhs.m_type != rhs.m_type)
5444 case timing::Type::Type0:
5445 return lhs.m_impl.m_value0 != rhs.m_impl.m_value0;
5446 case timing::Type::Type1:
5447 return lhs.m_impl.m_value1 != rhs.m_impl.m_value1;
5448 case timing::Type::Type2:
5449 return lhs.m_impl.m_value2 != rhs.m_impl.m_value2;
5450 case timing::Type::Type3:
5451 return lhs.m_impl.m_value3 != rhs.m_impl.m_value3;
5452 case timing::Type::Type4:
5453 return lhs.m_impl.m_value4 != rhs.m_impl.m_value4;
5454 case timing::Type::Type5:
5455 return lhs.m_impl.m_value5 != rhs.m_impl.m_value5;
5456 case timing::Type::Type6:
5457 return lhs.m_impl.m_value6 != rhs.m_impl.m_value6;
5458 case timing::Type::Type7:
5459 return lhs.m_impl.m_value7 != rhs.m_impl.m_value7;
5460 case timing::Type::Type8:
5461 return lhs.m_impl.m_value8 != rhs.m_impl.m_value8;
5467 inline bool operator==(
const timing& lhs,
const ossia::second& rhs)
5469 return (lhs.m_type == timing::Type::Type0) && (lhs.m_impl.m_value0 == rhs);
5471 inline bool operator==(
const ossia::second& lhs,
const timing& rhs)
5473 return (rhs.m_type == timing::Type::Type0) && (rhs.m_impl.m_value0 == lhs);
5475 inline bool operator!=(
const timing& lhs,
const ossia::second& rhs)
5477 return (lhs.m_type != timing::Type::Type0) || (lhs.m_impl.m_value0 != rhs);
5479 inline bool operator!=(
const ossia::second& lhs,
const timing& rhs)
5481 return (rhs.m_type != timing::Type::Type0) || (rhs.m_impl.m_value0 != lhs);
5483 inline bool operator==(
const timing& lhs,
const ossia::bark& rhs)
5485 return (lhs.m_type == timing::Type::Type1) && (lhs.m_impl.m_value1 == rhs);
5487 inline bool operator==(
const ossia::bark& lhs,
const timing& rhs)
5489 return (rhs.m_type == timing::Type::Type1) && (rhs.m_impl.m_value1 == lhs);
5491 inline bool operator!=(
const timing& lhs,
const ossia::bark& rhs)
5493 return (lhs.m_type != timing::Type::Type1) || (lhs.m_impl.m_value1 != rhs);
5495 inline bool operator!=(
const ossia::bark& lhs,
const timing& rhs)
5497 return (rhs.m_type != timing::Type::Type1) || (rhs.m_impl.m_value1 != lhs);
5499 inline bool operator==(
const timing& lhs,
const ossia::bpm& rhs)
5501 return (lhs.m_type == timing::Type::Type2) && (lhs.m_impl.m_value2 == rhs);
5503 inline bool operator==(
const ossia::bpm& lhs,
const timing& rhs)
5505 return (rhs.m_type == timing::Type::Type2) && (rhs.m_impl.m_value2 == lhs);
5507 inline bool operator!=(
const timing& lhs,
const ossia::bpm& rhs)
5509 return (lhs.m_type != timing::Type::Type2) || (lhs.m_impl.m_value2 != rhs);
5511 inline bool operator!=(
const ossia::bpm& lhs,
const timing& rhs)
5513 return (rhs.m_type != timing::Type::Type2) || (rhs.m_impl.m_value2 != lhs);
5515 inline bool operator==(
const timing& lhs,
const ossia::cent& rhs)
5517 return (lhs.m_type == timing::Type::Type3) && (lhs.m_impl.m_value3 == rhs);
5519 inline bool operator==(
const ossia::cent& lhs,
const timing& rhs)
5521 return (rhs.m_type == timing::Type::Type3) && (rhs.m_impl.m_value3 == lhs);
5523 inline bool operator!=(
const timing& lhs,
const ossia::cent& rhs)
5525 return (lhs.m_type != timing::Type::Type3) || (lhs.m_impl.m_value3 != rhs);
5527 inline bool operator!=(
const ossia::cent& lhs,
const timing& rhs)
5529 return (rhs.m_type != timing::Type::Type3) || (rhs.m_impl.m_value3 != lhs);
5531 inline bool operator==(
const timing& lhs,
const ossia::frequency& rhs)
5533 return (lhs.m_type == timing::Type::Type4) && (lhs.m_impl.m_value4 == rhs);
5535 inline bool operator==(
const ossia::frequency& lhs,
const timing& rhs)
5537 return (rhs.m_type == timing::Type::Type4) && (rhs.m_impl.m_value4 == lhs);
5539 inline bool operator!=(
const timing& lhs,
const ossia::frequency& rhs)
5541 return (lhs.m_type != timing::Type::Type4) || (lhs.m_impl.m_value4 != rhs);
5543 inline bool operator!=(
const ossia::frequency& lhs,
const timing& rhs)
5545 return (rhs.m_type != timing::Type::Type4) || (rhs.m_impl.m_value4 != lhs);
5547 inline bool operator==(
const timing& lhs,
const ossia::mel& rhs)
5549 return (lhs.m_type == timing::Type::Type5) && (lhs.m_impl.m_value5 == rhs);
5551 inline bool operator==(
const ossia::mel& lhs,
const timing& rhs)
5553 return (rhs.m_type == timing::Type::Type5) && (rhs.m_impl.m_value5 == lhs);
5555 inline bool operator!=(
const timing& lhs,
const ossia::mel& rhs)
5557 return (lhs.m_type != timing::Type::Type5) || (lhs.m_impl.m_value5 != rhs);
5559 inline bool operator!=(
const ossia::mel& lhs,
const timing& rhs)
5561 return (rhs.m_type != timing::Type::Type5) || (rhs.m_impl.m_value5 != lhs);
5563 inline bool operator==(
const timing& lhs,
const ossia::midi_pitch& rhs)
5565 return (lhs.m_type == timing::Type::Type6) && (lhs.m_impl.m_value6 == rhs);
5567 inline bool operator==(
const ossia::midi_pitch& lhs,
const timing& rhs)
5569 return (rhs.m_type == timing::Type::Type6) && (rhs.m_impl.m_value6 == lhs);
5571 inline bool operator!=(
const timing& lhs,
const ossia::midi_pitch& rhs)
5573 return (lhs.m_type != timing::Type::Type6) || (lhs.m_impl.m_value6 != rhs);
5575 inline bool operator!=(
const ossia::midi_pitch& lhs,
const timing& rhs)
5577 return (rhs.m_type != timing::Type::Type6) || (rhs.m_impl.m_value6 != lhs);
5579 inline bool operator==(
const timing& lhs,
const ossia::millisecond& rhs)
5581 return (lhs.m_type == timing::Type::Type7) && (lhs.m_impl.m_value7 == rhs);
5583 inline bool operator==(
const ossia::millisecond& lhs,
const timing& rhs)
5585 return (rhs.m_type == timing::Type::Type7) && (rhs.m_impl.m_value7 == lhs);
5587 inline bool operator!=(
const timing& lhs,
const ossia::millisecond& rhs)
5589 return (lhs.m_type != timing::Type::Type7) || (lhs.m_impl.m_value7 != rhs);
5591 inline bool operator!=(
const ossia::millisecond& lhs,
const timing& rhs)
5593 return (rhs.m_type != timing::Type::Type7) || (rhs.m_impl.m_value7 != lhs);
5595 inline bool operator==(
const timing& lhs,
const ossia::playback_speed& rhs)
5597 return (lhs.m_type == timing::Type::Type8) && (lhs.m_impl.m_value8 == rhs);
5599 inline bool operator==(
const ossia::playback_speed& lhs,
const timing& rhs)
5601 return (rhs.m_type == timing::Type::Type8) && (rhs.m_impl.m_value8 == lhs);
5603 inline bool operator!=(
const timing& lhs,
const ossia::playback_speed& rhs)
5605 return (lhs.m_type != timing::Type::Type8) || (lhs.m_impl.m_value8 != rhs);
5607 inline bool operator!=(
const ossia::playback_speed& lhs,
const timing& rhs)
5609 return (rhs.m_type != timing::Type::Type8) || (rhs.m_impl.m_value8 != lhs);
5611 struct strong_value_variant
5621 ossia::distance m_value1;
5623 ossia::position m_value2;
5625 ossia::speed m_value3;
5627 ossia::orientation m_value4;
5629 ossia::angle m_value5;
5631 ossia::color m_value6;
5633 ossia::gain m_value7;
5635 ossia::timing m_value8;
5659 void destruct_impl()
5664 m_impl.m_value0.~value();
5674 static const constexpr
auto npos = Npos;
5675 int which()
const {
return m_type; }
5677 operator bool()
const {
return m_type != npos; }
5678 template <
typename T>
5679 const T* target()
const;
5680 template <
typename T>
5682 template <
typename T>
5683 const T& get()
const;
5684 template <
typename T>
5687 template <
typename T>
5689 strong_value_variant()
5693 ~strong_value_variant() { destruct_impl(); }
5704 strong_value_variant(ossia::distance v)
5707 new(&m_impl.m_value1) ossia::distance{v};
5709 strong_value_variant(ossia::position v)
5712 new(&m_impl.m_value2) ossia::position{v};
5714 strong_value_variant(ossia::speed v)
5717 new(&m_impl.m_value3) ossia::speed{v};
5719 strong_value_variant(ossia::orientation v)
5722 new(&m_impl.m_value4) ossia::orientation{v};
5724 strong_value_variant(ossia::angle v)
5727 new(&m_impl.m_value5) ossia::angle{v};
5729 strong_value_variant(ossia::color v)
5732 new(&m_impl.m_value6) ossia::color{v};
5734 strong_value_variant(ossia::gain v)
5737 new(&m_impl.m_value7) ossia::gain{v};
5739 strong_value_variant(ossia::timing v)
5742 new(&m_impl.m_value8) ossia::timing{v};
5744 strong_value_variant(
const strong_value_variant& other)
5745 : m_type{other.m_type}
5750 new(&m_impl.m_value0)
ossia::value{other.m_impl.m_value0};
5753 new(&m_impl.m_value1) ossia::distance{other.m_impl.m_value1};
5756 new(&m_impl.m_value2) ossia::position{other.m_impl.m_value2};
5759 new(&m_impl.m_value3) ossia::speed{other.m_impl.m_value3};
5762 new(&m_impl.m_value4) ossia::orientation{other.m_impl.m_value4};
5765 new(&m_impl.m_value5) ossia::angle{other.m_impl.m_value5};
5768 new(&m_impl.m_value6) ossia::color{other.m_impl.m_value6};
5771 new(&m_impl.m_value7) ossia::gain{other.m_impl.m_value7};
5774 new(&m_impl.m_value8) ossia::timing{other.m_impl.m_value8};
5780 strong_value_variant(strong_value_variant&& other)
5781 : m_type{other.m_type}
5786 new(&m_impl.m_value0)
ossia::value{std::move(other.m_impl.m_value0)};
5789 new(&m_impl.m_value1) ossia::distance{std::move(other.m_impl.m_value1)};
5792 new(&m_impl.m_value2) ossia::position{std::move(other.m_impl.m_value2)};
5795 new(&m_impl.m_value3) ossia::speed{std::move(other.m_impl.m_value3)};
5798 new(&m_impl.m_value4) ossia::orientation{std::move(other.m_impl.m_value4)};
5801 new(&m_impl.m_value5) ossia::angle{std::move(other.m_impl.m_value5)};
5804 new(&m_impl.m_value6) ossia::color{std::move(other.m_impl.m_value6)};
5807 new(&m_impl.m_value7) ossia::gain{std::move(other.m_impl.m_value7)};
5810 new(&m_impl.m_value8) ossia::timing{std::move(other.m_impl.m_value8)};
5816 strong_value_variant& operator=(
const strong_value_variant& other)
5819 m_type = other.m_type;
5823 new(&m_impl.m_value0)
ossia::value{other.m_impl.m_value0};
5826 new(&m_impl.m_value1) ossia::distance{other.m_impl.m_value1};
5829 new(&m_impl.m_value2) ossia::position{other.m_impl.m_value2};
5832 new(&m_impl.m_value3) ossia::speed{other.m_impl.m_value3};
5835 new(&m_impl.m_value4) ossia::orientation{other.m_impl.m_value4};
5838 new(&m_impl.m_value5) ossia::angle{other.m_impl.m_value5};
5841 new(&m_impl.m_value6) ossia::color{other.m_impl.m_value6};
5844 new(&m_impl.m_value7) ossia::gain{other.m_impl.m_value7};
5847 new(&m_impl.m_value8) ossia::timing{other.m_impl.m_value8};
5854 strong_value_variant& operator=(strong_value_variant&& other)
5857 m_type = other.m_type;
5861 new(&m_impl.m_value0)
ossia::value{std::move(other.m_impl.m_value0)};
5864 new(&m_impl.m_value1) ossia::distance{std::move(other.m_impl.m_value1)};
5867 new(&m_impl.m_value2) ossia::position{std::move(other.m_impl.m_value2)};
5870 new(&m_impl.m_value3) ossia::speed{std::move(other.m_impl.m_value3)};
5873 new(&m_impl.m_value4) ossia::orientation{std::move(other.m_impl.m_value4)};
5876 new(&m_impl.m_value5) ossia::angle{std::move(other.m_impl.m_value5)};
5879 new(&m_impl.m_value6) ossia::color{std::move(other.m_impl.m_value6)};
5882 new(&m_impl.m_value7) ossia::gain{std::move(other.m_impl.m_value7)};
5885 new(&m_impl.m_value8) ossia::timing{std::move(other.m_impl.m_value8)};
5894 inline const ossia::value* strong_value_variant::target()
const
5897 return &m_impl.m_value0;
5901 inline const ossia::distance* strong_value_variant::target()
const
5904 return &m_impl.m_value1;
5908 inline const ossia::position* strong_value_variant::target()
const
5911 return &m_impl.m_value2;
5915 inline const ossia::speed* strong_value_variant::target()
const
5918 return &m_impl.m_value3;
5922 inline const ossia::orientation* strong_value_variant::target()
const
5925 return &m_impl.m_value4;
5929 inline const ossia::angle* strong_value_variant::target()
const
5932 return &m_impl.m_value5;
5936 inline const ossia::color* strong_value_variant::target()
const
5939 return &m_impl.m_value6;
5943 inline const ossia::gain* strong_value_variant::target()
const
5946 return &m_impl.m_value7;
5950 inline const ossia::timing* strong_value_variant::target()
const
5953 return &m_impl.m_value8;
5960 return &m_impl.m_value0;
5964 inline ossia::distance* strong_value_variant::target()
5967 return &m_impl.m_value1;
5971 inline ossia::position* strong_value_variant::target()
5974 return &m_impl.m_value2;
5978 inline ossia::speed* strong_value_variant::target()
5981 return &m_impl.m_value3;
5985 inline ossia::orientation* strong_value_variant::target()
5988 return &m_impl.m_value4;
5992 inline ossia::angle* strong_value_variant::target()
5995 return &m_impl.m_value5;
5999 inline ossia::color* strong_value_variant::target()
6002 return &m_impl.m_value6;
6006 inline ossia::gain* strong_value_variant::target()
6009 return &m_impl.m_value7;
6013 inline ossia::timing* strong_value_variant::target()
6016 return &m_impl.m_value8;
6020 inline const ossia::value& strong_value_variant::get()
const
6023 return m_impl.m_value0;
6024 ossia_do_throw(std::runtime_error,
"strong_value_variant: bad type");
6027 inline const ossia::distance& strong_value_variant::get()
const
6030 return m_impl.m_value1;
6031 ossia_do_throw(std::runtime_error,
"strong_value_variant: bad type");
6034 inline const ossia::position& strong_value_variant::get()
const
6037 return m_impl.m_value2;
6038 ossia_do_throw(std::runtime_error,
"strong_value_variant: bad type");
6041 inline const ossia::speed& strong_value_variant::get()
const
6044 return m_impl.m_value3;
6045 ossia_do_throw(std::runtime_error,
"strong_value_variant: bad type");
6048 inline const ossia::orientation& strong_value_variant::get()
const
6051 return m_impl.m_value4;
6052 ossia_do_throw(std::runtime_error,
"strong_value_variant: bad type");
6055 inline const ossia::angle& strong_value_variant::get()
const
6058 return m_impl.m_value5;
6059 ossia_do_throw(std::runtime_error,
"strong_value_variant: bad type");
6062 inline const ossia::color& strong_value_variant::get()
const
6065 return m_impl.m_value6;
6066 ossia_do_throw(std::runtime_error,
"strong_value_variant: bad type");
6069 inline const ossia::gain& strong_value_variant::get()
const
6072 return m_impl.m_value7;
6073 ossia_do_throw(std::runtime_error,
"strong_value_variant: bad type");
6076 inline const ossia::timing& strong_value_variant::get()
const
6079 return m_impl.m_value8;
6080 ossia_do_throw(std::runtime_error,
"strong_value_variant: bad type");
6086 return m_impl.m_value0;
6087 ossia_do_throw(std::runtime_error,
"strong_value_variant: bad type");
6090 inline ossia::distance& strong_value_variant::get()
6093 return m_impl.m_value1;
6094 ossia_do_throw(std::runtime_error,
"strong_value_variant: bad type");
6097 inline ossia::position& strong_value_variant::get()
6100 return m_impl.m_value2;
6101 ossia_do_throw(std::runtime_error,
"strong_value_variant: bad type");
6104 inline ossia::speed& strong_value_variant::get()
6107 return m_impl.m_value3;
6108 ossia_do_throw(std::runtime_error,
"strong_value_variant: bad type");
6111 inline ossia::orientation& strong_value_variant::get()
6114 return m_impl.m_value4;
6115 ossia_do_throw(std::runtime_error,
"strong_value_variant: bad type");
6118 inline ossia::angle& strong_value_variant::get()
6121 return m_impl.m_value5;
6122 ossia_do_throw(std::runtime_error,
"strong_value_variant: bad type");
6125 inline ossia::color& strong_value_variant::get()
6128 return m_impl.m_value6;
6129 ossia_do_throw(std::runtime_error,
"strong_value_variant: bad type");
6132 inline ossia::gain& strong_value_variant::get()
6135 return m_impl.m_value7;
6136 ossia_do_throw(std::runtime_error,
"strong_value_variant: bad type");
6139 inline ossia::timing& strong_value_variant::get()
6142 return m_impl.m_value8;
6143 ossia_do_throw(std::runtime_error,
"strong_value_variant: bad type");
6145 template <
typename Visitor>
6146 auto apply_nonnull(Visitor&& functor,
const strong_value_variant& var)
6150 case strong_value_variant::Type::Type0:
6151 return functor(var.m_impl.m_value0);
6152 case strong_value_variant::Type::Type1:
6153 return functor(var.m_impl.m_value1);
6154 case strong_value_variant::Type::Type2:
6155 return functor(var.m_impl.m_value2);
6156 case strong_value_variant::Type::Type3:
6157 return functor(var.m_impl.m_value3);
6158 case strong_value_variant::Type::Type4:
6159 return functor(var.m_impl.m_value4);
6160 case strong_value_variant::Type::Type5:
6161 return functor(var.m_impl.m_value5);
6162 case strong_value_variant::Type::Type6:
6163 return functor(var.m_impl.m_value6);
6164 case strong_value_variant::Type::Type7:
6165 return functor(var.m_impl.m_value7);
6166 case strong_value_variant::Type::Type8:
6167 return functor(var.m_impl.m_value8);
6169 ossia_do_throw(std::runtime_error,
"strong_value_variant: bad type");
6172 template <
typename Visitor>
6173 auto apply_nonnull(Visitor&& functor, strong_value_variant& var)
6177 case strong_value_variant::Type::Type0:
6178 return functor(var.m_impl.m_value0);
6179 case strong_value_variant::Type::Type1:
6180 return functor(var.m_impl.m_value1);
6181 case strong_value_variant::Type::Type2:
6182 return functor(var.m_impl.m_value2);
6183 case strong_value_variant::Type::Type3:
6184 return functor(var.m_impl.m_value3);
6185 case strong_value_variant::Type::Type4:
6186 return functor(var.m_impl.m_value4);
6187 case strong_value_variant::Type::Type5:
6188 return functor(var.m_impl.m_value5);
6189 case strong_value_variant::Type::Type6:
6190 return functor(var.m_impl.m_value6);
6191 case strong_value_variant::Type::Type7:
6192 return functor(var.m_impl.m_value7);
6193 case strong_value_variant::Type::Type8:
6194 return functor(var.m_impl.m_value8);
6196 ossia_do_throw(std::runtime_error,
"strong_value_variant: bad type");
6199 template <
typename Visitor>
6200 auto apply_nonnull(Visitor&& functor, strong_value_variant&& var)
6204 case strong_value_variant::Type::Type0:
6205 return functor(std::move(var.m_impl.m_value0));
6206 case strong_value_variant::Type::Type1:
6207 return functor(std::move(var.m_impl.m_value1));
6208 case strong_value_variant::Type::Type2:
6209 return functor(std::move(var.m_impl.m_value2));
6210 case strong_value_variant::Type::Type3:
6211 return functor(std::move(var.m_impl.m_value3));
6212 case strong_value_variant::Type::Type4:
6213 return functor(std::move(var.m_impl.m_value4));
6214 case strong_value_variant::Type::Type5:
6215 return functor(std::move(var.m_impl.m_value5));
6216 case strong_value_variant::Type::Type6:
6217 return functor(std::move(var.m_impl.m_value6));
6218 case strong_value_variant::Type::Type7:
6219 return functor(std::move(var.m_impl.m_value7));
6220 case strong_value_variant::Type::Type8:
6221 return functor(std::move(var.m_impl.m_value8));
6223 ossia_do_throw(std::runtime_error,
"strong_value_variant: bad type");
6226 template <
typename Visitor>
6227 auto apply(Visitor&& functor,
const strong_value_variant& var)
6231 case strong_value_variant::Type::Type0:
6232 return functor(var.m_impl.m_value0);
6233 case strong_value_variant::Type::Type1:
6234 return functor(var.m_impl.m_value1);
6235 case strong_value_variant::Type::Type2:
6236 return functor(var.m_impl.m_value2);
6237 case strong_value_variant::Type::Type3:
6238 return functor(var.m_impl.m_value3);
6239 case strong_value_variant::Type::Type4:
6240 return functor(var.m_impl.m_value4);
6241 case strong_value_variant::Type::Type5:
6242 return functor(var.m_impl.m_value5);
6243 case strong_value_variant::Type::Type6:
6244 return functor(var.m_impl.m_value6);
6245 case strong_value_variant::Type::Type7:
6246 return functor(var.m_impl.m_value7);
6247 case strong_value_variant::Type::Type8:
6248 return functor(var.m_impl.m_value8);
6253 template <
typename Visitor>
6254 auto apply(Visitor&& functor, strong_value_variant& var)
6258 case strong_value_variant::Type::Type0:
6259 return functor(var.m_impl.m_value0);
6260 case strong_value_variant::Type::Type1:
6261 return functor(var.m_impl.m_value1);
6262 case strong_value_variant::Type::Type2:
6263 return functor(var.m_impl.m_value2);
6264 case strong_value_variant::Type::Type3:
6265 return functor(var.m_impl.m_value3);
6266 case strong_value_variant::Type::Type4:
6267 return functor(var.m_impl.m_value4);
6268 case strong_value_variant::Type::Type5:
6269 return functor(var.m_impl.m_value5);
6270 case strong_value_variant::Type::Type6:
6271 return functor(var.m_impl.m_value6);
6272 case strong_value_variant::Type::Type7:
6273 return functor(var.m_impl.m_value7);
6274 case strong_value_variant::Type::Type8:
6275 return functor(var.m_impl.m_value8);
6280 template <
typename Visitor>
6281 auto apply(Visitor&& functor, strong_value_variant&& var)
6285 case strong_value_variant::Type::Type0:
6286 return functor(std::move(var.m_impl.m_value0));
6287 case strong_value_variant::Type::Type1:
6288 return functor(std::move(var.m_impl.m_value1));
6289 case strong_value_variant::Type::Type2:
6290 return functor(std::move(var.m_impl.m_value2));
6291 case strong_value_variant::Type::Type3:
6292 return functor(std::move(var.m_impl.m_value3));
6293 case strong_value_variant::Type::Type4:
6294 return functor(std::move(var.m_impl.m_value4));
6295 case strong_value_variant::Type::Type5:
6296 return functor(std::move(var.m_impl.m_value5));
6297 case strong_value_variant::Type::Type6:
6298 return functor(std::move(var.m_impl.m_value6));
6299 case strong_value_variant::Type::Type7:
6300 return functor(std::move(var.m_impl.m_value7));
6301 case strong_value_variant::Type::Type8:
6302 return functor(std::move(var.m_impl.m_value8));
6307 inline bool operator==(
const strong_value_variant& lhs,
const strong_value_variant& rhs)
6309 if(lhs.m_type == rhs.m_type)
6313 case strong_value_variant::Type::Type0:
6314 return lhs.m_impl.m_value0 == rhs.m_impl.m_value0;
6315 case strong_value_variant::Type::Type1:
6316 return lhs.m_impl.m_value1 == rhs.m_impl.m_value1;
6317 case strong_value_variant::Type::Type2:
6318 return lhs.m_impl.m_value2 == rhs.m_impl.m_value2;
6319 case strong_value_variant::Type::Type3:
6320 return lhs.m_impl.m_value3 == rhs.m_impl.m_value3;
6321 case strong_value_variant::Type::Type4:
6322 return lhs.m_impl.m_value4 == rhs.m_impl.m_value4;
6323 case strong_value_variant::Type::Type5:
6324 return lhs.m_impl.m_value5 == rhs.m_impl.m_value5;
6325 case strong_value_variant::Type::Type6:
6326 return lhs.m_impl.m_value6 == rhs.m_impl.m_value6;
6327 case strong_value_variant::Type::Type7:
6328 return lhs.m_impl.m_value7 == rhs.m_impl.m_value7;
6329 case strong_value_variant::Type::Type8:
6330 return lhs.m_impl.m_value8 == rhs.m_impl.m_value8;
6337 inline bool operator!=(
const strong_value_variant& lhs,
const strong_value_variant& rhs)
6339 if(lhs.m_type != rhs.m_type)
6343 case strong_value_variant::Type::Type0:
6344 return lhs.m_impl.m_value0 != rhs.m_impl.m_value0;
6345 case strong_value_variant::Type::Type1:
6346 return lhs.m_impl.m_value1 != rhs.m_impl.m_value1;
6347 case strong_value_variant::Type::Type2:
6348 return lhs.m_impl.m_value2 != rhs.m_impl.m_value2;
6349 case strong_value_variant::Type::Type3:
6350 return lhs.m_impl.m_value3 != rhs.m_impl.m_value3;
6351 case strong_value_variant::Type::Type4:
6352 return lhs.m_impl.m_value4 != rhs.m_impl.m_value4;
6353 case strong_value_variant::Type::Type5:
6354 return lhs.m_impl.m_value5 != rhs.m_impl.m_value5;
6355 case strong_value_variant::Type::Type6:
6356 return lhs.m_impl.m_value6 != rhs.m_impl.m_value6;
6357 case strong_value_variant::Type::Type7:
6358 return lhs.m_impl.m_value7 != rhs.m_impl.m_value7;
6359 case strong_value_variant::Type::Type8:
6360 return lhs.m_impl.m_value8 != rhs.m_impl.m_value8;
6366 inline bool operator==(
const strong_value_variant& lhs,
const ossia::value& rhs)
6368 return (lhs.m_type == strong_value_variant::Type::Type0)
6369 && (lhs.m_impl.m_value0 == rhs);
6371 inline bool operator==(
const ossia::value& lhs,
const strong_value_variant& rhs)
6373 return (rhs.m_type == strong_value_variant::Type::Type0)
6374 && (rhs.m_impl.m_value0 == lhs);
6376 inline bool operator!=(
const strong_value_variant& lhs,
const ossia::value& rhs)
6378 return (lhs.m_type != strong_value_variant::Type::Type0)
6379 || (lhs.m_impl.m_value0 != rhs);
6381 inline bool operator!=(
const ossia::value& lhs,
const strong_value_variant& rhs)
6383 return (rhs.m_type != strong_value_variant::Type::Type0)
6384 || (rhs.m_impl.m_value0 != lhs);
6386 inline bool operator==(
const strong_value_variant& lhs,
const ossia::distance& rhs)
6388 return (lhs.m_type == strong_value_variant::Type::Type1)
6389 && (lhs.m_impl.m_value1 == rhs);
6391 inline bool operator==(
const ossia::distance& lhs,
const strong_value_variant& rhs)
6393 return (rhs.m_type == strong_value_variant::Type::Type1)
6394 && (rhs.m_impl.m_value1 == lhs);
6396 inline bool operator!=(
const strong_value_variant& lhs,
const ossia::distance& rhs)
6398 return (lhs.m_type != strong_value_variant::Type::Type1)
6399 || (lhs.m_impl.m_value1 != rhs);
6401 inline bool operator!=(
const ossia::distance& lhs,
const strong_value_variant& rhs)
6403 return (rhs.m_type != strong_value_variant::Type::Type1)
6404 || (rhs.m_impl.m_value1 != lhs);
6406 inline bool operator==(
const strong_value_variant& lhs,
const ossia::position& rhs)
6408 return (lhs.m_type == strong_value_variant::Type::Type2)
6409 && (lhs.m_impl.m_value2 == rhs);
6411 inline bool operator==(
const ossia::position& lhs,
const strong_value_variant& rhs)
6413 return (rhs.m_type == strong_value_variant::Type::Type2)
6414 && (rhs.m_impl.m_value2 == lhs);
6416 inline bool operator!=(
const strong_value_variant& lhs,
const ossia::position& rhs)
6418 return (lhs.m_type != strong_value_variant::Type::Type2)
6419 || (lhs.m_impl.m_value2 != rhs);
6421 inline bool operator!=(
const ossia::position& lhs,
const strong_value_variant& rhs)
6423 return (rhs.m_type != strong_value_variant::Type::Type2)
6424 || (rhs.m_impl.m_value2 != lhs);
6426 inline bool operator==(
const strong_value_variant& lhs,
const ossia::speed& rhs)
6428 return (lhs.m_type == strong_value_variant::Type::Type3)
6429 && (lhs.m_impl.m_value3 == rhs);
6431 inline bool operator==(
const ossia::speed& lhs,
const strong_value_variant& rhs)
6433 return (rhs.m_type == strong_value_variant::Type::Type3)
6434 && (rhs.m_impl.m_value3 == lhs);
6436 inline bool operator!=(
const strong_value_variant& lhs,
const ossia::speed& rhs)
6438 return (lhs.m_type != strong_value_variant::Type::Type3)
6439 || (lhs.m_impl.m_value3 != rhs);
6441 inline bool operator!=(
const ossia::speed& lhs,
const strong_value_variant& rhs)
6443 return (rhs.m_type != strong_value_variant::Type::Type3)
6444 || (rhs.m_impl.m_value3 != lhs);
6446 inline bool operator==(
const strong_value_variant& lhs,
const ossia::orientation& rhs)
6448 return (lhs.m_type == strong_value_variant::Type::Type4)
6449 && (lhs.m_impl.m_value4 == rhs);
6451 inline bool operator==(
const ossia::orientation& lhs,
const strong_value_variant& rhs)
6453 return (rhs.m_type == strong_value_variant::Type::Type4)
6454 && (rhs.m_impl.m_value4 == lhs);
6456 inline bool operator!=(
const strong_value_variant& lhs,
const ossia::orientation& rhs)
6458 return (lhs.m_type != strong_value_variant::Type::Type4)
6459 || (lhs.m_impl.m_value4 != rhs);
6461 inline bool operator!=(
const ossia::orientation& lhs,
const strong_value_variant& rhs)
6463 return (rhs.m_type != strong_value_variant::Type::Type4)
6464 || (rhs.m_impl.m_value4 != lhs);
6466 inline bool operator==(
const strong_value_variant& lhs,
const ossia::angle& rhs)
6468 return (lhs.m_type == strong_value_variant::Type::Type5)
6469 && (lhs.m_impl.m_value5 == rhs);
6471 inline bool operator==(
const ossia::angle& lhs,
const strong_value_variant& rhs)
6473 return (rhs.m_type == strong_value_variant::Type::Type5)
6474 && (rhs.m_impl.m_value5 == lhs);
6476 inline bool operator!=(
const strong_value_variant& lhs,
const ossia::angle& rhs)
6478 return (lhs.m_type != strong_value_variant::Type::Type5)
6479 || (lhs.m_impl.m_value5 != rhs);
6481 inline bool operator!=(
const ossia::angle& lhs,
const strong_value_variant& rhs)
6483 return (rhs.m_type != strong_value_variant::Type::Type5)
6484 || (rhs.m_impl.m_value5 != lhs);
6486 inline bool operator==(
const strong_value_variant& lhs,
const ossia::color& rhs)
6488 return (lhs.m_type == strong_value_variant::Type::Type6)
6489 && (lhs.m_impl.m_value6 == rhs);
6491 inline bool operator==(
const ossia::color& lhs,
const strong_value_variant& rhs)
6493 return (rhs.m_type == strong_value_variant::Type::Type6)
6494 && (rhs.m_impl.m_value6 == lhs);
6496 inline bool operator!=(
const strong_value_variant& lhs,
const ossia::color& rhs)
6498 return (lhs.m_type != strong_value_variant::Type::Type6)
6499 || (lhs.m_impl.m_value6 != rhs);
6501 inline bool operator!=(
const ossia::color& lhs,
const strong_value_variant& rhs)
6503 return (rhs.m_type != strong_value_variant::Type::Type6)
6504 || (rhs.m_impl.m_value6 != lhs);
6506 inline bool operator==(
const strong_value_variant& lhs,
const ossia::gain& rhs)
6508 return (lhs.m_type == strong_value_variant::Type::Type7)
6509 && (lhs.m_impl.m_value7 == rhs);
6511 inline bool operator==(
const ossia::gain& lhs,
const strong_value_variant& rhs)
6513 return (rhs.m_type == strong_value_variant::Type::Type7)
6514 && (rhs.m_impl.m_value7 == lhs);
6516 inline bool operator!=(
const strong_value_variant& lhs,
const ossia::gain& rhs)
6518 return (lhs.m_type != strong_value_variant::Type::Type7)
6519 || (lhs.m_impl.m_value7 != rhs);
6521 inline bool operator!=(
const ossia::gain& lhs,
const strong_value_variant& rhs)
6523 return (rhs.m_type != strong_value_variant::Type::Type7)
6524 || (rhs.m_impl.m_value7 != lhs);
6526 inline bool operator==(
const strong_value_variant& lhs,
const ossia::timing& rhs)
6528 return (lhs.m_type == strong_value_variant::Type::Type8)
6529 && (lhs.m_impl.m_value8 == rhs);
6531 inline bool operator==(
const ossia::timing& lhs,
const strong_value_variant& rhs)
6533 return (rhs.m_type == strong_value_variant::Type::Type8)
6534 && (rhs.m_impl.m_value8 == lhs);
6536 inline bool operator!=(
const strong_value_variant& lhs,
const ossia::timing& rhs)
6538 return (lhs.m_type != strong_value_variant::Type::Type8)
6539 || (lhs.m_impl.m_value8 != rhs);
6541 inline bool operator!=(
const ossia::timing& lhs,
const strong_value_variant& rhs)
6543 return (rhs.m_type != strong_value_variant::Type::Type8)
6544 || (rhs.m_impl.m_value8 != lhs);
The value class.
Definition: value.hpp:173
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