Loading...
Searching...
No Matches
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>
18JSON_METADATA(ossia::impulse, "Impulse")
19JSON_METADATA(int32_t, "Int")
20JSON_METADATA(ossia::value_map_type, "Map")
21JSON_METADATA(bool, "Bool")
22JSON_METADATA(float, "Float")
23JSON_METADATA(ossia::vec2f, "Vec2f")
24JSON_METADATA(ossia::vec3f, "Vec3f")
25JSON_METADATA(ossia::vec4f, "Vec4f")
26JSON_METADATA(std::vector<ossia::value>, "Tuple")
27JSON_METADATA(std::string, "String")
28JSON_METADATA(ossia::domain_base<ossia::impulse>, "Impulse")
29JSON_METADATA(ossia::domain_base<int32_t>, "Int")
30JSON_METADATA(ossia::domain_base<bool>, "Bool")
31JSON_METADATA(ossia::domain_base<float>, "Float")
32JSON_METADATA(ossia::vecf_domain<2>, "Vec2f")
33JSON_METADATA(ossia::vecf_domain<3>, "Vec3f")
34JSON_METADATA(ossia::vecf_domain<4>, "Vec4f")
35JSON_METADATA(ossia::vector_domain, "Tuple")
36JSON_METADATA(ossia::domain_base<std::string>, "String")
37JSON_METADATA(ossia::domain_base<ossia::value>, "Generic")
38
39template <>
40struct is_custom_serialized<ossia::vector_domain> : public std::true_type
41{
42};
43template <std::size_t N>
44struct is_custom_serialized<ossia::vecf_domain<N>> : public std::true_type
45{
46};
47template <typename T, std::size_t N>
48struct is_custom_serialized<std::array<T, N>> : public std::true_type
49{
50};
51
52template <>
53struct is_custom_serialized<ossia::value_map_type> : public std::true_type
54{
55};
56
57template <>
58struct TSerializer<DataStream, ossia::value_map_type>
59 : TSerializer<DataStream, std::vector<ossia::value_map_element>>
60{
61};
62
63template <>
64struct TSerializer<JSONObject, ossia::value_map_type>
65 : TSerializer<JSONObject, std::vector<ossia::value_map_element>>
66{
67};
68
69template <>
70struct is_custom_serialized<ossia::value_variant_type> : public std::true_type
71{
72};
73
74template <>
75struct is_custom_serialized<ossia::domain_base_variant> : public std::true_type
76{
77};
78
79template <typename T>
81{
82 using type = T;
83};
Definition VisitorInterface.hpp:53
Definition VisitorInterface.hpp:61
STL namespace.
Definition VisitorInterface.hpp:13
Definition OSSIASerializationImpl.hpp:81