Safer and elgant serial helper macros

This commit is contained in:
Gioacchino Mazzurco 2018-01-25 11:37:16 +01:00
parent 7409de5170
commit 13d4a2c916
8 changed files with 133 additions and 115 deletions

View file

@ -48,24 +48,24 @@ void OutgoingRecord_deprecated::serial_process(
RsGenericSerializer::SerializeJob j,
RsGenericSerializer::SerializeContext& ctx )
{
RS_PROCESS_SERIAL_MEMBER_TYPED(status, uint8_t);
RS_PROCESS_SERIAL_MEMBER(recipient);
RS_PROCESS_SERIAL_MEMBER(mailItem);
RS_PROCESS_SERIAL_MEMBER(mailData);
RS_PROCESS_SERIAL_MEMBER_TYPED(clientService, uint16_t);
RS_PROCESS_SERIAL_MEMBER(presignedReceipt);
RS_SERIAL_PROCESS(status);
RS_SERIAL_PROCESS(recipient);
RS_SERIAL_PROCESS(mailItem);
RS_SERIAL_PROCESS(mailData);
RS_SERIAL_PROCESS(clientService);
RS_SERIAL_PROCESS(presignedReceipt);
}
void OutgoingRecord::serial_process(RsGenericSerializer::SerializeJob j,
RsGenericSerializer::SerializeContext& ctx)
{
RS_PROCESS_SERIAL_MEMBER_TYPED(status, uint8_t);
RS_PROCESS_SERIAL_MEMBER(recipient);
RS_PROCESS_SERIAL_MEMBER(author);
RS_PROCESS_SERIAL_MEMBER(group_id);
RS_PROCESS_SERIAL_MEMBER(sent_ts);
RS_PROCESS_SERIAL_MEMBER(mailItem);
RS_PROCESS_SERIAL_MEMBER(mailData);
RS_PROCESS_SERIAL_MEMBER_TYPED(clientService, uint16_t);
RS_PROCESS_SERIAL_MEMBER(presignedReceipt);
RS_SERIAL_PROCESS(status);
RS_SERIAL_PROCESS(recipient);
RS_SERIAL_PROCESS(author);
RS_SERIAL_PROCESS(group_id);
RS_SERIAL_PROCESS(sent_ts);
RS_SERIAL_PROCESS(mailItem);
RS_SERIAL_PROCESS(mailData);
RS_SERIAL_PROCESS(clientService);
RS_SERIAL_PROCESS(presignedReceipt);
}

View file

@ -55,7 +55,7 @@ public:
void serial_process( RsGenericSerializer::SerializeJob j,
RsGenericSerializer::SerializeContext& ctx )
{ RS_PROCESS_SERIAL_MEMBER_TYPED(mailId, uint64_t); }
{ RS_SERIAL_PROCESS(mailId); }
};
class RsGxsTransPresignedReceipt : public RsGxsTransBaseMsgItem
@ -140,9 +140,9 @@ public:
RsGenericSerializer::SerializeContext& ctx )
{
RsGxsTransBaseMsgItem::serial_process(j, ctx);
RS_PROCESS_SERIAL_MEMBER_TYPED(cryptoType, uint8_t);
RS_PROCESS_SERIAL_MEMBER(recipientHint);
RS_PROCESS_SERIAL_MEMBER(payload);
RS_SERIAL_PROCESS(cryptoType);
RS_SERIAL_PROCESS(recipientHint);
RS_SERIAL_PROCESS(payload);
}
void clear()