mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-24 06:14:25 -04:00
* Added the basics of GxsCircles service to libretroshare.
- Defined the control group stuff. - Background task to determine friend membership. - Caching of Circle info, - Added GXS interface class to gxs/rsgixs.h - TODO: Serialiser is incomplete. - TODO: SubCircles to be done in Phase 2. * Improvements to RsMemCache: - Added Value& ref(Key) to avoid data copying. - Added Statistics to check cache performance. - Fixed up bugs in tracking membership. * Improvements to RsTickEvent: - Added additional string parameter for more specificity. git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-gxs-b1@5910 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
baa949eaac
commit
5a55c1b5d6
18 changed files with 2353 additions and 427 deletions
|
@ -44,24 +44,41 @@ class RsTickEvent
|
|||
void tick_events();
|
||||
|
||||
void schedule_now(uint32_t event_type);
|
||||
void schedule_event(uint32_t event_type, time_t when);
|
||||
void schedule_now(uint32_t event_type, const std::string &elabel);
|
||||
|
||||
void schedule_event(uint32_t event_type, time_t when, const std::string &elabel);
|
||||
|
||||
void schedule_in(uint32_t event_type, uint32_t in_secs);
|
||||
void schedule_in(uint32_t event_type, uint32_t in_secs, const std::string &elabel);
|
||||
|
||||
int32_t event_count(uint32_t event_type);
|
||||
bool prev_event_ago(uint32_t event_type, int32_t &age);
|
||||
|
||||
protected:
|
||||
|
||||
// Overloaded to handle the events.
|
||||
virtual void handle_event(uint32_t event_type);
|
||||
virtual void handle_event(uint32_t event_type, const std::string &event_label);
|
||||
|
||||
private:
|
||||
|
||||
class EventData
|
||||
{
|
||||
public:
|
||||
EventData() :mEventType(0) { return; }
|
||||
EventData(uint32_t etype) :mEventType(etype) { return; }
|
||||
EventData(uint32_t etype, std::string elabel) :mEventLabel(elabel), mEventType(etype) { return; }
|
||||
|
||||
std::string mEventLabel;
|
||||
uint32_t mEventType;
|
||||
};
|
||||
|
||||
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;
|
||||
std::multimap<time_t, EventData> mEvents;
|
||||
};
|
||||
|
||||
#endif // RS_UTIL_TICK_EVENT
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue