summaryrefslogtreecommitdiffstats
path: root/manager.hpp
diff options
context:
space:
mode:
authorBrad Bishop <bradleyb@fuzziesquirrel.com>2018-12-12 21:40:26 -0500
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2019-01-07 15:59:43 -0500
commit7dfd08f8c4e4e0fb19378e9098dffc6012ee1dac (patch)
tree0f82e57bb2887b3c7311ff1d4076c3b76055bc0b /manager.hpp
parent35aba2347fd0ffbbaf704d4cc067304881348182 (diff)
downloadphosphor-inventory-manager-7dfd08f8c4e4e0fb19378e9098dffc6012ee1dac.tar.gz
phosphor-inventory-manager-7dfd08f8c4e4e0fb19378e9098dffc6012ee1dac.zip
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>
Diffstat (limited to 'manager.hpp')
-rw-r--r--manager.hpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/manager.hpp b/manager.hpp
index c9f14a0..93957d9 100644
--- a/manager.hpp
+++ b/manager.hpp
@@ -105,14 +105,14 @@ void propSerialize(const std::string& path, const std::string& iface,
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 @@ void propDeSerialize(const std::string& path, const std::string& iface,
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
OpenPOWER on IntegriCloud