mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-27 16:39:29 -05:00
Moved TokenQueue => TokenQueueVEG to make space for Real version.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-gxs-b1@5553 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
ce992475a1
commit
4f470090b2
@ -933,14 +933,14 @@ thewire {
|
|||||||
|
|
||||||
identities {
|
identities {
|
||||||
|
|
||||||
HEADERS += util/TokenQueue.h \
|
HEADERS += util/TokenQueueVEG.h \
|
||||||
gui/Identity/IdDialog.h \
|
gui/Identity/IdDialog.h \
|
||||||
gui/Identity/IdEditDialog.h \
|
gui/Identity/IdEditDialog.h \
|
||||||
|
|
||||||
FORMS += gui/Identity/IdDialog.ui \
|
FORMS += gui/Identity/IdDialog.ui \
|
||||||
gui/Identity/IdEditDialog.ui \
|
gui/Identity/IdEditDialog.ui \
|
||||||
|
|
||||||
SOURCES += util/TokenQueue.cpp \
|
SOURCES += util/TokenQueueVEG.cpp \
|
||||||
gui/Identity/IdDialog.cpp \
|
gui/Identity/IdDialog.cpp \
|
||||||
gui/Identity/IdEditDialog.cpp \
|
gui/Identity/IdEditDialog.cpp \
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "util/TokenQueue.h"
|
#include "util/TokenQueueVEG.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
@ -31,13 +31,13 @@
|
|||||||
*****/
|
*****/
|
||||||
|
|
||||||
/** Constructor */
|
/** Constructor */
|
||||||
TokenQueue::TokenQueue(RsTokenService *service, TokenResponse *resp)
|
TokenQueueVEG::TokenQueueVEG(RsTokenServiceVEG *service, TokenResponseVEG *resp)
|
||||||
:QWidget(NULL), mService(service), mResponder(resp)
|
:QWidget(NULL), mService(service), mResponder(resp)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TokenQueue::requestGroupInfo(uint32_t &token, uint32_t anstype, const RsTokReqOptions &opts, std::list<std::string> ids, uint32_t usertype)
|
bool TokenQueueVEG::requestGroupInfo(uint32_t &token, uint32_t anstype, const RsTokReqOptionsVEG &opts, std::list<std::string> ids, uint32_t usertype)
|
||||||
{
|
{
|
||||||
uint32_t basictype = TOKENREQ_GROUPINFO;
|
uint32_t basictype = TOKENREQ_GROUPINFO;
|
||||||
mService->requestGroupInfo(token, anstype, opts, ids);
|
mService->requestGroupInfo(token, anstype, opts, ids);
|
||||||
@ -47,7 +47,7 @@ bool TokenQueue::requestGroupInfo(uint32_t &token, uint32_t anstype, const RsTok
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool TokenQueue::requestMsgInfo(uint32_t &token, uint32_t anstype, const RsTokReqOptions &opts, std::list<std::string> ids, uint32_t usertype)
|
bool TokenQueueVEG::requestMsgInfo(uint32_t &token, uint32_t anstype, const RsTokReqOptionsVEG &opts, std::list<std::string> ids, uint32_t usertype)
|
||||||
{
|
{
|
||||||
uint32_t basictype = TOKENREQ_MSGINFO;
|
uint32_t basictype = TOKENREQ_MSGINFO;
|
||||||
mService->requestMsgInfo(token, anstype, opts, ids);
|
mService->requestMsgInfo(token, anstype, opts, ids);
|
||||||
@ -57,7 +57,7 @@ bool TokenQueue::requestMsgInfo(uint32_t &token, uint32_t anstype, const RsTokRe
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool TokenQueue::requestMsgRelatedInfo(uint32_t &token, uint32_t anstype, const RsTokReqOptions &opts, std::list<std::string> ids, uint32_t usertype)
|
bool TokenQueueVEG::requestMsgRelatedInfo(uint32_t &token, uint32_t anstype, const RsTokReqOptionsVEG &opts, std::list<std::string> ids, uint32_t usertype)
|
||||||
{
|
{
|
||||||
uint32_t basictype = TOKENREQ_MSGRELATEDINFO;
|
uint32_t basictype = TOKENREQ_MSGRELATEDINFO;
|
||||||
mService->requestMsgRelatedInfo(token, anstype, opts, ids);
|
mService->requestMsgRelatedInfo(token, anstype, opts, ids);
|
||||||
@ -67,13 +67,13 @@ bool TokenQueue::requestMsgRelatedInfo(uint32_t &token, uint32_t anstype, const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TokenQueue::queueRequest(uint32_t token, uint32_t basictype, uint32_t anstype, uint32_t usertype)
|
void TokenQueueVEG::queueRequest(uint32_t token, uint32_t basictype, uint32_t anstype, uint32_t usertype)
|
||||||
{
|
{
|
||||||
std::cerr << "TokenQueue::queueRequest() Token: " << token << " Type: " << basictype;
|
std::cerr << "TokenQueueVEG::queueRequest() Token: " << token << " Type: " << basictype;
|
||||||
std::cerr << " AnsType: " << anstype << " UserType: " << usertype;
|
std::cerr << " AnsType: " << anstype << " UserType: " << usertype;
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
|
|
||||||
TokenRequest req;
|
TokenRequestVEG req;
|
||||||
req.mToken = token;
|
req.mToken = token;
|
||||||
req.mType = basictype;
|
req.mType = basictype;
|
||||||
req.mAnsType = anstype;
|
req.mAnsType = anstype;
|
||||||
@ -91,7 +91,7 @@ void TokenQueue::queueRequest(uint32_t token, uint32_t basictype, uint32_t ansty
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TokenQueue::doPoll(float dt)
|
void TokenQueueVEG::doPoll(float dt)
|
||||||
{
|
{
|
||||||
/* single shot poll */
|
/* single shot poll */
|
||||||
//mTrigger->singlesshot(dt * 1000);
|
//mTrigger->singlesshot(dt * 1000);
|
||||||
@ -99,9 +99,9 @@ void TokenQueue::doPoll(float dt)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TokenQueue::pollRequests()
|
void TokenQueueVEG::pollRequests()
|
||||||
{
|
{
|
||||||
std::list<TokenRequest>::iterator it;
|
std::list<TokenRequestVEG>::iterator it;
|
||||||
|
|
||||||
double pollPeriod = 1.0; // max poll period.
|
double pollPeriod = 1.0; // max poll period.
|
||||||
for(it = mRequests.begin(); it != mRequests.end();)
|
for(it = mRequests.begin(); it != mRequests.end();)
|
||||||
@ -129,16 +129,16 @@ void TokenQueue::pollRequests()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool TokenQueue::checkForRequest(uint32_t token)
|
bool TokenQueueVEG::checkForRequest(uint32_t token)
|
||||||
{
|
{
|
||||||
/* check token */
|
/* check token */
|
||||||
return (COMPLETED_REQUEST == mService->requestStatus(token));
|
return (COMPLETED_REQUEST == mService->requestStatus(token));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TokenQueue::loadRequest(const TokenRequest &req)
|
void TokenQueueVEG::loadRequest(const TokenRequestVEG &req)
|
||||||
{
|
{
|
||||||
std::cerr << "TokenQueue::loadRequest(): ";
|
std::cerr << "TokenQueueVEG::loadRequest(): ";
|
||||||
std::cerr << "Token: " << req.mToken << " Type: " << req.mType;
|
std::cerr << "Token: " << req.mToken << " Type: " << req.mType;
|
||||||
std::cerr << " AnsType: " << req.mAnsType << " UserType: " << req.mUserType;
|
std::cerr << " AnsType: " << req.mAnsType << " UserType: " << req.mUserType;
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
@ -149,12 +149,12 @@ void TokenQueue::loadRequest(const TokenRequest &req)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool TokenQueue::cancelRequest(const uint32_t token)
|
bool TokenQueueVEG::cancelRequest(const uint32_t token)
|
||||||
{
|
{
|
||||||
/* cancel at lower level first */
|
/* cancel at lower level first */
|
||||||
mService->cancelRequest(token);
|
mService->cancelRequest(token);
|
||||||
|
|
||||||
std::list<TokenRequest>::iterator it;
|
std::list<TokenRequestVEG>::iterator it;
|
||||||
|
|
||||||
for(it = mRequests.begin(); it != mRequests.end(); it++)
|
for(it = mRequests.begin(); it != mRequests.end(); it++)
|
||||||
{
|
{
|
||||||
@ -162,14 +162,14 @@ bool TokenQueue::cancelRequest(const uint32_t token)
|
|||||||
{
|
{
|
||||||
mRequests.erase(it);
|
mRequests.erase(it);
|
||||||
|
|
||||||
std::cerr << "TokenQueue::cancelRequest() Cleared Request: " << token;
|
std::cerr << "TokenQueueVEG::cancelRequest() Cleared Request: " << token;
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::cerr << "TokenQueue::cancelRequest() Failed to Find Request: " << token;
|
std::cerr << "TokenQueueVEG::cancelRequest() Failed to Find Request: " << token;
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
|
|
||||||
return false;
|
return false;
|
@ -21,8 +21,8 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef MRK_TOKEN_QUEUE_H
|
#ifndef MRK_VEG_TOKEN_QUEUE_H
|
||||||
#define MRK_TOKEN_QUEUE_H
|
#define MRK_VEG_TOKEN_QUEUE_H
|
||||||
|
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
@ -30,7 +30,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#include <retroshare/rsidentity.h>
|
#include <retroshare/rsidentityVEG.h>
|
||||||
|
|
||||||
#define COMPLETED_REQUEST 4
|
#define COMPLETED_REQUEST 4
|
||||||
|
|
||||||
@ -38,9 +38,9 @@
|
|||||||
#define TOKENREQ_MSGINFO 2
|
#define TOKENREQ_MSGINFO 2
|
||||||
#define TOKENREQ_MSGRELATEDINFO 3
|
#define TOKENREQ_MSGRELATEDINFO 3
|
||||||
|
|
||||||
class TokenQueue;
|
class TokenQueueVEG;
|
||||||
|
|
||||||
class TokenRequest
|
class TokenRequestVEG
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
uint32_t mToken;
|
uint32_t mToken;
|
||||||
@ -51,7 +51,7 @@ class TokenRequest
|
|||||||
struct timeval mPollTs;
|
struct timeval mPollTs;
|
||||||
};
|
};
|
||||||
|
|
||||||
class TokenResponse
|
class TokenResponseVEG
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
//virtual ~TokenResponse() { return; }
|
//virtual ~TokenResponse() { return; }
|
||||||
@ -60,25 +60,25 @@ class TokenResponse
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class TokenQueue: public QWidget
|
class TokenQueueVEG: public QWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TokenQueue(RsTokenService *service, TokenResponse *resp);
|
TokenQueueVEG(RsTokenServiceVEG *service, TokenResponseVEG *resp);
|
||||||
|
|
||||||
/* generic handling of token / response update behaviour */
|
/* generic handling of token / response update behaviour */
|
||||||
bool requestGroupInfo(uint32_t &token, uint32_t anstype, const RsTokReqOptions &opts,
|
bool requestGroupInfo(uint32_t &token, uint32_t anstype, const RsTokReqOptionsVEG &opts,
|
||||||
std::list<std::string> ids, uint32_t usertype);
|
std::list<std::string> ids, uint32_t usertype);
|
||||||
bool requestMsgInfo(uint32_t &token, uint32_t anstype, const RsTokReqOptions &opts,
|
bool requestMsgInfo(uint32_t &token, uint32_t anstype, const RsTokReqOptionsVEG &opts,
|
||||||
std::list<std::string> ids, uint32_t usertype);
|
std::list<std::string> ids, uint32_t usertype);
|
||||||
bool requestMsgRelatedInfo(uint32_t &token, uint32_t anstype, const RsTokReqOptions &opts,
|
bool requestMsgRelatedInfo(uint32_t &token, uint32_t anstype, const RsTokReqOptionsVEG &opts,
|
||||||
std::list<std::string> ids, uint32_t usertype);
|
std::list<std::string> ids, uint32_t usertype);
|
||||||
bool cancelRequest(const uint32_t token);
|
bool cancelRequest(const uint32_t token);
|
||||||
|
|
||||||
void queueRequest(uint32_t token, uint32_t basictype, uint32_t anstype, uint32_t usertype);
|
void queueRequest(uint32_t token, uint32_t basictype, uint32_t anstype, uint32_t usertype);
|
||||||
bool checkForRequest(uint32_t token);
|
bool checkForRequest(uint32_t token);
|
||||||
void loadRequest(const TokenRequest &req);
|
void loadRequest(const TokenRequestVEG &req);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void doPoll(float dt);
|
void doPoll(float dt);
|
||||||
@ -88,10 +88,10 @@ private slots:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
/* Info for Data Requests */
|
/* Info for Data Requests */
|
||||||
std::list<TokenRequest> mRequests;
|
std::list<TokenRequestVEG> mRequests;
|
||||||
|
|
||||||
RsTokenService *mService;
|
RsTokenServiceVEG *mService;
|
||||||
TokenResponse *mResponder;
|
TokenResponseVEG *mResponder;
|
||||||
|
|
||||||
QTimer *mTrigger;
|
QTimer *mTrigger;
|
||||||
};
|
};
|
Loading…
Reference in New Issue
Block a user