RetroShare/tests/librssimulator/peer/FakePeerMgr.h
drbob c98d6d1595 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
2014-04-10 08:46:15 +00:00

27 lines
667 B
C++

#pragma once
#include <list>
#include <retroshare/rsids.h>
#include <pqi/p3peermgr.h>
class FakePeerMgr: public p3PeerMgrIMPL
{
public:
FakePeerMgr(const RsPeerId& own,const std::list<RsPeerId>& ids)
: p3PeerMgrIMPL(own,RsPgpId(),"no name","location name")
{
for(std::list<RsPeerId>::const_iterator it(ids.begin());it!=ids.end();++it)
_ids.insert(*it) ;
}
virtual bool idFriend(const RsPeerId& ssl_id) { return _ids.find(ssl_id) != _ids.end() ; }
virtual ServicePermissionFlags servicePermissionFlags(const RsPeerId& /*ssl_id*/)
{
return ~ServicePermissionFlags(0) ;
}
std::set<RsPeerId> _ids ;
};