inventory: implement serialization
Use Cereal to serialize and persist inventory items to the filesystem.
Serialize inventory objects as and when they're created/updated via the
notify() API.
Create a template API to perform serialization on the sdbusplus
inventory interface type.
An inventory item path /foo/bar/baz implementing interfaces iface1 and
iface2 would be stored in paths /foo/bar/baz/iface1 and
/foo/bar/baz/iface2.
Change-Id: I9a175185eac1740d6f2ca86a3ee13457edfc8ea9
Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
diff --git a/manager.cpp b/manager.cpp
index 97d629b..86b1757 100644
--- a/manager.cpp
+++ b/manager.cpp
@@ -200,6 +200,8 @@
auto& assign = std::get<AssignerType>(opsit->second);
assign(ifaceit->second, refaceit->second);
}
+ auto& serialize = std::get<SerializerType>(opsit->second);
+ serialize(path, ifaceit->first, refaceit->second);
}
catch (const InterfaceError& e)
{