Enable Cereal class versioning

Fixes openbmc/openbmc#2320

Change-Id: Iac2649cd5f4794e2049cbdd4eb2df874d26beaaa
Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
diff --git a/settings_manager.mako.hpp b/settings_manager.mako.hpp
index 9e0b3fd..09a5a1f 100644
--- a/settings_manager.mako.hpp
+++ b/settings_manager.mako.hpp
@@ -216,7 +216,8 @@
 
 template<class Archive>
 void save(Archive& a,
-          const Impl& setting)
+          const Impl& setting,
+          const std::uint32_t version)
 {
 <%
 props = []
@@ -231,7 +232,8 @@
 
 template<class Archive>
 void load(Archive& a,
-          Impl& setting)
+          Impl& setting,
+          const std::uint32_t version)
 {
 <% props = [] %>\
 % for index, item in enumerate(settingsDict[object]):
@@ -349,3 +351,18 @@
 
 } // namespace settings
 } // namespace phosphor
+
+// Now register the class version with Cereal
+% for object in objects:
+<%
+   classname = "phosphor::settings"
+   ns = object.split('/')
+   ns.pop(0)
+%>\
+% for n in ns:
+<%
+    classname += "::" + n
+%>\
+% endfor
+CEREAL_CLASS_VERSION(${classname + "::Impl"}, CLASS_VERSION);
+% endfor