serialize: add concept API
Wrap serialization methods in a struct to match a yet to be consumed
serialization template concept API.
Change-Id: I4be1749f693ea5fe116bbac581428972e7670791
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/manager.hpp b/manager.hpp
index c9f14a0..93957d9 100644
--- a/manager.hpp
+++ b/manager.hpp
@@ -105,14 +105,14 @@
const std::any& holder)
{
const auto& object = *std::any_cast<const std::shared_ptr<T>&>(holder);
- cereal::serialize(path, iface, object);
+ SerialOps::serialize(path, iface, object);
}
template <typename T, std::enable_if_t<!HasProperties<T>::value, bool> = false>
void propSerialize(const std::string& path, const std::string& iface,
const std::any& holder)
{
- cereal::serialize(path, iface);
+ SerialOps::serialize(path, iface);
}
template <typename T, std::enable_if_t<HasProperties<T>::value, bool> = true>
@@ -120,13 +120,14 @@
std::any& holder)
{
auto& object = *std::any_cast<std::shared_ptr<T>&>(holder);
- cereal::deserialize(path, iface, object);
+ SerialOps::deserialize(path, iface, object);
}
template <typename T, std::enable_if_t<!HasProperties<T>::value, bool> = false>
void propDeSerialize(const std::string& path, const std::string& iface,
std::any& holder)
{
+ SerialOps::deserialize(path, iface);
}
/** @struct MakeInterface