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:
chrisparker126 2012-01-16 21:52:22 +00:00
parent 2504c0fd9a
commit cf5158d2b0
5 changed files with 40 additions and 22 deletions

View File

@ -2,6 +2,8 @@
#define RSGNP_H #define RSGNP_H
#include <set> #include <set>
#include <time.h>
#include <stdlib.h>
#include "services/p3service.h" #include "services/p3service.h"
#include "gxs/rsgdp.h" #include "gxs/rsgdp.h"
@ -22,21 +24,17 @@ public:
/*** gdp::iterface *****/ /*** gdp::iterface *****/
int requestMsgs(std::set<std::string> msgId, double &delay); int requestMsgs(std::set<std::string> msgId, double &delay);
void addGdp(RsGdp* gdp); void addGdp(RsGdp* gdp) = 0;
void removeGdp(RsGdp* gdp); void removeGdp(RsGdp* gdp) = 0;
private: public:
/*** IMPLEMENTATION DETAILS ****/ /*** IMPLEMENTATION DETAILS ****/
/* Get/Send Messages */ /* Get/Send Messages */
void getAvailableMsgs(std::string peerId, time_t from, time_t to); /* request over the network */ 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 #endif // RSGNP_H

View File

@ -31,6 +31,7 @@
*/ */
#include "rsgdp.h" #include "rsgdp.h"
#include "util/rsthreads.h"
/*! /*!
* Retroshare general exchange service * Retroshare general exchange service
@ -40,11 +41,14 @@
* GDP deals with exporting and importing msgs to and from the concrete service * GDP deals with exporting and importing msgs to and from the concrete service
* data from the derived class * data from the derived class
* GXIP is used to maintain * GXIP is used to maintain
*
*
* The maiin transport mechanism
*/ */
class RsGxs class RsGxs : public RsThread
{ {
public: public:
RsGxs(); RsGxs(const std::string& serviceName);
public: public:
@ -52,27 +56,43 @@ public:
* These are messages, that have been pushed to you * These are messages, that have been pushed to you
* This will be called by RsGdp whenever a new msg(s) has arrived * 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 * 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 * Push a set of messages which have been written to your service
* database * database
* @param msgIds
*/ */
void push(std::set<std::string>& msgIds) = 0; 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); bool cached(std::string& msgId);
/*! /*!
* Use to retrieve cached msgs * Use to retrieve cached msgs
* * If message id of messages not cached are requested, it is simply ignored
* @param msgs the cached msgs * @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); void retrieveCache(std::set<std::string>& requestIds, std::set<RsGxsSignedMessage*>& msgs);

View File

@ -163,7 +163,7 @@ HEADERS += plugins/pluginmanager.h \
gxs/rsgxs.h \ gxs/rsgxs.h \
gxs/rsgnp.h \ gxs/rsgnp.h \
gxs/rsgdp.h \ gxs/rsgdp.h \
util/rssqlite.h \ util/retrodb.h \
gxs/rsgixs.h gxs/rsgixs.h
HEADERS += $$PUBLIC_HEADERS HEADERS += $$PUBLIC_HEADERS
@ -668,7 +668,7 @@ SOURCES += \
gxs/rsgdp.cpp gxs/rsgdp.cpp
SOURCES += \ SOURCES += \
util/rssqlite.cpp util/retrodb.cpp
SOURCES += \ SOURCES += \
gxs/rsgixs.cpp gxs/rsgixs.cpp

View File

@ -7,8 +7,8 @@
#include <set> #include <set>
/*! /*!
* The idea of RsDb is to provide a means for Retroshare core and its services itself to maintain * The idea of RsDb is to provide a means for Retroshare core and
* easy to use random access files via a database * its services itself to maintain easy to use random access files via a database
* Especially for messages, rather than all data to memory * Especially for messages, rather than all data to memory
* It models itself after android's sqlite functionality * It models itself after android's sqlite functionality
*/ */