pimgen: generate serialization code
Subsequent commits will introduce serialization of inventory properties.
Generate the save()/load() functions required by Cereal.
Change-Id: I2ce16d205cad9684711c49c32ddae9f69cd8632d
Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
diff --git a/pimgen.py b/pimgen.py
index 4f0a566..73d1868 100755
--- a/pimgen.py
+++ b/pimgen.py
@@ -570,11 +570,23 @@
interfaces=self.interfaces,
indent=Indent()))
+ def generate_serialization(self, loader):
+ with open(os.path.join(
+ args.outputdir,
+ 'gen_serialization.hpp'), 'w') as fd:
+ fd.write(
+ self.render(
+ loader,
+ 'gen_serialization.mako.hpp',
+ interfaces=self.interfaces,
+ interface_composite=self.interface_composite))
+
if __name__ == '__main__':
script_dir = os.path.dirname(os.path.realpath(__file__))
valid_commands = {
'generate-cpp': 'generate_cpp',
+ 'generate-serialization': 'generate_serialization',
}
parser = argparse.ArgumentParser(