Finished Notifications in p3ServiceControl:

- added extra Mutex to make notifications work.
 - Added ServiceControl tick to ServiceServer.
 - switched p3discovery2 from pqiMonitor -> pqiServiceMonitor



git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7201 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
drbob 2014-03-23 03:30:59 +00:00
parent 708f6d6b43
commit a06064e167
6 changed files with 212 additions and 66 deletions

View file

@ -55,7 +55,7 @@ class ServicePeerFilter
std::ostream &operator<<(std::ostream &out, const ServicePeerFilter &filter);
class p3ServiceControl: public RsServiceControl /* , public p3Config, public pqiMonitor */
class p3ServiceControl: public RsServiceControl, public pqiMonitor /* , public p3Config */
{
public:
@ -124,6 +124,7 @@ virtual bool loadList(std::list<RsItem *>& load);
private:
void notifyServices();
void notifyAboutFriends();
bool createDefaultPermissions_locked(uint32_t serviceId, std::string serviceName, bool defaultOn);
@ -138,6 +139,8 @@ void recordFilterChanges_locked(const RsPeerId &peerId,
void updatePeerConnect(const RsPeerId &peerId);
void updatePeerDisconnect(const RsPeerId &peerId);
void updatePeerNew(const RsPeerId &peerId);
void updatePeerRemoved(const RsPeerId &peerId);
bool peerHasPermissionForService_locked(const RsPeerId &peerId, uint32_t serviceId);
@ -157,8 +160,12 @@ bool peerHasPermissionForService_locked(const RsPeerId &peerId, uint32_t service
// Below here is saved in Configuration.
std::map<uint32_t, RsServicePermissions> mServicePermissionMap;
std::multimap<uint32_t, pqiServiceMonitor *> mMonitors;
std::map<uint32_t, ServiceNotifications> mNotifications;
std::list<pqiServicePeer> mFriendNotifications;
// Separate mutex here - must not hold both at the same time!
RsMutex mMonitorMtx; /* below is protected */
std::multimap<uint32_t, pqiServiceMonitor *> mMonitors;
};