OSSIASerializationImpl.hpp
1 #pragma once
2 
3 #include <State/Value.hpp>
4 #include <State/ValueConversion.hpp>
5 #include <State/ValueSerialization.hpp>
6 
8 #include <score/serialization/MapSerialization.hpp>
9 #include <score/serialization/VariantSerialization.hpp>
11 
12 #include <ossia/detail/for_each.hpp>
13 #include <ossia/network/base/node_attributes.hpp>
14 #include <ossia/network/dataspace/dataspace.hpp>
15 #include <ossia/network/domain/domain.hpp>
16 
17 #include <score_lib_state_export.h>
18 JSON_METADATA(ossia::impulse, "Impulse")
19 JSON_METADATA(int32_t, "Int")
20 JSON_METADATA(ossia::value_map_type, "Map")
21 JSON_METADATA(bool, "Bool")
22 JSON_METADATA(float, "Float")
23 JSON_METADATA(ossia::vec2f, "Vec2f")
24 JSON_METADATA(ossia::vec3f, "Vec3f")
25 JSON_METADATA(ossia::vec4f, "Vec4f")
26 JSON_METADATA(std::vector<ossia::value>, "Tuple")
27 JSON_METADATA(std::string, "String")
28 JSON_METADATA(ossia::domain_base<ossia::impulse>, "Impulse")
29 JSON_METADATA(ossia::domain_base<int32_t>, "Int")
30 JSON_METADATA(ossia::domain_base<bool>, "Bool")
31 JSON_METADATA(ossia::domain_base<float>, "Float")
32 JSON_METADATA(ossia::vecf_domain<2>, "Vec2f")
33 JSON_METADATA(ossia::vecf_domain<3>, "Vec3f")
34 JSON_METADATA(ossia::vecf_domain<4>, "Vec4f")
35 JSON_METADATA(ossia::vector_domain, "Tuple")
36 JSON_METADATA(ossia::domain_base<std::string>, "String")
37 JSON_METADATA(ossia::domain_base<ossia::value>, "Generic")
38 
39 template <>
40 struct is_custom_serialized<ossia::vector_domain> : public std::true_type
41 {
42 };
43 template <std::size_t N>
44 struct is_custom_serialized<ossia::vecf_domain<N>> : public std::true_type
45 {
46 };
47 template <typename T, std::size_t N>
48 struct is_custom_serialized<std::array<T, N>> : public std::true_type
49 {
50 };
51 
52 template <>
53 struct is_custom_serialized<ossia::value_map_type> : public std::true_type
54 {
55 };
56 
57 template <>
58 struct TSerializer<DataStream, ossia::value_map_type>
59  : TSerializer<DataStream, std::vector<ossia::value_map_element>>
60 {
61 };
62 
63 template <>
64 struct TSerializer<JSONObject, ossia::value_map_type>
65  : TSerializer<JSONObject, std::vector<ossia::value_map_element>>
66 {
67 };
68 
69 template <>
70 struct is_custom_serialized<ossia::value_variant_type> : public std::true_type
71 {
72 };
73 
74 template <>
75 struct is_custom_serialized<ossia::domain_base_variant> : public std::true_type
76 {
77 };
78 
79 template <typename T>
80 struct typeholder
81 {
82  using type = T;
83 };
Definition: VisitorInterface.hpp:53
Definition: QmlObjects.hpp:345
Definition: VisitorInterface.hpp:61
Definition: VisitorInterface.hpp:13
Definition: OSSIASerializationImpl.hpp:81