Add serialization to the Callout class
Adding serialize() and deserialize() APIs to the callout
class to save and restore the class data persistently.
The APIs take the directory to store the files in, and the
filename itself will be the ID, which is the callout number.
For example, a path could be:
/var/lib/ibm-logging/errors/5/callouts/0.
Tested: Passes the testcases in future commit.
Change-Id: I526f6483df71dbceac3a33f7ce8872f6914bcd9d
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
diff --git a/configure.ac b/configure.ac
index 07abbe0..574bd1a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,6 +22,9 @@
AC_CHECK_HEADER(nlohmann/json.hpp, ,
[AC_MSG_ERROR([Could not find nlohmann/json.hpp... nlohmann/json package required])])
+AC_CHECK_HEADER(cereal/archives/binary.hpp, ,
+ [AC_MSG_ERROR([Could not find cereal/archives/binary.hpp... cereal package required])])
+
# Checks for typedefs, structures, and compiler characteristics.
AX_CXX_COMPILE_STDCXX_14([noext])
AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS])
@@ -83,5 +86,12 @@
AS_IF([test "x$POLICY_JSON_PATH" == "x"], [POLICY_JSON_PATH="/usr/share/ibm-logging/policy.json"])
AC_DEFINE_UNQUOTED([POLICY_JSON_PATH], ["$POLICY_JSON_PATH"], [The path to the policy json file on the BMC])
+AC_ARG_VAR(CALLOUT_CLASS_VERSION,
+ [Callout class version to register with Cereal])
+AS_IF([test "x$CALLOUT_CLASS_VERSION" == "x"],
+ [CALLOUT_CLASS_VERSION=1])
+AC_DEFINE_UNQUOTED([CALLOUT_CLASS_VERSION], [$CALLOUT_CLASS_VERSION],
+ [Callout Class version to register with Cereal])
+
AC_CONFIG_FILES([Makefile test/Makefile])
AC_OUTPUT