Tidy up sources

This commit is contained in:
Vinnie Falco
2014-08-14 14:16:34 -07:00
parent 019c1af435
commit 2e3784a914
28 changed files with 100 additions and 157 deletions

View File

@@ -33,70 +33,6 @@ public:
//--------------------------------------------------------------------------
struct Payload
{
Payload ()
{
}
};
template <class Config>
class PeerLogic : public TestOverlay::PeerLogicBase <Config>
{
public:
typedef TestOverlay::PeerLogicBase <Config> Base;
typedef typename Config::Payload Payload;
typedef typename Base::Connection Connection;
typedef typename Base::Peer Peer;
typedef typename Base::Message Message;
typedef typename Config::SizeType SizeType;
explicit PeerLogic (Peer& peer)
: TestOverlay::PeerLogicBase <Config> (peer)
{
}
~PeerLogic ()
{
}
void step ()
{
if (this->peer().id () == 1)
{
if (this->peer().network().steps() == 0)
{
this->peer().network().state().increment();
this->peer().send_all (Payload (1));
}
}
}
void receive (Connection const& c, Message const& m)
{
if (this->peer().id () != 1)
{
this->peer().network().state().increment();
this->peer().send_all_if (Message (m.id(),
m.payload().withHop ()),
typename Connection::IsNotPeer (c.peer()));
}
}
};
struct Params : TestOverlay::ConfigType <
Params,
TestOverlay::StateBase,
PeerLogic
>
{
typedef TestOverlay::PremadeInitPolicy <250, 3> InitPolicy;
};
typedef Params::Network Network;
//--------------------------------------------------------------------------
struct TestSource : Source
{
TestSource (beast::String const& name, std::uint32_t start, std::uint32_t end)