mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-12-10 06:15:50 -05:00
Added librssimulator, and very basic test for statusservice.
Obviously lots to do here - but its a start! git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7258 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
5221ec0aca
commit
c98d6d1595
12 changed files with 966 additions and 8 deletions
35
tests/librssimulator/peer/FakeServiceControl.h
Normal file
35
tests/librssimulator/peer/FakeServiceControl.h
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
#pragma once
|
||||
|
||||
#include <iostream>
|
||||
#include <list>
|
||||
|
||||
#include <retroshare/rsids.h>
|
||||
#include <pqi/p3linkmgr.h>
|
||||
#include <pqi/p3servicecontrol.h>
|
||||
|
||||
class FakeServiceControl: public p3ServiceControl
|
||||
{
|
||||
public:
|
||||
FakeServiceControl(p3LinkMgr *lm)
|
||||
: p3ServiceControl(lm),mLink(lm)
|
||||
{
|
||||
}
|
||||
|
||||
virtual void getPeersConnected(const uint32_t serviceId, std::set<RsPeerId> &peerSet)
|
||||
{
|
||||
(void) serviceId;
|
||||
std::list<RsPeerId> ids ;
|
||||
mLink->getOnlineList(ids) ;
|
||||
|
||||
for(std::list<RsPeerId>::const_iterator it(ids.begin());it!=ids.end();++it)
|
||||
peerSet.insert(*it) ;
|
||||
}
|
||||
|
||||
virtual bool checkFilter(uint32_t,const RsPeerId& id)
|
||||
{
|
||||
(void) id;
|
||||
return true ;
|
||||
}
|
||||
p3LinkMgr *mLink;
|
||||
};
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue