mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-25 01:10:19 -05:00
added new declaration for retrodb and removed sqlite reference.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-new_cache_system@4804 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
2504c0fd9a
commit
cf5158d2b0
@ -2,6 +2,8 @@
|
||||
#define RSGNP_H
|
||||
|
||||
#include <set>
|
||||
#include <time.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "services/p3service.h"
|
||||
#include "gxs/rsgdp.h"
|
||||
@ -22,21 +24,17 @@ public:
|
||||
|
||||
/*** gdp::iterface *****/
|
||||
int requestMsgs(std::set<std::string> msgId, double &delay);
|
||||
void addGdp(RsGdp* gdp);
|
||||
void removeGdp(RsGdp* gdp);
|
||||
void addGdp(RsGdp* gdp) = 0;
|
||||
void removeGdp(RsGdp* gdp) = 0;
|
||||
|
||||
private:
|
||||
public:
|
||||
|
||||
/*** IMPLEMENTATION DETAILS ****/
|
||||
|
||||
/* Get/Send Messages */
|
||||
void getAvailableMsgs(std::string peerId, time_t from, time_t to); /* request over the network */
|
||||
void sendAvailableMsgs(std::string peerId, gdp::id grpId, time_t from, time_t to); /* send to peers */
|
||||
void sendAvailableMsgs(std::string peerId, time_t from, time_t to); /* send to peers */
|
||||
|
||||
requestMessages(std::string peerId, gdp::id grpId, std::list<gdp::id> msgIds);
|
||||
sendMessages(std::string peerId, gdp::id grpId, std::list<gdp::id> msgIds); /* send to peer, obviously permissions have been checked first */
|
||||
|
||||
/* Search the network */
|
||||
};
|
||||
|
||||
#endif // RSGNP_H
|
||||
|
@ -31,6 +31,7 @@
|
||||
*/
|
||||
|
||||
#include "rsgdp.h"
|
||||
#include "util/rsthreads.h"
|
||||
|
||||
/*!
|
||||
* Retroshare general exchange service
|
||||
@ -40,11 +41,14 @@
|
||||
* GDP deals with exporting and importing msgs to and from the concrete service
|
||||
* data from the derived class
|
||||
* GXIP is used to maintain
|
||||
*
|
||||
*
|
||||
* The maiin transport mechanism
|
||||
*/
|
||||
class RsGxs
|
||||
class RsGxs : public RsThread
|
||||
{
|
||||
public:
|
||||
RsGxs();
|
||||
RsGxs(const std::string& serviceName);
|
||||
|
||||
public:
|
||||
|
||||
@ -52,27 +56,43 @@ public:
|
||||
* These are messages, that have been pushed to you
|
||||
* This will be called by RsGdp whenever a new msg(s) has arrived
|
||||
* the list contains ids which may be queried from the external db
|
||||
*
|
||||
* @param msgIds the ids of the new msgs received
|
||||
*/
|
||||
virtual void receiveMessage(std::set<std::string> msgIds) = 0;
|
||||
virtual void receiveMessage(std::set<std::string>& msgIds) = 0;
|
||||
|
||||
/*!
|
||||
* Push a set of messages which have been written to your service
|
||||
* database
|
||||
* @param msgIds
|
||||
*/
|
||||
void push(std::set<std::string>& msgIds) = 0;
|
||||
|
||||
/*!
|
||||
* drives synchronisation between peers
|
||||
*/
|
||||
void tick();
|
||||
|
||||
void cache(RsGxsSignedMessage*);
|
||||
/*!
|
||||
* allows for non blocking pushes, receives, and configuration changes.
|
||||
*/
|
||||
void run();
|
||||
|
||||
|
||||
/*!
|
||||
* cache a message
|
||||
* @param msg message to cache
|
||||
*
|
||||
*/
|
||||
void cache(RsGxsSignedMessage* msg);
|
||||
|
||||
/*!
|
||||
* Queries if message with message id is cached
|
||||
* @param msgId the id of the message to query
|
||||
*/
|
||||
bool cached(std::string& msgId);
|
||||
|
||||
/*!
|
||||
* Use to retrieve cached msgs
|
||||
*
|
||||
* @param msgs the cached msgs
|
||||
* If message id of messages not cached are requested, it is simply ignored
|
||||
* @param requestIds The ids of messages to retrieve
|
||||
* @param msgs the retrieved cached messages
|
||||
*/
|
||||
void retrieveCache(std::set<std::string>& requestIds, std::set<RsGxsSignedMessage*>& msgs);
|
||||
|
||||
|
@ -163,7 +163,7 @@ HEADERS += plugins/pluginmanager.h \
|
||||
gxs/rsgxs.h \
|
||||
gxs/rsgnp.h \
|
||||
gxs/rsgdp.h \
|
||||
util/rssqlite.h \
|
||||
util/retrodb.h \
|
||||
gxs/rsgixs.h
|
||||
|
||||
HEADERS += $$PUBLIC_HEADERS
|
||||
@ -668,7 +668,7 @@ SOURCES += \
|
||||
gxs/rsgdp.cpp
|
||||
|
||||
SOURCES += \
|
||||
util/rssqlite.cpp
|
||||
util/retrodb.cpp
|
||||
|
||||
SOURCES += \
|
||||
gxs/rsgixs.cpp
|
||||
|
@ -7,8 +7,8 @@
|
||||
#include <set>
|
||||
|
||||
/*!
|
||||
* The idea of RsDb is to provide a means for Retroshare core and its services itself to maintain
|
||||
* easy to use random access files via a database
|
||||
* The idea of RsDb is to provide a means for Retroshare core and
|
||||
* its services itself to maintain easy to use random access files via a database
|
||||
* Especially for messages, rather than all data to memory
|
||||
* It models itself after android's sqlite functionality
|
||||
*/
|
Loading…
x
Reference in New Issue
Block a user