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

Public Types

using id_t = Peer::id_t
using ptr = std::shared_ptr<Peer>

Public Member Functions

 PeerSim (Overlay &overlay, beast::Journal journal)
 ~PeerSim () override=default
id_t id () const override
std::string const & fingerprint () const override
void onMessage (MessageSPtr const &m, SquelchCB f) override
 Local Peer (PeerImp).
void onMessage (protocol::TMSquelch const &squelch) override
 Remote Peer (Directly connected Peer).
void send (protocol::TMSquelch const &squelch)
void send (std::shared_ptr< Message > const &m) override
beast::IP::Endpoint getRemoteAddress () const override
void charge (Resource::Charge const &fee, std::string const &context={}) override
 Adjust this peer's load balance based on the type of load imposed.
bool cluster () const override
 Returns true if this connection is a member of the cluster.
bool isHighLatency () const override
int getScore (bool) const override
PublicKey const & getNodePublic () const override
json::Value json () override
bool supportsFeature (ProtocolFeature f) const override
std::optional< std::size_tpublisherListSequence (PublicKey const &) const override
void setPublisherListSequence (PublicKey const &, std::size_t const) override
uint256 const & getClosedLedgerHash () const override
bool hasLedger (uint256 const &hash, std::uint32_t seq) const override
void ledgerRange (std::uint32_t &minSeq, std::uint32_t &maxSeq) const override
bool hasTxSet (uint256 const &hash) const override
void cycleStatus () override
bool hasRange (std::uint32_t uMin, std::uint32_t uMax) override
bool compressionEnabled () const override
bool txReduceRelayEnabled () const override
void sendTxQueue () override
 Send aggregated transactions' hashes.
void addTxQueue (uint256 const &) override
 Aggregate transaction's hash.
void removeTxQueue (uint256 const &) override
 Remove hash from the transactions' hashes queue.
shared_from_this (T... args)
weak_from_this (T... args)

Static Public Member Functions

static void resetId ()

Public Attributes

PublicKey nodePublicKey

Private Attributes

std::string fingerprint_
id_t id_
Overlayoverlay_
reduce_relay::Squelch< ManualClocksquelch_

Static Private Attributes

static id_t sid = 0

Detailed Description

Definition at line 454 of file reduce_relay_test.cpp.

Member Typedef Documentation

◆ id_t

Definition at line 457 of file reduce_relay_test.cpp.

◆ ptr

using xrpl::Peer::ptr = std::shared_ptr<Peer>
inherited

Definition at line 26 of file xrpld/overlay/Peer.h.

Constructor & Destructor Documentation

◆ PeerSim()

xrpl::test::PeerSim::PeerSim ( Overlay & overlay,
beast::Journal journal )

Definition at line 458 of file reduce_relay_test.cpp.

◆ ~PeerSim()

xrpl::test::PeerSim::~PeerSim ( )
overridedefault

Member Function Documentation

◆ id()

id_t xrpl::test::PeerSim::id ( ) const
overridevirtual

Implements xrpl::Peer.

Definition at line 466 of file reduce_relay_test.cpp.

◆ fingerprint()

std::string const & xrpl::test::PeerSim::fingerprint ( ) const
overridevirtual

Implements xrpl::Peer.

Definition at line 472 of file reduce_relay_test.cpp.

◆ resetId()

void xrpl::test::PeerSim::resetId ( )
static

Definition at line 478 of file reduce_relay_test.cpp.

◆ onMessage() [1/2]

void xrpl::test::PeerSim::onMessage ( MessageSPtr const & m,
SquelchCB f )
overridevirtual

Local Peer (PeerImp).

Implements xrpl::test::PeerPartial.

Definition at line 485 of file reduce_relay_test.cpp.

◆ onMessage() [2/2]

void xrpl::test::PeerSim::onMessage ( protocol::TMSquelch const & squelch)
overridevirtual

Remote Peer (Directly connected Peer).

Implements xrpl::test::PeerPartial.

Definition at line 498 of file reduce_relay_test.cpp.

◆ send() [1/2]

void xrpl::test::PeerPartial::send ( protocol::TMSquelch const & squelch)
inherited

Definition at line 84 of file reduce_relay_test.cpp.

◆ send() [2/2]

void xrpl::test::PeerPartial::send ( std::shared_ptr< Message > const & m)
overridevirtualinherited

Implements xrpl::Peer.

Definition at line 91 of file reduce_relay_test.cpp.

◆ getRemoteAddress()

beast::IP::Endpoint xrpl::test::PeerPartial::getRemoteAddress ( ) const
nodiscardoverridevirtualinherited

Implements xrpl::Peer.

Definition at line 95 of file reduce_relay_test.cpp.

◆ charge()

void xrpl::test::PeerPartial::charge ( Resource::Charge const & fee,
std::string const & context = {} )
overridevirtualinherited

Adjust this peer's load balance based on the type of load imposed.

Implements xrpl::Peer.

Definition at line 100 of file reduce_relay_test.cpp.

◆ cluster()

bool xrpl::test::PeerPartial::cluster ( ) const
nodiscardoverridevirtualinherited

Returns true if this connection is a member of the cluster.

Implements xrpl::Peer.

Definition at line 104 of file reduce_relay_test.cpp.

◆ isHighLatency()

bool xrpl::test::PeerPartial::isHighLatency ( ) const
nodiscardoverridevirtualinherited

Implements xrpl::Peer.

Definition at line 109 of file reduce_relay_test.cpp.

◆ getScore()

int xrpl::test::PeerPartial::getScore ( bool ) const
nodiscardoverridevirtualinherited

Implements xrpl::Peer.

Definition at line 114 of file reduce_relay_test.cpp.

◆ getNodePublic()

PublicKey const & xrpl::test::PeerPartial::getNodePublic ( ) const
nodiscardoverridevirtualinherited

Implements xrpl::Peer.

Definition at line 119 of file reduce_relay_test.cpp.

◆ json()

json::Value xrpl::test::PeerPartial::json ( )
overridevirtualinherited

Implements xrpl::Peer.

Definition at line 124 of file reduce_relay_test.cpp.

◆ supportsFeature()

bool xrpl::test::PeerPartial::supportsFeature ( ProtocolFeature f) const
nodiscardoverridevirtualinherited

Implements xrpl::Peer.

Definition at line 129 of file reduce_relay_test.cpp.

◆ publisherListSequence()

std::optional< std::size_t > xrpl::test::PeerPartial::publisherListSequence ( PublicKey const & ) const
nodiscardoverridevirtualinherited

Implements xrpl::Peer.

Definition at line 134 of file reduce_relay_test.cpp.

◆ setPublisherListSequence()

void xrpl::test::PeerPartial::setPublisherListSequence ( PublicKey const & ,
std::size_t const  )
overridevirtualinherited

Implements xrpl::Peer.

Definition at line 139 of file reduce_relay_test.cpp.

◆ getClosedLedgerHash()

uint256 const & xrpl::test::PeerPartial::getClosedLedgerHash ( ) const
nodiscardoverridevirtualinherited

Implements xrpl::Peer.

Definition at line 143 of file reduce_relay_test.cpp.

◆ hasLedger()

bool xrpl::test::PeerPartial::hasLedger ( uint256 const & hash,
std::uint32_t seq ) const
nodiscardoverridevirtualinherited

Implements xrpl::Peer.

Definition at line 149 of file reduce_relay_test.cpp.

◆ ledgerRange()

void xrpl::test::PeerPartial::ledgerRange ( std::uint32_t & minSeq,
std::uint32_t & maxSeq ) const
overridevirtualinherited

Implements xrpl::Peer.

Definition at line 154 of file reduce_relay_test.cpp.

◆ hasTxSet()

bool xrpl::test::PeerPartial::hasTxSet ( uint256 const & hash) const
nodiscardoverridevirtualinherited

Implements xrpl::Peer.

Definition at line 158 of file reduce_relay_test.cpp.

◆ cycleStatus()

void xrpl::test::PeerPartial::cycleStatus ( )
overridevirtualinherited

Implements xrpl::Peer.

Definition at line 163 of file reduce_relay_test.cpp.

◆ hasRange()

bool xrpl::test::PeerPartial::hasRange ( std::uint32_t uMin,
std::uint32_t uMax )
overridevirtualinherited

Implements xrpl::Peer.

Definition at line 167 of file reduce_relay_test.cpp.

◆ compressionEnabled()

bool xrpl::test::PeerPartial::compressionEnabled ( ) const
nodiscardoverridevirtualinherited

Implements xrpl::Peer.

Definition at line 172 of file reduce_relay_test.cpp.

◆ txReduceRelayEnabled()

bool xrpl::test::PeerPartial::txReduceRelayEnabled ( ) const
nodiscardoverridevirtualinherited

Implements xrpl::Peer.

Definition at line 177 of file reduce_relay_test.cpp.

◆ sendTxQueue()

void xrpl::test::PeerPartial::sendTxQueue ( )
overridevirtualinherited

Send aggregated transactions' hashes.

Implements xrpl::Peer.

Definition at line 182 of file reduce_relay_test.cpp.

◆ addTxQueue()

void xrpl::test::PeerPartial::addTxQueue ( uint256 const & )
overridevirtualinherited

Aggregate transaction's hash.

Implements xrpl::Peer.

Definition at line 186 of file reduce_relay_test.cpp.

◆ removeTxQueue()

void xrpl::test::PeerPartial::removeTxQueue ( uint256 const & )
overridevirtualinherited

Remove hash from the transactions' hashes queue.

Implements xrpl::Peer.

Definition at line 190 of file reduce_relay_test.cpp.

Member Data Documentation

◆ sid

id_t xrpl::test::PeerSim::sid = 0
staticprivate

Definition at line 513 of file reduce_relay_test.cpp.

◆ fingerprint_

std::string xrpl::test::PeerSim::fingerprint_
private

Definition at line 514 of file reduce_relay_test.cpp.

◆ id_

id_t xrpl::test::PeerSim::id_
private

Definition at line 515 of file reduce_relay_test.cpp.

◆ overlay_

Overlay& xrpl::test::PeerSim::overlay_
private

Definition at line 516 of file reduce_relay_test.cpp.

◆ squelch_

reduce_relay::Squelch<ManualClock> xrpl::test::PeerSim::squelch_
private

Definition at line 517 of file reduce_relay_test.cpp.

◆ nodePublicKey

PublicKey xrpl::test::PeerPartial::nodePublicKey
inherited

Definition at line 77 of file reduce_relay_test.cpp.