mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-28 10:51:30 -05:00
46 lines
822 B
C
46 lines
822 B
C
![]() |
#ifndef NXSTESTHUB_H
|
||
|
#define NXSTESTHUB_H
|
||
|
|
||
|
#include "util/rsthreads.h"
|
||
|
#include "gxs/rsgxsnetservice.h"
|
||
|
|
||
|
/*!
|
||
|
* This scenario module allows you to model
|
||
|
* simply back and forth conversation between nxs and a virtual peer
|
||
|
* (this module being the virtual peer)
|
||
|
*/
|
||
|
class NxsScenario
|
||
|
{
|
||
|
|
||
|
static int SCENARIO_OUTGOING;
|
||
|
static int SCENARIO_INCOMING;
|
||
|
|
||
|
public:
|
||
|
|
||
|
virtual int scenarioType() = 0;
|
||
|
|
||
|
virtual void receive(RsNxsItem* ) = 0;
|
||
|
virtual RsNxsItem* send() = 0;
|
||
|
|
||
|
};
|
||
|
|
||
|
|
||
|
|
||
|
class NxsTestHub : public RsThread
|
||
|
{
|
||
|
public:
|
||
|
|
||
|
|
||
|
NxsTestHub(NxsScenario* , std::pair<RsGxsNetService*, RsGxsNetService*> servicePair);
|
||
|
|
||
|
/*!
|
||
|
* To be called only after this thread has
|
||
|
* been shutdown
|
||
|
*/
|
||
|
bool testsPassed();
|
||
|
|
||
|
void run();
|
||
|
};
|
||
|
|
||
|
#endif // NXSTESTHUB_H
|