27 #ifndef INCLUDED_PathElementSerializationDescriptions_h_GUID_88DACA90_818A_4B81_9655_1177F10E8142
28 #define INCLUDED_PathElementSerializationDescriptions_h_GUID_88DACA90_818A_4B81_9655_1177F10E8142
37 #include <type_traits>
45 template <
typename Input,
typename Known>
46 using enable_if_element_type =
typename std::enable_if<std::is_same<
47 typename std::remove_const<Input>::type, Known>::value>::type;
50 template <
typename Functor,
typename ValType>
51 inline enable_if_element_type<ValType, elements::DeviceElement>
52 serializationDescription(Functor &f, ValType &value) {
53 f(
"device_name", value.getDeviceName());
54 f(
"server", value.getServer());
55 f(
"descriptor", value.getDescriptor());
59 template <
typename Functor,
typename ValType>
60 inline enable_if_element_type<ValType, elements::AliasElement>
61 serializationDescription(Functor &f, ValType &value) {
62 f(
"source", value.getSource());
63 f(
"priority", value.priority());
67 template <
typename Functor,
typename ValType>
68 inline enable_if_element_type<ValType, elements::StringElement>
69 serializationDescription(Functor &f, ValType &value) {
70 f(
"string", value.getString());
74 template <
typename Functor,
typename ValType>
75 inline enable_if_element_type<ValType, elements::NullElement>
76 serializationDescription(Functor &, ValType &) {}
77 template <
typename Functor,
typename ValType>
78 inline enable_if_element_type<ValType, elements::PluginElement>
79 serializationDescription(Functor &, ValType &) {}
80 template <
typename Functor,
typename ValType>
81 inline enable_if_element_type<ValType, elements::InterfaceElement>
82 serializationDescription(Functor &, ValType &) {}
83 template <
typename Functor,
typename ValType>
84 inline enable_if_element_type<ValType, elements::SensorElement>
85 serializationDescription(Functor &, ValType &) {}
90 #endif // INCLUDED_PathElementSerializationDescriptions_h_GUID_88DACA90_818A_4B81_9655_1177F10E8142