xrpld
Loading...
Searching...
No Matches
xrpl::test::Network Class Reference
Collaboration diagram for xrpl::test::Network:

Public Member Functions

 Network (Application &app)
void init ()
 ~Network ()=default
void reset ()
Peer::ID addPeer ()
void deleteLastPeer ()
void purgePeers ()
Validator & validator (std::uint16_t v)
OverlaySim & overlay ()
void enableLink (std::uint16_t validatorId, Peer::ID peer, bool enable)
void onDisconnectPeer (Peer::ID peer)
void propagate (LinkIterCB link, std::uint16_t nValidators=kMaxValidators, std::uint32_t nMessages=kMaxMessages, bool purge=true, bool resetClock=true)
bool isSelected (Peer::ID id)
 Is peer in Selected state in any of the slots.
bool allCounting (Peer::ID peer)
 Check if there are peers to unsquelch - peer is in Selected state in any of the slots and there are peers in Squelched state in those slots.

Static Public Member Functions

static void forRand (std::uint32_t min, std::uint32_t max, std::function< void(std::uint32_t)> f)

Private Attributes

OverlaySim overlay_
std::vector< Validator > validators_

Detailed Description

Definition at line 590 of file reduce_relay_test.cpp.

Constructor & Destructor Documentation

◆ Network()

xrpl::test::Network::Network ( Application & app)

Definition at line 593 of file reduce_relay_test.cpp.

◆ ~Network()

xrpl::test::Network::~Network ( )
default

Member Function Documentation

◆ init()

void xrpl::test::Network::init ( )

Definition at line 599 of file reduce_relay_test.cpp.

◆ reset()

void xrpl::test::Network::reset ( )

Definition at line 613 of file reduce_relay_test.cpp.

◆ addPeer()

Peer::ID xrpl::test::Network::addPeer ( )

Definition at line 623 of file reduce_relay_test.cpp.

◆ deleteLastPeer()

void xrpl::test::Network::deleteLastPeer ( )

Definition at line 632 of file reduce_relay_test.cpp.

◆ purgePeers()

void xrpl::test::Network::purgePeers ( )

Definition at line 644 of file reduce_relay_test.cpp.

◆ validator()

Validator & xrpl::test::Network::validator ( std::uint16_t v)

Definition at line 651 of file reduce_relay_test.cpp.

◆ overlay()

OverlaySim & xrpl::test::Network::overlay ( )

Definition at line 658 of file reduce_relay_test.cpp.

◆ enableLink()

void xrpl::test::Network::enableLink ( std::uint16_t validatorId,
Peer::ID peer,
bool enable )

Definition at line 664 of file reduce_relay_test.cpp.

◆ onDisconnectPeer()

void xrpl::test::Network::onDisconnectPeer ( Peer::ID peer)

Definition at line 679 of file reduce_relay_test.cpp.

◆ forRand()

void xrpl::test::Network::forRand ( std::uint32_t min,
std::uint32_t max,
std::function< void(std::uint32_t)> f )
static

Definition at line 699 of file reduce_relay_test.cpp.

◆ propagate()

void xrpl::test::Network::propagate ( LinkIterCB link,
std::uint16_t nValidators = kMaxValidators,
std::uint32_t nMessages = kMaxMessages,
bool purge = true,
bool resetClock = true )

Definition at line 712 of file reduce_relay_test.cpp.

◆ isSelected()

bool xrpl::test::Network::isSelected ( Peer::ID id)

Is peer in Selected state in any of the slots.

Definition at line 739 of file reduce_relay_test.cpp.

◆ allCounting()

bool xrpl::test::Network::allCounting ( Peer::ID peer)

Check if there are peers to unsquelch - peer is in Selected state in any of the slots and there are peers in Squelched state in those slots.

Definition at line 751 of file reduce_relay_test.cpp.

Member Data Documentation

◆ overlay_

OverlaySim xrpl::test::Network::overlay_
private

Definition at line 769 of file reduce_relay_test.cpp.

◆ validators_

std::vector<Validator> xrpl::test::Network::validators_
private

Definition at line 770 of file reduce_relay_test.cpp.