2 #include <score/plugins/SerializableInterface.hpp>
4 #include <score/serialization/JSONVisitor.hpp>
18 template <
typename FactoryList_T,
typename... Args>
19 auto deserialize_interface(
21 typename FactoryList_T::object_type*
30 SCORE_DEBUG_CHECK_DELIMITER2(sub);
31 typename FactoryList_T::factory_type::ConcreteKey k;
35 SCORE_DEBUG_CHECK_DELIMITER2(sub);
37 if(
auto concrete_factory = factories.get(k))
40 auto obj = concrete_factory->load(sub.toVariant(), std::forward<Args>(args)...);
42 SCORE_DEBUG_CHECK_DELIMITER2(sub);
53 return factories.loadMissing(sub.toVariant(), std::forward<Args>(args)...);
56 template <
typename FactoryList_T,
typename... Args>
57 auto deserialize_interface(
59 typename FactoryList_T::object_type*
68 SCORE_DEBUG_CHECK_DELIMITER2(sub);
69 typename FactoryList_T::factory_type::ConcreteKey k;
73 SCORE_DEBUG_CHECK_DELIMITER2(sub);
75 if(
auto concrete_factory = factories.get(k))
78 auto obj = concrete_factory->load(sub.toVariant(), std::forward<Args>(args)...);
80 SCORE_DEBUG_CHECK_DELIMITER2(sub);
91 return factories.loadMissing(sub.toVariant(), std::forward<Args>(args)...);
94 template <
typename FactoryList_T,
typename... Args>
95 auto deserialize_interface(
97 typename FactoryList_T::object_type*
102 typename FactoryList_T::factory_type::ConcreteKey k;
108 if(
auto concrete_factory = factories.get(k))
111 return concrete_factory->load(des.toVariant(), std::forward<Args>(args)...);
120 return factories.loadMissing(des.toVariant(), std::forward<Args>(args)...);
123 template <
typename FactoryList_T,
typename... Args>
124 auto deserialize_interface(
126 typename FactoryList_T::object_type*
131 typename FactoryList_T::factory_type::ConcreteKey k;
137 if(
auto concrete_factory = factories.get(k))
140 return concrete_factory->load(des.toVariant(), std::forward<Args>(args)...);
149 return factories.loadMissing(des.toVariant(), std::forward<Args>(args)...);
Definition: DataStreamVisitor.hpp:202
Definition: JSONVisitor.hpp:423
Definition: VisitorInterface.hpp:13