From e406a1fb8bd53ea65d8acc5ef4ecfca93385186a Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Mon, 20 Apr 2020 11:55:20 +0200 Subject: [PATCH] Fix JSON API compilation after rebasing on master --- libretroshare/src/gxs/rsgxsdataaccess.cc | 1 + .../src/retroshare/rsgxsifacetypes.h | 39 +++++++++++-------- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/libretroshare/src/gxs/rsgxsdataaccess.cc b/libretroshare/src/gxs/rsgxsdataaccess.cc index 0b23594c2..17c61f956 100644 --- a/libretroshare/src/gxs/rsgxsdataaccess.cc +++ b/libretroshare/src/gxs/rsgxsdataaccess.cc @@ -1970,3 +1970,4 @@ bool RsGxsDataAccess::checkMsgFilter( } GxsGroupStatistic::~GxsGroupStatistic() = default; +GxsServiceStatistic::~GxsServiceStatistic() = default; diff --git a/libretroshare/src/retroshare/rsgxsifacetypes.h b/libretroshare/src/retroshare/rsgxsifacetypes.h index ad4979067..038906317 100644 --- a/libretroshare/src/retroshare/rsgxsifacetypes.h +++ b/libretroshare/src/retroshare/rsgxsifacetypes.h @@ -230,24 +230,13 @@ struct GxsGroupStatistic : RsSerializable ~GxsGroupStatistic() override; }; -class GxsServiceStatistic +struct GxsServiceStatistic : RsSerializable { -public: - GxsServiceStatistic() - { - mNumMsgs = 0; - mNumGrps = 0; - mSizeOfMsgs = 0; - mSizeOfGrps = 0; - mNumGrpsSubscribed = 0; - mNumThreadMsgsNew = 0; - mNumThreadMsgsUnread = 0; - mNumChildMsgsNew = 0; - mNumChildMsgsUnread = 0; - mSizeStore = 0; - } + GxsServiceStatistic() : + mNumMsgs(0), mNumGrps(0), mSizeOfMsgs(0), mSizeOfGrps(0), + mNumGrpsSubscribed(0), mNumThreadMsgsNew(0), mNumThreadMsgsUnread(0), + mNumChildMsgsNew(0), mNumChildMsgsUnread(0), mSizeStore(0) {} -public: uint32_t mNumMsgs; uint32_t mNumGrps; uint32_t mSizeOfMsgs; @@ -258,6 +247,24 @@ public: uint32_t mNumChildMsgsNew; uint32_t mNumChildMsgsUnread; uint32_t mSizeStore; + + /// @see RsSerializable + void serial_process( RsGenericSerializer::SerializeJob j, + RsGenericSerializer::SerializeContext& ctx ) override + { + RS_SERIAL_PROCESS(mNumMsgs); + RS_SERIAL_PROCESS(mNumGrps); + RS_SERIAL_PROCESS(mSizeOfMsgs); + RS_SERIAL_PROCESS(mSizeOfGrps); + RS_SERIAL_PROCESS(mNumGrpsSubscribed); + RS_SERIAL_PROCESS(mNumThreadMsgsNew); + RS_SERIAL_PROCESS(mNumThreadMsgsUnread); + RS_SERIAL_PROCESS(mNumChildMsgsNew); + RS_SERIAL_PROCESS(mNumChildMsgsUnread); + RS_SERIAL_PROCESS(mSizeStore); + } + + ~GxsServiceStatistic() override; }; class RS_DEPRECATED RsGxsGroupUpdateMeta