mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-12-20 19:06:09 -05:00
remaining code for nxs sync optimisation
- still needs testing git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-gxs_finale@6903 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
2e886bf443
commit
f74aacd759
7 changed files with 678 additions and 59 deletions
|
|
@ -37,13 +37,17 @@
|
|||
#include "gxs/rsgxsdata.h"
|
||||
|
||||
|
||||
const uint8_t RS_PKT_SUBTYPE_GXS_GRP_UPDATE = 0x0001;
|
||||
const uint8_t RS_PKT_SUBTYPE_GXS_MSG_UPDATE = 0x0002;
|
||||
const uint8_t RS_PKT_SUBTYPE_GXS_GRP_UPDATE = 0x0001;
|
||||
const uint8_t RS_PKT_SUBTYPE_GXS_MSG_UPDATE = 0x0002;
|
||||
const uint8_t RS_PKT_SUBTYPE_GXS_SERVER_GRP_UPDATE = 0x0004;
|
||||
const uint8_t RS_PKT_SUBTYPE_GXS_SERVER_MSG_UPDATE = 0x0008;
|
||||
|
||||
class RsGxsGrpUpdateItem : public RsItem {
|
||||
public:
|
||||
RsGxsGrpUpdateItem();
|
||||
virtual ~RsGxsGrpUpdateItem();
|
||||
RsGxsGrpUpdateItem(uint16_t servType) : RsItem(RS_PKT_VERSION_SERVICE, servType,
|
||||
RS_PKT_SUBTYPE_GXS_GRP_UPDATE)
|
||||
{}
|
||||
virtual ~RsGxsGrpUpdateItem() {}
|
||||
|
||||
virtual void clear();
|
||||
virtual std::ostream &print(std::ostream &out, uint16_t indent);
|
||||
|
|
@ -52,10 +56,24 @@ public:
|
|||
uint32_t grpUpdateTS;
|
||||
};
|
||||
|
||||
class RsGxsServerGrpUpdateItem : public RsItem {
|
||||
public:
|
||||
RsGxsServerGrpUpdateItem(uint16_t servType) : RsItem(RS_PKT_VERSION_SERVICE, servType,
|
||||
RS_PKT_SUBTYPE_GXS_SERVER_GRP_UPDATE)
|
||||
{}
|
||||
virtual ~RsGxsServerGrpUpdateItem();
|
||||
|
||||
virtual void clear();
|
||||
virtual std::ostream &print(std::ostream &out, uint16_t indent);
|
||||
|
||||
uint32_t grpUpdateTS;
|
||||
};
|
||||
|
||||
class RsGxsMsgUpdateItem : public RsItem
|
||||
{
|
||||
public:
|
||||
RsGxsMsgUpdateItem();
|
||||
RsGxsMsgUpdateItem(uint16_t servType) : RsItem(RS_PKT_VERSION_SERVICE, servType, RS_PKT_SUBTYPE_GXS_MSG_UPDATE)
|
||||
{}
|
||||
virtual ~RsGxsMsgUpdateItem();
|
||||
|
||||
virtual void clear();
|
||||
|
|
@ -65,6 +83,20 @@ public:
|
|||
std::map<std::string, uint32_t> msgUpdateTS;
|
||||
};
|
||||
|
||||
class RsGxsServerMsgUpdateItem : public RsItem
|
||||
{
|
||||
public:
|
||||
RsGxsServerMsgUpdateItem(uint16_t servType) : RsItem(RS_PKT_VERSION_SERVICE,
|
||||
servType, RS_PKT_SUBTYPE_GXS_SERVER_MSG_UPDATE)
|
||||
{}
|
||||
virtual ~RsGxsServerMsgUpdateItem();
|
||||
|
||||
virtual void clear();
|
||||
virtual std::ostream &print(std::ostream &out, uint16_t indent);
|
||||
|
||||
std::string grpId;
|
||||
uint32_t msgUpdateTS; // the last time this group received a new msg
|
||||
};
|
||||
|
||||
|
||||
class RsGxsUpdateSerialiser : public RsSerialType
|
||||
|
|
@ -89,12 +121,24 @@ private:
|
|||
virtual bool serialiseGxsGrpUpdate(RsGxsGrpUpdateItem *item, void *data, uint32_t *size);
|
||||
virtual RsGxsGrpUpdateItem* deserialGxsGrpUpddate(void *data, uint32_t *size);
|
||||
|
||||
/* for RS_PKT_SUBTYPE_GXS_ */
|
||||
/* for RS_PKT_SUBTYPE_GRP_SERVER_UPDATE_ITEM */
|
||||
|
||||
virtual uint32_t sizeGxsServerGrpUpdate(RsGxsServerGrpUpdateItem* item);
|
||||
virtual bool serialiseGxsServerGrpUpdate(RsGxsServerGrpUpdateItem *item, void *data, uint32_t *size);
|
||||
virtual RsGxsServerGrpUpdateItem* deserialGxsServerGrpUpddate(void *data, uint32_t *size);
|
||||
|
||||
/* for RS_PKT_SUBTYPE_GXS_MSG_UPDATE_ITEM */
|
||||
|
||||
virtual uint32_t sizeGxsMsgUpdate(RsGxsMsgUpdateItem* item);
|
||||
virtual bool serialiseGxsMsgUpdate(RsGxsMsgUpdateItem *item, void *data, uint32_t *size);
|
||||
virtual RsGxsMsgUpdateItem* deserialGxsMsgUpdate(void *data, uint32_t *size);
|
||||
|
||||
/* for RS_PKT_SUBTYPE_GXS_SERVER_UPDATE_ITEM */
|
||||
|
||||
virtual uint32_t sizeGxsServerMsgUpdate(RsGxsServerMsgUpdateItem* item);
|
||||
virtual bool serialiseGxsServerMsgUpdate(RsGxsServerMsgUpdateItem *item, void *data, uint32_t *size);
|
||||
virtual RsGxsServerMsgUpdateItem* deserialGxsServerMsgUpdate(void *data, uint32_t *size);
|
||||
|
||||
private:
|
||||
|
||||
const uint16_t SERVICE_TYPE;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue