removed TokenQueue from GxsTransportStatistics

This commit is contained in:
csoler 2020-04-04 22:00:52 +02:00
parent 72a22bcc88
commit 4653f18dd1
No known key found for this signature in database
GPG key ID: 7BCA522266C0804C
6 changed files with 171 additions and 166 deletions

View file

@ -85,8 +85,7 @@ public:
* @param groupIds the ids return for given request token
* @return false if request token is invalid, check token status for error report
*/
bool getGroupList(const uint32_t &token,
std::list<RsGxsGroupId> &groupIds)
bool getGroupList(const uint32_t &token, std::list<RsGxsGroupId> &groupIds)
{
return mGxs.getGroupList(token, groupIds);
}
@ -119,8 +118,7 @@ public:
* @param groupInfo the ids returned for given request token
* @return false if request token is invalid, check token status for error report
*/
bool getGroupSummary(const uint32_t &token,
std::list<RsGroupMetaData> &groupInfo)
bool getGroupSummary(const uint32_t &token, std::list<RsGroupMetaData> &groupInfo)
{
return mGxs.getGroupMeta(token, groupInfo);
}
@ -130,8 +128,7 @@ public:
* @param msgInfo the message metadata returned for given request token
* @return false if request token is invalid, check token status for error report
*/
bool getMsgSummary(const uint32_t &token,
GxsMsgMetaMap &msgInfo)
bool getMsgSummary(const uint32_t &token, GxsMsgMetaMap &msgInfo)
{
return mGxs.getMsgMeta(token, msgInfo);
}

View file

@ -70,10 +70,8 @@ enum class GxsTransSendStatus : uint8_t
typedef uint64_t RsGxsTransId;
class RsGxsTransGroup
class RsGxsTransGroup: public RsGxsGenericGroupData
{
public:
RsGroupMetaData mMeta;
};
class RsGxsTransMsg
@ -103,7 +101,34 @@ struct RsGxsTransOutgoingRecord
RsGxsGroupId group_id ;
};
class RsGxsTransGroupStatistics: public GxsGroupStatistic
{
public:
RsGxsTransGroupStatistics()
{
last_publish_TS = 0;
popularity = 0;
subscribed = false;
}
void addMessageMeta(const RsGxsGroupId& grp,const RsMsgMetaData& meta)
{
messages_metas[meta.mMsgId] = meta ;
last_publish_TS = std::max(last_publish_TS,meta.mPublishTs) ;
mGrpId = grp ;
}
bool subscribed ;
int popularity ;
rstime_t last_publish_TS;
std::map<RsGxsMessageId,RsMsgMetaData> messages_metas ;
};
/// RetroShare GxsTrans asyncronous redundant small mail trasport on top of GXS
///
class RsGxsTrans: public RsGxsIfaceHelper
{
public:
@ -120,10 +145,8 @@ public:
virtual ~RsGxsTrans() {}
virtual bool getStatistics(GxsTransStatistics& stats)=0;
// virtual bool getGroupData(const uint32_t &token, std::vector<RsGxsTransGroup> &groups) = 0;
// virtual bool getPostData(const uint32_t &token, std::vector<RsGxsTransMsg> &posts) = 0;
virtual bool getDataStatistics(GxsTransStatistics& stats)=0;
virtual bool getGroupStatistics(std::map<RsGxsGroupId,RsGxsTransGroupStatistics>& stats) =0;
};
extern RsGxsTrans *rsGxsTrans ;