Added Identity Info retrieval to rsIdentities.

This is now pretty much complete for Phase 1 of GXS.
Still todo:
	- PGPHash signatures.
	- Reputations.

 - Added two helper classes GxsTokenQueue: similar to TokenQueue, but for libretroshare
       & RsTickEvent: schedule one shot events, and basic stats.
 - Reorganised/simplified p3IdService using these two classes.
 - Added fns to load/reload a list of Own Identities.
 - Improved the Cache to store all GUI required Info.
 - Updater retroshare/rsidentity.h with new Identity interface.
 - added fns to update Cache from internal background tasks.
 - Modified RsMemCache to support replace operation.
 - Found nasty Bug that caused PGPHASHes not to match & Patched same bug in GXS.
 - added generic CacheArbitration.
 - Added AuthorIds to dummy Forum messages.



git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-gxs-b1@5848 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
drbob 2012-11-19 22:00:05 +00:00
parent 6e349749d0
commit c6e6d444bf
13 changed files with 1096 additions and 491 deletions

View file

@ -0,0 +1,67 @@
/*
* libretroshare/src/util: rstickevent.h
*
* Identity interface for RetroShare.
*
* Copyright 2012-2012 by Robert Fernie.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License Version 2.1 as published by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Please report all bugs and problems to "retroshare@lunamutt.com".
*
*/
#ifndef RS_UTIL_TICK_EVENT
#define RS_UTIL_TICK_EVENT
/*
*
* A simple event queue... to avoid having to continually write separate one.
*/
#include <map>
#include <time.h>
#include "util/rsthreads.h"
class RsTickEvent
{
public:
RsTickEvent():mEventMtx("TickEventMtx") { return; }
void tick_events();
void schedule_now(uint32_t event_type);
void schedule_event(uint32_t event_type, time_t when);
void schedule_in(uint32_t event_type, uint32_t in_secs);
int32_t event_count(uint32_t event_type);
bool prev_event_ago(uint32_t event_type, int32_t &age);
// Overloaded to handle the events.
virtual void handle_event(uint32_t event_type);
private:
void count_adjust_locked(uint32_t event_type, int32_t change);
void note_event_locked(uint32_t event_type);
RsMutex mEventMtx;
std::map<uint32_t, int32_t> mEventCount;
std::map<uint32_t, time_t> mPreviousEvent;
std::multimap<time_t, uint32_t> mEvents;
};
#endif // RS_UTIL_TICK_EVENT