def add_serializers(self, struct, indent): # Adhers to the packer interface fn = Function() fn.name = 'pack' fn.ret = 'void' fn.qual = 'throws IOException' arg = Variable() arg.name = 'out' arg.type = 'LittleEndianDataOutputStream' fn.args.append(arg) fn.body = self.gen_serializer_body(struct, indent) struct.methods.append(fn) fn = Function() fn.name = 'unpack' fn.ret = 'void' fn.qual = 'throws IOException' arg = Variable() arg.name = 'in' arg.type = 'LittleEndianDataInputStream' fn.args.append(arg) fn.body = self.gen_deserializer_body(struct, indent) struct.methods.append(fn)
def add_serializers(self, struct, indent): # Adhers to the packer interface fn = Function() fn.name = 'pack' fn.inline = None fn.ret = 'void' fn.qual = 'const' arg = Variable() arg.name = 'out' arg.type = 'boost::archive::binary_oarchive&' fn.args.append(arg) fn.body = self.gen_serializer_body(struct, indent) struct.methods.append(fn) fn = Function() fn.name = 'unpack' fn.ret = 'void' fn.qual = '' arg = Variable() arg.name = 'in' arg.type = 'boost::archive::binary_iarchive&' fn.args.append(arg) fn.body = self.gen_deserializer_body(struct, indent) struct.methods.append(fn)