mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-19 11:28:24 -04:00
Cleanup GxsTokenQueue header
This commit is contained in:
parent
55ff9067cf
commit
e246876513
1 changed files with 17 additions and 21 deletions
|
@ -29,41 +29,37 @@
|
||||||
#include "util/rsthreads.h"
|
#include "util/rsthreads.h"
|
||||||
|
|
||||||
|
|
||||||
/*
|
struct GxsTokenQueueItem
|
||||||
*
|
|
||||||
* A little helper class, to manage callbacks from requests
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
class GxsTokenQueueItem
|
|
||||||
{
|
{
|
||||||
public:
|
|
||||||
GxsTokenQueueItem(const uint32_t token, const uint32_t req_type)
|
|
||||||
:mToken(token),mReqType(req_type) { return; }
|
|
||||||
|
|
||||||
GxsTokenQueueItem(): mToken(0), mReqType(0) { return; }
|
GxsTokenQueueItem(const uint32_t token, const uint32_t req_type) :
|
||||||
|
mToken(token), mReqType(req_type) {}
|
||||||
|
|
||||||
|
GxsTokenQueueItem(): mToken(0), mReqType(0) {}
|
||||||
|
|
||||||
uint32_t mToken;
|
uint32_t mToken;
|
||||||
uint32_t mReqType;
|
uint32_t mReqType;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A little helper class, to manage callbacks from requests
|
||||||
|
*/
|
||||||
class GxsTokenQueue
|
class GxsTokenQueue
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
GxsTokenQueue(RsGenExchange *gxs) :
|
||||||
|
mGenExchange(gxs), mQueueMtx("GxsTokenQueueMtx") {}
|
||||||
|
|
||||||
GxsTokenQueue(RsGenExchange *gxs)
|
bool queueRequest(uint32_t token, uint32_t req_type);
|
||||||
:mGenExchange(gxs), mQueueMtx("GxsTokenQueueMtx") { return; }
|
void checkRequests(); /// must be called by
|
||||||
bool queueRequest(uint32_t token, uint32_t req_type);
|
|
||||||
|
|
||||||
void checkRequests(); // must be called by
|
protected:
|
||||||
|
|
||||||
protected:
|
/// This must be overloaded to complete the functionality.
|
||||||
|
virtual void handleResponse(uint32_t token, uint32_t req_type);
|
||||||
|
|
||||||
// This must be overloaded to complete the functionality.
|
private:
|
||||||
virtual void handleResponse(uint32_t token, uint32_t req_type);
|
|
||||||
|
|
||||||
private:
|
|
||||||
RsGenExchange *mGenExchange;
|
RsGenExchange *mGenExchange;
|
||||||
RsMutex mQueueMtx;
|
RsMutex mQueueMtx;
|
||||||
std::list<GxsTokenQueueItem> mQueue;
|
std::list<GxsTokenQueueItem> mQueue;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue